Introduction
Self-supervised learning (SSL) has become a cornerstone of modern computer vision, enabling models to learn powerful representations from unlabeled data. Methods like SimCLR and MoCo achieve this by enforcing invariance to various data augmentations. However, a fundamental limitation persists: the optimal set of invariances is task-dependent. While object recognition benefits from ignoring orientation, tasks like pose estimation or facial landmark detection require precise spatial sensitivity. Traditionally, resolving this conflict required training separate models for different tasks—a computationally prohibitive requirement.
Presented at ICLR 2023, "Amortised Invariance Learning for Contrastive Self-Supervision" introduces a novel framework to address this "one-size-fits-all" problem. The authors propose a method to pre-train a single neural network capable of adapting its invariance properties to diverse downstream requirements without retraining the entire backbone.
The Challenge of Static Invariance
In contrastive SSL, models are trained to recognize that an image and its augmented version (e.g., cropped, flipped, or color-jittered) represent the same underlying concept. This process builds invariance to those specific transformations. However, invariance is a double-edged sword. A model trained to be invariant to rotation will struggle to predict the angle of an object, as the features necessary for that prediction have been intentionally discarded during pre-training.
The authors ask: How can we learn a single representation that efficiently supports a set of downstream tasks with conflicting invariance requirements?
Methodology: Amortised Invariance Learning (AIL)
The core innovation is the parameterization of the feature extractor $h(x; i)$ with an invariance descriptor $i$. This descriptor acts as a "dial" that adjusts the model's sensitivity to specific transformations.
1. The Invariance Descriptor
The descriptor $i$ is a vector where each element corresponds to a specific augmentation (e.g., horizontal flip, color jitter, rotation). During pre-training, the model is exposed to various combinations of these augmentations, learning to associate specific descriptor values with the corresponding level of invariance. Even though trained on discrete bits, the model learns a continuous "manifold" of features, allowing for smooth interpolation between being fully invariant and fully sensitive at test time.
2. Architectural Implementations
The authors explore two primary architectures to implement this conditioning:
- Hyper-ResNets: For convolutional neural networks (CNNs), the authors utilize a Hypernetwork—a secondary network that generates the weights for a primary ResNet50 based on the invariance descriptor. To ensure scalability, they developed a "single forward-pass" variant that makes training on large-scale datasets like ImageNet-1k feasible.
- Prompt-ViTs: For Vision Transformers (ViTs), the framework employs prompt learning. The invariance descriptor is embedded into "invariance tokens" that are prepended to the image tokens. These tokens guide the transformer's attention mechanism to focus on or ignore specific features based on the desired invariance profile.
3. Downstream Adaptation
When transitioning to a new task, the backbone weights are frozen. Instead of merely training a linear classification or regression head, the model performs gradient descent on the invariance descriptor $i$. This allows the model to "discover" the optimal set of inductive biases for the specific task at hand.
Experimental Results
The authors conducted extensive evaluations across vision and audio modalities, demonstrating the versatility of the AIL framework.
Spatial and Regression Tasks
The most significant gains were observed in spatially sensitive tasks where standard SSL models typically fail. On the CelebA dataset, the amortised model achieved a +21% improvement in $R^2$ score compared to a standard MoCo baseline. This suggests that the model successfully "dialed down" its learned invariances to preserve the spatial information necessary for landmark detection.
Few-Shot Learning
In scenarios with limited labeled data, selecting the correct inductive bias is critical. The AI-MoCo model consistently outperformed baselines across various few-shot benchmarks (CIFAR, Caltech101, etc.), ranking first in overall performance.
Audio Modality
The framework's effectiveness extends beyond vision. In audio tasks using the FSD50K dataset, the method outperformed conventional SimCLR on speaker identification (VoxCeleb) and instrument classification (NSynth), proving that the concept of tunable invariance is a general principle of representation learning.
Discussion and Limitations
While AIL offers significant flexibility, it comes with trade-offs:
- Computational Cost: Pre-training the "Swiss Army knife" model is more intensive than training a standard backbone, requiring approximately 1.7x to 3x the GPU resources.
- Memory Requirements: Hypernetworks, in particular, introduce additional memory overhead during the training phase.
- Scope of Invariance: The model's adaptability is limited to the suite of augmentations encountered during pre-training. It cannot automatically adapt to entirely novel types of noise or transformations not represented in the initial descriptor.
Conclusion
Amortised Invariance Learning represents a significant step toward general-purpose visual representations. By moving away from static, "one-size-fits-all" models and toward architectures that can dynamically adjust their inductive biases, the authors provide a pathway for more efficient and versatile AI systems. This approach is particularly promising for specialized fields like medical imaging or scientific analysis, where the optimal invariances are often unknown or highly specific.
Summary updated