Abstract
To perform well on unseen and potentially out-of-distribution samples, it is desirable for machine learning models to have a predictable response with respect to transformations affecting the factors of variation of the input. Here, we study the relative importance of several types of inductive biases towards such predictable behavior: the choice of data, their augmentations, and model architectures. Invariance is commonly achieved through hand-engineered data augmentation, but do standard data augmentations address transformations that explain variations in real data? While prior work has focused on synthetic data, we attempt here to characterize the factors of variation in a real dataset, ImageNet, and study the invariance of both standard residual networks and the recently proposed vision transformer with respect to changes in these factors. We show standard augmentation relies on a precise combination of translation and scale, with translation recapturing most of the performance improvement -- despite the (approximate) translation invariance built in to convolutional architectures, such as residual networks. In fact, we found that scale and translation invariance was similar across residual networks and vision transformer models despite their markedly different architectural inductive biases. We show the training data itself is the main source of invariance, and that data augmentation only further increases the learned invariances. Notably, the invariances learned during training align with the ImageNet factors of variation we found. Finally, we find that the main factors of variation in ImageNet mostly relate to appearance and are specific to each class.
Introduction: The Nature vs. Nurture of Model Invariance
A fundamental goal in computer vision is developing models capable of ignoring "nuisance" variations—such as shifts in position or lighting—that do not alter an object's identity. Traditionally, this invariance has been pursued through three primary avenues: architectural inductive biases (e.g., the translation invariance of CNNs), data augmentation, and direct learning from the statistical regularities of the training data.
This research, presented at NeurIPS 2021, re-evaluates these paths by dissecting standard training recipes on ImageNet. The authors challenge the conventional wisdom that architectural "nature" is the dominant source of invariance, suggesting instead that invariance is primarily "nurtured" by the data itself.
Methodology: Dissecting Augmentation and Invariance
To isolate the drivers of performance and invariance, the researchers employed several novel analytical techniques:
- Augmentation Decomposition: The ubiquitous Random Resized Crop (RRC) was broken down into its constituent translation and scale components to determine which transformation drives accuracy gains.
- Invariance Quantification: A metric was developed to measure the cosine distance between embeddings of original and transformed images, normalized against random image pairs to provide a clear signal of learned invariance.
- Cross-Architecture Benchmarking: The study compared ResNet18 (possessing architectural translation bias) against Vision Transformers (ViT), which lack such constraints, to see how they discover symmetries from data.
- Natural Factor Discovery: Using similarity searches, the authors identified which transformations (from the AutoAugment suite) most effectively align different images of the same class in embedding space.
Key Insights: Data as the Primary Teacher
The study reveals that the training data itself is the most potent source of invariance. Surprisingly, trained ViTs—despite having no built-in translation invariance—often exhibit higher translation invariance than trained ResNets. This suggests that the signal within the data is strong enough to override architectural differences.
Furthermore, the success of standard augmentations like RRC is driven almost entirely by translation. In experiments, ResNet18 models trained with only translation augmentation achieved 69.14% Top-1 accuracy, nearly matching the 70.05% achieved with full RRC, while scale-only augmentation lagged significantly.
Another critical finding is that invariance is selective. Training increases invariance for transformations present in the data (like translation and brightness) but can actually decrease it for transformations that are informative for classification, such as extreme rotation or shearing. This indicates that models learn to preserve features that distinguish classes in the specific context of the dataset.
Results and Class-Specific Variations
The research highlights that factors of variation are not universal across ImageNet. While geometric transformations are often the focus of research, the authors found that 78% of the top factors of variation in ImageNet are actually appearance-based (color, contrast, brightness).
Moreover, these factors are highly class-specific. For instance, rotation is a major factor for textile classes like "velvet" where orientation is arbitrary, but it is detrimental for classes with fixed orientations like "houses." For approximately 12% of ImageNet classes, standard RRC augmentation actually harmed performance, sometimes by as much as 22%, suggesting that "one-size-fits-all" augmentation strategies are sub-optimal.
Conclusion and Future Directions
The findings suggest a shift in focus from architectural engineering toward data-centric approaches. The alignment between learned invariances and natural factors of variation in ImageNet points toward per-class data augmentation as a promising frontier. By tailoring augmentations to the specific ways different objects vary in the real world—moving beyond simple geometric shifts to more complex appearance-based transformations—we can build more robust and accurate vision systems.
Summary updated