[论文解读] Transferable Adversarial Attacks on Vision Transformers with Token Gradient Regularization
本文提出了一种名为Token Gradient Regularization(TGR)的新方法,通过在中间块中减少梯度方差,提升视觉Transformer(ViTs)的可迁移对抗攻击性能。TGR通过逐token地消除极端梯度,稳定梯度更新方向,从而在ImageNet上实现比当前最先进方法平均8.8%的性能提升。
Vision transformers (ViTs) have been successfully deployed in a variety of computer vision tasks, but they are still vulnerable to adversarial samples. Transfer-based attacks use a local model to generate adversarial samples and directly transfer them to attack a target black-box model. The high efficiency of transfer-based attacks makes it a severe security threat to ViT-based applications. Therefore, it is vital to design effective transfer-based attacks to identify the deficiencies of ViTs beforehand in security-sensitive scenarios. Existing efforts generally focus on regularizing the input gradients to stabilize the updated direction of adversarial samples. However, the variance of the back-propagated gradients in intermediate blocks of ViTs may still be large, which may make the generated adversarial samples focus on some model-specific features and get stuck in poor local optima. To overcome the shortcomings of existing approaches, we propose the Token Gradient Regularization (TGR) method. According to the structural characteristics of ViTs, TGR reduces the variance of the back-propagated gradient in each internal block of ViTs in a token-wise manner and utilizes the regularized gradient to generate adversarial samples. Extensive experiments on attacking both ViTs and CNNs confirm the superiority of our approach. Notably, compared to the state-of-the-art transfer-based attacks, our TGR offers a performance improvement of 8.8% on average.
研究动机与目标
- 为解决现有基于梯度正则化的对抗攻击在视觉Transformer(ViTs)上可迁移性有限的问题。
- 探究为何当前方法尽管在输入层面进行了正则化,却仍无法在中间块中稳定梯度。
- 通过在ViT块内以token为单位正则化反向传播梯度,提升对抗样本的可迁移性。
- 开发一种方法,在无需访问目标模型的情况下,提升在ViTs和CNNs上的攻击成功率。
提出的方法
- TGR在ViT每个内部块中识别并逐token地消除具有极端值的反向传播梯度。
- 它将每个patch嵌入视为一个token,并计算分类损失相对于中间层每个token表征的梯度。
- 该方法采用基于阈值的剪枝策略,对每个token的前k个最大幅值梯度进行裁剪,以降低反向传播信号的方差。
- 正则化后的梯度随后用于在攻击过程中更新对抗扰动。
- TGR在源模型的白盒攻击阶段应用,生成的对抗样本可直接迁移到黑盒目标模型。
- 该方法还被适配至CNNs,通过在中间特征图上应用相同的梯度正则化,展示了其泛化能力。
实验结果
研究问题
- RQ1为何现有梯度正则化方法尽管减少了输入梯度方差,却仍无法提升ViTs中的可迁移性?
- RQ2ViTs中间块中的梯度方差在多大程度上影响了对抗样本的可迁移性?
- RQ3在ViT块中进行逐token梯度正则化,能在多大程度上提升ViTs和CNNs上的攻击成功率?
- RQ4每token去除多少个极端梯度才能在性能与效率之间取得最佳平衡?
- RQ5TGR能否推广至非ViT架构(如CNNs)?与现有SOTA方法相比表现如何?
主要发现
- TGR在多个ImageNet模型上,相较于当前最先进基于迁移的攻击方法,在视觉Transformer上的平均攻击成功率提升了8.8%。
- ViTs的深层表现出最低的梯度方差,而浅层则表现出最高的梯度方差,证实了对中间块进行正则化的必要性。
- 与基线方法(如VMI)相比,TGR在浅层和中层更有效地降低了全网络层级的平均梯度方差。
- 消融实验表明,注意力机制对可迁移性的贡献最大,其次是MLP和QKV组件。
- 当应用于CNNs时,TGR相比MIM将攻击成功率提升了超过12.5%,并达到与VMI相当的性能,证明了其泛化能力。
- 最优的正则化极端token数量为k=1;当k超过此值时,由于梯度修改过度,可迁移性反而下降。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。