[Paper Review] Patch-Fool: Are Vision Transformers Always Robust Against Adversarial Perturbations?
This paper introduces Patch-Fool, a novel adversarial attack framework targeting the self-attention mechanism of Vision Transformers (ViTs) by optimizing perturbations at the individual patch level. Unlike prior attacks, Patch-Fool exploits attention-aware patch selection and loss design, revealing that ViTs are consistently less robust than CNNs under this attack, challenging the assumption of inherent ViT robustness and highlighting perturbation density and strength as key factors in robustness ranking.
Vision transformers (ViTs) have recently set off a new wave in neural architecture design thanks to their record-breaking performance in various vision tasks. In parallel, to fulfill the goal of deploying ViTs into real-world vision applications, their robustness against potential malicious attacks has gained increasing attention. In particular, recent works show that ViTs are more robust against adversarial attacks as compared with convolutional neural networks (CNNs), and conjecture that this is because ViTs focus more on capturing global interactions among different input/feature patches, leading to their improved robustness to local perturbations imposed by adversarial attacks. In this work, we ask an intriguing question: "Under what kinds of perturbations do ViTs become more vulnerable learners compared to CNNs?" Driven by this question, we first conduct a comprehensive experiment regarding the robustness of both ViTs and CNNs under various existing adversarial attacks to understand the underlying reason favoring their robustness. Based on the drawn insights, we then propose a dedicated attack framework, dubbed Patch-Fool, that fools the self-attention mechanism by attacking its basic component (i.e., a single patch) with a series of attention-aware optimization techniques. Interestingly, our Patch-Fool framework shows for the first time that ViTs are not necessarily more robust than CNNs against adversarial perturbations. In particular, we find that ViTs are more vulnerable learners compared with CNNs against our Patch-Fool attack which is consistent across extensive experiments, and the observations from Sparse/Mild Patch-Fool, two variants of Patch-Fool, indicate an intriguing insight that the perturbation density and strength on each patch seem to be the key factors that influence the robustness ranking between ViTs and CNNs.
Motivation & Objective
- To investigate whether Vision Transformers (ViTs) are truly robust against all adversarial perturbations, challenging the prevailing belief that their global attention mechanism ensures superior robustness.
- To identify the specific types of perturbations that make ViTs more vulnerable than Convolutional Neural Networks (CNNs), particularly by targeting the fundamental building block of ViTs—individual image patches.
- To develop a new attack framework that systematically undermines ViTs by exploiting their self-attention mechanism through patch-level optimization.
- To analyze how perturbation density and strength influence the robustness ranking between ViTs and CNNs, providing insights for future defense and architecture design.
Proposed method
- Proposes Patch-Fool, an attack framework that targets the basic unit of ViTs—individual image patches—by optimizing perturbations at the patch level to disrupt self-attention computations.
- Introduces an attention-aware patch selection strategy that identifies the most influential patches based on their attention weights and contribution to the model's output.
- Designs an attention-aware loss function that maximizes the model's prediction error by focusing on patches that are highly attended in the self-attention mechanism.
- Employs iterative optimization techniques under $L_2$ and $L_∞$ constraints to generate imperceptible yet effective perturbations on selected patches.
- Evaluates the attack on multiple ViT and CNN architectures (e.g., DeiT, ResNet-50) across standard ImageNet benchmarks under varying perturbation settings.
- Introduces two variants—Sparse Patch-Fool and Mild Patch-Fool—to study the impact of perturbation density and strength on robustness ranking between ViTs and CNNs.
Experimental results
Research questions
- RQ1Under what types of perturbations do Vision Transformers become more vulnerable than Convolutional Neural Networks?
- RQ2Can a patch-level attack effectively bypass the global feature representation of ViTs by exploiting their self-attention mechanism?
- RQ3How do perturbation density and strength influence the robustness ranking between ViTs and CNNs?
- RQ4Does the self-attention mechanism's reliance on global interactions truly confer robustness, or are ViTs more sensitive to localized, high-strength patch perturbations?
- RQ5Can the proposed Patch-Fool attack outperform existing adversarial attacks in fooling ViTs while maintaining imperceptibility?
Key findings
- ViTs are consistently less robust than CNNs under the Patch-Fool attack across all evaluated settings, with DeiT-S achieving only 6.25% robust accuracy under 4-patch $L_∞$ attack with $͑ = 128/255$.
- Under $L_∞$ constraints, DeiT-S transitions from being more robust than ResNet-50 at low perturbation strength ($͑ = 8/255$) to significantly less robust at higher strength ($͑ = 128/255$), indicating a shift in robustness ranking based on strength.
- Sparse Patch-Fool, which perturbs only a few patches, still achieves high attack success, showing that ViTs are vulnerable even under low-density attacks.
- Mild Patch-Fool experiments reveal that as perturbation strength ($͑$) increases from $8/255$ to $128/255$, DeiT-S's robust accuracy drops from 67.23% to 6.25% under $L_∞$ constraint, while ResNet-50 remains relatively stable.
- The robustness ranking between ViTs and CNNs is not fixed but depends critically on perturbation density and strength, with ViTs becoming more vulnerable as these factors increase.
- Even adversarially trained ViTs and CNNs are successfully fooled by Patch-Fool, indicating that standard adversarial training does not fully mitigate this patch-level vulnerability.
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.