{"id":26896951,"url":"https://github.com/gszfwsb/NCFM","last_synced_at":"2025-04-01T04:02:31.260Z","repository":{"id":280256068,"uuid":"941159481","full_name":"gszfwsb/NCFM","owner":"gszfwsb","description":"Official PyTorch implementation of the paper \"Dataset Distillation with Neural Characteristic Function\" (NCFM) in CVPR 2025.","archived":false,"fork":false,"pushed_at":"2025-03-10T14:50:12.000Z","size":1216,"stargazers_count":279,"open_issues_count":2,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T15:22:46.009Z","etag":null,"topics":["computer-vision","data-centric-ai","dataset-distillation","synthetic-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gszfwsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T16:25:09.000Z","updated_at":"2025-03-10T14:50:18.000Z","dependencies_parsed_at":"2025-03-02T10:37:35.935Z","dependency_job_id":null,"html_url":"https://github.com/gszfwsb/NCFM","commit_stats":null,"previous_names":["gszfwsb/ncfm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszfwsb%2FNCFM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszfwsb%2FNCFM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszfwsb%2FNCFM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszfwsb%2FNCFM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gszfwsb","download_url":"https://codeload.github.com/gszfwsb/NCFM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246580468,"owners_count":20800111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","data-centric-ai","dataset-distillation","synthetic-data"],"created_at":"2025-04-01T04:02:24.846Z","updated_at":"2025-04-01T04:02:31.255Z","avatar_url":"https://github.com/gszfwsb.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# [CVPR2025] Dataset Distillation with Neural Characteristic Function: A Minmax Perspective \r\n\r\nOfficial PyTorch implementation of the paper [\"Dataset Distillation with Neural Characteristic Function\"](https://arxiv.org/abs/2502.20653) (NCFM) in CVPR 2025.\r\n\r\n\r\n## :fire: News\r\n\r\n- [2025/03/02] The code of our paper has been released.  \r\n- [2025/02/27] Our NCFM paper has been accepted to CVPR 2025 (Rating: 555). Thanks!  \r\n\r\n\r\n## :rocket: Pipeline\r\n\r\nHere's an overview of the process behind our **Neural Characteristic Function Matching (NCFM)** method:\r\n\r\n![Figure 1](./asset/figure1.png?raw=true)\r\n\r\n\r\n\r\n\r\n\r\n## :mag: TODO\r\n\u003cfont color=\"red\"\u003e**We are currently organizing all the code. Stay tuned!**\u003c/font\u003e\r\n- [ ] Distillation code\r\n- [x] Evaluation code\r\n- [ ] Sampling network\r\n- [ ] Config files\r\n- [ ] Pretrained models\r\n- [ ] Distilled datasets\r\n- [ ] Continual learning code\r\n- [ ] Project page\r\n\r\n\r\n\r\n\r\n## 🛠️ Getting Started\r\n\r\nTo get started with NCFM, follow the installation instructions below.\r\n\r\n1.  Clone the repo\r\n\r\n```sh\r\ngit clone https://github.com/gszfwsb/NCFM.git\r\n```\r\n\r\n2. Install dependencies\r\n   \r\n```sh\r\npip install -r requirements.txt\r\n```\r\n3. Pretrain the models yourself, or download the **pretrained_models** from [Google Drive](https://drive.google.com/drive/folders/1HT_eUbTWOVXvBov5bM90b169jdy2puOh?usp=drive_link). \r\n```sh\r\ncd pretrain\r\ntorchrun --nproc_per_node={n_gpus} --nnodes=1 pretrain_script.py --gpu={gpu_ids} --config_path=../config/{ipc}/{dataset}.yaml\r\n\r\n```\r\n\r\n4. Condense\r\n```sh\r\ncd condense \r\ntorchrun --nproc_per_node={n_gpus} --nnodes=1 condense_script.py --gpu={gpu_ids} --ipc={ipc} --config_path=../config/{ipc}/{dataset}.yaml\r\n\r\n```\r\n5. Evaluation\r\n```sh\r\ncd evaluation \r\ntorchrun --nproc_per_node={n_gpus} --nnodes=1 evaluation_script.py --gpu={gpu_ids} --ipc={ipc} --config_path=../config/{ipc}/{dataset}.yaml --load_path={distilled_dataset.pt}\r\n```\r\n\r\n### :blue_book: Example Usage\r\n\r\n1. CIFAR-10\r\n\r\n```sh\r\n#ipc50\r\ncd condense\r\ntorchrun --nproc_per_node=8 --nnodes=1 --master_port=34153 condense_script.py --gpu=\"0,1,2,3,4,5,6,7\" --ipc=50 --config_path=../config/ipc50/cifar10.yaml\r\n```\r\n\r\n2. CIFAR-100\r\n\r\n```sh\r\n#ipc10\r\ncd condense\r\ntorchrun --nproc_per_node=8 --nnodes=1 --master_port=34153 condense_script.py --gpu=\"0,1,2,3,4,5,6,7\" --ipc=10 --config_path=../config/ipc10/cifar100.yaml\r\n```\r\n\r\n\r\n\r\n## :postbox: Contact\r\nIf you have any questions, please contact [Shaobo Wang](https://gszfwsb.github.io/)(`shaobowang1009@sjtu.edu.cn`).\r\n\r\n## :pushpin: Citation\r\nIf you find NCFM useful for your research and applications, please cite using this BibTeX:\r\n\r\n```bibtex\r\n@misc{wang2025datasetdistillationneuralcharacteristic,\r\n      title={Dataset Distillation with Neural Characteristic Function: A Minmax Perspective}, \r\n      author={Shaobo Wang and Yicun Yang and Zhiyuan Liu and Chenghao Sun and Xuming Hu and Conghui He and Linfeng Zhang},\r\n      year={2025},\r\n      eprint={2502.20653},\r\n      archivePrefix={arXiv},\r\n      primaryClass={cs.CV},\r\n      url={https://arxiv.org/abs/2502.20653}, \r\n}\r\n```\r\n\r\n## Acknowledgement\r\nWe sincerely thank the developers of the following projects for their valuable contributions and inspiration: [MTT](https://github.com/GeorgeCazenavette/mtt-distillation), [DATM](https://github.com/NUS-HPC-AI-Lab/DATM), [DC/DM](https://github.com/VICO-UoE/DatasetCondensation), [IDC](https://github.com/snu-mllab/Efficient-Dataset-Condensation), [SRe2L](https://github.com/VILA-Lab/SRe2L), [RDED](https://github.com/LINs-lab/RDED), [DANCE](https://github.com/Hansong-Zhang/DANCE). We draw inspiration from these fantastic projects!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgszfwsb%2FNCFM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgszfwsb%2FNCFM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgszfwsb%2FNCFM/lists"}