Abstract
With the rapid advancement of generative AI, it is now possible to synthesize high-quality images in a few seconds. Despite the power of these technologies, they raise significant concerns regarding misuse. Current efforts to distinguish between real and AI-generated images may lack generalization, being effective for only certain types of generative models and susceptible to post-processing techniques like JPEG compression. To overcome these limitations, we propose a novel framework, CO-SPY, that first enhances existing semantic features (e.g., the number of fingers in a hand) and artifact features (e.g., pixel value differences), and then adaptively integrates them to achieve more general and robust synthetic image detection. Additionally, we create CO-SPYBench, a comprehensive dataset comprising 5 real image datasets and 22 state-of-the-art generative models, including the latest models like FLUX. We also collect 50k synthetic images in the wild from the Internet to enable evaluation in a more practical setting. Our extensive evaluations demonstrate that our detector outperforms existing methods under identical training conditions, achieving an average accuracy improvement of approximately 11% to 34%.
Introduction
The proliferation of sophisticated generative AI models—such as Midjourney, DALL-E 3, and the recent FLUX—has made the creation of hyper-realistic synthetic imagery accessible to everyone. While these tools foster creativity, they also pose substantial risks regarding misinformation and digital forgery. Existing detection methods generally struggle with a "generalization gap." Semantic-based detectors, which look for logical inconsistencies, often fail when encountering novel objects or models. Conversely, artifact-based detectors, which identify microscopic "fingerprints" of the generation process, are highly sensitive to common post-processing like JPEG compression or blurring.
Methodology: The CO-SPY Framework
To address these challenges, we introduce CO-SPY (COmbining Semantic and Pixel features). This framework enhances both semantic and artifact extraction and employs an adaptive fusion mechanism to leverage their complementary strengths.
Enhanced Semantic and Artifact Extraction
CO-SPY improves upon traditional detection by refining the feature extraction process:
- Semantic Enhancement: We utilize a massive, pre-trained CLIP (ViT-SO400M) backbone. To ensure the model learns generalizable concepts rather than specific training samples, we implement "feature interpolation," creating mathematical blends of real and fake features during training.
- Artifact Enhancement: Instead of analyzing raw pixel grids, we utilize the reconstruction error from a Variational Autoencoder (VAE). Most modern Latent Diffusion Models (LDMs) use a VAE-based decoder to transform latent representations into pixels. By using a similar VAE to "reverse engineer" the image, we can isolate decoding artifacts that are significantly more robust to compression than traditional pixel-level clues.
Adaptive Fusion
The core of CO-SPY is its Regulator module. Rather than a simple summation of scores, this module dynamically weights the semantic and artifact features based on the characteristics of the input image, allowing the system to adapt to various levels of image quality and content diversity.
Experimental Setup: CO-SPYBench
We evaluate our framework using CO-SPYBench, a new, large-scale benchmark containing over 1 million images. This dataset includes outputs from 22 state-of-the-art generative models, including the latest FLUX model. Crucially, we also include an "in-the-wild" dataset of 50,000 synthetic images collected from internet platforms like Lexica and Midjourney to simulate real-world deployment conditions.
Results and Discussion
Our extensive evaluations reveal that CO-SPY significantly outperforms current state-of-the-art baselines:
- Accuracy Gains: CO-SPY achieved an average accuracy improvement of 11% to 34% and a 7% increase in Average Precision (AP).
- Zero-Shot Generalization: On unseen models like FLUX, CO-SPY outperformed previous methods by over 30%.
- Real-World Robustness: The system maintained over 75% accuracy under extreme blurring and noise. In "in-the-wild" testing, it surpassed the next best detector by 14%.
Conclusion
CO-SPY provides a robust solution to the synthetic image detection problem by synergistically combining enhanced semantic and pixel-level features. By addressing the generalization gap and robustness issues of previous methods, CO-SPY offers a more reliable tool for identifying AI-generated content in practical, real-world scenarios. Future work will explore the detection of localized image manipulations and inpainting.
Summary updated