Table of Contents
Fetching ...

Manifold Induced Biases for Zero-shot and Few-shot Detection of Generated Images

Jonathan Brokman, Amit Giloni, Omer Hofman, Roman Vainshtein, Hisashi Kojima, Guy Gilboa

TL;DR

The paper tackles the challenge of distinguishing real from AI-generated images in zero-shot and few-shot regimes. It builds a theoretical framework around biases on the learned probability manifold of pre-trained diffusion models, using score-function analysis to define curvature and gradient-based criteria that quantify generation biases. A three-term detector $C(x_0)$ combines curvature, gradient magnitude, and a bias term to enable zero-shot detection, with extensive evaluation across 20 generative models showing state-of-the-art performance and robust generalization. It also demonstrates practical gains in a mixture-of-experts few-shot setting, highlighting the approach's potential for scalable content verification without constant data maintenance.

Abstract

Distinguishing between real and AI-generated images, commonly referred to as 'image detection', presents a timely and significant challenge. Despite extensive research in the (semi-)supervised regime, zero-shot and few-shot solutions have only recently emerged as promising alternatives. Their main advantage is in alleviating the ongoing data maintenance, which quickly becomes outdated due to advances in generative technologies. We identify two main gaps: (1) a lack of theoretical grounding for the methods, and (2) significant room for performance improvements in zero-shot and few-shot regimes. Our approach is founded on understanding and quantifying the biases inherent in generated content, where we use these quantities as criteria for characterizing generated images. Specifically, we explore the biases of the implicit probability manifold, captured by a pre-trained diffusion model. Through score-function analysis, we approximate the curvature, gradient, and bias towards points on the probability manifold, establishing criteria for detection in the zero-shot regime. We further extend our contribution to the few-shot setting by employing a mixture-of-experts methodology. Empirical results across 20 generative models demonstrate that our method outperforms current approaches in both zero-shot and few-shot settings. This work advances the theoretical understanding and practical usage of generated content biases through the lens of manifold analysis.

Manifold Induced Biases for Zero-shot and Few-shot Detection of Generated Images

TL;DR

The paper tackles the challenge of distinguishing real from AI-generated images in zero-shot and few-shot regimes. It builds a theoretical framework around biases on the learned probability manifold of pre-trained diffusion models, using score-function analysis to define curvature and gradient-based criteria that quantify generation biases. A three-term detector combines curvature, gradient magnitude, and a bias term to enable zero-shot detection, with extensive evaluation across 20 generative models showing state-of-the-art performance and robust generalization. It also demonstrates practical gains in a mixture-of-experts few-shot setting, highlighting the approach's potential for scalable content verification without constant data maintenance.

Abstract

Distinguishing between real and AI-generated images, commonly referred to as 'image detection', presents a timely and significant challenge. Despite extensive research in the (semi-)supervised regime, zero-shot and few-shot solutions have only recently emerged as promising alternatives. Their main advantage is in alleviating the ongoing data maintenance, which quickly becomes outdated due to advances in generative technologies. We identify two main gaps: (1) a lack of theoretical grounding for the methods, and (2) significant room for performance improvements in zero-shot and few-shot regimes. Our approach is founded on understanding and quantifying the biases inherent in generated content, where we use these quantities as criteria for characterizing generated images. Specifically, we explore the biases of the implicit probability manifold, captured by a pre-trained diffusion model. Through score-function analysis, we approximate the curvature, gradient, and bias towards points on the probability manifold, establishing criteria for detection in the zero-shot regime. We further extend our contribution to the few-shot setting by employing a mixture-of-experts methodology. Empirical results across 20 generative models demonstrate that our method outperforms current approaches in both zero-shot and few-shot settings. This work advances the theoretical understanding and practical usage of generated content biases through the lens of manifold analysis.

Paper Structure

This paper contains 28 sections, 4 theorems, 46 equations, 13 figures, 3 tables.

Key Result

Corollary 2

In the setting of claim cl:one, we furthermore have the following approximation

Figures (13)

  • Figure 1: The proposed zero-shot detection pipeline, which circumvents the need for generated data. An input image $x_0$ is subjected to a pre-trained diffusion model and spherical perturbations. This sets the stage for our mathematical characterization of $x_0$, resulting in a criterion for the detection task.
  • Figure 2: Toy probability surface. Simulation of toy data probability in a two-dimensional space ($d=2$), structured along a one-dimensional manifold ($\Omega$ is a curve). (a) The log probability surface of perturbed samples, considering a uniform probability on the $\Omega$ curve. (b) A simulation of the hypothesis that generative models learn a bumpy version of the manifold: Bumps are randomly assigned to the manifold and visualized in color on the original surface. (c) The resulting bumpy surface. (d) Gradient magnitude of the bumpy manifold. (e) Total-variation curvature of the bumpy manifold. (f) Demonstrates the differential property derived from our analysis, highlighting locally maximal regions of the bumps which correspond to likely generated data points. We mathematically establish a way to capture this property through a zero-shot analysis of the diffusion model.
  • Figure 3: a) The Local Maxima Region Property. We trained a diffusion model on a 3-modal Gaussian Mixture Model (GMM) (details in Appendix \ref{['sec:stable_toy_gmm']}). The colormap shows the learned PDF, with reverse diffusion trajectories overlaid. Starting points (green circles) converge toward local maxima of the probability, confirming our assumption that the generation process ends near stable local maxima (red stars). For statistics at scale see Fig. \ref{['fig:termination_near_maxima_scale']}b) Expected Behavior of the Curvature Criterion $\kappa$. We compute $\kappa$ on two marked circles centered at local maxima and saddle points of a differentiable analytic function (details in Appendix \ref{['app:kappa_estim']}). As expected, $\kappa$ is higher for the local maxima. c) Error Analysis of $\kappa$ Estimators. We experiment with both $\kappa$ values from b), and approximate them with increasing no. of spherical samples based on (Equation (\ref{['eq:kapp_init']})). We average 100 runs and show std as error bars. Results confirm reliability: 1) The mean remains close to the true value even with few samples (unbiased estimator). 2) Separation between maxima and saddle points is maintained, even with as few as 4 samples. d) Consistency and Convergence of $\kappa$ Estimators. The standard deviation of $\kappa$ estimators is plotted against the number of spherical boundary samples in a log-log plot. Linear regression is applied to quantify the rate of convergence, showing a good fit with negative regression slopes, confirming exponential convergence. Combined with the empirical unbiasedness demonstrated in b), this establishes that the $\kappa$ estimators are empirically consistent.
  • Figure 4: (a) We calibrate a decision threshold based on the mean and standard deviation of 1,000 real image criteria, ensuring it's free from generated data influence. Criteria from another dataset's real and generated images are also displayed. (b) As a result of $\|\epsilon\|\sim\chi\text{-distribution}$, as $d$ increases, $\epsilon$ concentrates around a spherical thin shell, with radii $\sqrt{d}$. This demonstrates interchangeable use of $x_t$ and $\tilde{x}$ in high-dimensional space. (c) 2D Visualization of the Concentration of Measure: For each $d$, the radii and samples' are set as the $d$-dimensional $\mathbb{E} \|\epsilon\|$ and $var(\|\epsilon\|)$ respectively. Correspondingly, the radii increases while the variance converges with $d$, effectively simulating the phenomenon in 2D.
  • Figure 5: Zero-shot comparison. Plots $a.1$-$a.3$ demonstrate the superior AUC performance of our method across the three main generative technique groups. Error bars represent variability in AUC between techniques within each group, with our method showing the least variation. Plot $b$ details AUC per technique, where our method achieves the highest scores in most cases. Although our criterion originates from a zero-shot analysis of an LDM model, it empirically generalizes well to other techniques. Competitors show sensitivity to changes in technique, which hampers their generalization capabilities (clarified by detailed histograms in the Appendix, Fig. \ref{['fig:small_histograms']}).
  • ...and 8 more figures

Theorems & Definitions (9)

  • Claim 1
  • Corollary 2
  • Corollary 3
  • Claim 1
  • proof
  • Corollary 2
  • proof
  • Corollary 3
  • proof