DE-FAKE: Detection and Attribution of Fake Images Generated by Text-to-Image Diffusion Models

Zeyang Sha, Zheng Li, Ning Yu, Yang Zhang

Introduction

The recent emergence of text-to-image (T2I) generation models, such as Stable Diffusion, DALL·E 2, and GLIDE, has revolutionized digital content creation. By leveraging diffusion processes, these models can generate high-fidelity, photorealistic images from simple natural language descriptions. However, this technological leap brings significant societal risks, including the potential for large-scale misinformation, the creation of non-consensual imagery, and copyright infringement.

While the research community has developed robust tools for detecting images generated by Generative Adversarial Networks (GANs), these tools often fail when applied to diffusion-based models. Diffusion models operate on fundamentally different mathematical principles, necessitating a new approach to digital forensics. This paper introduces DE-FAKE, the first systematic study focused on the detection and attribution of fake images generated by modern T2I diffusion models.

The DE-FAKE Framework

The DE-FAKE framework is designed to address three primary research questions: detection (is the image real or fake?), attribution (which model created it?), and prompt analysis (how does the input text influence detectability?).

1. Detection (RQ1)

To distinguish real images from those generated by T2I models, the researchers developed two distinct classification strategies:

  • Image-Only Detection: A standard ResNet-18 classifier that analyzes pixel-level data to identify artifacts.
  • Hybrid Detection: A novel approach that utilizes CLIP (Contrastive Language-Image Pre-training) embeddings. This method represents both the image and its corresponding text prompt in a shared latent space. By concatenating these embeddings, the detector leverages the semantic relationship between the text and the image. The core hypothesis is that in T2I generation, the image is a direct mathematical derivative of the prompt, creating a "tighter" semantic bond than exists in real-world photography.

2. Attribution (RQ2)

Beyond simple detection, it is crucial to hold model owners accountable. DE-FAKE employs a multi-class classifier to attribute a fake image to its source model (e.g., distinguishing a Stable Diffusion output from a GLIDE output). This relies on the discovery that different diffusion architectures leave unique "fingerprints" in the generated images, similar to the sensor noise patterns found in physical cameras.

3. Prompt Analysis (RQ3)

In the T2I ecosystem, the prompt is a primary variable. The researchers investigated how prompt characteristics—such as topic, length, and structure—affect the "authenticity" (the difficulty of detection) of the resulting image. They utilized semantic clustering (DBSCAN) and structural analysis to identify patterns in prompts that produce the most convincing fakes.

Experimental Setup

The study utilized two major benchmark datasets to provide prompts and real-world image comparisons: MSCOCO and Flickr30k. Using these prompts, the researchers generated a comprehensive dataset of fake images using four state-of-the-art models:

  • Stable Diffusion (SD)
  • Latent Diffusion (LD)
  • GLIDE
  • DALL·E 2

To simulate real-world scenarios where the original prompt might be unavailable, the researchers employed BLIP, an image captioning model, to "reverse-engineer" prompts from the generated images.

Key Insights and Results

The "Smoking Gun" Prompt

The Hybrid detector significantly outperformed image-only methods. The semantic alignment between a prompt and a generated image serves as a powerful diagnostic signal. Even when the prompt was unknown and reconstructed via BLIP, detection accuracy remained high (ranging from 0.84 to 0.94), proving that the semantic signature of diffusion models is robust.

Artifacts and Fingerprints

Through frequency analysis using Fourier transforms, the researchers identified that all T2I models share common artifacts in the central frequency region. This allows a detector trained on one model (e.g., Stable Diffusion) to generalize and detect fakes from an unseen model (e.g., DALL·E 2) better than random chance. Simultaneously, each model leaves a unique fingerprint that enables attribution with over 93% accuracy.

The Authenticity Sweet Spot

Not all prompts are equally effective at deceiving detectors. The study found that:

  • Topic Matters: Prompts involving the "person" topic tend to produce images that are harder for machines to identify as fake.
  • Length Matters: There is a "sweet spot" for prompt length between 25 and 75 characters. Prompts that are too short lack sufficient detail for high-quality generation, while excessively long prompts can introduce contradictions or noise that make the image easier to detect.

Failure of Legacy Tools

Crucially, the study confirmed that existing forensic classifiers designed for GANs performed poorly on diffusion-based fakes, often achieving an accuracy of only 0.5 (no better than a coin flip). This underscores the urgent need for specialized tools like DE-FAKE.

Conclusion

DE-FAKE demonstrates that while text-to-image diffusion models are capable of producing stunningly realistic imagery, they are not invisible to forensic analysis. By leveraging the relationship between text prompts and image pixels, and by identifying unique model fingerprints, we can effectively detect and attribute synthetic content. As T2I models continue to evolve, the "arms race" between generation and detection will intensify, requiring continuous updates to forensic frameworks to safeguard the integrity of digital media.

Summary updated

BibTeX
@inproceedings{sha2023de,
  author = {Zeyang Sha and Zheng Li and Ning Yu and Yang Zhang},
  title = {{DE-FAKE: Detection and Attribution of Fake Images Generated by Text-to-Image Diffusion Models}},
  booktitle = {CCS},
  year = {2023},
  doi = {10.1145/3576915.3616588},
}
Figure