通过跨模态对齐提升CLIP在对抗攻击下的鲁棒性
Enhancing CLIP Robustness via Cross-Modality Alignment
- 利用最优传输方法重建图像与文本特征的全局对齐与局部一致性
- 在PGD攻击下,ImageNet平均准确率提升6.7%,且保持干净样本高精度
- 无需训练,可适配已有微调模型,适合部署于安全敏感场景
视觉语言模型(如CLIP)在零样本分类中表现优异,但对对抗扰动极为脆弱。现有方法多聚焦于对抗微调或提示优化,却忽视了CLIP特征空间中文本与图像特征分离的问题。这种错位在对抗攻击下被显著放大,导致性能严重下降。为此,我们提出基于最优传输的跨模态对齐框架COLA,通过将对抗图像嵌入投影到类别文本特征子空间,有效过滤非语义干扰并保留判别信息;再将图像与文本视为多增强视图下的离散分布,利用最优传输优化对齐,并将子空间投影融入代价计算,确保对抗条件下的稳定对齐。COLA无需训练,兼容现有微调模型。在14个零样本分类基准上评估表明,其在PGD攻击下对ImageNet及其变体的平均准确率提升6.7%,同时保持干净样本的高精度。
原文摘要 · Abstract (English)
Vision-language models (VLMs) such as CLIP demonstrate strong generalization in zero-shot classification but remain highly vulnerable to adversarial perturbations. Existing methods primarily focus on adversarial fine-tuning or prompt optimization; they often overlook the gaps in CLIP's encoded features, which is shown as the text and image features lie far apart from each other. This misalignment is significantly amplified under adversarial perturbations, leading to severe degradation in classification performance. To address this problem, we propose Cross-modality Alignment, dubbed COLA, an optimal transport-based framework that explicitly addresses adversarial misalignment by restoring both global image-text alignment and local structural consistency in the feature space. (1) COLA first projects adversarial image embeddings onto a subspace spanned by class text features, effectively filtering out non-semantic distortions while preserving discriminative information. (2) It then models images and texts as discrete distributions over multiple augmented views and refines their alignment via OT, with the subspace projection seamlessly integrated into the cost computation. This design ensures stable cross-modal alignment even under adversarial conditions. COLA is training-free and compatible with existing fine-tuned models. Extensive evaluations across 14 zero-shot classification benchmarks demonstrate the effectiveness of COLA, especially with an average improvement of 6.7% on ImageNet and its variants under PGD adversarial attacks, while maintaining high accuracy on clean samples.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。