{"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/c2p-clip-injecting-category-common-prompt-in","title":"C2P-CLIP: Injecting Category Common Prompt in CLIP to Enhance Generalization in Deepfake Detection","arxiv_id":"2408.09647","date":"2024-08-19","proceeding":null,"authors":["Chuangchuang Tan","Renshuai Tao","Huan Liu","Guanghua Gu","Baoyuan Wu","Yao Zhao","Yunchao Wei"],"abstract":"This work focuses on AIGC detection to develop universal detectors capable of identifying various types of forgery images. Recent studies have found large pre-trained models, such as CLIP, are effective for generalizable deepfake detection along with linear classifiers. However, two critical issues remain unresolved: 1) understanding why CLIP features are effective on deepfake detection through a linear classifier; and 2) exploring the detection potential of CLIP. In this study, we delve into the underlying mechanisms of CLIP's detection capabilities by decoding its detection features into text and performing word frequency analysis. Our finding indicates that CLIP detects deepfakes by recognizing similar concepts (Fig. \\ref{fig:fig1} a). Building on this insight, we introduce Category Common Prompt CLIP, called C2P-CLIP, which integrates the category common prompt into the text encoder to inject category-related concepts into the image encoder, thereby enhancing detection performance (Fig. \\ref{fig:fig1} b). Our method achieves a 12.41\\% improvement in detection accuracy compared to the original CLIP, without introducing additional parameters during testing. Comprehensive experiments conducted on two widely-used datasets, encompassing 20 generation models, validate the efficacy of the proposed method, demonstrating state-of-the-art performance. The code is available at \\url{https://github.com/chuangchuangtan/C2P-CLIP-DeepfakeDetection}","url_abs":"https://arxiv.org/abs/2408.09647v2","url_pdf":"https://arxiv.org/pdf/2408.09647v2.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":"c2p-clip-injecting-category-common-prompt-in","repo_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"deepfake-detection","task_name":"DeepFake Detection"},{"task_slug":"face-swapping","task_name":"Face Swapping"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2408.09647","atlas_url":"https://app.syntology.ai/?focus=2408.09647","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.09647"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":5,"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":5,"samples":[{"code_sha256_prefix":"f839584065da54aa","entry":"create_logger","repo":"chuangchuangtan/c2p-clip-deepfakedetection","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection/blob/HEAD/utils/logger.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":"f839584065da54aa"}},{"code_sha256_prefix":"e33b112514a9e4b0","entry":"generate2","repo":"chuangchuangtan/c2p-clip-deepfakedetection","repo_kind":"official","path":"networks/decode_clipfeature_image.py","file_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection/blob/HEAD/networks/decode_clipfeature_image.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":"e33b112514a9e4b0"}},{"code_sha256_prefix":"0eb85b162e25a879","entry":"get_clip_model","repo":"chuangchuangtan/c2p-clip-deepfakedetection","repo_kind":"official","path":"networks/decode_clipfeature_image.py","file_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection/blob/HEAD/networks/decode_clipfeature_image.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":"0eb85b162e25a879"}},{"code_sha256_prefix":"8ce1a73d6b1c51e4","entry":"get_text","repo":"chuangchuangtan/c2p-clip-deepfakedetection","repo_kind":"official","path":"networks/decode_clipfeature_image.py","file_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection/blob/HEAD/networks/decode_clipfeature_image.py","link_basis":"first_harvest_node","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":"8ce1a73d6b1c51e4"}},{"code_sha256_prefix":"7742460f647f9ca2","entry":"unnormalize","repo":"chuangchuangtan/c2p-clip-deepfakedetection","repo_kind":"official","path":"utils/util.py","file_url":"https://github.com/chuangchuangtan/c2p-clip-deepfakedetection/blob/HEAD/utils/util.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":"7742460f647f9ca2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}