Introduction
As AI image generators (AIGIs) like Stable Diffusion and Midjourney reach new heights of hyper-realism, the boundary between synthetic and authentic imagery is blurring. Existing detection methods often struggle with two primary issues: semantic bias, where models learn to recognize specific objects rather than generative artifacts, and poor generalization, where detectors trained on one architecture (e.g., GANs) fail to identify images from another (e.g., Diffusion models).
To address these challenges, we introduce Multi-granularity Local Entropy Patterns (MLEP). This method shifts the focus from visual content to the underlying technical "glossy and smooth" texture characteristic of AI-generated images, providing a content-agnostic approach to universal detection.
Methodology: The MLEP Pipeline
The MLEP framework is designed to strip away semantic meaning and highlight structural flaws through a three-step process.
- Semantic Suppression (Patch Shuffling): To prevent the model from relying on recognizable objects, the input image is divided into tiny $l \times l$ patches (as small as $2 \times 2$) and randomly shuffled. This "scrambles" the image, forcing the classifier to focus on pixel-level relationships.
- Multi-Scale Resampling: The shuffled image undergoes downsampling and subsequent upsampling back to its original size across various scales. This process amplifies the mathematical "footprints" left by the upsampling operations inherent in most AI generative architectures.
- Local Entropy Patterns (LEP): Shannon entropy is calculated within a $2 \times 2$ sliding window. Due to the small window size, entropy values are restricted to five discrete levels $\{0, 0.8, 1.0, 1.5, 2.0\}$. These maps capture the local "randomness" of pixels, serving as a robust discriminator.
- Classification: The resulting multi-scale entropy maps are processed by a standard CNN (e.g., ResNet-50) for final "Real vs. Fake" determination.
Experimental Setup
The robustness of MLEP was tested using a rigorous cross-dataset evaluation. The model was trained exclusively on four categories (cars, cats, chairs, horses) from the ForenSynths dataset, generated by ProGAN. It was then evaluated against a massive suite of 32 distinct models, including 16 GAN-based models (e.g., StyleGAN, BigGAN) and 16 Diffusion-based models (e.g., Stable Diffusion v1/v2, Midjourney, DALL-E 2).
Results and Analysis
MLEP achieves a remarkable 97.1% mean accuracy across all 32 test sets, outperforming previous state-of-the-art methods. Notably, despite being trained only on GAN images, it achieved 97.8% accuracy on Diffusion-based datasets, demonstrating its ability to learn a universal signature of AI generation.
A key insight from our analysis is the distribution of entropy values. As shown in Figure 1, real photographs consistently exhibit a higher probability of reaching maximum entropy ($2.0$) in local patches compared to AI-generated images. This confirms that AI images are "too smooth" at a mathematical level, a feature that MLEP successfully exploits for detection.
Conclusion
MLEP provides a powerful, source-invariant solution for AI image detection by focusing on local entropy patterns rather than semantic content. By leveraging fine-grained patch shuffling and multi-scale analysis, the method achieves high accuracy and exceptional generalization across diverse generative architectures. Future work will explore the computational efficiency of larger window sizes and the system's robustness against adversarial post-processing like heavy compression or blurring.
Summary updated