Introduction
While Convolutional Neural Networks (CNNs) have long been the standard for computer vision, they often exhibit brittleness, relying heavily on local textures rather than global shapes. This makes them sensitive to occlusions, noise, and domain shifts. Vision Transformers (ViTs) have emerged as a powerful alternative, but their fundamental processing mechanisms remain a subject of intense study. This paper investigates whether ViTs process visual information in a fundamentally different—and potentially more robust—way than CNNs, particularly in safety-critical scenarios.
Methodology
The researchers systematically compared three ViT families (ViT, DeiT, and T2T) against high-performing CNNs like ResNet. The evaluation utilized 15 diverse datasets ranging from large-scale benchmarks like ImageNet to fine-grained classification tasks like CUB (birds) and GTSRB (traffic signs).
Key experimental setups included:
- PatchDrop: A strategy to test occlusion robustness by masking out random, salient (foreground), or non-salient (background) image patches.
- Shape Distillation: A dedicated "shape token" was introduced into the Transformer architecture, using a CNN trained on stylized images as a "teacher" to instill shape-biased knowledge.
- Feature Ensembling: "Class tokens" from multiple transformer blocks were combined to create robust feature representations for transfer learning.
- Permutation Analysis: Image patches were shuffled at different grid sizes to evaluate the model's reliance on spatial order versus patch content.
Key Insights
Dynamic Receptive Fields and Shape Bias
Unlike the fixed-size filters of CNNs, ViTs leverage self-attention to create "dynamic receptive fields." This allows later layers to automatically shift attention to remaining visible patches when parts of an image are occluded. Furthermore, while CNNs are "texture-biased," ViTs exhibit a significant "shape-bias," behaving more like the human visual system.
Automated Segmentation and Spatial Robustness
An intriguing byproduct of this shape-bias is that ViT attention maps naturally highlight object boundaries, enabling accurate semantic segmentation without pixel-level labels. Additionally, ViTs proved surprisingly robust to patch shuffling (permutation), suggesting they can perform reasonably well by analyzing the collection of patches even when spatial structure is disturbed.
Key Results
- Extreme Occlusion Robustness: In scenarios where 80% of an image is randomly occluded, standard CNN accuracy drops to near zero. Conversely, ViTs like DeiT-B maintain nearly 60% top-1 accuracy on ImageNet.
- Superior Transfer Learning: Ensembling off-the-shelf features from a single ViT model consistently outperformed CNNs in few-shot and fine-grained classification tasks.
- Adversarial Resilience: ViTs demonstrated higher robustness to adversarial patches compared to their CNN counterparts.
- The Robustness Trade-off: While shape-distilled models excel at recognizing objects in stylized domains (sketches/paintings), they may become more vulnerable to standard corruptions like blur or noise, mirroring trade-offs observed in CNN research.
Conclusion and Future Work
ViTs represent a significant shift in visual processing, offering remarkable resilience to occlusion and a human-like focus on global shape. Future research may focus on balancing shape-bias with adversarial robustness and integrating these findings with self-supervised frameworks like DINO to further enhance automated segmentation capabilities.
Summary updated