Skip to main content
QUICK REVIEW

[论文解读] Understanding Adversarial Robustness of Vision Transformers via Cauchy Problem

Zheng Wang, Wenjie Ruan|arXiv (Cornell University)|Aug 1, 2022
Adversarial Robustness in Machine Learning被引用 4
一句话总结

本文提出了一种新颖的理论框架,通过常微分方程(ODE)近似将视觉Transformer(ViT)的鲁棒性与柯西问题联系起来,证明了ViT具有Lipschitz连续性。研究发现,第一层和最后一层对鲁棒性具有决定性影响,且出人意料的是,多头自注意力(MSA)仅在弱攻击(如FGSM)下提升鲁棒性,而在强攻击(如PGD)下反而损害鲁棒性。

ABSTRACT

Recent research on the robustness of deep learning has shown that Vision Transformers (ViTs) surpass the Convolutional Neural Networks (CNNs) under some perturbations, e.g., natural corruption, adversarial attacks, etc. Some papers argue that the superior robustness of ViT comes from the segmentation of its input images; others say that the Multi-head Self-Attention (MSA) is the key to preserving the robustness. In this paper, we aim to introduce a principled and unified theoretical framework to investigate such an argument on ViT's robustness. We first theoretically prove that, unlike Transformers in Natural Language Processing, ViTs are Lipschitz continuous. Then we theoretically analyze the adversarial robustness of ViTs from the perspective of the Cauchy Problem, via which we can quantify how the robustness propagates through layers. We demonstrate that the first and last layers are the critical factors to affect the robustness of ViTs. Furthermore, based on our theory, we empirically show that unlike the claims from existing research, MSA only contributes to the adversarial robustness of ViTs under weak adversarial attacks, e.g., FGSM, and surprisingly, MSA actually comprises the model's adversarial robustness under stronger attacks, e.g., PGD attacks.

研究动机与目标

  • 建立一个原则性、统一的理论框架,用于分析视觉Transformer(ViTs)的对抗鲁棒性,超越经验观察。
  • 研究多头自注意力(MSA)在ViT鲁棒性中的作用,挑战当前认为MSA天然增强鲁棒性的普遍观点。
  • 利用柯西问题公式,量化鲁棒性在ViT各层间的传播。
  • 识别出对ViT鲁棒性影响最大的结构组件——特别是第一层和最后一层。

提出的方法

  • 将ViTs建模为底层ODE系统的前向欧拉近似,其中每个Transformer块对应于ODE中的非线性函数F(x):dx/dt = F(x, t)。
  • 利用F(x)在输入处的一阶泰勒展开,将局部鲁棒性与雅可比矩阵的最大奇异值联系起来,该方法源自柯西问题框架。
  • 在一定假设下证明ViTs具有Lipschitz连续性,这是鲁棒性理论分析的基础前提。
  • 将每层块的雅可比矩阵的最大奇异值用作局部鲁棒性的代理指标,从而实现对鲁棒性在各层间传播的量化。
  • 在受控ε和步长下,通过FGSM、PGD-7和CW攻击对鲁棒性进行实证评估,比较ViTs与CoViTs在不同模型深度和patch大小下的表现。
  • 由于计算不可行性,对大输入的雅可比矩阵奇异值施加上界,承认这是关键近似。

实验结果

研究问题

  • RQ1如何通过原则性的理论框架,正式量化视觉Transformer中的对抗鲁棒性?
  • RQ2多头自注意力(MSA)在ViT鲁棒性中扮演何种角色,特别是在不同攻击强度下?
  • RQ3ViT编码器中的哪些层对整体对抗鲁棒性影响最大?
  • RQ4输入标记化或patch嵌入机制是否比MSA更有利于鲁棒性,如一些先前研究所述?
  • RQ5在强对抗攻击下,ViTs与CoViTs的鲁棒性如何比较,这又对MSA的防御能力意味着什么?

主要发现

  • 在ODE近似假设下,ViTs被理论证明具有Lipschitz连续性,为鲁棒性分析提供了严格基础。
  • ViT编码器的第一层和最后一层被确定为影响对抗鲁棒性的最关键组件,因为它们限制了雅可比矩阵最大奇异值的上界。
  • MSA仅在弱攻击(如FGSM)下提升鲁棒性,即使在大模型中,其防御增益也微乎其微。
  • 在强攻击(如PGD-7和CW)下,MSA反而损害了对抗鲁棒性,与先前认为其具有强大防御能力的观点相矛盾。
  • CoViT模型在强攻击下始终优于ViTs,尤其在大patch尺寸下,表明MSA的动态感受野在高强扰动下效果较差。
  • 鲁棒准确率与雅可比矩阵最大奇异值的上界相关,验证了理论框架的预测能力。

更好的研究,从现在开始

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

无需绑定信用卡

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