让CLIP模型在测试时自动防御图像攻击,提升安全性和鲁棒性。
TAPT: Test-Time Adversarial Prompt Tuning for Robust Inference in Vision-Language Models
- 测试时动态生成文本与视觉双模防御提示,无需训练数据。
- 对11个数据集测试,对抗攻击下准确率提升超48.9%。
- 适用于各类视觉语言模型,尤其适合追求高安全性的场景。
预训练的视觉语言模型(如CLIP)在多个下游任务中展现出出色的零样本泛化能力。然而,近期研究发现,其推理性能易受微小对抗扰动影响,尤其是视觉模态,带来显著安全风险。为此,本文提出一种新型防御方法——测试时对抗提示调优(TAPT),以增强CLIP对视觉对抗攻击的推理鲁棒性。TAPT是一种测试时防御方法,通过优化每张测试样本的防御双模(文本与视觉)提示,使模型在不依赖训练数据的前提下提升鲁棒性。具体而言,该方法通过最小化多视图熵并拉齐对抗样本与干净样本的分布来实现。我们在11个基准数据集(包括ImageNet和10个零样本数据集)上评估了TAPT的有效性,结果表明其可使原始CLIP在面对AutoAttack时的零样本对抗鲁棒性提升至少48.9%,同时基本保持对干净样本的性能。此外,TAPT在多种骨干网络上均优于现有对抗提示调优方法,平均鲁棒性提升达36.6%以上。
原文摘要 · Abstract (English)
Large pre-trained Vision-Language Models (VLMs) such as CLIP have demonstrated excellent zero-shot generalizability across various downstream tasks. However, recent studies have shown that the inference performance of CLIP can be greatly degraded by small adversarial perturbations, especially its visual modality, posing significant safety threats. To mitigate this vulnerability, in this paper, we propose a novel defense method called Test-Time Adversarial Prompt Tuning (TAPT) to enhance the inference robustness of CLIP against visual adversarial attacks. TAPT is a test-time defense method that learns defensive bimodal (textual and visual) prompts to robustify the inference process of CLIP. Specifically, it is an unsupervised method that optimizes the defensive prompts for each test sample by minimizing a multi-view entropy and aligning adversarial-clean distributions. We evaluate the effectiveness of TAPT on 11 benchmark datasets, including ImageNet and 10 other zero-shot datasets, demonstrating that it enhances the zero-shot adversarial robustness of the original CLIP by at least 48.9% against AutoAttack (AA), while largely maintaining performance on clean examples. Moreover, TAPT outperforms existing adversarial prompt tuning methods across various backbones, achieving an average robustness improvement of at least 36.6%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。