论文标题
在视觉变压器上进行有效的对抗训练
Towards Efficient Adversarial Training on Vision Transformers
论文作者
论文摘要
视觉变压器(VIT)是卷积神经网络(CNN)的强大替代方案,引起了很多关注。最近的工作表明,VIT也容易受到CNN等对抗性例子的影响。为了建立强大的VIT,一种直观的方法是应用对抗训练,因为它已被证明是完成强大CNN的最有效方法之一。但是,对抗性培训的一个主要局限性是其沉重的计算成本。 VIT所采用的自我注意力的机制是一个计算强度的操作,其费用随输入贴片的数量四次增加,从而使VIT上的对抗性训练更加耗时。在这项工作中,我们首先全面研究了有关各种视觉变压器的快速对抗训练,并说明了效率与鲁棒性之间的关系。然后,为了加快对VIT的对抗训练,我们提出了一种有效的注意力指导的对抗训练机制。具体而言,依靠自我注意的特殊性,我们在对抗训练期间以注意引导的掉落策略积极地消除了每一层的某些斑块嵌入。纤细的自我发场模块大大加速了对VIT的对抗训练。只有65%的快速对抗训练时间,我们与具有挑战性的成像网基准相匹配。
Vision Transformer (ViT), as a powerful alternative to Convolutional Neural Network (CNN), has received much attention. Recent work showed that ViTs are also vulnerable to adversarial examples like CNNs. To build robust ViTs, an intuitive way is to apply adversarial training since it has been shown as one of the most effective ways to accomplish robust CNNs. However, one major limitation of adversarial training is its heavy computational cost. The self-attention mechanism adopted by ViTs is a computationally intense operation whose expense increases quadratically with the number of input patches, making adversarial training on ViTs even more time-consuming. In this work, we first comprehensively study fast adversarial training on a variety of vision transformers and illustrate the relationship between the efficiency and robustness. Then, to expediate adversarial training on ViTs, we propose an efficient Attention Guided Adversarial Training mechanism. Specifically, relying on the specialty of self-attention, we actively remove certain patch embeddings of each layer with an attention-guided dropping strategy during adversarial training. The slimmed self-attention modules accelerate the adversarial training on ViTs significantly. With only 65\% of the fast adversarial training time, we match the state-of-the-art results on the challenging ImageNet benchmark.