STD-FD: Spatio-Temporal Distribution Fitting Deviation for AIGC Forgery Identification

Hengrui Lou, Zunlei Feng, Jinsong Geng, Erteng Liu, Jie Lei, Lechao Cheng, Jie Song, Mingli Song, Yijun Bei

TL;DR

STD-FD moves beyond treating AI image generation as a "black box" by analyzing the specific spatio-temporal patterns of how diffusion models fit noise during reconstruction. By identifying unique "DFactors" (Discriminant Factors) across different semantic regions over time, this method achieves state-of-the-art detection accuracy and superior generalization across unseen generative models.

What Problem Does This Paper Address?

As AI-Generated Content (AIGC)—specifically from diffusion models like Stable Diffusion and Midjourney—becomes indistinguishable from reality, the "Deepfake" arms race has shifted. Traditional forgery detection often relies on spatial artifacts (like weird textures) or frequency domain anomalies. However, modern diffusion models are getting too good at mimicking these.

Recent "reconstruction-based" detectors (like DIRE) try to identify fakes by seeing how well a pre-trained model can reconstruct the image; the idea is that a model will reconstruct an image it "knows" (a fake it could have generated) better than a real one. The gap? These methods treat the reconstruction as a single end-to-end step. They are highly sensitive to the specific data the reconstruction model was trained on. This paper aims to open that black box and look at the process of reconstruction itself.

Methods: Spatio-Temporal Distribution Fitting Deviation (STD-FD)

The authors propose tracking how an image "evolves" during the denoising process across both space and time, rather than just looking at a single final error value.

The STD-FD pipeline illustrating spatial-temporal information capture, pattern extraction, and discrepancy detection.
  1. Spatial Decomposition: The image is partitioned into "semantic units" using the SLIC superpixel algorithm. This ensures that the model analyzes coherent parts of an image (like a face vs. a background) separately, as these regions behave differently during generation.
  2. Temporal Tracking: The researchers track the predicted noise at every timestep of the diffusion process. They calculate the SSIM (Structural Similarity Index) between adjacent timesteps for each superpixel, creating a time-series "signature" of how that specific region fits the noise distribution.
  3. DFactor Extraction: They identify DFactors—critical temporal patterns that statistically distinguish real data from fake data.
  4. Discrepancy Detection: To compare a new image's time-series data against these DFactors, they use Greedy Dynamic Time Warping (GDTW). This allows for non-linear alignment, meaning the detector can find the "fake signature" even if the timing of the generation process varies slightly.
  5. Classification: Finally, these distance and correlation features are fed into a simple classifier (like XGBoost) to make the final "Real vs. Fake" call.

Datasets

The authors evaluated their method on two massive, diverse benchmarks:

  • GenImage: A million-scale dataset featuring images from 8 different generators (including Stable Diffusion v1.4, v1.5, ADM, GLIDE, Wukong, Midjourney, and VQDM).
  • DeepFaceGen: A specialized facial forgery dataset containing 1.3M real images and 1.35M generated images across 12 different prompt-guided methods.

Key Insights and Ideas

  • The "Middle" Matters: One of the most striking findings is that the largest difference between real and fake samples often occurs in the middle timesteps of the reconstruction process, not at the very beginning or end. Standard methods that only look at the final output miss this "smoking gun."
  • Semantic Sensitivity: Different parts of an image have different "noise fitting" budgets. Backgrounds are often simpler and fit noise quickly, while complex features like eyes or hair show distinct deviations in fake images. By using superpixels, STD-FD prevents large, simple background areas from "washing out" the discriminative signals in smaller, complex regions.
  • Breaking the Domain Lock: Because STD-FD looks at the mechanism of how noise is handled rather than just the pixel-level reconstruction error, it is far less sensitive to "domain shift." The underlying distribution fitting deviation remains a reliable signal regardless of the specific training data.

Key Results

  • State-of-the-Art Performance: STD-FD achieved an average accuracy of 92.01% on GenImage, outperforming top-tier competitors like DIRE (71.24%) and DRCT (89.49%).
  • Generalization: In "cross-generator" tests (training on one AI model and testing on another), STD-FD showed remarkable robustness.
Cross-generator evaluation heatmaps showing STD-FD's superior generalization compared to DRCT, Defake, and AIDE.

As seen in the cross-generator heatmaps, when trained on SDv1.4 and tested on Midjourney, STD-FD maintained high accuracy where other models saw catastrophic drops in performance.

  • Robustness: The method proved resilient against common image "attacks," maintaining over 90% AUC even after JPEG compression, resizing, and adversarial perturbations designed to fool AI.
  • Efficiency: Despite the complex analysis, the running time (272ms) is comparable to standard architectures, and it uses significantly less GPU memory (2253MiB) than many SOTA competitors.

Limitations and Future Work

While highly effective, the authors note that performance does dip slightly under heavy adversarial attacks. The current pipeline involves several discrete steps (superpixels -> time-series -> GDTW -> classifier). Future work will focus on developing a more "end-to-end" framework that can uncover even more subtle spatio-temporal patterns automatically.

Summary updated

BibTeX
@inproceedings{lou2025std,
  author = {Hengrui Lou and Zunlei Feng and Jinsong Geng and Erteng Liu and Jie Lei and Lechao Cheng and Jie Song and Mingli Song and Yijun Bei},
  title = {{STD-FD: Spatio-Temporal Distribution Fitting Deviation for AIGC Forgery Identification}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=SGnjO72L95},
}
Figure