[Paper Review] Understanding and Improving Robustness of Vision Transformers through Patch-based Negative Augmentation
This paper identifies that Vision Transformers (ViTs) rely on non-robust, patch-based features that survive semantic-destroying transformations yet are not indicative of true class semantics. By introducing patch-based negative augmentations—transformations that disrupt spatial and semantic structure—the authors regularize ViTs to avoid these features, significantly improving out-of-distribution robustness without sacrificing in-distribution accuracy across 20+ settings.
We investigate the robustness of vision transformers (ViTs) through the lens of their special patch-based architectural structure, i.e., they process an image as a sequence of image patches. We find that ViTs are surprisingly insensitive to patch-based transformations, even when the transformation largely destroys the original semantics and makes the image unrecognizable by humans. This indicates that ViTs heavily use features that survived such transformations but are generally not indicative of the semantic class to humans. Further investigations show that these features are useful but non-robust, as ViTs trained on them can achieve high in-distribution accuracy, but break down under distribution shifts. From this understanding, we ask: can training the model to rely less on these features improve ViT robustness and out-of-distribution performance? We use the images transformed with our patch-based operations as negatively augmented views and offer losses to regularize the training away from using non-robust features. This is a complementary view to existing research that mostly focuses on augmenting inputs with semantic-preserving transformations to enforce models' invariance. We show that patch-based negative augmentation consistently improves robustness of ViTs across a wide set of ImageNet based robustness benchmarks. Furthermore, we find our patch-based negative augmentation are complementary to traditional (positive) data augmentation, and together boost the performance further.
Motivation & Objective
- To investigate why Vision Transformers (ViTs) remain vulnerable to distribution shift despite their global attention mechanisms.
- To identify and analyze non-robust features in ViTs that persist under patch-based transformations that destroy semantic meaning.
- To develop a training regularization method that reduces ViT reliance on such non-robust features to improve generalization under distribution shift.
- To demonstrate that patch-based negative augmentation is complementary to existing positive data augmentation and contrastive learning techniques.
- To provide a new framework for diagnosing and mitigating robustness failures in ViTs through targeted, semantic-destroying transformations.
Proposed method
- Design and apply patch-based transformations—such as random patch rotation, shuffling, and background infilling—that destroy spatial and semantic relationships but preserve local patch statistics.
- Use the transformed images as negatively augmented views during training, encouraging the model to produce representations distinct from the original input.
- Introduce a contrastive loss that treats the original image and its patch-based transformed version as positive and negative pairs, respectively, to regularize the model away from non-robust features.
- Combine the proposed negative augmentation with standard positive data augmentation (e.g., mixup, Cutout) and batch-based negative examples in contrastive learning for improved robustness.
- Train ViTs using standard supervised learning with the new loss objective, ensuring no architectural changes or additional inference cost.
- Evaluate robustness on standard ImageNet-based benchmarks, including ImageNet-R, ImageNet-A, and ImageNet-V2, under distribution shift.
Experimental results
Research questions
- RQ1Why do Vision Transformers remain vulnerable to distribution shift despite their global attention mechanism?
- RQ2What specific types of features do ViTs rely on that are non-robust under patch-based transformations?
- RQ3Can training with patch-based negative augmentations reduce reliance on non-robust features and improve out-of-distribution generalization?
- RQ4How does patch-based negative augmentation compare to or complement existing positive data augmentation and contrastive learning methods?
- RQ5Can the proposed method improve robustness without degrading in-distribution accuracy on standard benchmarks?
Key findings
- ViTs exhibit high in-distribution accuracy but fail significantly on robustness benchmarks when tested with patch-based transformations that destroy semantic content.
- The features ViTs rely on after patch-based transformations are useful for in-distribution performance but are non-robust, as they do not correspond to human-understandable semantic cues.
- Patch-based negative augmentation consistently improves ViT robustness across 20+ experimental settings on ImageNet-based robustness benchmarks, including ImageNet-R, ImageNet-A, and ImageNet-V2.
- The method improves robustness even when combined with standard positive data augmentation and batch-based negative examples in contrastive learning, demonstrating complementary gains.
- The proposed approach maintains or slightly improves in-distribution accuracy while significantly reducing reliance on non-robust features, as confirmed by attention visualization and feature attribution analysis.
- The study reveals that ViTs can attend to objects but still fail to generalize when predictions depend on non-robust, patch-level artifacts rather than global semantic structure.
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.