arXiv:2602.12461cs.CV2026-02被引 2

用语义增强的对抗样本提升CLIP模型在零样本分类中的鲁棒性

Semantic-aware Adversarial Fine-tuning for CLIP

  • 通过融合多个优化后的文本描述生成语义感知对抗样本
  • 在16个数据集上显著提升CLIP零样本对抗鲁棒性
  • 适合关注视觉语言模型安全性的研究者与应用开发者

近期研究表明,通过使用对抗样本对CLIP的图像编码器进行微调可增强其在零样本分类任务中的对抗鲁棒性。这些对抗样本通常通过最小化图像与人工模板(如'一张{标签}的照片')之间的余弦相似度生成。然而,单一图像与单一模板间的余弦相似度不足以准确衡量图像-文本对的语义相似性。本文发现,当采用语义更丰富的相似度度量时,基于余弦相似度生成的对抗样本可能失效,导致微调后的模型鲁棒性下降。为此,我们提出语义集成攻击,通过最小化原始图像与一组经大模型生成并去幻觉优化的文本描述平均相似度,生成语义感知的对抗样本。基于此,我们设计了语义感知对抗微调(SAFT),利用这些语义感知对抗样本对CLIP图像编码器进行微调。大量实验表明,SAFT在16个数据集上均优于现有方法,显著提升了零样本对抗鲁棒性。代码已开源:https://github.com/tmlr-group/SAFT。

原文摘要 · Abstract (English)

Recent studies have shown that CLIP model's adversarial robustness in zero-shot classification tasks can be enhanced by adversarially fine-tuning its image encoder with adversarial examples (AEs), which are generated by minimizing the cosine similarity between images and a hand-crafted template (e.g., ''A photo of a {label}''). However, it has been shown that the cosine similarity between a single image and a single hand-crafted template is insufficient to measure the similarity for image-text pairs. Building on this, in this paper, we find that the AEs generated using cosine similarity may fail to fool CLIP when the similarity metric is replaced with semantically enriched alternatives, making the image encoder fine-tuned with these AEs less robust. To overcome this issue, we first propose a semantic-ensemble attack to generate semantic-aware AEs by minimizing the average similarity between the original image and an ensemble of refined textual descriptions. These descriptions are initially generated by a foundation model to capture core semantic features beyond hand-crafted templates and are then refined to reduce hallucinations. To this end, we propose Semantic-aware Adversarial Fine-Tuning (SAFT), which fine-tunes CLIP's image encoder with semantic-aware AEs. Extensive experiments show that SAFT outperforms current methods, achieving substantial improvements in zero-shot adversarial robustness across 16 datasets. Our code is available at: https://github.com/tmlr-group/SAFT.

CLIP对抗训练语义增强零样本

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。