Exploring Adversarial Attacks against Latent Diffusion Model from the Perspective of Adversarial Transferability

Junxi Chen, Junhao Dong, Xiaohua XiearXiv 2024 · DOI

Abstract

Adversarial attacks on Latent Diffusion Models (LDMs) often struggle with transferability—protections designed for one model version may fail against another. This research demonstrates that the "smoothness" of a surrogate model's loss landscape is a critical factor in attack success. By identifying and targeting specific time-steps where models like Stable Diffusion v1.4 are mathematically smoother, the authors develop the $AdvDM_{800}^{900}$ attack. This method produces adversarial perturbations that are significantly more effective at disrupting image editing across diverse target models, providing a more robust defense against unauthorized AI-driven content manipulation.

Introduction

As Latent Diffusion Models (LDMs) like Stable Diffusion become ubiquitous, concerns regarding copyright infringement and malicious image editing (e.g., deepfakes) have intensified. Researchers have proposed "adversarial examples" (AEs)—images embedded with invisible perturbations—to disrupt these AI processes. However, a significant hurdle remains: adversarial transferability. An attack optimized for one version of Stable Diffusion often fails when the target uses a different model, prompt, or guidance scale. This paper investigates how to enhance the universality of these protective perturbations by analyzing the mathematical properties of the diffusion process.

Methods: Smoothness and Strategic Sampling

The authors treat existing Monte-Carlo-based attacks, such as AdvDM, as an ensemble of surrogate models where each diffusion "time-step" ($t$) represents a different surrogate. They introduce the concept of $\beta$-smoothness to the diffusion context. A smoother loss landscape allows adversarial gradients to transfer more effectively from a surrogate model to an unknown target model.

Smoothness Discovery

By measuring smoothness across the diffusion trajectory, the researchers found that for models like SD-v1.4, the loss landscape is "sharp" at low noise levels (small $t$) but becomes significantly "smoother" at high noise levels (large $t$). In contrast, newer models like SD-v2.1 remain relatively sharp throughout the process.

Smoothness vs. time-step $t$ for different Stable Diffusion versions.

The $AdvDM_{800}^{900}$ Attack

Based on this discovery, the authors propose restricting the adversarial attack to the smoothest regime—specifically sampling $t$ between 800 and 900. This targeted approach, dubbed $AdvDM_{800}^{900}$, generates perturbations that are far more resilient and transferable than those produced by standard random sampling across the full 0-1000 range.

Key Results and Insights

The proposed method was evaluated using standard LDM benchmarks and LSUN datasets. The primary metric for success was the Fréchet Inception Distance (FID); a higher $\Delta$ FID indicates that the AI-edited image is of significantly lower quality and deviates further from the intended distribution.

Transferability Performance

The $AdvDM_{800}^{900}$ attack consistently outperformed other variants. Notably, an attack crafted on a "smooth" version of SD-v1.4 proved more effective at breaking SD-v2.1 than an attack crafted directly on SD-v2.1 itself. This confirms that surrogate smoothness is a more dominant factor in transferability than the similarity between the surrogate and target models.

Transferability of adversarial attacks across SD-v1-4 and SD-v2-1 using different time-step ranges.

Semantic and Visual Impact

Beyond FID scores, the attack successfully lowered CLIP scores, indicating that the AI's output no longer matched the user's prompt. Qualitatively, the $AdvDM_{800}^{900}$ perturbations introduce a "latticed texture" that destroys depth and realism, effectively blinding the model to the original image's structure.

Discussion: Inference vs. Fine-tuning

A critical finding of this work is the trade-off between stopping inference tasks (like image editing) and fine-tuning tasks (like Textual Inversion). Attacks optimized for transferability in inference often fail against fine-tuning because the latter acts as a "data poisoning" problem. Fine-tuning allows the model to learn to ignore high-frequency adversarial noise, suggesting that protecting against model training requires a different, likely lower-frequency, perturbation strategy.

Limitations and Future Work

While effective, the current approach relies on gradient magnitude as a proxy for smoothness due to the high computational cost of calculating the full Hessian matrix for diffusion models. Additionally, common image preprocessing techniques like JPEG compression can still mitigate the impact of these attacks. Future research will focus on developing "transformation-invariant" techniques to ensure protections remain durable against standard image processing pipelines.

Summary updated

BibTeX
@misc{chen2024exploring,
  author = {Junxi Chen and Junhao Dong and Xiaohua Xie},
  title = {{Exploring Adversarial Attacks against Latent Diffusion Model from the Perspective of Adversarial Transferability}},
  year = {2024},
  eprint = {2401.07087},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.07087},
}
Figure