Towards Efficient Adversarial Training on Vision Transformers

Boxi Wu, Jindong Gu, Zhifeng Li, Deng Cai, Xiaofei He +1 more
7/21/2022
cs.CV

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wu2022towards,
  title  = {Towards Efficient Adversarial Training on Vision Transformers},
  author = {Boxi Wu and Jindong Gu and Zhifeng Li and Deng Cai and Xiaofei He and Wei Liu},
  year   = {2022},
  eprint = {2207.10498},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.10498v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.10498.svg)](https://codeofpaper.com/paper/2207.10498)

Discussion