[Paper Review] Towards Transferable Adversarial Attacks on Vision Transformers
This paper proposes a dual attack framework—Pay No Attention (PNA) and PatchOut—specifically tailored for Vision Transformers to enhance adversarial transferability. By bypassing gradients through the attention mechanism and optimizing only subsets of patches per iteration, the method achieves state-of-the-art transferability, boosting attack success rates to 59.15% on ViTs and 36.23% on robustly trained CNNs when combined with existing techniques.
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. 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.
Motivation & Objective
- To address the limited transferability of adversarial attacks on Vision Transformers due to architectural differences from CNNs.
- To investigate how attention mechanisms and patch-level features in ViTs influence adversarial transferability.
- To develop a dual attack framework that jointly targets self-attention and patch representations for improved generalization across models.
- To validate that architectural-aware attacks outperform standard methods on both ViTs and CNNs, including robustly trained models.
Proposed method
- Introduces the Pay No Attention (PNA) attack, which bypasses gradient backpropagation through the self-attention mechanism by treating attention weights as constants during optimization.
- Employs the PatchOut attack, which randomly samples a subset of patches at each iteration to update, mimicking dropout and reducing overfitting.
- Combines PNA and PatchOut with an $L_2$ regularization term to encourage perturbations that are farther from the original image while maintaining high attack success.
- Uses a white-box ViT as a surrogate model to generate adversarial examples that transfer effectively to black-box ViTs, standard CNNs, and robustly trained CNNs.
- Applies the BIM attack with modified gradient flow to craft adversarial examples under $L_{\ ext{\infty}}$-norm constraints.
- Tunes hyperparameters $T$ (number of patches per iteration) and $\lambda$ (balance between loss and regularization) to optimize transferability.
Experimental results
Research questions
- RQ1How does bypassing gradients through the attention mechanism affect adversarial transferability in Vision Transformers?
- RQ2Can random subset optimization of patches improve transferability compared to full-image optimization?
- RQ3What is the combined effect of PNA and PatchOut on transferability across diverse model architectures, including robustly trained CNNs?
- RQ4How do hyperparameters like $T$ and $\lambda$ influence the performance of the dual attack framework?
- RQ5To what extent can this method be combined with existing transfer attack techniques to further improve performance?
Key findings
- Bypassing gradients through the attention mechanism (PNA) increases black-box attack success rate from 29.92% to 42.47% on ViT-B/16, demonstrating that attention gradients impair transferability.
- Using PatchOut with 130 randomly sampled patches per iteration achieves optimal performance, outperforming both full-image and smaller patch subsets.
- The combination of PNA, PatchOut, and $L_2$ regularization achieves a 59.15% attack success rate on ViTs and 36.23% on robustly trained CNNs, significantly outperforming baseline methods.
- The ablation study confirms that all components contribute complementarily, with PNA providing the largest improvement in transferability.
- The method generalizes well across architectural gaps, showing strong transferability from ViTs to both standard and robustly trained CNNs.
- The approach can be seamlessly combined with existing transfer attack methods, consistently boosting their performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.