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

Raising the Bar of AI-generated Image Detection with CLIP

Davide Cozzolino, Giovanni Poggi, Riccardo Corvi, Matthias Nießner, Luisa Verdoliva

TL;DR

This paper demonstrates that pre-trained vision-language models like CLIP can be transformed into highly effective, universal detectors for AI-generated images with minimal training data. By using a simple linear classifier on CLIP features, the authors achieve state-of-the-art generalization across diverse generative architectures and remarkable robustness against common image "laundering" techniques like compression and resizing.

What Problem Does This Paper Address?

As generative AI tools like DALL-E 3 and Midjourney become mainstream, the threat of high-quality disinformation grows. Detecting these "fakes" has become a high-stakes game of cat-and-mouse.

Traditional forensic detectors typically rely on low-level "fingerprints"—subtle artifacts left by specific neural network architectures (e.g., checkerboard patterns from GAN upsampling). However, these methods face two major hurdles:

  1. Generalization: They often fail when encountering a new generative model they weren't trained on (Out-of-Distribution data).
  2. Robustness: The subtle noise traces they rely on are easily destroyed by "laundering" operations common on social media, such as JPEG compression or resizing.

The authors seek a "universal" detector that can handle unseen generators and survive the harsh environment of the open web.

Methods

The authors propose a surprisingly lightweight detection strategy:

  • Feature Extraction: Instead of training a deep network from scratch, they use the pre-trained image encoder of CLIP (ViT L/14). Specifically, they extract features from the next-to-last layer, which they found to be more descriptive for this task than the final layer.
  • Paired Training: To avoid semantic bias (e.g., the detector learning that "cats" are real and "dragons" are fake), they use a paired approach. They take real images with captions and use those same captions to generate synthetic counterparts.
  • Simple Classifier: They train a linear SVM on these CLIP features.
  • Minimal Data: Unlike previous State-of-the-Art (SoTA) methods that require hundreds of thousands of images, this approach reaches peak performance with just 1,000 to 10,000 examples.

Datasets

The study evaluates performance across a massive benchmark of 18 different synthetic models, grouped into three families:

  • GAN-based: ProGAN, StyleGAN2, StyleGAN3, StyleGAN-T, GigaGAN.
  • Diffusion-based (DM): ADM, GLIDE, Stable Diffusion (1.3, 1.4, 2.1, XL), DiT, DeepFloyd-IF.
  • Commercial Tools: DALL-E 2, DALL-E 3, Midjourney v5, Adobe Firefly.

Training was primarily conducted using COCO for real images and Latent Diffusion for synthetic ones. They also explored the impact of CLIP pre-training datasets like LAION-400M, LAION-2B, and CommonPool (12.8B).

Key Insights and Ideas

  • Semantic Features > Forensic Noise: Traditional detectors look for microscopic noise. CLIP-based detectors appear to leverage higher-level semantic inconsistencies. As shown in Fourier spectra analysis, even when low-level Fourier peaks are removed by decimation, the CLIP-based detector remains effective, whereas noise-based detectors fail.
  • Pre-training Scale is Paramount: The detection ability is a direct byproduct of the VLM's pre-training. As shown in Performance vs Pre-training, using a CLIP model pre-trained on the massive 12.8B image CommonPool dataset yields significantly better results than smaller versions.
  • Diversity Over Quantity: For the reference set, the quality and diversity of images matter more than the sheer number. A few well-chosen examples from a single generator can enable detection across many others.
  • Orthogonality: CLIP features are largely independent of traditional low-level forensic traces. This allows for powerful "fusion" strategies where a CLIP detector and a traditional detector are combined to boost overall accuracy.
Figure 5. Top (from left to right): a synthetic image generated by Stable Diffusion XL [59] and its 4× decimated version; a real im- age and the corresponding image processed by the autoencoder of Stable Diffusion XL. Bottom: Fourier spectra of the noise residu- als for images shown on the top. A suitable decimation removes Fourier peaks in synthetic images, while passing a real image through an autoencoder creates new peaks.
Figure 4. Performance of the CLIP-based detector as a function of the pre-training. We show AUC, AP and Accuracy on post- processed images for models pre-trained on LAION-400M (0.4B images), LAION (2B) and CommonPool (12.8B).

Key Results

  • Superior Generalization: The CLIP-based detector improves generalization to unseen generators by +6% AUC over previous SoTA methods.
  • Extreme Robustness: It improves robustness to impaired/laundered data (compressed/resized) by +13% AUC.
  • Efficiency: As illustrated in Generalization vs Robustness, the proposed method (red dot) achieves the best balance of generalization and robustness while using orders of magnitude less training data (indicated by circle size) than competitors.
  • Few-Shot Success: The model performs remarkably well even in "few-shot" scenarios with as few as 10 training examples, making it highly adaptable to new generative threats as they emerge.
Figure 1. Area Under ROC Curve (AUC %) on unseen synthetic generators (x-axis) and on post-processed data (y-axis). The first number measures the generalization ability of the detector, the sec- ond measures its robustness to possible impairments. Circle area is proportional to training set size. Performance is measured over 18 different synthetic models. Our CLIP-based detector largely outperforms all SoTA methods with very limited training data.

Limitations and Future Work

  • Threshold Calibration: While the AUC (Area Under Curve) is high, setting a fixed decision threshold (e.g., 0.5) for all scenarios remains challenging without some calibration data from the target domain.
  • Interpretability: While the results are impressive, it is not yet fully understood which specific semantic features CLIP is identifying as "synthetic."
  • Future Directions: The authors suggest exploring more sophisticated few-shot adaptation methods that can update the detector "on the fly" and investigating the explainability of CLIP-based forensic features.

Summary updated

BibTeX
@inproceedings{cozzolino2023raising,
  author = {Davide Cozzolino and Giovanni Poggi and Riccardo Corvi and Matthias Nießner and Luisa Verdoliva},
  title = {{Raising the Bar of AI-generated Image Detection with CLIP}},
  booktitle = {Workshops @ CVPR},
  year = {2023},
}
Figure