arXiv:2608.12155cs.CVAug 2026

Manuscript Offprint

arXiv:2608.12155

Understanding Why Foundation Models Work for Diffusion-Generated Image Detection

Davide Cozzolino, Giovanni Poggi, Luisa Verdoliva

Abstract

Vision foundation models have recently emerged as powerful feature extractors for detecting AI-generated images, achieving strong generalization across generators and robustness to common image degradations. However, the reason behind their effectiveness is poorly understood. In this work, we investigate what cues are exploited by foundation-model-based detectors to distinguish real images from diffusion-generated ones. To this end, we design an ad hoc analysis protocol based on DDIM inversion. Given a real image we generate a sequence of synthetic copies by changing the depth of DDIM inversion. Even though most copies are semantically identical to the real reference, the detector score varies significantly across them due to subtle traces introduced by the diffusion synthesis, showing that its decision is not primarily driven by semantic failures. Through a frequency-swapping analysis, we further reveal that the discriminative cues exploited by the detectors are mainly localized in the low-to-mid frequency range, rather than only in the high-frequency range, as is the case for artifacts commonly associated with generative models. Finally, a latent-space analysis shows that regenerated images exhibit reduced variance and effective dimensionality, indicating that diffusion models do not fully reproduce the variability of real data. Overall, our results suggest that foundation-model-based detectors succeed by capturing non-semantic low-to-mid frequency distributional discrepancies between real and diffusion-generated images. These findings provide new insight into the robustness and generalization of such detectors and suggest directions for more interpretable forensic methods.

1 Introduction

Detecting whether an image is real or synthetically generated has become increasingly important, as modern generative models can produce highly realistic visual content that may be misused for disinformation [4, 5]. Accordingly, a large body of work has focused on designing detectors capable of distinguishing real from generated images [33, 2]. Beyond obvious visual failures, such as clear asymmetries, inconsistent perspective or implausible object geometry, that can be analyzed by vision-language models [49, 48], synthetic images often contain subtle statistical traces. As generative models produce increasingly realistic images, such hidden artifacts become more relevant to design effective detectors.

Figure

Figure 1: Visualization of diffusion-induced traces across regeneration timesteps. The first row shows the original real image, its VAE-laundered version, and DDIM-regenerated images obtained from increasing inversion timesteps kk, together with the corresponding detector scores. The second row reports the pixel-wise difference with respect to the previous image, while the third row shows the corresponding power spectra. As kk increases, the detector score progressively shifts toward the fake class, and the difference maps reveal increasingly structured artifacts. Notably, these traces are visible not only at high frequencies but especially in the low-frequency region of the spectrum.

Early works have shown that synthetic images exhibit telltale artifacts in the Fourier domain [62] such as pronounced peaks at harmonic frequencies and anomalous shapes of the power spectrum. These artifacts are typically referred to as low-level traces, since they are not related to the semantic content of the image but arise from the image generative process itself. For example, in generative adversarial networks, spectral peaks are due to common architectural components that perform the necessary upsampling operations [19, 17]. Likewise, similar artifacts appear in images generated by diffusion models (DM), introduced in the final decoding process from the latent space. In addition, power spectrum anomalies have been also observed at the medium and high frequencies, especially along diagonal directions [10]. These are precious cues for discrimination, largely exploited, either explicitly or implicitly, by a plethora of dedicated models proposed in recent years for AI-generated content detection [32, 28, 11, 31, 21]. However, relying on high-frequency artifacts is a double-edged sword: it yields strong performance under ideal conditions but leads to a drastic drop in performance when these traces are attenuated by low-pass filtering. This often occurs in real-world settings, where images shared on social networks are resized and compressed, removing many low-level cues. As a result, detectors suffer from poor robustness and limited generalization, making them unreliable in the wild [50].

In this challenging scenario, detectors based on foundation models stand out as a notable exception. Recent studies have shown that frozen pre-trained large Vision Foundation Models (VFMs) provide remarkably effective and robust representations for detecting AI-generated images. A simple linear classifier working on features extracted from foundation models provides excellent results and strong generalization across different generative models, often outperforming detectors specifically trained for the real-versus-fake task [37]. Furthermore, this simple detector proves robust to common low-level perturbations and even laundering attacks, suggesting that it does not rely primarily on spectral peaks or high-frequency artifacts, but that alternative discriminating features come into play. This was explicitly shown in [13], where CLIP features were found to be largely independent of, and complementary to, low-level forensic traces. Further evidence comes from experiments on more recent models, such as MetaCLIP 2 and DINOv3, which show better performance and greater robustness than previous models, even on more challenging in-the-wild datasets [64, 26]. Nevertheless, the reasons underlying this success are not yet fully understood. Shedding light on this mechanism is the primary goal of this paper.

We will show that diffusion models introduce artifacts at the medium and low frequencies of the spectrum, besides those already well-known at the high frequencies. Furthermore, we show that foundation model-based detectors rely on these artifacts to make their decision. To support this conclusion, we design a testing strategy based on DDIM inversion. Given a real image, we apply DDIM inversion [46] to derive a noise-like seed that once fed to the DDIM generation process, allows us to re-generate an image very similar to the original image. In this way, we obtain two images, one real and one generated by a diffusion model, which are semantically identical, but whose different origins are not lost to the detector. Continuing along this path, we run the DDIM generation multiple times, starting form different timesteps, thus generating a sequence of semantically coherent images that change very gradually along the process, which allows us to study in detail when and where artifacts appear and how they impact on the detector decision. Fig. 1 shows an example subsequence. The rightmost image is generated with full DDIM inversion (1.00TT) and is the only one that, due to process imperfections, differs semantically from the real image (the leftmost one). With partial inversion (≤\leq0.60TT) semantic consistency is always ensured, yet the detector provides high (fake) scores down to values close to 0 (≤\leq0.04TT). The difference images show that artifacts appear throughout the entire process, not just at the end, and the corresponding spectra prove that they are mainly localized at low frequencies.

Overall, this work provides new insights into the behavior of foundation-model-based detectors and makes the following contributions:

  • We design a testing strategy based on DDIM inversion to expose the non-semantic artifacts introduced by diffusion models and arguably exploited by foundation models to detect synthetic images;
  • We reveal a clear distributional gap between real and DM-generated images, with the most relevant differences emerging at mid and low spectral frequencies;
  • We introduce several latent-space measures to quantify experimentally the inconsistencies observed in diffusion-based generative models.

References (39)