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

Abstract

As generative AI models achieve unprecedented levels of photorealism, the need for robust detection methods becomes paramount. Traditional supervised classifiers often fail to generalize to unseen architectures, leading to a persistent "cat-and-mouse" game between creators and detectors. This paper introduces a novel, mathematically grounded zero-shot method that identifies AI-generated images by analyzing the "implicit probability manifold" of pre-trained diffusion models. We hypothesize that generative models learn "bumpy" manifolds where synthetic images tend to cluster at stable local maxima (peaks). By measuring local curvature and gradients via spherical perturbations, our method effectively distinguishes these synthetic peaks from real data. Our approach achieves an average AUC of 0.835 across 20 diverse generative models, significantly outperforming existing zero-shot benchmarks and demonstrating remarkable cross-model generalization.

Introduction

The rapid advancement of AI image generators poses significant challenges for digital security and the fight against misinformation. While supervised learning remains the standard for detection, its reliance on specific training datasets makes it fragile when faced with new generative techniques. To address this, researchers have turned toward zero-shot and few-shot detection methods that aim to identify universal "fingerprints" or biases inherent in the generative process.

However, many existing zero-shot methods lack a rigorous theoretical foundation and struggle with consistency across different model families (e.g., GANs vs. Diffusion models). This work bridges that gap by proposing a geometric criterion based on the manifold hypothesis, repurposing pre-trained diffusion models as mathematical probes to detect the structural biases of synthetic content.

Methodology

The "Bumpy" Manifold Hypothesis

The core of our detection strategy lies in the observation that generative models do not learn perfectly smooth data distributions. Instead, they produce an "implicit bumpy manifold" where generated images are likely to land near stable local maxima—essentially the "peaks" of the learned probability distribution. Real images, by contrast, do not typically exhibit these specific geometric signatures within the model's learned space.

Figure 2: Visualization of the "bumpy" manifold hypothesis. Synthetic images (Gen) tend to reside at local maxima (peaks) of the probability surface, while real images do not.

Detection Pipeline

To evaluate whether an image sits on one of these peaks, we utilize a pre-trained diffusion model (e.g., Stable Diffusion 1.4) as a score-function estimator. The process involves three primary steps:

  1. Spherical Perturbations: We introduce multiple instances of low-magnitude spherical noise to the input image $X_0$.
  2. Score-Function Analysis: These perturbed samples are fed into the diffusion model. The model’s denoising predictions (the score function) effectively point toward the highest probability regions of the manifold.
  3. Geometric Criterion: By analyzing the variance and direction of these denoising vectors, we approximate the local curvature and gradient. An image characterized by high local curvature and a low gradient is flagged as a local maximum, indicating it is likely AI-generated.
Figure 1: Overview of our zero-shot detection method. Input samples undergo spherical perturbation and are analyzed via a diffusion model to extract manifold differentials for criterion analysis.

For few-shot scenarios, we extend this geometric score by integrating it into a Mixture-of-Experts (MoE) framework alongside existing feature extractors like CLIP, allowing for even higher precision with minimal additional training data.

Experimental Setup

We evaluated our method on a comprehensive aggregated dataset of approximately 200,000 images, drawing from benchmarks including CNNSpot, Universal Fake Detect, and GenImage. This dataset encompasses real images from sources like ImageNet and LAION, paired with synthetic images from 20 different generative techniques. These include GANs (ProGAN, StyleGAN), Diffusion models (Stable Diffusion, Glide), and commercial platforms (Midjourney, DALL-E).

Key Results and Discussion

Zero-Shot Performance

Our manifold-based method achieved an average Area Under the Curve (AUC) of 0.835 across the 20 tested generators. This represents a massive improvement over previous state-of-the-art zero-shot methods such as RIGID (0.439 AUC) and AEROBLADE (0.444 AUC). Unlike these competitors, which often performed well on specific models but failed on others, our geometric criterion remained highly stable across diverse architectures.

Cross-Model Generalization

A significant finding is the method's ability to generalize. Probing the manifold of a single model (Stable Diffusion v1.4) successfully identified images from entirely different architectures, including GANs. This suggests that different models trained on similar large-scale datasets (like LAION) develop convergent geometric biases in their learned manifolds.

Efficiency

Despite the use of multiple perturbations, the method is computationally efficient. It processes a sample in approximately 2.1 seconds on a single A100 GPU, making it more than twice as fast as some competing zero-shot approaches.

Conclusion and Future Work

This work demonstrates that the geometric properties of learned data manifolds provide a powerful and stable signal for detecting AI-generated images. By identifying the "peaks" where synthetic data resides, we can achieve high-accuracy detection without the need for extensive retraining. While the empirical results for cross-model generalization are strong, future research is needed to mathematically formalize why different generative architectures converge on similar manifold biases. Proving this phenomenon will be essential for developing the next generation of universal fake detectors.

Summary updated

BibTeX
@inproceedings{brokman2025manifold,
  author = {Jonathan Brokman and Amit Giloni and Omer Hofman and Roman Vainshtein and Hisashi Kojima and Guy Gilboa},
  title = {{Manifold Induced Biases for Zero-shot and Few-shot Detection of Generated Images}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=7gGl6HB5Zd},
}
Figure