Skip to main content
QUICK REVIEW

[论文解读] Backdoor Attacks on Vision Transformers

Akshayvarun Subramanya, Aniruddha Saha|arXiv (Cornell University)|Jun 16, 2022
Adversarial Robustness in Machine Learning被引用 7
一句话总结

本文表明视觉Transformer(ViTs)易受后门攻击(如BadNets和隐藏触发器后门攻击)的影响,并揭示了其与CNNs的关键差异:像GradRollout这样的解释方法在推理过程中能有效定位ViTs中的触发器。基于此,作者提出一种测试时图像遮挡防御方法,通过遮蔽注意力图中高激活区域来显著降低攻击成功率,同时结合训练时正则化策略,在保持干净准确率方面表现良好。

ABSTRACT

Vision Transformers (ViT) have recently demonstrated exemplary performance on a variety of vision tasks and are being used as an alternative to CNNs. Their design is based on a self-attention mechanism that processes images as a sequence of patches, which is quite different compared to CNNs. Hence it is interesting to study if ViTs are vulnerable to backdoor attacks. Backdoor attacks happen when an attacker poisons a small part of the training data for malicious purposes. The model performance is good on clean test images, but the attacker can manipulate the decision of the model by showing the trigger at test time. To the best of our knowledge, we are the first to show that ViTs are vulnerable to backdoor attacks. We also find an intriguing difference between ViTs and CNNs - interpretation algorithms effectively highlight the trigger on test images for ViTs but not for CNNs. Based on this observation, we propose a test-time image blocking defense for ViTs which reduces the attack success rate by a large margin. Code is available here: https://github.com/UCDvision/backdoor_transformer.git

研究动机与目标

  • 探究视觉Transformer是否像CNNs一样易受后门攻击影响,尽管其架构不同。
  • 比较解释方法在ViTs与CNNs中定位后门触发器的有效性。
  • 基于注意力图引导的图像遮挡,提出一种新型ViTs测试时防御方法。
  • 评估该防御在不同触发器尺寸和模型架构下的鲁棒性。
  • 探讨干净准确率与防御性能之间的权衡,并提出一种训练时正则化策略以恢复准确率损失。

提出的方法

  • 作者在ImageNet上对ViT模型应用两种标准后门攻击方法——BadNets和隐藏触发器后门攻击(HTBA),通过微调方式实现。
  • 使用GradRollout(一种基于梯度的解释方法)生成受触发测试图像的注意力热力图,以定位后门触发器。
  • 提出一种测试时防御方法,通过遮挡GradRollout热力图中激活最高的区域,从而有效中和触发器。
  • 为缓解测试时遮挡导致的干净准确率下降,将该防御机制在训练阶段作为数据增强策略应用,对相同高激活区域进行遮蔽。
  • 在多个ViT变体(ViT-Base、CaiT、PatchConv)上评估该方法,并与CNNs(VGG16、ResNet18、ResNet50)在相同威胁模型下进行对比。
  • 通过改变遮挡区域尺寸(10x10至70x70)测试防御性能,以评估在触发器尺寸未知情况下的鲁棒性。

实验结果

研究问题

  • RQ1视觉Transformer是否易受与影响CNNs类似的后门攻击?
  • RQ2为何像GradRollout这样的解释方法能在ViTs中成功定位触发器,却在CNNs中无效?
  • RQ3能否利用注意力图解释来设计一种针对ViTs后门攻击的有效测试时防御?
  • RQ4当触发器尺寸未知时,不同遮挡区域尺寸下的防御性能如何变化?
  • RQ5在训练时应用相同防御机制是否能恢复测试时遮挡造成的干净准确率损失?

主要发现

  • ViTs易受后门攻击影响,在HTBA和BadNets威胁模型下,攻击成功率最高可达98%。
  • GradRollout解释图能有效突出ViTs中的触发器,CaiT模型的IoU达到0.66,而所有测试的CNNs均低于0.04。
  • 测试时图像遮挡防御显著降低了攻击成功率,当遮挡尺寸与触发器尺寸匹配(30x30)时,攻击成功率最低。
  • 即使对触发器尺寸了解有限,该防御在所有测试遮挡尺寸下均优于基线(无防御),表现出对不确定性的鲁棒性。
  • 在训练时应用该防御机制可恢复测试时遮挡导致的大部分干净准确率损失,证明其作为正则化器的有效性。
  • 无论使用何种解释方法(GradCAM、Score-CAM、FullGrad),该防御在CNNs上均无效,证实了触发器定位在架构上的本质差异。

更好的研究,从现在开始

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

无需绑定信用卡

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