NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Deepfake Detection without Deepfakes: Generalization via Synthetic Frequency Patterns Injection

Davide Alessandro Coccomini, Roberto Caldelli, Claudio Gennaro, Giuseppe Fiameni, Giuseppe Amato, Fabrizio FalchiarXiv 2024

TL;DR

Researchers have developed a way to train deepfake detectors without using a single actual deepfake. By injecting randomized, synthetic frequency patterns into pristine images, they created models that generalize far better to new, unseen generation techniques than traditional detectors trained on specific deepfake datasets.

What Problem Does This Paper Address?

The core challenge in deepfake detection is the generalization gap. Most current detectors are trained on specific datasets (e.g., images from a particular GAN or Diffusion Model). While they become experts at spotting fakes from those specific sources, they often fail miserably when faced with a new generation method.

This happens because detectors tend to memorize the specific "fingerprints"—subtle artifacts left by the generator's architecture—rather than learning the general concept of what makes an image "synthetic." As new generative models are released almost daily, detectors that require constant re-training on new data are fundamentally unsustainable.

Methods

The authors propose a paradigm shift: Deepfake Detection without Deepfakes. Instead of collecting fakes, they use only pristine images and "infect" them with synthetic artifacts in the frequency domain.

1. Fingerprint Extraction

First, they analyzed how various generators (like StyleGAN or Stable Diffusion) leave traces. By averaging the power spectrum of many images from a single generator, a distinct, structured pattern emerges in the frequency domain.

Fig. 1: The fingerprints extraction process presented in [16] is shown in the figure. Considering a set of images obtained from the same generator, they undergo a denoising process and then are transformed to the frequency domain by Fourier Transform. The square of the Fourier Transform is averaged to obtain a unique generator’s fingerprint.

2. Synthetic Pattern Generation

Inspired by these findings, the team designed a pattern generator that creates three categories of randomized, structured artifacts:

  • Geometric: Grids, checkerboards, and stripes.
  • Auras: Rings, dots, and diffused peaks.
  • Frequency Spikes: Symmetrical intensity spikes scattered throughout the frequency domain.
Fig. 2: Overview of synthetically generated patterns. For each category of pattern, the first row indicates the pattern generated in the spatial domain, the second is the magnitude of its Fourier Transform, the third row shows the pristine image on which the pattern has been applied, and the last row shows its Fourier Transform.

3. Pattern Injection

To create a "fake" training sample, they transform a pristine image into the frequency domain using a Fourier Transform. They then add the magnitude of a synthetic pattern to the magnitude of the image, while keeping the original image's phase information (to preserve the basic visual structure). Finally, an inverse Fourier Transform brings the image back to the spatial domain.

Fig. 3: The process of applying a pattern to an image is shown in the figure. The Fourier Transforms of both are first calculated. From them, we derive the magnitude and phase of the image and pattern. The pattern’s magnitude is added to the magnitude of each image channel. Combining these components, we obtain the image with the pattern applied.

4. Training Procedure

During training, the model sees a batch of pristine images. With a 50% probability, an image undergoes pattern injection and is labeled "fake." The model is thus forced to look for structured frequency anomalies rather than specific model-dependent fingerprints.

Fig. 4: The proposed training procedure is shown in the figure. During the training data loading phase, each image in the considered batch randomly undergoes pattern injection. If this occurs, the image is considered fake, otherwise it remains pristine.

Datasets

  • Training: Approximately 118,000 pristine images from the MSCOCO training set. No actual deepfakes were used during training.
  • Evaluation: A massive cross-model test set featuring images from 25 different generation methods, including various GANs (ProGAN, StyleGAN2, BigGAN, etc.) and Diffusion Models (ADM, GLIDE, LDM, Stable Diffusion, and Stable Diffusion XL).

Key Insights and Ideas

  • Generic vs. Specific: By training on randomized synthetic patterns that aren't tied to any specific generator, the model learns to identify the presence of structured artifacts in general. This acts like a broad-spectrum vaccine for synthetic imagery.
  • The "One-Epoch" Rule: The authors discovered that models perform best after just one epoch of training. Further training causes the model to "specialize" in the specific synthetic patterns used, which actually hurts its ability to generalize to real-world deepfakes.
  • Magnitude Matters: The method focuses on perturbing the magnitude component of the signal, as this is where generative fingerprints are most consistently found.

Key Results

The approach demonstrated remarkable generalization across both GAN-based and Diffusion-based fakes:

  • Swin-Base Performance: The Swin-Base architecture trained with this method achieved a mean accuracy of 83.6% across all 25 test sets.
  • Superior Generalization: Compared to state-of-the-art detectors trained on specific models (like StyleGAN2 or LDM), the proposed method was significantly more robust. For example, a ResNet50 trained on StyleGAN2 might get ~100% on StyleGAN2 but drop to <1% on newer Diffusion Models; the proposed method maintained high performance across both.
  • High Specificity: The models maintained a specificity of 95.3% to 97.4% on pristine images, meaning they rarely flag real photos as fakes.

Limitations and Future Work

  • Specialization Risk: The model's tendency to specialize in the training task after one epoch suggests that the synthetic patterns, while diverse, could still be refined to be even more representative of real-world artifacts.
  • Color Spaces and Phase: The current work focuses on the magnitude of the Fourier Transform in the RGB space. The authors suggest that exploring other color spaces or injecting patterns into the phase component could further improve detection.
  • Fine-tuning: Future research could explore using these synthetic patterns to fine-tune existing detectors to improve their robustness against "zero-day" generative models.

Summary updated

BibTeX
@misc{coccomini2024deepfake,
  author = {Davide Alessandro Coccomini and Roberto Caldelli and Claudio Gennaro and Giuseppe Fiameni and Giuseppe Amato and Fabrizio Falchi},
  title = {{Deepfake Detection without Deepfakes: Generalization via Synthetic Frequency Patterns Injection}},
  year = {2024},
  eprint = {2403.13479},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.13479},
}
Figure