{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/cafe-learning-to-condense-dataset-by-aligning","title":"CAFE: Learning to Condense Dataset by Aligning Features","arxiv_id":"2203.01531","date":"2022-03-03","proceeding":"CVPR 2022 1","authors":["Kai Wang","Bo Zhao","Xiangyu Peng","Zheng Zhu","Shuo Yang","Shuo Wang","Guan Huang","Hakan Bilen","Xinchao Wang","Yang You"],"abstract":"Dataset condensation aims at reducing the network training effort through condensing a cumbersome training set into a compact synthetic one. State-of-the-art approaches largely rely on learning the synthetic data by matching the gradients between the real and synthetic data batches. Despite the intuitive motivation and promising results, such gradient-based methods, by nature, easily overfit to a biased set of samples that produce dominant gradients, and thus lack global supervision of data distribution. In this paper, we propose a novel scheme to Condense dataset by Aligning FEatures (CAFE), which explicitly attempts to preserve the real-feature distribution as well as the discriminant power of the resulting synthetic set, lending itself to strong generalization capability to various architectures. At the heart of our approach is an effective strategy to align features from the real and synthetic data across various scales, while accounting for the classification of real samples. Our scheme is further backed up by a novel dynamic bi-level optimization, which adaptively adjusts parameter updates to prevent over-/under-fitting. We validate the proposed CAFE across various datasets, and demonstrate that it generally outperforms the state of the art: on the SVHN dataset, for example, the performance gain is up to 11%. Extensive experiments and analyses verify the effectiveness and necessity of proposed designs.","url_abs":"https://arxiv.org/abs/2203.01531v2","url_pdf":"https://arxiv.org/pdf/2203.01531v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"cafe-learning-to-condense-dataset-by-aligning","repo_url":"https://github.com/kaiwang960112/cafe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"cafe-learning-to-condense-dataset-by-aligning","repo_url":"https://github.com/Guang000/Awesome-Dataset-Distillation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"dataset-condensation","task_name":"Dataset Condensation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2203.01531","atlas_url":"https://app.syntology.ai/?focus=2203.01531","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.01531"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Guang000/Awesome-Dataset-Distillation","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kaiwang960112/cafe","reach":null}],"summary":{"ran":8,"ran_fixture":2,"ran_draft_wrong":16,"ran_honours":1,"unverified":6},"by_repo_kind":{"official":{"samples":33,"ran":27,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":33,"samples":[{"code_sha256_prefix":"931c859769faecd5","entry":"AlexNet","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"931c859769faecd5"}},{"code_sha256_prefix":"1a326419c73ee5da","entry":"ConvNet","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a326419c73ee5da"}},{"code_sha256_prefix":"de12e346f3744454","entry":"DiffAugment","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"de12e346f3744454"}},{"code_sha256_prefix":"47a58a8eff474d1c","entry":"LeNet","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"47a58a8eff474d1c"}},{"code_sha256_prefix":"0935dbd6d06c3d0a","entry":"MLP","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0935dbd6d06c3d0a"}},{"code_sha256_prefix":"3a7e1b5c7abb8046","entry":"ParamDiffAug","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3a7e1b5c7abb8046"}},{"code_sha256_prefix":"820bb01f1d2a3735","entry":"ResNet","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"820bb01f1d2a3735"}},{"code_sha256_prefix":"aa9bc50ea3b078f6","entry":"ResNet18","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa9bc50ea3b078f6"}},{"code_sha256_prefix":"63d307fe8ed31e64","entry":"ResNet18BN_AP","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"63d307fe8ed31e64"}},{"code_sha256_prefix":"d63549dbc5535241","entry":"ResNet_AP","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d63549dbc5535241"}},{"code_sha256_prefix":"1bd08e0189b116b5","entry":"VGG","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1bd08e0189b116b5"}},{"code_sha256_prefix":"955fe26af93adacd","entry":"VGG11","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"955fe26af93adacd"}},{"code_sha256_prefix":"988edc744dcd7cc3","entry":"VGG11BN","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"988edc744dcd7cc3"}},{"code_sha256_prefix":"8335c250c64e41f3","entry":"augment","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8335c250c64e41f3"}},{"code_sha256_prefix":"45800818f22dfa10","entry":"build_logger","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"45800818f22dfa10"}},{"code_sha256_prefix":"68cbb3fefaa24eb8","entry":"criterion_middle","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"68cbb3fefaa24eb8"}},{"code_sha256_prefix":"b447e8791b4d9091","entry":"get_daparam","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b447e8791b4d9091"}},{"code_sha256_prefix":"ed8ab232870c1ce9","entry":"get_eval_pool","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed8ab232870c1ce9"}},{"code_sha256_prefix":"ae1b026d05c0c014","entry":"get_loops","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ae1b026d05c0c014"}},{"code_sha256_prefix":"2381e0ea15f245ea","entry":"rand_brightness","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2381e0ea15f245ea"}},{"code_sha256_prefix":"22b1451f3070f9e5","entry":"rand_contrast","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"22b1451f3070f9e5"}},{"code_sha256_prefix":"8ef6746e0ade200d","entry":"rand_crop","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8ef6746e0ade200d"}},{"code_sha256_prefix":"b3fdd0e504dba6d1","entry":"rand_cutout","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b3fdd0e504dba6d1"}},{"code_sha256_prefix":"a52fd828a62130d2","entry":"rand_flip","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a52fd828a62130d2"}},{"code_sha256_prefix":"6c89a7b5fe0611fa","entry":"rand_rotate","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6c89a7b5fe0611fa"}},{"code_sha256_prefix":"7f5ed98fe0143f9c","entry":"rand_saturation","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7f5ed98fe0143f9c"}},{"code_sha256_prefix":"d2492574e9a83673","entry":"rand_scale","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d2492574e9a83673"}},{"code_sha256_prefix":"a9589f68cbcd06ab","entry":"adjust_learning_rate","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a9589f68cbcd06ab"}},{"code_sha256_prefix":"6fa52b79ca3583aa","entry":"epoch","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6fa52b79ca3583aa"}},{"code_sha256_prefix":"c7e7ef42dd736d9d","entry":"evaluate_synset","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c7e7ef42dd736d9d"}},{"code_sha256_prefix":"af2d19355b2e2b4b","entry":"get_dataset","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"af2d19355b2e2b4b"}},{"code_sha256_prefix":"d8f2e9a5be7af8ca","entry":"get_network","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d8f2e9a5be7af8ca"}},{"code_sha256_prefix":"7b2a4be6c55f2514","entry":"main","repo":"kaiwang960112/cafe","repo_kind":"official","path":"distill.py","file_url":"https://github.com/kaiwang960112/cafe/blob/HEAD/distill.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7b2a4be6c55f2514"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}