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

Exploring the Adversarial Robustness of CLIP for AI-generated Image Detection

Vincenzo De Rosa, Fabrizio Guillaro, Giovanni Poggi, Davide Cozzolino, Luisa Verdoliva

Abstract

As generative AI models produce increasingly realistic imagery, the demand for reliable forensic detectors has grown. While Contrastive Language-Image Pretraining (CLIP) models have emerged as the state-of-the-art for identifying synthetic content, their vulnerability to adversarial manipulation remains a critical security concern. This paper investigates the robustness of CLIP-based detectors compared to traditional Convolutional Neural Networks (CNNs). Our findings reveal that while both architectures are susceptible to white-box attacks, they rely on fundamentally different image features. CLIP models focus on low-to-medium frequency structures and patch-based semantics, whereas CNNs prioritize high-frequency textures. This architectural divergence results in low attack transferability, suggesting that hybrid ensembles may offer a robust defense against adversarial evasion.

Introduction

The rapid advancement of Latent Diffusion Models (LDMs) has made AI-generated images nearly indistinguishable from reality, sparking an "arms race" between generative models and forensic detectors. Historically, Convolutional Neural Networks (CNNs) like ResNet were the primary tools for detection. However, these models often overfit to specific training artifacts and struggle with common image processing tasks like resizing or compression.

Recently, detectors utilizing CLIP (Vision Transformer or ViT backbones) have demonstrated superior generalization across diverse generative models. Despite their success, their security profile against intentional adversarial attacks—where an attacker slightly modifies a fake image to be classified as real—was previously under-explored. This study evaluates whether these transformer-based detectors offer a genuine security advantage or merely a different set of vulnerabilities.

Methodology

The researchers conducted a comparative analysis between two primary detector families:

  1. CNN-based Detectors: Including ResNet50 and ConvNeXt.
  2. CLIP-based Detectors: Utilizing various ViT backbones (ViT-L, ViT-g, and ViT-B).

To test robustness, the models were subjected to four adversarial attack vectors:

  • Projected Gradient Descent (PGD): A standard iterative white-box attack.
  • $DI^2$-FGSM: An optimization-based attack designed to improve transferability across different models.
  • Robust White-Box Attack (RWA): A specialized forensic attack that maintains effectiveness even after image degradations like JPEG compression.
  • Universal Attack (UA): A static noise pattern intended to fool a detector across a wide variety of images.

Evaluation was performed using a balanced dataset of 1,000 real images from the COCO dataset and 1,000 synthetic images generated by LDMs. The detectors were trained on a modern, large-scale dataset to ensure a competitive baseline.

The Frequency Gap and Architectural Signatures

A core contribution of this research is the use of Fourier transforms to visualize adversarial noise in the frequency domain. The analysis revealed a significant "Frequency Gap" between the two architectures:

  • CNNs and High Frequencies: CNN-based detectors primarily identify fakes by looking for high-frequency "fingerprints" or fine-grained pixel textures. Consequently, adversarial attacks against CNNs focus on manipulating these minute details.
  • CLIP and Global Structure: CLIP-based models focus on low-to-medium frequencies, emphasizing global structure and semantic consistency.
  • The Cross Signature: Interestingly, attacks targeting CLIP models produce a distinct "cross-shaped" pattern in the frequency spectrum. This is a direct result of the patch-wise processing mechanism inherent in Vision Transformers, where the model analyzes the image in discrete blocks rather than a continuous sliding window.

Experimental Results

White-Box Vulnerability

In a white-box scenario—where the attacker has full access to the detector's weights and architecture—both CNN and CLIP models are highly vulnerable. The Success Attack Rate (SAR) reached nearly 100% for all tested models, indicating that no current architecture is inherently immune to direct optimization attacks.

Transferability and the Ensemble Advantage

The study found that attacks are rarely effective when transferred between different architectures. An adversarial perturbation designed to blind a ResNet detector often fails to fool a CLIP-based detector. For instance, at a standard attack strength ($\epsilon=8$), the transfer success rate between the two families was frequently below 46%. This lack of transferability suggests that the models are "looking" at different parts of the image, making it difficult for an attacker to bypass both simultaneously.

Robustness to Image Degradation

CLIP-based detectors proved significantly more resilient to low-pass filtering. While removing high-frequency details caused CNN performance to plummet, CLIP models maintained high accuracy. This confirms that CLIP's reliance on "big picture" semantics makes it more robust against common image processing and specific "fake-to-real" adversarial attempts.

Conclusion

While CLIP-based detectors are not a silver bullet against adversarial attacks, they represent a significant shift in the forensic landscape. Their reliance on low-to-medium frequency features and patch-based structures provides a natural defense against attacks optimized for traditional CNNs.

Future research should focus on black-box, query-based attacks where the attacker has no prior knowledge of the model. Additionally, investigating how these detectors handle generic forensic traces—common to all digital photography rather than just AI generation—will be essential for deploying these tools in real-world security environments. For now, the most effective strategy for AI detection appears to be a multi-architectural ensemble that forces an attacker to reconcile the conflicting frequency requirements of both CNNs and Transformers.

Summary updated

BibTeX
@inproceedings{rosa2024exploring,
  author = {Vincenzo De Rosa and Fabrizio Guillaro and Giovanni Poggi and Davide Cozzolino and Luisa Verdoliva},
  title = {{Exploring the Adversarial Robustness of CLIP for AI-generated Image Detection}},
  booktitle = {WIFS},
  year = {2024},
  url = {https://openreview.net/forum?id=MMLj0RzpDS},
}
Figure