Invisible Backdoor Attacks on Diffusion Models

Sen Li, Junchi Ma, Minhao ChengarXiv 2024 · DOI

Introduction

Diffusion models have revolutionized generative AI, powering tools like Stable Diffusion and Midjourney. However, as these models become more integrated into critical workflows, their security vulnerabilities come into sharper focus. Researchers have recently uncovered a sophisticated threat: invisible backdoor attacks. Unlike traditional backdoor attacks that rely on obvious visual triggers, this new method uses imperceptible, input-aware patterns to force models into generating specific malicious or restricted target images.

The Problem: Stealthy Adversarial Triggers

A backdoor attack is a form of adversarial machine learning where a model is trained to behave normally on clean data but perform a specific malicious action when a "trigger" is present. In diffusion models, a backdoor might force the generation of a specific logo or a restricted image whenever a certain pattern is hidden in the input noise or prompt.

The primary challenge addressed by this research is visibility. Previous backdoor methods for diffusion models used manually crafted, discernible patterns that a human could easily detect. This paper introduces a bi-level optimization framework to make these triggers "input-aware" and invisible, making the attack significantly harder to detect and providing a potential tool for model watermarking.

Methodology: Bi-Level Optimization

The core of this attack is a bi-level optimization framework designed to create stealthy backdoors across different generation tasks:

  1. Inner Optimization: The algorithm optimizes a trigger generator. For a given diffusion model, it learns to produce a trigger that forces the model to output a specific target image while keeping the trigger's magnitude (constrained by an $\ell_\infty$ norm) so low that it remains invisible to the human eye.
  2. Outer Optimization: The algorithm then optimizes the diffusion model itself. It ensures the model maintains high "utility" (generating high-quality images for normal users) while achieving high "specificity" (faithfully generating the target image when the invisible trigger is present).
Overview of invisible backdoor attacks on unconditional and conditional diffusion models.

This framework is versatile, covering both unconditional models (where triggers are hidden in the starting Gaussian noise) and conditional models. For the first time, researchers demonstrated backdooring text-guided image editing and inpainting pipelines by hiding triggers within the masked area of an image being edited.

Key Insights and Results

The researchers evaluated their framework on standard benchmarks including CIFAR10, CELEBA-HQ, and MS COCO. Several key insights emerged:

  • Instance-Adaptive Triggers: Instead of a universal "sticker," the model generates a unique, invisible trigger for every specific input. This dynamic nature makes the attack much harder for automated defenses to identify.
  • High Stealth and Precision: On CIFAR10, the backdoored model achieved an FID (Fréchet Inception Distance) of 11.76, slightly better than the clean model's 12.80, proving the attack does not degrade image quality. The Mean Squared Error (MSE) between the generated backdoored image and the intended target was extremely low (e.g., 3.07e-3), indicating high reliability.
  • Defense Resistance: Common defenses—such as fine-tuning on clean data, Adversarial Neuron Pruning (ANP), and specialized diffusion defenses like Elijah—were found to be ineffective against these invisible backdoors.
Qualitative examples of invisible triggers and the resulting target image generation across different datasets.

Applications: The Watermarking Silver Lining

While backdoors are typically viewed as threats, this framework can be repurposed for model ownership verification. A model owner can embed an invisible trigger as a watermark. If the model weights are stolen, the owner can prove theft by demonstrating that the model generates a specific "signature" image when the secret trigger is applied. Experiments showed that a watermarked model could be identified with as few as 50 queries.

Conclusion and Future Work

The primary limitation of this approach is the computational cost of bi-level optimization; training on high-resolution datasets like CELEBA-HQ can take up to 12 days on a single high-end GPU. Future research will focus on faster sampling strategies to accelerate training. More importantly, the authors emphasize the urgent need for the research community to develop advanced defense mechanisms, as current state-of-the-art methods are currently unable to mitigate these invisible, input-aware attacks.

Summary updated

BibTeX
@misc{li2024invisible,
  author = {Sen Li and Junchi Ma and Minhao Cheng},
  title = {{Invisible Backdoor Attacks on Diffusion Models}},
  year = {2024},
  eprint = {2406.00816},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.00816},
}
Figure