NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

C2P-CLIP: Injecting Category Common Prompt in CLIP to Enhance Generalization in Deepfake Detection

Chuangchuang Tan, Renshuai Tao, Huan Liu, Guanghua Gu, Baoyuan Wu, Yao Zhao, Yunchao Wei · DOI

Introduction

As generative AI models like GANs and Diffusion Models reach new heights of realism, distinguishing AI-generated content (AIGC) from authentic photography has become a critical challenge. Traditional deepfake detectors often overfit to the specific artifacts of their training data, failing when presented with content from unseen generators. Recent research has shown that large-scale pre-trained models like CLIP are surprisingly effective at this task when paired with simple classifiers. However, the underlying mechanism of this success remained poorly understood.

This paper introduces C2P-CLIP (Category Common Prompt CLIP), a method that enhances deepfake detection by injecting category-specific semantic concepts into the CLIP architecture. By teaching CLIP the "language" of deepfakes, the proposed method boosts detection accuracy and generalization across diverse generative models.

Understanding CLIP's Detection Mechanism

Before proposing a new architecture, the authors conducted a diagnostic study to understand why CLIP's features are so effective for binary "real vs. fake" classification. They utilized ClipCap, an image-to-text decoder, to translate internal CLIP features back into human-readable captions.

The diagnostic process involves decoding CLIP's internal features into text to reveal the semantic concepts the model associates with real and fake images.

The findings revealed that CLIP does not possess an inherent understanding of "authenticity." Instead, it functions as a semantic matcher. It clusters images based on shared concepts that are statistically more prevalent in either real or fake datasets. For instance, if a training set of fake images frequently contains blurry backgrounds or specific textures, CLIP learns to associate those semantic concepts with the "fake" label. The t-SNE visualization of detection features confirms that the model effectively separates real and fake categories based on these high-level semantic clusters.

The C2P-CLIP Methodology

Building on the insight that CLIP relies on semantics, the authors developed C2P-CLIP to explicitly guide the model toward distinguishing features. The framework consists of three main components:

  1. Caption Enhancement with Common Prompts: Training image captions are augmented with "Category Common Prompts." A real image caption might be extended to "A person in a room [Camera]", while a fake counterpart becomes "A person in a room [Deepfake]".
  2. Concept Injection via LoRA: To avoid the computational cost of retraining the entire CLIP model, the researchers employed Low-Rank Adaptation (LoRA). This allows the image encoder to learn associations between visual cues and the injected category prompts (e.g., "Camera" or "Deepfake") efficiently.
  3. Dual Loss Training: The model is optimized using a combination of contrastive loss (aligning images with their enhanced text descriptions) and standard classification loss.
The C2P-CLIP architecture: (a) shows the analysis of CLIP features, and (b) illustrates the injection of category common prompts into the text encoder and the use of LoRA in the image encoder.

During inference, the text encoder is discarded. The system uses only the lightweight, LoRA-enhanced image encoder and a linear classifier, ensuring zero additional computational overhead compared to a standard CLIP-based detector.

Experimental Evaluation

C2P-CLIP was rigorously tested on two major benchmarks: UniversalFakeDetect, a cross-model benchmark tested on 19 diverse subsets (StyleGAN, BigGAN, etc.), and GenImage, a million-scale dataset focused on diffusion models like Midjourney and Stable Diffusion.

Key Results

  • Superior Generalization: On UniversalFakeDetect, C2P-CLIP improved mean accuracy (mAcc) by 12.41% over the baseline UniFD method.
  • State-of-the-Art Performance: On the GenImage dataset, it achieved an accuracy of 95.8%, outperforming the previous leading method, FatFormer, by 6.9%.
  • Robustness: The method proved robust to the specific wording of the prompts; using different labels for real and fake categories yielded consistently high performance, indicating that the model learns the underlying semantic divergence rather than just specific keywords.

Conclusion and Future Work

C2P-CLIP demonstrates that the key to robust deepfake detection lies in leveraging the semantic power of vision-language models. By explicitly injecting category concepts, the model moves beyond low-level artifact detection toward a more generalized understanding of synthetic content. Future research directions include refining the semantic analysis beyond simple word frequencies and extending these insights to the domain of video deepfakes.

Summary updated

BibTeX
@inproceedings{tan2025c,
  author = {Chuangchuang Tan and Renshuai Tao and Huan Liu and Guanghua Gu and Baoyuan Wu and Yao Zhao and Yunchao Wei},
  title = {{C2P-CLIP: Injecting Category Common Prompt in CLIP to Enhance Generalization in Deepfake Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i7.32772},
}
Figure