Abstract
While Vision Transformers (ViTs) have matched or exceeded Convolutional Neural Networks (CNNs) in standard accuracy benchmarks, their performance under distribution shift and adversarial conditions is less understood. This paper demonstrates that ViTs are significantly more robust than state-of-the-art CNNs across a wide range of corruptions and perturbations. We attribute this robustness to the self-attention mechanism, which promotes smoother loss landscapes and reduced sensitivity to high-frequency noise.
Introduction
Deep learning models often suffer from "brittleness," where minor image corruptions—such as blur, noise, or slight rotations—lead to catastrophic failures. While CNNs have dominated computer vision, the emergence of Vision Transformers (ViTs) offers a fundamentally different architectural paradigm. This study investigates whether the shift from local convolutions to global self-attention inherently improves model robustness beyond simple accuracy gains.
Methodology
We conduct a comprehensive comparison between ViT and Big-Transfer (BiT), a scaled-up ResNet variant representing the state-of-the-art in CNNs. To ensure parity, models are compared across similar parameter counts and pre-training datasets (e.g., ImageNet-21k). Robustness is evaluated using a suite of specialized datasets:
- ImageNet-C & -P: Common algorithmic corruptions (blur, noise) and perturbations (rotations, shifts).
- ImageNet-R & -O: Semantic shifts (sketches, renditions) and out-of-distribution detection.
- ImageNet-A: "Natural" adversarial examples that specifically fool standard models.
Architectural Insights
The superior robustness of ViTs stems from several key architectural properties identified through spectral and landscape analysis:
- Global Receptive Fields: Unlike the fixed, local receptive fields of CNNs, ViT's self-attention allows even the earliest layers to integrate information from across the entire image. This "contextual awareness" makes them less likely to be fooled by local distortions.
- Frequency Resilience: CNNs are highly sensitive to high-frequency artifacts (fine-grained noise). ViTs show a much lower error rate when high-frequency noise is introduced, suggesting they rely on more stable, low-frequency structural features.
- Optimization Stability: Loss landscape visualizations show that ViTs possess a significantly smoother optimization surface compared to BiT. Under adversarial attacks (e.g., PGD), the loss for ViTs increases more gradually, indicating a more stable decision boundary.
Experimental Results
ViTs consistently outperform BiT across nearly all robustness benchmarks. As shown in the comparison of common corruptions, ViT models maintain higher accuracy across various scales.
The most striking performance gap is observed on ImageNet-A. The ViT L-16 model achieves a top-1 accuracy of 28.10%, which is 4.3x higher than the comparable BiT r101x1 model (6.41%). This suggests that the self-attention mechanism is far more effective at handling the "natural" adversarial features that plague convolutional architectures.
Furthermore, ViTs show remarkable resilience to information loss. In masking experiments using "Cutout," ViT maintained 60.4% accuracy when 50% of the image was removed, compared to 52% for the equivalent BiT model.
Conclusion
Vision Transformers are not just high-accuracy models; they are inherently more robust learners than traditional CNNs. Their ability to leverage global context and maintain stability against high-frequency perturbations makes them ideal candidates for safety-critical applications. While ViTs currently lag slightly in background-specific robustness (ImageNet-9), their overall resilience to corruptions and adversarial shifts marks a significant step forward for reliable computer vision.
Summary updated