Skip to main content
QUICK REVIEW

[论文解读] Are Vision Transformers Robust to Patch Perturbations?

Jindong Gu, Volker Tresp|arXiv (Cornell University)|Nov 20, 2021
Adversarial Robustness in Machine Learning被引用 4
一句话总结

本文研究了视觉Transformer(ViT)在图像块扰动下的鲁棒性,发现ViT对自然损坏更具鲁棒性,但对对抗性图像块的脆弱性显著高于ResNets。作者将此归因于自注意力机制:该机制能忽略自然损坏,却容易被对抗性损坏误导。为此,本文提出通过温度缩放实现平滑注意力,以减少对单一图像块的注意力集中,从而提升鲁棒性。

ABSTRACT

Recent advances in Vision Transformer (ViT) have demonstrated its impressive performance in image classification, which makes it a promising alternative to Convolutional Neural Network (CNN). Unlike CNNs, ViT represents an input image as a sequence of image patches. The patch-based input image representation makes the following question interesting: How does ViT perform when individual input image patches are perturbed with natural corruptions or adversarial perturbations, compared to CNNs? In this work, we study the robustness of ViT to patch-wise perturbations. Surprisingly, we find that ViTs are more robust to naturally corrupted patches than CNNs, whereas they are more vulnerable to adversarial patches. Furthermore, we discover that the attention mechanism greatly affects the robustness of vision transformers. Specifically, the attention module can help improve the robustness of ViT by effectively ignoring natural corrupted patches. However, when ViTs are attacked by an adversary, the attention mechanism can be easily fooled to focus more on the adversarially perturbed patches and cause a mistake. Based on our analysis, we propose a simple temperature-scaling based method to improve the robustness of ViT against adversarial patches. Extensive qualitative and quantitative experiments are performed to support our findings, understanding, and improvement of ViT robustness to patch-wise perturbations across a set of transformer-based architectures.

研究动机与目标

  • 调查视觉Transformer(ViT)在图像块扰动下相较于卷积神经网络(CNNs)的表现。
  • 理解自注意力机制在ViT对自然与对抗性图像块损坏的鲁棒性中的作用。
  • 基于注意力行为的洞察,提出一种提升ViT对对抗性图像块攻击鲁棒性的方法。
  • 在不同图像块攻击设置下,比较各种ViT变体、CNNs及混合架构的鲁棒性。

提出的方法

  • 使用标准基准,在图像块自然损坏和对抗性扰动下,对ViT和ResNet进行公平比较。
  • 通过滚动注意力可视化注意力图,分析ViT在不同扰动类型下对图像块的关注方式。
  • 提出平滑注意力,一种应用于自注意力机制中softmax的温度缩放技术,以更均匀地分配注意力权重。
  • 通过温度缩放,防止任一图像块在后续层中主导注意力计算。
  • 在多种攻击设置下,评估包括DeiT、Swin Transformers、LeViT和MLP-Mixer在内的多种架构的鲁棒性。
  • 在不可察觉、目标导向及ViT无关的图像块攻击下测试该方法,以验证泛化能力与鲁棒性提升效果。

实验结果

研究问题

  • RQ1ViT在图像块自然损坏下的鲁棒性与ResNet相比如何?
  • RQ2尽管ViT对自然损坏具有鲁棒性,为何其对对抗性图像块攻击更为脆弱?
  • RQ3自注意力机制在图像块扰动下,对ViT的鲁棒性或脆弱性有多大贡献?
  • RQ4在注意力机制中应用温度缩放,能否有效提升ViT对对抗性图像块攻击的鲁棒性?
  • RQ5不同ViT变体(如Swin、MLP-Mixer)的架构设计在图像块攻击下如何影响其鲁棒性?

主要发现

  • ViT对自然损坏的图像块比ResNet更具鲁棒性,其注意力机制能有效忽略受损区域。
  • ViT对对抗性图像块攻击的脆弱性显著高于ResNet,在标准图像块攻击下,DeiT-small的欺骗率高达61.5%。
  • ViT中的自注意力机制可被轻易操纵,使其聚焦于对抗性图像块,从而导致误分类,注意力图可视化已证实这一点。
  • 通过温度缩放实现的平滑注意力显著提升了ViT对对抗性图像块的鲁棒性,DeiT和LeViT取得显著改进,而Swin Transformers因分层设计,改进有限。
  • 在不可察觉的图像块攻击下(受限于8/225),DeiT-tiny的脆弱性(欺骗率为11.2%)仍高于ResNet18(2.9%)。
  • 使DeiT-tiny失效所需的最少迭代次数(65次)远低于ResNet18(342次),证实ViT在攻击中更易快速失效。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。