{"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/villandiffusion-a-unified-backdoor-attack-1","title":"VillanDiffusion: A Unified Backdoor Attack Framework for Diffusion Models","arxiv_id":"2306.06874","date":"2023-06-12","proceeding":"NeurIPS 2023 11","authors":["Sheng-Yen Chou","Pin-Yu Chen","Tsung-Yi Ho"],"abstract":"Diffusion Models (DMs) are state-of-the-art generative models that learn a reversible corruption process from iterative noise addition and denoising. They are the backbone of many generative AI applications, such as text-to-image conditional generation. However, recent studies have shown that basic unconditional DMs (e.g., DDPM and DDIM) are vulnerable to backdoor injection, a type of output manipulation attack triggered by a maliciously embedded pattern at model input. This paper presents a unified backdoor attack framework (VillanDiffusion) to expand the current scope of backdoor analysis for DMs. Our framework covers mainstream unconditional and conditional DMs (denoising-based and score-based) and various training-free samplers for holistic evaluations. Experiments show that our unified framework facilitates the backdoor analysis of different DM configurations and provides new insights into caption-based backdoor attacks on DMs. Our code is available on GitHub: \\url{https://github.com/IBM/villandiffusion}","url_abs":"https://arxiv.org/abs/2306.06874v5","url_pdf":"https://arxiv.org/pdf/2306.06874v5.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":"villandiffusion-a-unified-backdoor-attack-1","repo_url":"https://github.com/ibm/villandiffusion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"backdoor-attack","task_name":"Backdoor Attack"},{"task_slug":"denoising","task_name":"Denoising"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2306.06874","atlas_url":"https://app.syntology.ai/?focus=2306.06874","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.06874"}},"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/IBM/villandiffusion","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ibm/villandiffusion","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":2,"ran":2,"ran_violates":2,"ran_honours":1,"unverified":7},"by_repo_kind":{"official":{"samples":14,"ran":7,"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":0,"samples":[{"code_sha256_prefix":"8bee9b7a4832d4a1","entry":"Upsample","repo":"IBM/villandiffusion","repo_kind":"official","path":"model.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/model.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8bee9b7a4832d4a1"}},{"code_sha256_prefix":"f3a9cdb81c13d825","entry":"cosine_beta_schedule","repo":"IBM/villandiffusion","repo_kind":"official","path":"loss.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f3a9cdb81c13d825"}},{"code_sha256_prefix":"fbf9ec7be545688e","entry":"default","repo":"IBM/villandiffusion","repo_kind":"official","path":"model.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fbf9ec7be545688e"}},{"code_sha256_prefix":"608e364a9d2376a3","entry":"exists","repo":"IBM/villandiffusion","repo_kind":"official","path":"model.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"608e364a9d2376a3"}},{"code_sha256_prefix":"37a36e71b86103ce","entry":"linear_beta_schedule","repo":"IBM/villandiffusion","repo_kind":"official","path":"loss.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/loss.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"37a36e71b86103ce"}},{"code_sha256_prefix":"496165266c2eceff","entry":"quadratic_beta_schedule","repo":"IBM/villandiffusion","repo_kind":"official","path":"loss.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"496165266c2eceff"}},{"code_sha256_prefix":"410e560ea7b3decb","entry":"read_json","repo":"IBM/VillanDiffusion","repo_kind":"official","path":"VillanDiffusion.py","file_url":"https://github.com/IBM/VillanDiffusion/blob/HEAD/VillanDiffusion.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"410e560ea7b3decb"}},{"code_sha256_prefix":"7eef736dc758d990","entry":"action_generator","repo":"IBM/villandiffusion","repo_kind":"official","path":"config.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/config.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7eef736dc758d990"}},{"code_sha256_prefix":"a17aa1b06ec919e8","entry":"calculate_activation_statistics","repo":"IBM/villandiffusion","repo_kind":"official","path":"fid_score.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a17aa1b06ec919e8"}},{"code_sha256_prefix":"0def50a351111624","entry":"calculate_frechet_distance","repo":"IBM/villandiffusion","repo_kind":"official","path":"fid_score.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0def50a351111624"}},{"code_sha256_prefix":"be5b84142037dc3b","entry":"download_img","repo":"IBM/villandiffusion","repo_kind":"official","path":"caption_dataset.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/caption_dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"be5b84142037dc3b"}},{"code_sha256_prefix":"9f5980b8530c7409","entry":"get_activations","repo":"IBM/villandiffusion","repo_kind":"official","path":"fid_score.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9f5980b8530c7409"}},{"code_sha256_prefix":"2f00b39db5a81466","entry":"import_model_class_from_model_name_or_path","repo":"IBM/villandiffusion","repo_kind":"official","path":"caption_sim.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/caption_sim.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2f00b39db5a81466"}},{"code_sha256_prefix":"5a5ee8bd0dc9da41","entry":"yield_default","repo":"IBM/villandiffusion","repo_kind":"official","path":"arg_parser.py","file_url":"https://github.com/IBM/villandiffusion/blob/HEAD/arg_parser.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5a5ee8bd0dc9da41"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}