Real-Time Deepfake Detection in the Real World

Bar Cavia, Eliahu Horwitz, Tal Reiss, Yedid HoshenSubmission to ICLR 2025 · Withdrawn

TL;DR

Current deepfake detectors achieve near-perfect scores on standard benchmarks but fail on real-world social media due to hidden compression biases in simulated datasets. To fix this, the authors introduce WildRF, a realistic benchmark sourced from social platforms, alongside LaDeDa and Tiny-LaDeDa—ultra-efficient patch-based detectors focusing on local artifacts rather than global semantics, with the tiny distilled variant running in just 20 milliseconds on edge CPUs.

What Problem Does This Paper Address?

Generative models (such as Midjourney and Stable Diffusion) can produce hyper-realistic fakes, yet most academic detectors claim near-solved performance (~99% mAP). The authors reveal a major flaw in how the community evaluates these systems: standard benchmarks (like ForenSynth) train and test on simulated data where real images are lossy JPEGs from older datasets and synthetic images are lossless PNGs directly exported from generators.

As a result, existing detectors often act as "file-format detectors" rather than identifying generative synthesis artifacts. When tested on real-world deepfakes shared across social platforms like Reddit, X (Twitter), and Facebook, state-of-the-art detectors degrade drastically—frequently dropping to near-random performance.

Methods

The paper proposes a local-first approach to deepfake detection:

  • LaDeDa (Locally Aware Deepfake Detection Algorithm): Based on the observation that generative models leave distinct pixel-level artifacts during upsampling, LaDeDa modifies ResNet50 (similar to BagNet) by swapping most $3 \times 3$ convolutions with $1 \times 1$ convolutions. This restricts the receptive field to tiny $9 \times 9$ patches, forcing the model to ignore global semantics and focus strictly on local textural irregularities. Patch-level scores are aggregated via global average pooling to yield a final image-level prediction.
  • Tiny-LaDeDa (Knowledge Distillation for the Edge): Because generation artifacts manifest at very small scales, the authors hypothesize that deep architectures are overkill. They distill LaDeDa into a student model consisting of only 4 convolutional layers (8 channels each) with a $5 \times 5$ receptive field. Tiny-LaDeDa is trained using an MSE loss against the soft patch-level logit scores output by the teacher.

Datasets

  • Simulated Benchmarks: The standard ForenSynth benchmark (real images from LSUN; fake images from ProGAN) and the Universal Fake Detector (UFD) test suite, spanning 16 generative models including StyleGAN, BigGAN, CycleGAN, GLIDE, and Latent Diffusion Models (LDM).
  • WildRF (New Benchmark): A realistic dataset of approximately 5,000 images curated directly from social media platforms using authentic photography hashtags (e.g., #nofilter, #streetphotography) and AI generation tags (e.g., #midjourney, #stablediffusion). The dataset is partitioned for cross-platform evaluation:
  • Training: Reddit (1,200 real, 1,200 fake)
    • Testing: Unseen images from Reddit (750 real, 750 fake), X/Twitter (340 real, 340 fake), and Facebook (160 real, 160 fake).

Key Insights and Ideas

  • The JPEG Shortcut: Detectors trained without augmentations on standard simulated benchmarks plummet in accuracy as soon as test fake images are compressed (e.g., performance on StyleGAN drops from ~96–100% AP to under 55% AP at JPEG quality 80), confirming they overfit to lossless vs. lossy artifacts.
  • Locality Over Semantics: Global semantic representations are not mandatory for detecting generative fakes. Receptive fields as small as $9 \times 9$ (or even $5 \times 5$) provide sufficient discriminative signal, as generative pipelines struggle to recreate natural sensor noise and instead generate unnaturally smooth high-frequency patches.
  • Soft Patch Labels Beat Hard Labels: Distilling via soft patch-level scores outperforms training student networks directly on hard binary image-level labels (91.6% mAP vs. 84.5% mAP), allowing the model to adaptively weigh ambiguous patches.

Key Results

  • Simulated Benchmarks: LaDeDa achieves state-of-the-art results on ForenSynth and UFD, reaching 98.9% mAP and 92.7% ACC, outperforming PatchFor (94.9% mAP) and CLIP linear probes (96.3% mAP). Tiny-LaDeDa follows closely at 97.5% mAP.
  • Generalization Failure: When trained on ProGAN and evaluated zero-shot on WildRF, all standard models suffer sharp drops; CNNDet drops to 47.8% mAP, while LaDeDa retains 79.9% mAP.
  • In-the-Wild Performance (Social Protocol): Retrained on WildRF’s Reddit split, LaDeDa attains the top score of 93.7% mAP (85.7% accuracy) across unseen platforms, while Tiny-LaDeDa reaches 91.6% mAP (82.5% accuracy).
  • Efficiency: Tiny-LaDeDa uses only 1,290 parameters (~$10,000\times$ fewer than LaDeDa) and 0.0566B FLOPs ($375\times$ fewer), running inference in 0.02 seconds on a modest single CPU core with 4GB RAM.

Limitations and Future Work

  • Dataset Scale: WildRF contains ~5,000 images. Scaling experiments demonstrate that detection accuracy climbs steadily with training set size and has not yet saturated, suggesting larger in-the-wild datasets are needed.
  • Domain Shift Between Synthetic & Social: Models trained exclusively on social media do not transfer seamlessly back to pristine simulated datasets (and vice versa) without joint training on both distributions.
  • The Unsolved Gap: While 93.7% mAP leads existing baselines, the remaining error margin demonstrates that robust, real-world deepfake detection in unconstrained online environments remains an open challenge.

Summary updated

Abstract

Recent improvements in generative AI made synthesizing fake images easy; as they can be used to cause harm, it is crucial to develop accurate techniques to identify them. This paper introduces "Locally Aware Deepfake Detection Algorithm" (LaDeDa), that accepts a single $9 \times 9$ image patch and outputs its deepfake score. The image deepfake score is the pooled score of its patches. With merely patch-level information, LaDeDa significantly improves over the state-of-the-art, achieving around $99\%$ mAP on current benchmarks. Owing to the patch-level structure of LaDeDa, we hypothesize that the generation artifacts can be detected by a simple model. We therefore distill LaDeDa into Tiny-LaDeDa, a highly efficient model consisting of only $4$ convolutional layers. Remarkably, Tiny-LaDeDa has $375 \times$ fewer FLOPs and is $10\text{,}000 \times$ more parameter-efficient than LaDeDa, allowing it to run efficiently on edge devices with a minor decrease in accuracy. These almost-perfect scores raise the question: is the task of deepfake detection close to being solved? Perhaps surprisingly, our investigation reveals that current training protocols prevent methods from generalizing to real-world deepfakes extracted from social media. To address this issue, we introduce WildRF, a new deepfake detection dataset curated from several popular social networks. Our method achieves the top performance of $93.7\%$ mAP on WildRF, however the large gap from perfect accuracy shows that reliable real-world deepfake detection is still unsolved.
BibTeX
@misc{cavia2024real,
  author = {Bar Cavia and Eliahu Horwitz and Tal Reiss and Yedid Hoshen},
  title = {{Real-Time Deepfake Detection in the Real World}},
  year = {2024},
  eprint = {2406.09398},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.09398},
}
Figure