arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.12461cs.CV
收藏

语义感知对抗微调用于CLIP

Semantic-aware Adversarial Fine-tuning for CLIP

School of Computing and Information Systems(计算机与信息系统学院);The University of Melbourne(墨尔本大学)

Jiacheng Zhang, Jinhao Li, Hanxun Huang, Sarah M. Erfani, Benjamin I. P. Rubinstein, Feng Liu

AI总结:

本文提出语义感知对抗微调方法,通过生成语义感知的对抗性示例提升CLIP模型在零样本分类任务中的对抗鲁棒性。

摘要:

最近的研究表明,通过对抗性示例(AEs)对抗性微调CLIP模型的图像编码器,可以在零样本分类任务中增强CLIP模型的对抗鲁棒性。这些对抗性示例是通过最小化图像与手工制作模板(例如,'一张{标签}的照片')之间的余弦相似性生成的。然而,研究表明,单个图像与单个手工制作模板之间的余弦相似性不足以衡量图像-文本对的相似性。基于此,本文发现,使用余弦相似性生成的AEs在相似度度量被替换为语义增强替代方案时,可能无法欺骗CLIP,从而使使用这些AEs微调的图像编码器更不鲁棒。为了解决这个问题,我们首先提出了一种语义-集成攻击,通过最小化原始图像与经过细化的文本描述集合之间的平均相似性,生成语义感知的AEs。这些描述最初由基础模型生成,以捕捉超出手工制作模板的核心语义特征,然后经过细化以减少幻觉。为此,我们提出了语义感知对抗微调(SAFT),该方法通过语义感知的AEs微调CLIP的图像编码器。广泛的实验表明,SAFT在16个数据集上实现了显著的改进,在零样本对抗鲁棒性方面优于当前方法。我们的代码可在:https://github.com/tmlr-group/SAFT上找到。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑