# 数据集蒸馏

数据集蒸馏是一种机器学习技术，它从较大的真实数据集中合成一个小型合成数据集，使得在合成数据上训练的模型能够接近在完整数据上训练的模型的性能。<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> 合成图像不必看起来真实；它们作为自由参数被优化，以便对训练具有信息量。该技术面向持续学习、神经架构搜索、联邦学习和隐私保护机器学习。<sup>[2](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 提出者 | 王同舟、朱俊彦、安东尼奥·托拉尔巴和阿列克谢·A·埃夫罗斯，《数据集蒸馏》，arXiv，2018<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> |
| 标志性结果 | 60,000 张 MNIST 图像压缩为 10 张合成图像（每类一张），经过少数几步梯度下降后性能接近原始水平<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> |
| 主要目标函数族 | 性能匹配、参数匹配和分布匹配<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup> |
| 标准预算 | 每类 1、10 和 50 张图像（IPC）<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup> |
| 大规模结果 | TESLA 在 ImageNet-1K 上 IPC 为 10 时达到 31.0±0.5%，而完整数据为 86.0±0.1%<sup>[4](https://proceedings.mlr.press/v202/cui23e/cui23e.pdf)</sup> |
| 已知失效模式 | 依赖实例归一化的方法迁移到不含该层的架构时表现很差<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup> |
| 近期转变 | 基于扩散和选择混合的方法现已能蒸馏 ImageNet 规模的数据，例如 IGD 在 ImageNet-1K 上 IPC 为 50 时达到 60.3%<sup>[5](https://proceedings.iclr.cc/paper_files/paper/2025/file/d3e50c185ced668857ba40a7d4a29efc-Paper-Conference.pdf)</sup> |

## 工作原理

目标是从真实数据集 \( \mathcal{T} \) 中推导出一个更小的合成数据集 \( \mathcal{S} \)，使得在 \( \mathcal{S} \) 上训练的网络性能与在 \( \mathcal{T} \) 上训练的网络相当。已发表的方法归为三种主流目标：性能匹配、参数匹配和分布匹配，其中性能匹配在原始工作中提出。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

**性能匹配**是一种双层优化。内层循环在合成数据上训练模型，外层循环通过展开的训练计算图最小化真实数据上的验证损失：

\[ \operatorname*{arg\,min}_{\mathcal{X}_{s}} \; L(\mathcal{F}_{\theta_{s}}(\mathcal{X}_{r}), \mathcal{Y}_{r}) \quad \text{满足} \quad \theta_{s} = \operatorname*{arg\,min}_{\theta} \; L(\mathcal{F}_{\theta}(\mathcal{X}_{s}), \mathcal{Y}_{s}) \]

这是按时间反向传播风格的蒸馏所给出的公式。<sup>[6](https://arxiv.org/html/2406.04284)</sup> **梯度匹配**通过最小化真实损失与合成损失关于参数 \( \theta \) 的梯度之间的距离 \( D \) 来消除这一递归计算图的昂贵展开，即 \( \operatorname*{arg\,min}_{\mathcal{X}_{s}} D[\nabla L(\mathcal{F}_{\theta}(\mathcal{X}_{s}), \mathcal{Y}_{s}), \nabla L(\mathcal{F}_{\theta}(\mathcal{X}_{r}), \mathcal{Y}_{r})] \)，这使得优化更快、更节省内存，并可扩展到 ResNet。<sup>[7](https://doi.org/10.48550/arxiv.2006.05929)</sup> **分布匹配**使用最大均值差异作为距离来匹配真实数据和合成数据的特征分布 \( \phi_{\theta}(x_i) \) 和 \( \phi_{\theta}(s_j) \)，仅针对来自采样或随机初始化网络的特征优化合成数据，而非交替训练特征提取器和合成集，从而避免大规模数据集上的双层优化障碍。<sup>[8](https://openaccess.thecvf.com/content/WACV2023/papers/Zhao_Dataset_Condensation_With_Distribution_Matching_WACV_2023_paper.pdf)</sup> **轨迹匹配**通过最小化下式来对齐训练轨迹的片段

\[ \frac{\| \hat{\theta}_{t+N} - \theta^{*}_{t+M} \|^{2}_{2}}{\| \theta^{*}_{t} - \theta^{*}_{t+M} \|^{2}_{2}} \]

其中 \( \theta^{*} \) 是真实数据上专家轨迹的参数，\( \hat{\theta} \) 是在蒸馏数据上训练的参数。<sup>[6](https://arxiv.org/html/2406.04284)</sup>

## 实施方法

实践者首先固定评估架构和 IPC 预算；已发表的评估通常使用每类 1、10 和 50 张图像。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup> 合成集从高斯噪声或随机选择的真实样本初始化，后者被当前大多数方法采用；K-Center 等核心集式初始化也有使用。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

核心循环随后取决于目标函数。在性能匹配中，内层循环通过在 \( \mathcal{S} \) 上梯度下降更新模型参数 \( \theta \)，同时缓存递归计算图，外层循环通过该图反向传播 \( \mathcal{T} \) 上的验证损失以更新合成数据。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup> 在 MTT 实现中，学生网络在合成数据上训练多轮迭代，测量学生网络与在真实数据上训练的专家网络之间的参数空间误差，并将该误差通过所有步骤反向传播。<sup>[9](https://github.com/georgecazenavette/mtt-distillation)</sup> SLDD 引入了允许标签超越独热向量的做法，已被证明能同时提高存储效率和蒸馏性能。<sup>[10](https://www.ijcai.org/proceedings/2023/0741.pdf)</sup>

评估协议为每个合成集训练多个模型以对随机性取平均：DC 协议在 5 个生成集上各训练 20 个随机初始化模型，每个 IPC 预算共 100 个模型，IPC 取 1、10 和 50。<sup>[7](https://doi.org/10.48550/arxiv.2006.05929)</sup> 在 CIFAR-10 上 IPC 为 10 时使用 DSA 数据增强的跨架构测试检验蒸馏数据是否过拟合于单一网络。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

## 起源

数据集蒸馏由王同舟（Tongzhou Wang）、朱俊彦（Jun-Yan Zhu）、安东尼奥·托拉尔巴（Antonio Torralba）和[阿列克谢·A·埃夫罗斯](https://www.edgepedia.org/zh/alexei-a-efros)（Alexei A. Efros）在 2018 年发表于 arXiv 的论文《数据集蒸馏》中提出，其算法通过在蒸馏图像上训练模型的优化步骤进行反向传播。<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> 该论文将模型权重表示为蒸馏图像的函数，并用基于梯度的超参数优化对其进行优化。<sup>[2](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)</sup> 其标志性结果将 60,000 张 MNIST 训练图像压缩为 10 张合成图像，每类一张，仅需少数几步梯度下降即达到接近原始性能。<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup>

该方法建立在核心集构建和实例选择的早期工作之上，后者选择训练数据的一个子集，使得在子集上训练的模型性能与在完整数据集上相当。<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> 原始作者指出，核心集算法需要每类更多的样本，因为它们“有价值的”图像必须是真实的，而蒸馏图像不受此约束。<sup>[1](https://doi.org/10.48550/arxiv.1811.10959)</sup> 该领域随后分化为多个谱系：梯度匹配（DC）由赵博（Bo Zhao）、孔达·雷迪·莫普里（Konda Reddy Mopuri）和哈坎·比伦（Hakan Bilen）于 2020 年在 arXiv 提出，<sup>[7](https://doi.org/10.48550/arxiv.2006.05929)</sup> 分布匹配（DM）由赵和比伦于 2021 年在 arXiv 提出，<sup>[11](https://doi.org/10.48550/arxiv.2110.04181)</sup> 基于无限宽卷积网络的核蒸馏（KIP）由蒂莫西·阮（Timothy Nguyen）、罗曼·诺瓦克（Roman Novak）、肖乐超（Lechao Xiao）和李在勋（Jaehoon Lee）于 2021 年在 arXiv 提出，<sup>[12](https://doi.org/10.48550/arxiv.2107.13034)</sup> 轨迹匹配（MTT）由乔治·卡泽纳维特（George Cazenavette）及其同事于 2022 年在 arXiv 提出。<sup>[2](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)</sup>

## 变体

**梯度匹配（DC）** 匹配真实损失和合成损失的逐类梯度，避免展开的双层优化。<sup>[7](https://doi.org/10.48550/arxiv.2006.05929)</sup> **分布匹配（DM）** 通过最大均值差异以单层交替优化匹配特征分布。<sup>[8](https://openaccess.thecvf.com/content/WACV2023/papers/Zhao_Dataset_Condensation_With_Distribution_Matching_WACV_2023_paper.pdf)</sup> **MTT** 在蒸馏数据上训练网络若干迭代，并最小化合成训练参数与真实数据训练参数之间的距离，使用预计算的专家轨迹；它匹配轨迹的片段而非单步梯度。<sup>[2](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)</sup> **TESLA**（带软标签分配的轨迹匹配）由崔贾斯汀（Justin Cui）、王若尘（Ruochen Wang）、司思（Si Si）和谢卓睿（Cho-Jui Hsieh）于 2022 年提出，降低了轨迹匹配的内存成本以扩展到 ImageNet-1K。<sup>[13](https://doi.org/10.48550/arxiv.2211.10586)</sup> **DataDAM** 由萨杰迪（Sajedi）及其同事于 2023 年提出，匹配注意力图而非梯度或特征。<sup>[14](https://doi.org/10.48550/arxiv.2310.00093)</sup> **SRe2L** 由尹泽元（Zeyuan Yin）、邢波（Eric Xing）和沈志强（Zhiqiang Shen）于 2023 年提出，以压缩、恢复和重标注的流程重新构建了 ImageNet 规模的数据集凝缩。<sup>[15](https://doi.org/10.48550/arxiv.2306.13092)</sup> **SelMatch** 由李勇民（Yongmin Lee）和郑惠元（Hye Won Chung）于 2024 年提出，将基于选择的初始化与轨迹匹配的部分更新相结合。<sup>[16](https://doi.org/10.48550/arxiv.2406.18561)</sup> **LD3M** 由莫泽（Moser）及其同事于 2024 年提出，通过扩散模型进行蒸馏。<sup>[17](https://doi.org/10.48550/arxiv.2403.03881)</sup>

## 应用

准确率强烈依赖于 IPC。在 CIFAR-10 上，MTT 每类使用 50 张合成图像（100 倍压缩率）相比在整个数据集上训练仅损失 13.4% 的准确率。<sup>[4](https://proceedings.mlr.press/v202/cui23e/cui23e.pdf)</sup> 在极端压缩下差距扩大：官方 DC 代码报告在 MNIST 上使用 ConvNet、每类 1 张图像时达到 91.7%，但在 CIFAR-10 上仅为 28.3%。<sup>[18](https://github.com/vico-uoe/DatasetCondensation)</sup> 在 ImageNet-1K 上，TESLA 报告 IPC 为 1 时达到 15.4±0.3%，IPC 为 10 时达到 31.0±0.5%，而完整数据参考值为 86.0±0.1%。<sup>[4](https://proceedings.mlr.press/v202/cui23e/cui23e.pdf)</sup>

在 CIFAR-100 上使用 20-IPC 缓冲区的类增量持续学习中，DataDAM 在 5 步和 10 步学习下均达到 39.7% 的最终测试准确率，而 DM 为 34.4% 和 34.7%，DSA 为 31.7% 和 30.3%，herding 为 28.1% 和 27.4%，随机选择为 24.8%。<sup>[19](https://openaccess.thecvf.com/content/ICCV2023/papers/Sajedi_DataDAM_Efficient_Dataset_Distillation_with_Attention_Matching_ICCV_2023_paper.pdf)</sup> 在 720 个 ConvNet 的 CIFAR-10 空间上进行神经架构搜索时，DataDAM 50-IPC 代理集选出的模型测试准确率为 89.0%，而完整数据为 89.2%，代理与完整数据排名之间的 Spearman 相关性报告为 0.72，为最高值。<sup>[19](https://openaccess.thecvf.com/content/ICCV2023/papers/Sajedi_DataDAM_Efficient_Dataset_Distillation_with_Attention_Matching_ICCV_2023_paper.pdf)</sup> 蒸馏数据集也被用于联邦学习和隐私保护机器学习。<sup>[2](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)</sup> 影响引导扩散（IGD）在 ImageNet-1K 上 IPC 为 50 时达到 60.3%，是 ImageNet 蒸馏的最先进结果。<sup>[5](https://proceedings.iclr.cc/paper_files/paper/2025/file/d3e50c185ced668857ba40a7d4a29efc-Paper-Conference.pdf)</sup>

## 局限与替代方案

跨架构迁移是一个有据可查的失效模式。在 CIFAR-10 上 IPC 为 10、在 Conv-BN 模型上评估时，已发表表格报告 FRePo 为 65.6±0.6，MTT 为 64.4±0.9，DD 为 60.2±0.4，DSA 为 53.2±0.8，DM 为 49.2±0.8，DC 为 44.9±0.5；在不含归一化的架构上，除 FRePo 外大多数方法性能显著下降，例如 DD 在 Conv-NN 上降至 17.8±2.7。实例归一化层似乎是 DD、DC、DSA、DM 和 MTT 中的关键要素，缺失时会损害可迁移性。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

蒸馏本身成本高昂。在每类 50 张图像下训练 DC 需要 500K 轮网络参数更新和 50K 次合成集更新。<sup>[10](https://www.ijcai.org/proceedings/2023/0741.pdf)</sup> 在 CIFAR-10 上 IPC 为 50 时展开 30 步 MTT 需要 47GB 的 GPU 内存，这就是 MTT 未经修改无法扩展到 ImageNet-1K 的原因。<sup>[4](https://proceedings.mlr.press/v202/cui23e/cui23e.pdf)</sup> 扩大规模受三方面限制：在更大 IPC 下获得有信息量的合成集很困难，在 ImageNet 规模数据上运行蒸馏具有挑战性，适应大型复杂模型也不容易。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

与核心集选择和数据剪枝相比，蒸馏合成新的可学习数据而非保留原始未修改样本，这可能提供更好的隐私保护；核心集方法依赖启发式或贪心策略，因为底层的选择问题是 NP 难的，使其更容易产生次优结果。<sup>[3](https://ar5iv.labs.arxiv.org/html/2301.07014)</sup>

## References

1. [Wang, Tongzhou and colleagues (2018). Dataset Distillation. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1811.10959)
2. [Dataset Distillation by Matching Training Trajectories (MTT, CVPR 2022)](https://openaccess.thecvf.com/content/CVPR2022/papers/Cazenavette_Dataset_Distillation_by_Matching_Training_Trajectories_CVPR_2022_paper.pdf)
3. [Dataset Distillation: A Comprehensive Review](https://ar5iv.labs.arxiv.org/html/2301.07014)
4. [Scaling Up Dataset Distillation to ImageNet-1K with Constant Memory (TESLA, ICML 2023)](https://proceedings.mlr.press/v202/cui23e/cui23e.pdf)
5. [Influence-Guided Diffusion for Dataset Distillation (IGD, ICLR 2025)](https://proceedings.iclr.cc/paper_files/paper/2025/file/d3e50c185ced668857ba40a7d4a29efc-Paper-Conference.pdf)
6. [What is Dataset Distillation Learning? (ICML 2024, PMLR)](https://arxiv.org/html/2406.04284)
7. [Zhao, Bo, Mopuri, Konda Reddy, Bilen, Hakan (2020). Dataset Condensation with Gradient Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2006.05929)
8. [Dataset Condensation With Distribution Matching (DM, WACV 2023)](https://openaccess.thecvf.com/content/WACV2023/papers/Zhao_Dataset_Condensation_With_Distribution_Matching_WACV_2023_paper.pdf)
9. [GeorgeCazenavette/mtt-distillation (official MTT code)](https://github.com/georgecazenavette/mtt-distillation)
10. [A Survey on Dataset Distillation: Approaches, Applications and Future Directions (IJCAI 2023)](https://www.ijcai.org/proceedings/2023/0741.pdf)
11. [Zhao, Bo, Bilen, Hakan (2021). Dataset Condensation with Distribution Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2110.04181)
12. [Nguyen, Timothy and colleagues (2021). Dataset Distillation with Infinitely Wide Convolutional Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2107.13034)
13. [Cui, Justin and colleagues (2022). Scaling Up Dataset Distillation to ImageNet-1K with Constant Memory. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2211.10586)
14. [Sajedi, Ahmad and colleagues (2023). DataDAM: Efficient Dataset Distillation with Attention Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2310.00093)
15. [Yin, Zeyuan, Xing, Eric, Shen, Zhiqiang (2023). Squeeze, Recover and Relabel: Dataset Condensation at ImageNet Scale From A New Perspective. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2306.13092)
16. [Lee, Yongmin, Chung, Hye Won (2024). SelMatch: Effectively Scaling Up Dataset Distillation via Selection-Based Initialization and Partial Updates by Trajectory Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2406.18561)
17. [Moser, Brian B. and colleagues (2024). Unlocking Dataset Distillation with Diffusion Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2403.03881)
18. [VICO-UoE/DatasetCondensation (official DC code)](https://github.com/vico-uoe/DatasetCondensation)
19. [DataDAM: Efficient Dataset Distillation with Attention Matching (ICCV 2023)](https://openaccess.thecvf.com/content/ICCV2023/papers/Sajedi_DataDAM_Efficient_Dataset_Distillation_with_Attention_Matching_ICCV_2023_paper.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/dataset-distillation

English original: https://www.edgepedia.org/dataset-distillation
