{"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/lare-2-latent-reconstruction-error-based","title":"LaRE^2: Latent Reconstruction Error Based Method for Diffusion-Generated Image Detection","arxiv_id":"2403.17465","date":"2024-03-26","proceeding":"CVPR 2024 1","authors":["Yunpeng Luo","Junlong Du","Ke Yan","Shouhong Ding"],"abstract":"The evolution of Diffusion Models has dramatically improved image generation quality, making it increasingly difficult to differentiate between real and generated images. This development, while impressive, also raises significant privacy and security concerns. In response to this, we propose a novel Latent REconstruction error guided feature REfinement method (LaRE^2) for detecting the diffusion-generated images. We come up with the Latent Reconstruction Error (LaRE), the first reconstruction-error based feature in the latent space for generated image detection. LaRE surpasses existing methods in terms of feature extraction efficiency while preserving crucial cues required to differentiate between the real and the fake. To exploit LaRE, we propose an Error-Guided feature REfinement module (EGRE), which can refine the image feature guided by LaRE to enhance the discriminativeness of the feature. Our EGRE utilizes an align-then-refine mechanism, which effectively refines the image feature for generated-image detection from both spatial and channel perspectives. Extensive experiments on the large-scale GenImage benchmark demonstrate the superiority of our LaRE^2, which surpasses the best SoTA method by up to 11.9%/12.1% average ACC/AP across 8 different image generators. LaRE also surpasses existing methods in terms of feature extraction cost, delivering an impressive speed enhancement of 8 times. Code is available.","url_abs":"https://arxiv.org/abs/2403.17465v3","url_pdf":"https://arxiv.org/pdf/2403.17465v3.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":"lare-2-latent-reconstruction-error-based","repo_url":"https://github.com/luo3300612/lare","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.17465","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.17465"}},"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/luo3300612/lare","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":"6978f1d410660f53","entry":"conv3x3","repo":"luo3300612/lare","repo_kind":"official","path":"model_base.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/model_base.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6978f1d410660f53"}},{"code_sha256_prefix":"054aa6966bc007ec","entry":"search_best_acc","repo":"luo3300612/lare","repo_kind":"official","path":"train_classifier_wmap.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/train_classifier_wmap.py","link_basis":"first_harvest_node","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":"054aa6966bc007ec"}},{"code_sha256_prefix":"b75e320bbdef33fa","entry":"split_list","repo":"luo3300612/lare","repo_kind":"official","path":"extract_lare.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/extract_lare.py","link_basis":"first_harvest_node","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":"b75e320bbdef33fa"}},{"code_sha256_prefix":"0648e3b3ea1471b7","entry":"train_one_epoch","repo":"luo3300612/lare","repo_kind":"official","path":"train_classifier_wmap.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/train_classifier_wmap.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0648e3b3ea1471b7"}},{"code_sha256_prefix":"b59cbe843294ab85","entry":"encode_image","repo":"luo3300612/lare","repo_kind":"official","path":"model.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/model.py","link_basis":"first_harvest_node","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":"b59cbe843294ab85"}},{"code_sha256_prefix":"0923387a70ab89fc","entry":"forward","repo":"luo3300612/lare","repo_kind":"official","path":"model.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/model.py","link_basis":"first_harvest_node","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":"0923387a70ab89fc"}},{"code_sha256_prefix":"de38f1d62d33eabc","entry":"validation_contrastive","repo":"luo3300612/lare","repo_kind":"official","path":"train_classifier_wmap.py","file_url":"https://github.com/luo3300612/lare/blob/HEAD/train_classifier_wmap.py","link_basis":"first_harvest_node","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":"de38f1d62d33eabc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}