针对视觉Transformer的对抗样本,提出注意力感知检测方法。
ViTGuard: Attention-aware Detection against Adversarial Examples for Vision Transformer
- 利用掩码自编码器重构图像,结合注意力图与分类标记进行检测。
- 在三个数据集上对九种攻击均表现更优,包括局部扰动攻击。
- 无需对抗样本训练,能有效防御未知攻击,适合部署于安全敏感场景。
视觉变压器(ViT)在图像分类中通过捕捉图像块间的空间关系提升性能,但其同样易受对抗攻击影响,尤其是小区域内的扰动攻击。传统检测方法因依赖卷积网络设计,对ViT效果差且忽略局部攻击。本文提出ViTGuard,基于掩码自编码器(MAE)重建被遮蔽图像块,结合注意力图与分类(CLS)标记特征,构建阈值检测器。该方法训练时不使用对抗样本,可有效识别未见攻击。在三个数据集上对比七种现有方法,在九种攻击下均表现更优,且验证了其对抗自适应攻击的鲁棒性。
原文摘要 · Abstract (English)
The use of transformers for vision tasks has challenged the traditional dominant role of convolutional neural networks (CNN) in computer vision (CV). For image classification tasks, Vision Transformer (ViT) effectively establishes spatial relationships between patches within images, directing attention to important areas for accurate predictions. However, similar to CNNs, ViTs are vulnerable to adversarial attacks, which mislead the image classifier into making incorrect decisions on images with carefully designed perturbations. Moreover, adversarial patch attacks, which introduce arbitrary perturbations within a small area, pose a more serious threat to ViTs. Even worse, traditional detection methods, originally designed for CNN models, are impractical or suffer significant performance degradation when applied to ViTs, and they generally overlook patch attacks. In this paper, we propose ViTGuard as a general detection method for defending ViT models against adversarial attacks, including typical attacks where perturbations spread over the entire input and patch attacks. ViTGuard uses a Masked Autoencoder (MAE) model to recover randomly masked patches from the unmasked regions, providing a flexible image reconstruction strategy. Then, threshold-based detectors leverage distinctive ViT features, including attention maps and classification (CLS) token representations, to distinguish between normal and adversarial samples. The MAE model does not involve any adversarial samples during training, ensuring the effectiveness of our detectors against unseen attacks. ViTGuard is compared with seven existing detection methods under nine attacks across three datasets. The evaluation results show the superiority of ViTGuard over existing detectors. Finally, considering the potential detection evasion, we further demonstrate ViTGuard's robustness against adaptive attacks for evasion.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。