{"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/could-it-be-generated-towards-practical","title":"An Inversion-based Measure of Memorization for Diffusion Models","arxiv_id":"2405.05846","date":"2024-05-09","proceeding":null,"authors":["Zhe Ma","Qingming Li","Xuhong Zhang","Tianyu Du","Ruixiao Lin","Zonghui Wang","Shouling Ji","Wenzhi Chen"],"abstract":"The past few years have witnessed substantial advances in image generation powered by diffusion models. However, it was shown that diffusion models are vulnerable to training data memorization, raising concerns regarding copyright infringement and privacy invasion. This study delves into a rigorous analysis of memorization in diffusion models. We introduce an inversion-based measure of memorization, InvMM, which searches for a sensitive latent noise distribution accounting for the replication of an image. For accurate estimation of the memorization score, we propose an adaptive algorithm that balances the normality and sensitivity of the inverted distribution. Comprehensive experiments, conducted on both unconditional and text-guided diffusion models, demonstrate that InvMM is capable of detecting heavily memorized images and elucidating the effect of various factors on memorization. Additionally, we discuss how memorization differs from membership. In practice, InvMM serves as a useful tool for model developers to reliably assess the risk of memorization, thereby contributing to the enhancement of trustworthiness and privacy-preserving capabilities of diffusion models.","url_abs":"https://arxiv.org/abs/2405.05846v2","url_pdf":"https://arxiv.org/pdf/2405.05846v2.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":"could-it-be-generated-towards-practical","repo_url":"https://github.com/Maryeon/InvMM","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"memorization","task_name":"Memorization"},{"task_slug":"privacy-preserving","task_name":"Privacy Preserving"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.05846","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.05846"}},"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/Maryeon/InvMM","reach":{"status":"ok"}}],"summary":{"ran_violates":2,"ran":4,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":9,"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":9,"samples":[{"code_sha256_prefix":"856d86b39c6005b4","entry":"divisible_by","repo":"Maryeon/InvMM","repo_kind":"official","path":"latent-diffusion/inversion.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/latent-diffusion/inversion.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"856d86b39c6005b4"}},{"code_sha256_prefix":"2f7a1370a8d67d2b","entry":"has_int_squareroot","repo":"Maryeon/InvMM","repo_kind":"official","path":"stable-diffusion-v1/inversion.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/stable-diffusion-v1/inversion.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2f7a1370a8d67d2b"}},{"code_sha256_prefix":"cd3edab30cfead44","entry":"calculate_frechet_distance","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/score/fid.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/score/fid.py","link_basis":"harvester_set","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":"cd3edab30cfead44"}},{"code_sha256_prefix":"6a78f18d5b2ce056","entry":"extract","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/diffusion.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6a78f18d5b2ce056"}},{"code_sha256_prefix":"9b81ae7906ed29eb","entry":"get_inception_score","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/score/inception_score.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/score/inception_score.py","link_basis":"harvester_set","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":"9b81ae7906ed29eb"}},{"code_sha256_prefix":"f4114f6cd2bcefff","entry":"sscd_similarity","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/inverion.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/inverion.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":"f4114f6cd2bcefff"}},{"code_sha256_prefix":"b304af5c4fc5341a","entry":"torch_cov","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/score/fid.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/score/fid.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b304af5c4fc5341a"}},{"code_sha256_prefix":"526c471ba9b04752","entry":"get_inception_and_fid_score","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/score/both.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/score/both.py","link_basis":"harvester_set","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":"526c471ba9b04752"}},{"code_sha256_prefix":"2dfa8886e774088c","entry":"sqrt_newton_schulz","repo":"Maryeon/InvMM","repo_kind":"official","path":"ddpm/score/fid.py","file_url":"https://github.com/Maryeon/InvMM/blob/HEAD/ddpm/score/fid.py","link_basis":"harvester_set","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":"2dfa8886e774088c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}