{"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/diffusion-models-and-semi-supervised-learners-1","title":"Diffusion Models and Semi-Supervised Learners Benefit Mutually with Few Labels","arxiv_id":"2302.10586","date":"2023-02-21","proceeding":"NeurIPS 2023 11","authors":["Zebin You","Yong Zhong","Fan Bao","Jiacheng Sun","Chongxuan Li","Jun Zhu"],"abstract":"In an effort to further advance semi-supervised generative and classification tasks, we propose a simple yet effective training strategy called dual pseudo training (DPT), built upon strong semi-supervised learners and diffusion models. DPT operates in three stages: training a classifier on partially labeled data to predict pseudo-labels; training a conditional generative model using these pseudo-labels to generate pseudo images; and retraining the classifier with a mix of real and pseudo images. Empirically, DPT consistently achieves SOTA performance of semi-supervised generation and classification across various settings. In particular, with one or two labels per class, DPT achieves a Fr\\'echet Inception Distance (FID) score of 3.08 or 2.52 on ImageNet 256x256. Besides, DPT outperforms competitive semi-supervised baselines substantially on ImageNet classification tasks, achieving top-1 accuracies of 59.0 (+2.8), 69.5 (+3.0), and 74.4 (+2.0) with one, two, or five labels per class, respectively. Notably, our results demonstrate that diffusion can generate realistic images with only a few labels (e.g., <0.1%) and generative augmentation remains viable for semi-supervised classification. Our code is available at https://github.com/ML-GSAI/DPT.","url_abs":"https://arxiv.org/abs/2302.10586v3","url_pdf":"https://arxiv.org/pdf/2302.10586v3.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":"diffusion-models-and-semi-supervised-learners-1","repo_url":"https://github.com/ml-gsai/dpt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"diffusion-models-and-semi-supervised-learners-1","repo_url":"https://github.com/baofff/U-ViT","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"diffusion-models-and-semi-supervised-learners-1","repo_url":"https://github.com/MindCode-4/code-3/tree/main/dpt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-prediction-transformer","method_name":"DPT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2302.10586","atlas_url":"https://app.syntology.ai/?focus=2302.10586","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.10586"}},"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":"deterministic:regex_extraction","url":"https://github.com/ML-GSAI/DPT","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/baofff/U-ViT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-3/tree/main/dpt","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ml-gsai/dpt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"ran_fixture":6,"ran_honours":1,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":19,"ran":14,"repositories":2}},"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":3,"samples":[{"code_sha256_prefix":"f057bf3471d77c43","entry":"center_crop","repo":"ML-GSAI/DPT","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f057bf3471d77c43"}},{"code_sha256_prefix":"7478f8e64cee8964","entry":"distributed_sinkhorn","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/losses.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/losses.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7478f8e64cee8964"}},{"code_sha256_prefix":"55120f2026b56aa2","entry":"drop_path","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/deit.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/deit.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"55120f2026b56aa2"}},{"code_sha256_prefix":"b723a1cb4778012f","entry":"get_sde","repo":"ML-GSAI/DPT","repo_kind":"official","path":"sde.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/sde.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b723a1cb4778012f"}},{"code_sha256_prefix":"86c7877e164664bc","entry":"interpolate_fn","repo":"ML-GSAI/DPT","repo_kind":"official","path":"dpm_solver_pp.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/dpm_solver_pp.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"86c7877e164664bc"}},{"code_sha256_prefix":"cec1c5fdf881ddf4","entry":"make_transforms","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/data_manager.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/data_manager.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cec1c5fdf881ddf4"}},{"code_sha256_prefix":"ace7da590f4070e0","entry":"model_wrapper","repo":"ML-GSAI/DPT","repo_kind":"official","path":"dpm_solver_pp.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/dpm_solver_pp.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ace7da590f4070e0"}},{"code_sha256_prefix":"b102ed94bbf0cfb9","entry":"model_wrapper","repo":"ML-GSAI/DPT","repo_kind":"official","path":"dpm_solver_pytorch.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/dpm_solver_pytorch.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b102ed94bbf0cfb9"}},{"code_sha256_prefix":"02c82bdf3494ea71","entry":"mos","repo":"ML-GSAI/DPT","repo_kind":"official","path":"sde.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/sde.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"02c82bdf3494ea71"}},{"code_sha256_prefix":"7a7de2a8e080f047","entry":"patchify","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"7a7de2a8e080f047"}},{"code_sha256_prefix":"9cf076a2ae913f94","entry":"patchify","repo":"baofff/u-vit","repo_kind":"official","path":"libs/uvit.py","file_url":"https://github.com/baofff/u-vit/blob/HEAD/libs/uvit.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9cf076a2ae913f94"}},{"code_sha256_prefix":"05d1f95a391c0ec3","entry":"random_crop_arr","repo":"ML-GSAI/DPT","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"05d1f95a391c0ec3"}},{"code_sha256_prefix":"2ee6e353f1dd4cf3","entry":"stable_diffusion_beta_schedule","repo":"ML-GSAI/DPT","repo_kind":"official","path":"sample_ldm_discrete_all.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/sample_ldm_discrete_all.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2ee6e353f1dd4cf3"}},{"code_sha256_prefix":"262b18d8278dcf70","entry":"timestep_embedding","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"262b18d8278dcf70"}},{"code_sha256_prefix":"b494dd297ded5960","entry":"timestep_embedding","repo":"baofff/u-vit","repo_kind":"official","path":"libs/uvit.py","file_url":"https://github.com/baofff/u-vit/blob/HEAD/libs/uvit.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b494dd297ded5960"}},{"code_sha256_prefix":"82e1ad8a9b00554e","entry":"unpatchify","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"82e1ad8a9b00554e"}},{"code_sha256_prefix":"f9244c08c1011341","entry":"unpatchify","repo":"baofff/u-vit","repo_kind":"official","path":"libs/uvit.py","file_url":"https://github.com/baofff/u-vit/blob/HEAD/libs/uvit.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f9244c08c1011341"}},{"code_sha256_prefix":"f8b4a29a52612a41","entry":"center_crop_arr","repo":"ML-GSAI/DPT","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8b4a29a52612a41"}},{"code_sha256_prefix":"b2c367ab087ec039","entry":"copy_imgnt_locally","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/data_manager.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/data_manager.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b2c367ab087ec039"}},{"code_sha256_prefix":"ec08cc8c5589ddfe","entry":"init_data","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/data_manager.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/data_manager.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ec08cc8c5589ddfe"}},{"code_sha256_prefix":"e22a49db490231b6","entry":"load_checkpoint","repo":"ML-GSAI/DPT","repo_kind":"official","path":"src/msn_train.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/src/msn_train.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e22a49db490231b6"}},{"code_sha256_prefix":"4d33c2f525f1b1c0","entry":"stp","repo":"ML-GSAI/DPT","repo_kind":"official","path":"sde.py","file_url":"https://github.com/ML-GSAI/DPT/blob/HEAD/sde.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d33c2f525f1b1c0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}