M3D
AAAI 2024, M3D: Dataset Condensation by Minimizing Maximum Mean Discrepancy
Install / Use
/learn @Hansong-Zhang/M3DREADME
[AAAI 2024] M3D: Dataset Condensation by Minimizing Maximum Mean Discrepancy
Paper
Previous Distribution-Matching based methods in Dataset Condensation/Distillation naively align only the first-order moment of the feature representations of real and synthetic data. However, identical first-order moments does not guarantee identical distributions, as shown below.
To address this issue, we further embed the feature representations into a reproducing kernel Hilbert space (RKHS), where we can easily align infinite order moments, leading to a more distribution-aligned synthetic set.

Getting Started
- Change the data path and result path in configs/dataset/IPCxxx.yaml
- Perform the condensation process
python condense_m3d.py --cfg ./configs/CIFAR-10/IPC50.yaml
- Condensing the ImageNet-100 dataset needs a multi-processing version
python condense_m3d_multiprocess.py --cfg ./configs/ImageNet-100/IPC10.yaml --phase 0 --nclass_sub 20
python condense_m3d_multiprocess.py --cfg ./configs/ImageNet-100/IPC10.yaml --phase 1 --nclass_sub 20
python condense_m3d_multiprocess.py --cfg ./configs/ImageNet-100/IPC10.yaml --phase 2 --nclass_sub 20
python condense_m3d_multiprocess.py --cfg ./configs/ImageNet-100/IPC10.yaml --phase 3 --nclass_sub 20
python condense_m3d_multiprocess.py --cfg ./configs/ImageNet-100/IPC10.yaml --phase 4 --nclass_sub 20
Evaluation
We provide a script to evaluate the condensed images
python evaluate_synset.py --dataset cifar10 --data_dir <path to your CIFAR dataset> \
--syn_data_dir <path to the saved condensed images> \
--dsa_strategy color_crop_flip_scale_rotate \
--epochs 1000 \
Acknowledgement
Our code is built upon IDC
Citation
If you find our code useful for your research, please cite our paper.
@inproceedings{zhang2024m3d,
title={M3D: Dataset Condensation by Minimizing Maximum Mean Discrepancy},
author={Hansong Zhang and Shikun Li and Pengju Wang and Dan Zeng and Shiming Ge},
year={2024},
booktitle={The 38th Annual AAAI Conference on Artificial Intelligence (AAAI)}
}
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
