Skip to main content
QUICK REVIEW

[Paper Review] Towards Universal Fake Image Detectors that Generalize Across Generative Models

Utkarsh Ojha, Yuheng Li|arXiv (Cornell University)|Feb 20, 2023
Generative Adversarial Networks and Image SynthesisComputer Science6 citations
TL;DR

This paper proposes a universal fake image detector that generalizes across diverse generative models by leveraging a fixed, pretrained vision-language feature space (e.g., CLIP-ViT) instead of training a classifier end-to-end. Using simple nearest neighbor or linear probing on these features, the method achieves state-of-the-art generalization, improving mAP by +15.05 and accuracy by +25.90% on unseen diffusion and autoregressive models compared to prior work.

ABSTRACT

With generative models proliferating at a rapid rate, there is a growing need for general purpose fake image detectors. In this work, we first show that the existing paradigm, which consists of training a deep network for real-vs-fake classification, fails to detect fake images from newer breeds of generative models when trained to detect GAN fake images. Upon analysis, we find that the resulting classifier is asymmetrically tuned to detect patterns that make an image fake. The real class becomes a sink class holding anything that is not fake, including generated images from models not accessible during training. Building upon this discovery, we propose to perform real-vs-fake classification without learning; i.e., using a feature space not explicitly trained to distinguish real from fake images. We use nearest neighbor and linear probing as instantiations of this idea. When given access to the feature space of a large pretrained vision-language model, the very simple baseline of nearest neighbor classification has surprisingly good generalization ability in detecting fake images from a wide variety of generative models; e.g., it improves upon the SoTA by +15.07 mAP and +25.90% acc when tested on unseen diffusion and autoregressive models.

Motivation & Objective

  • To address the lack of generalization in existing fake image detectors trained on one generative model (e.g., GANs) when detecting fakes from unseen models (e.g., diffusion, autoregressive).
  • To investigate why current deep learning-based detectors fail to generalize across different generative model families.
  • To develop a simple, robust baseline for universal fake detection that does not require retraining for each new generative model.
  • To identify the key properties of a feature space that enable effective zero-shot detection of diverse fake image types.

Proposed method

  • Use a large-scale, pretrained vision-language model (CLIP-ViT) to extract fixed features from images, avoiding end-to-end training for real-vs-fake classification.
  • Perform real-vs-fake classification via nearest neighbor search in the CLIP feature space, using a precomputed feature bank of real and fake images from a single generative model (e.g., ProGAN).
  • As an alternative, apply linear probing on the CLIP features using a single linear layer trained on the same real/fake feature bank.
  • Train the linear probe with data augmentation (Gaussian blur, JPEG compression) to improve robustness to common post-processing attacks.
  • Evaluate generalization performance on unseen generative models, including diffusion (LDM, Glide) and autoregressive (DALL-E) models.
  • Analyze the impact of dataset size, feature space quality, and data distribution on detection performance.

Experimental results

Research questions

  • RQ1Why do existing fake image detectors fail to generalize across different generative model families, such as GANs to diffusion models?
  • RQ2Can a fixed, pretrained feature space enable zero-shot detection of fake images from unseen generative models without fine-tuning?
  • RQ3What properties of a feature space make it effective for universal fake image detection?
  • RQ4How does the performance of simple baselines like nearest neighbor or linear probing compare to end-to-end trained models in cross-model generalization?
  • RQ5To what extent does data augmentation during linear probing improve robustness to common image manipulations like blur and JPEG compression?

Key findings

  • Nearest neighbor classification in CLIP-ViT’s feature space achieves +15.05 mAP and +25.90% accuracy improvement over the SoTA on unseen diffusion and autoregressive model fakes.
  • Linear probing on CLIP features improves mAP by +19.49 and accuracy by +23.39% on the same unseen models, demonstrating strong generalization.
  • The real class in traditional classifiers becomes a 'sink' class, misclassifying non-GAN fake images as real, due to asymmetric learning on low-level artifacts.
  • The method generalizes effectively across generative model types: GAN data can be used to detect diffusion and autoregressive model fakes, and vice versa.
  • Image encoders pre-trained on internet-scale data (e.g., CLIP) are essential; models like ImageNet-only encoders fail to generalize.
  • The method remains robust to common post-processing operations like Gaussian blur and JPEG compression, even when the backbone was not explicitly trained for such robustness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.