Abstract
The rapid advancement of Denoising Diffusion Probabilistic Models (DDPMs) has enabled the creation of hyper-realistic synthetic imagery, posing new challenges for digital forensics. Existing detectors, primarily designed for Generative Adversarial Networks (GANs), often fail to identify diffusion-generated images due to the absence of traditional architectural artifacts. We introduce DIffusion Reconstruction Error (DIRE), a method that identifies synthetic images by measuring how accurately a pre-trained diffusion model can reconstruct them. Our approach leverages the observation that generated images are "closer" to the model's learned distribution than real-world images. Evaluated on the comprehensive DiffusionForensics benchmark, DIRE achieves state-of-the-art performance, maintaining near-perfect accuracy across various unseen diffusion models and demonstrating remarkable robustness to common image perturbations.
Introduction
The rise of diffusion models like Stable Diffusion and ADM has revolutionized image synthesis, but it has also lowered the barrier for creating convincing misinformation. Traditional "deepfake" detectors often rely on specific architectural "fingerprints"—such as checkerboard artifacts from upsampling layers—that are prevalent in GANs. However, diffusion models utilize an iterative, noise-based refinement process that does not leave these same traces. Consequently, simple binary classifiers trained on specific datasets often fail to generalize to new, unseen diffusion architectures.
To address this, we propose a "universal" detector that focuses on the underlying generative logic of diffusion itself rather than superficial pixel artifacts. By assessing the "reconstructibility" of an image through a diffusion model, we can effectively distinguish between "model-native" synthetic images and the complex, high-entropy distribution of the real world.
Methodology: The DIRE Framework
The core of our approach is the DIffusion Reconstruction Error (DIRE) representation. Instead of classifying raw pixels, we transform the input image into an error map that highlights its deviation from a diffusion model's learned manifold.
The process consists of three primary stages:
- Inversion: An input image ($x_0$) is mapped to a latent noise vector ($x_T$) using the deterministic Denoising Diffusion Implicit Models (DDIM) inversion process.
- Reconstruction: A pre-trained diffusion model (e.g., ADM trained on LSUN-Bedroom) takes the noise vector $x_T$ and attempts to reconstruct the original image, producing $\hat{x}_0$.
- Error Calculation: The DIRE map is computed as the pixel-wise absolute difference between the original and the reconstruction: $|x_0 - \hat{x}_0|$.
A standard ResNet-50 classifier is then trained on these DIRE error maps to perform the final binary classification (real vs. generated).
Visualizing Reconstruction Error
The effectiveness of DIRE stems from the "Manifold Advantage." Images generated by a diffusion process naturally reside on the mathematical manifold ($p_g(x)$) that the model is designed to navigate. Consequently, the model can "re-find" these images during reconstruction with high fidelity. In contrast, real images ($p_r(x)$) contain complex natural textures and noise patterns that the model cannot perfectly capture, leading to significantly higher and more structured reconstruction errors.
As shown in the comparison above, the DIRE maps for real images are noticeably "messier" than those for images generated by models like DDPM or ADM. This distinct visual signal allows the classifier to generalize across different generative architectures.
Experimental Results and Robustness
To evaluate DIRE, we introduced DiffusionForensics, a benchmark featuring real images from LSUN-Bedroom and ImageNet, alongside synthetic images from eight state-of-the-art models, including Stable Diffusion (v1/v2) and VQ-Diffusion.
Performance and Generalization
DIRE achieved an average of 99.9% Accuracy (ACC) and 100% Average Precision (AP) on the DiffusionForensics benchmark. Crucially, while baseline detectors like CNNDetection saw performance drop to near-random levels (50-60% ACC) when faced with unseen models, DIRE maintained near-perfect scores. Furthermore, a DIRE detector trained solely on indoor scenes (LSUN-Bedroom) achieved over 90% accuracy on diverse ImageNet objects, proving its cross-dataset viability.
Robustness to Perturbations
Attackers often attempt to bypass detectors using post-processing techniques like Gaussian blur or JPEG compression. While these "cleaning" methods often destroy the fine-grained artifacts that GAN detectors rely on, they do not significantly alter the fundamental "reconstructibility" of the image. Our tests show that DIRE remains incredibly resilient to these perturbations, maintaining high detection rates where other methods fail.
Conclusion and Future Work
DIRE represents a significant step toward universal diffusion-generated image detection. By shifting the focus from pixel-level artifacts to the generative process's internal consistency, we provide a highly generalizable and robust forensic tool.
However, challenges remain. The iterative nature of DDIM inversion and reconstruction introduces significant computational overhead, making real-time large-scale deployment difficult. Additionally, as generative models evolve—perhaps by minimizing reconstruction error for real images—the gap exploited by DIRE may narrow. Future research will focus on optimizing the speed of the DIRE computation and exploring its limits against hybrid GAN-diffusion architectures.
Summary updated