Towards Universal Fake Image Detectors that Generalize Across Generative Models

Utkarsh Ojha,Yuheng Li,Yong Jae Lee
2024-04-01
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.
Computer Vision and Pattern Recognition,Machine Learning
What problem does this paper attempt to address?
### Problems the Paper Aims to Solve This paper aims to develop a universal fake image detection method capable of identifying fake images generated by any type of generative model, even when only exposed to data from one generative model during training. Specifically, existing methods, while able to generalize well among different generative models within the same family (e.g., different GAN variants), show significantly reduced performance when faced with generative models from different families (e.g., diffusion models or autoregressive models). The analysis in this paper reveals that existing deep learning-based classifiers tend to rely on low-level features specific to the generative model used during training, making them ineffective at recognizing fake images from other types of generative models. To address this issue, the authors propose a new approach that does not specifically train a feature space to distinguish between real and fake images for classification. In practice, the authors use the feature space of a pre-trained CLIP-ViT model and employ two simple baseline methods: nearest neighbor classification and linear probing. Experimental results show that these two methods exhibit significantly better generalization capabilities in detecting fake images from various generative models compared to existing methods. For example, in detecting fake images from unseen diffusion models and autoregressive models (such as DALL-E), the nearest neighbor classification method improves by 15.05 mAP and 25.90% accuracy over the current best method, while the linear probing method improves by 19.49 mAP and 23.39% accuracy, respectively. Additionally, the study explores the key factors that make the feature space effective for fake image detection and points out that the image encoder used needs to be trained on large-scale internet data.