通过互补注意力提升CLIP模型零样本抗攻击能力
Complementary Text-Guided Attention for Zero-Shot Adversarial Robustness
- 引入互补文本引导注意力机制,增强模型对对抗扰动的鲁棒性
- 在16个数据集上实现11.95%的零样本鲁棒准确率提升
- 适合关注视觉语言模型安全性的研究者与应用开发者
由于出色的零样本能力,预训练视觉语言模型(如CLIP)在多个领域受到广泛关注和应用。然而,CLIP被发现对对抗样本敏感。实验分析显示,对抗扰动会导致文本引导注意力发生偏移。基于此,我们提出Text-Guided Attention for Zero-Shot Robustness(TGA-ZSR),包含局部注意力优化模块和全局注意力约束模块,旨在保持CLIP泛化能力的同时提升抗攻击性。其中,全局注意力约束模块利用干净样本从目标模型和原始模型中获取文本引导注意力,以维持清洁样本上的性能并增强整体鲁棒性。但该方法偶尔会关注无关或虚假特征,影响表现。为此,我们进一步提出互补文本引导注意力(Comp-TGA),融合类别提示引导的前景注意力与非类别提示驱动的反向注意力,使模型能更全面准确地捕捉前景信息。实验验证,TGA-ZSR和Comp-TGA分别在16个数据集上相较当前最优方法提升9.58%和11.95%的零样本鲁棒准确率。
原文摘要 · Abstract (English)
Due to the impressive zero-shot capabilities, pre-trained vision-language models (e.g., CLIP), have attracted widespread attention and adoption across various domains. Nonetheless, CLIP has been observed to be susceptible to adversarial examples. Through experimental analysis, we have observed a phenomenon wherein adversarial perturbations induce shifts in text-guided attention. Building upon this observation, we propose a simple yet effective strategy: Text-Guided Attention for Zero-Shot Robustness (TGA-ZSR). This framework incorporates two components: Local Attention Refinement Module and Global Attention Constraint Module. Our goal is to maintain the generalization of the CLIP model and enhance its adversarial robustness. Additionally, the Global Attention Constraint Module acquires text-guided attention from both the target and original models using clean examples. Its objective is to maintain model performance on clean samples while enhancing overall robustness. However, we observe that the method occasionally focuses on irrelevant or spurious features, which can lead to suboptimal performance and undermine its robustness in certain scenarios. To overcome this limitation, we further propose a novel approach called Complementary Text-Guided Attention (Comp-TGA). This method integrates two types of foreground attention: attention guided by the class prompt and reversed attention driven by the non-class prompt. These complementary attention mechanisms allow the model to capture a more comprehensive and accurate representation of the foreground. The experiments validate that TGA-ZSR and Comp-TGA yield 9.58% and 11.95% improvements respectively, in zero-shot robust accuracy over the current state-of-the-art techniques across 16 datasets.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。