Towards Transferable Adversarial Attacks on Vision Transformers

Zhipeng Wei, Jingjing Chen, Micah Goldblum, Zuxuan Wu, Tom Goldstein +1 more
9/9/2021
183 citations
cs.CVcs.AI
transformer-attention

Official code: zhipeng-wei/PNA-PatchOut (38 stars, Python, last commit 2024-07-03).

Abstract

Vision transformers (ViTs) have demonstrated impressive performance on a series of computer vision tasks, yet they still suffer from adversarial examples. % crafted in a similar fashion as CNNs. In this paper, we posit that adversarial attacks on transformers should be specially tailored for their architecture, jointly considering both patches and self-attention, in order to achieve high transferability.

Show full abstract

More specifically, we introduce a dual attack framework, which contains a Pay No Attention (PNA) attack and a PatchOut attack, to improve the transferability of adversarial samples across different ViTs. We show that skipping the gradients of attention during backpropagation can generate adversarial examples with high transferability. In addition, adversarial perturbations generated by optimizing randomly sampled subsets of patches at each iteration achieve higher attack success rates than attacks using all patches. We evaluate the transferability of attacks on state-of-the-art ViTs, CNNs and robustly trained CNNs. The results of these experiments demonstrate that the proposed dual attack can greatly boost transferability between ViTs and from ViTs to CNNs. In addition, the proposed method can easily be combined with existing transfer methods to boost performance. Code is available at https://github.com/zhipeng-wei/PNA-PatchOut.

View on arXivView PDF

Code Implementations(1)

385Python, ShellDec 8, 20212 years ago

Similar Papers

Cite this paper

@article{wei2021towards,
  title  = {Towards Transferable Adversarial Attacks on Vision Transformers},
  author = {Zhipeng Wei and Jingjing Chen and Micah Goldblum and Zuxuan Wu and Tom Goldstein and Yu-Gang Jiang},
  year   = {2021},
  eprint = {2109.04176},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.04176}
}

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/2109.04176.svg)](https://codeofpaper.com/paper/2109.04176)

Discussion