通过分析注意力动态变化,有效检测文本到图像扩散模型的后门攻击
Dynamic Attention Analysis for Backdoor Detection in Text-to-Image Diffusion Models
- 基于注意力图随时间演化的动态特性进行检测
- 在6种攻击场景下平均F1达79.27%,AUC达86.27%
- 适合关注生成模型安全性的研究人员和工程师
近期研究发现,文本到图像扩散模型易受后门攻击,攻击者通过植入隐蔽文本触发器操纵模型输出。现有检测方法多依赖后门样本的静态特征,但扩散模型具有固有的动态特性。本文提出动态注意力分析(DAA),揭示动态特性是更优的检测指标。具体而言,通过分析交叉注意力图的动态演化,发现后门样本在<$EOS$>标记处呈现与正常样本不同的特征演化模式。为量化此类动态异常,首先提出DAA-I,将注意力图视为空间独立,使用Frobenius范数度量动态特征;进一步提出基于动力系统的方法DAA-S,利用图结构状态方程建模注意力图间的空间关联,并理论分析其全局渐近稳定性。在六种代表性后门攻击场景下的大量实验表明,本方法显著优于现有方法,平均F1得分为79.27%,AUC达86.27%。代码已开源:https://github.com/Robin-WZQ/DAA。
原文摘要 · Abstract (English)
Recent studies have revealed that text-to-image diffusion models are vulnerable to backdoor attacks, where attackers implant stealthy textual triggers to manipulate model outputs. Previous backdoor detection methods primarily focus on the static features of backdoor samples. However, a vital property of diffusion models is their inherent dynamism. This study introduces a novel backdoor detection perspective named Dynamic Attention Analysis (DAA), showing that these dynamic characteristics serve as better indicators for backdoor detection. Specifically, by examining the dynamic evolution of cross-attention maps, we observe that backdoor samples exhibit distinct feature evolution patterns at the $<$EOS$>$ token compared to benign samples. To quantify these dynamic anomalies, we first introduce DAA-I, which treats the tokens' attention maps as spatially independent and measures dynamic feature using the Frobenius norm. Furthermore, to better capture the interactions between attention maps and refine the feature, we propose a dynamical system-based approach, referred to as DAA-S. This model formulates the spatial correlations among attention maps using a graph-based state equation and we theoretically analyze the global asymptotic stability of this method. Extensive experiments across six representative backdoor attack scenarios demonstrate that our approach significantly surpasses existing detection methods, achieving an average F1 Score of 79.27% and an AUC of 86.27%. The code is available at https://github.com/Robin-WZQ/DAA.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。