When Synthetic Traces Hide Real Content: Analysis of Stable Diffusion Image Laundering

Sara Mandelli, Paolo Bestagini, Stefano TubaroarXiv 2024 · arXiv

TL;DR

This paper introduces and analyzes "image laundering," a process where real images are passed through Stable Diffusion (SD) autoencoders to strip away their original digital traces while maintaining visual fidelity. The authors demonstrate that this process fools standard forensic detectors into misclassifying real content as AI-generated and propose a robust two-stage detection pipeline to distinguish between pristine, laundered, and fully synthetic images.

What Problem Does This Paper Address?

As generative AI becomes ubiquitous, forensic tools have evolved to distinguish "real" photographs from "synthetic" AI-generated images. However, the authors identify a critical vulnerability: Stable Diffusion image laundering.

By using SD's image-to-image pipeline with a "strength" parameter of zero ($s=0$), a user can pass a real photograph through the model's encoder and decoder. The resulting image is visually identical to the original (see Figure 1) but its low-level digital fingerprints—like camera sensor noise and compression artifacts—are replaced by the artifacts of the SD autoencoder.

Visual comparison showing that laundered images are indistinguishable from pristine ones to the human eye.

This creates a dangerous loophole. Malicious actors could "launder" harmful real-world content (such as CSAM or sensitive private imagery) to make it appear AI-generated. If forensic tools or content moderators classify this material as "synthetic," they might lower their guard, allowing harmful real content to proliferate under the guise of being "just AI."

Methods

The authors propose a two-stage detection pipeline to solve this three-way classification problem (Real vs. Laundered vs. Fully Synthetic).

  1. Stage 1: Synthetic Image Detection. A binary classifier (based on EfficientNet-B4) determines if an image is "Pristine" (Real) or "Synthetic" (which includes both laundered and fully synthetic images).
  2. Stage 2: Laundered vs. Fully Synthetic. If the first stage flags an image as synthetic, it passes to a second detector trained specifically to tell laundered images apart from those generated entirely from text prompts.
Fig. 5: Sketch of our proposed two-stage methodology to classify an analyzed image as real, fully synthetic or laundered. At step 1, we tell real images apart from synthetic ones; step 2 further discriminates between fully synthetic and laundered samples.

Technical Highlights: * Patch-based Analysis: Instead of looking at the whole image, the detectors analyze 800 random $96 \times 96$ patches. This makes the system robust to resizing and less dependent on the image's semantic content. * Frequency Analysis: The authors used Fourier transform analysis on noise residuals to find the "smoking gun." They discovered that while both laundered and fully synthetic images have artifacts, laundered images retain a frequency spectrum much closer to real images (focused on low frequencies) compared to the broader, noisier spectrum of fully synthetic images.

Fig. 4: Fourier transform analysis of real, laundered and fully synthetic images. All spectra are centered in the spatial frequencies (0, 0).

Datasets

The study utilized a massive collection of over 200,000 images for training and evaluation:

  • Real Images: Faces from FFHQ, CelebA-HQ, and the Vision dataset (for camera identification).
  • Synthetic/Laundered Images: Generated using multiple versions of Stable Diffusion (1.5, 2.1, XL, XL-turbo), GANs (StyleGAN2/3), and other models like DALL-E 3 and Adobe Firefly.
  • Uncontrolled Data: 3,000 images from DiffusionDB to test generalization on real-world, user-generated AI content.

Key Insights and Ideas

  • Laundering as a Counter-Forensic Attack: Standard "real vs. fake" detectors are highly susceptible to laundering. Figure 3 shows how laundered images (which are semantically real) are pushed into the "synthetic" score distribution by a standard detector.
  • Anonymization of Origin: Laundering effectively "washes out" the unique footprints left by specific camera models. This makes it nearly impossible for traditional forensic tools to trace a laundered image back to its source device.
  • Spectral Signatures Persist: Even though laundering hides camera traces, it leaves behind its own unique spectral signature in the high-frequency domain that differs from "pure" AI generation. This is the key insight that allows the two-stage detector to work.
Fig. 3: Distributions of the detection scores of real and laundered images; the detector is a synthetic versus real detector not trained over laundered images.

Key Results

  • High Accuracy: The two-stage pipeline achieved an AUC > 0.99 and a Balanced Accuracy of 96.1% in distinguishing laundered from fully synthetic images.
  • Robustness: The system remained effective against common post-processing like JPEG compression and upscaling.
  • Camera ID Failure: Laundering reduced camera model identification accuracy from 96.15% to near-random levels (as low as 39% for SD-1.5), highlighting the severity of the anonymization effect.
  • Generalization: The detector performed exceptionally well on the uncontrolled DiffusionDB dataset, achieving 99.67% accuracy in flagging synthetic content.

Limitations and Future Work

  • Intermediate Strength ($s > 0$): This study focused on the extreme case of $s=0$ (pure laundering). The authors acknowledge that intermediate values, where the model introduces slight semantic changes, need further investigation.
  • Downscaling Sensitivity: Performance dropped when images were significantly downsampled (e.g., $0.5\times$ resizing), as this destroys the low-level artifacts the detector relies on.
  • Calibration: Future work will focus on better "calibration" techniques, such as using upscaling to counteract the effects of downscaling, to improve robustness in real-world scenarios where images are often resized for social media.

Summary updated

Abstract

In recent years, methods for producing highly realistic synthetic images have significantly advanced, allowing the creation of high-quality images from text prompts that describe the desired content. Even more impressively, Stable Diffusion (SD) models now provide users with the option of creating synthetic images in an image-to-image translation fashion, modifying images in the latent space of advanced autoencoders. This striking evolution, however, brings an alarming consequence: it is possible to pass an image through SD autoencoders to reproduce a synthetic copy of the image with high realism and almost no visual artifacts. This process, known as SD image laundering, can transform real images into lookalike synthetic ones and risks complicating forensic analysis for content authenticity verification. Our paper investigates the forensic implications of image laundering, revealing a serious potential to obscure traces of real content, including sensitive and harmful materials that could be mistakenly classified as synthetic, thereby undermining the protection of individuals depicted. To address this issue, we propose a two-stage detection pipeline that effectively differentiates between pristine, laundered, and fully synthetic images (those generated from text prompts), showing robustness across various conditions. Finally, we highlight another alarming property of image laundering, which appears to mask the unique artifacts exploited by forensic detectors to solve the camera model identification task, strongly undermining their performance. Our experimental code is available at https://github.com/polimi-ispl/synthetic-image-detection.
BibTeX
@misc{mandelli2024when,
  author = {Sara Mandelli and Paolo Bestagini and Stefano Tubaro},
  title = {{When Synthetic Traces Hide Real Content: Analysis of Stable Diffusion Image Laundering}},
  year = {2024},
  eprint = {2407.10736},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.10736},
}
Figure