{"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/invdiff-invariant-guidance-for-bias","title":"InvDiff: Invariant Guidance for Bias Mitigation in Diffusion Models","arxiv_id":"2412.08480","date":"2024-12-11","proceeding":null,"authors":["Min Hou","Yueying Wu","Chang Xu","Yu-Hao Huang","Chenxi Bai","Le Wu","Jiang Bian"],"abstract":"As one of the most successful generative models, diffusion models have demonstrated remarkable efficacy in synthesizing high-quality images. These models learn the underlying high-dimensional data distribution in an unsupervised manner. Despite their success, diffusion models are highly data-driven and prone to inheriting the imbalances and biases present in real-world data. Some studies have attempted to address these issues by designing text prompts for known biases or using bias labels to construct unbiased data. While these methods have shown improved results, real-world scenarios often contain various unknown biases, and obtaining bias labels is particularly challenging. In this paper, we emphasize the necessity of mitigating bias in pre-trained diffusion models without relying on auxiliary bias annotations. To tackle this problem, we propose a framework, InvDiff, which aims to learn invariant semantic information for diffusion guidance. Specifically, we propose identifying underlying biases in the training data and designing a novel debiasing training objective. Then, we employ a lightweight trainable module that automatically preserves invariant semantic information and uses it to guide the diffusion model's sampling process toward unbiased outcomes simultaneously. Notably, we only need to learn a small number of parameters in the lightweight learnable module without altering the pre-trained diffusion model. Furthermore, we provide a theoretical guarantee that the implementation of InvDiff is equivalent to reducing the error upper bound of generalization. Extensive experimental results on three publicly available benchmarks demonstrate that InvDiff effectively reduces biases while maintaining the quality of image generation. Our code is available at https://github.com/Hundredl/InvDiff.","url_abs":"https://arxiv.org/abs/2412.08480v1","url_pdf":"https://arxiv.org/pdf/2412.08480v1.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":"invdiff-invariant-guidance-for-bias","repo_url":"https://github.com/hundredl/invdiff","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.08480","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.08480"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/hundredl/invdiff","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_fixture":2,"unverified":8},"by_repo_kind":{"official":{"samples":11,"ran":3,"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":"af985ecf236605b0","entry":"compute_pairwise_distances","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/improved_prd.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/improved_prd.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af985ecf236605b0"}},{"code_sha256_prefix":"321ebed484cb3298","entry":"distances2radii","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/improved_prd.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/improved_prd.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"321ebed484cb3298"}},{"code_sha256_prefix":"bcc716018b80b027","entry":"get_kth_value","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/improved_prd.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/improved_prd.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bcc716018b80b027"}},{"code_sha256_prefix":"ad2e2a000b9c7682","entry":"calculate_debias_score","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/bias_score.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/bias_score.py","link_basis":"first_harvest_node","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":"ad2e2a000b9c7682"}},{"code_sha256_prefix":"e2b97b3cd45e225a","entry":"get_clip_score","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/clip_score.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/clip_score.py","link_basis":"first_harvest_node","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":"e2b97b3cd45e225a"}},{"code_sha256_prefix":"e33d88ba86e28104","entry":"load_classifier_model","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/bias_score.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/bias_score.py","link_basis":"first_harvest_node","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":"e33d88ba86e28104"}},{"code_sha256_prefix":"3615d4cc8893f913","entry":"load_pic_dataset","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/bias_score.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/bias_score.py","link_basis":"first_harvest_node","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":"3615d4cc8893f913"}},{"code_sha256_prefix":"44f09524879d9935","entry":"load_pic_dataset","repo":"hundredl/invdiff","repo_kind":"official","path":"src/utils/score/clip_score.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/utils/score/clip_score.py","link_basis":"first_harvest_node","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":"44f09524879d9935"}},{"code_sha256_prefix":"3957a0589de806cc","entry":"process_train","repo":"hundredl/invdiff","repo_kind":"official","path":"src/train_classifier.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/train_classifier.py","link_basis":"first_harvest_node","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":"3957a0589de806cc"}},{"code_sha256_prefix":"ccf2fa49689a52e5","entry":"process_train_for_one","repo":"hundredl/invdiff","repo_kind":"official","path":"src/train_classifier.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/train_classifier.py","link_basis":"first_harvest_node","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":"ccf2fa49689a52e5"}},{"code_sha256_prefix":"3ca1e034cf9f7749","entry":"process_val_for_one","repo":"hundredl/invdiff","repo_kind":"official","path":"src/train_classifier.py","file_url":"https://github.com/hundredl/invdiff/blob/HEAD/src/train_classifier.py","link_basis":"first_harvest_node","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":"3ca1e034cf9f7749"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}