Perturbing Attention Gives You More Bang for the Buck: Subtle Imaging Perturbations That Efficiently Fool Customized Diffusion Models
Jingyao Xu, Yuetong Lu, Yandong Li, Siyang Lu, Dongdong Wang, Xiang Wei
TL;DR
The paper addresses the vulnerability of Text-to-Image diffusion models to targeted attacks by revealing that cross-attention layers are highly sensitive to gradient updates during training. It introduces CAAT, a lightweight attacker that jointly optimizes a small cross-attention subspace ($W_K$, $W_V$) and a visually imperceptible input perturbation $\delta$ under a budget $\eta$, to degrade the mapping from text to image in customized LDMs. Through extensive experiments across DreamBooth, Textual Inversion, Custom Diffusion, and SVDiff, CAAT outperforms existing attacks (e.g., Anti-DreamBooth, Mist) in both effectiveness and efficiency, while running roughly 2x faster and without requiring large auxiliary image sets. The results demonstrate strong generalization across LDM variants and provide a practical image-preprocessing safeguard for portrait rights, with ablation and robustness analyses supporting its reliability and practicality in real-world scenarios. $L_{DM}(\theta,x_0)=\mathbb{E}_{x_0,t,\epsilon}\|\epsilon-\epsilon_{\theta}(x_t,t)\|$, $x_t=\sqrt{\alpha_t}x_0+\sqrt{1-\alpha_t}\epsilon$, Attention$(Q,K,V)=\text{softmax}(\tfrac{QK^T}{\sqrt{d}})V$, $Q=W_Q f$, $K=W_K c$, $V=W_V c$, $\delta=\arg\max_{\delta}\mathcal{L}_{LDM}(\theta,x+\delta)$, $\|\delta\|\le\eta$.
Abstract
Diffusion models (DMs) embark a new era of generative modeling and offer more opportunities for efficient generating high-quality and realistic data samples. However, their widespread use has also brought forth new challenges in model security, which motivates the creation of more effective adversarial attackers on DMs to understand its vulnerability. We propose CAAT, a simple but generic and efficient approach that does not require costly training to effectively fool latent diffusion models (LDMs). The approach is based on the observation that cross-attention layers exhibits higher sensitivity to gradient change, allowing for leveraging subtle perturbations on published images to significantly corrupt the generated images. We show that a subtle perturbation on an image can significantly impact the cross-attention layers, thus changing the mapping between text and image during the fine-tuning of customized diffusion models. Extensive experiments demonstrate that CAAT is compatible with diverse diffusion models and outperforms baseline attack methods in a more effective (more noise) and efficient (twice as fast as Anti-DreamBooth and Mist) manner.
