NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Instance-Specific Augmentations by Capturing Local Invariances

Ning Miao, Tom Rainforth, Emile Mathieu, Yann Dubois, Yee Whye Teh, Adam Foster, Hyunjik Kim

Introduction

Data augmentation is a cornerstone of modern deep learning, improving model generalization by exposing networks to variations of training data. However, standard augmentation techniques apply the same "global" transformation distribution to every image in a dataset.

This approach harbors a fundamental flaw: invariances are often instance-specific. For example, a yellow leaf can be color-jittered to green without changing its identity, but color-jittering a yellow lemon to green turns it into a lime, crossing a class boundary. Similarly, cropping a patch of grass from a background is safe, but cropping a patch of a cow might leave only grass, destroying the label. To avoid these "label-destroying" errors, global augmentation schemes must remain conservative, limiting their overall effectiveness.

To address this, researchers introduce InstaAug, a novel framework that moves away from "one-size-fits-all" data augmentation by learning to tailor transformations to individual images. By capturing "local invariances"—transformations that preserve the identity of a specific input but might be harmful to others—InstaAug significantly boosts performance in both supervised and self-supervised learning tasks.

The InstaAug Framework

InstaAug replaces fixed augmentation distributions with a learnable invariance module ($\phi$). Instead of applying a static set of rules, this module takes an input image $x$ and predicts the parameters for a tailored transformation distribution $p(\tau; \phi(x))$.

Key technical components of the framework include:

  • The Objective Function: The model is trained to minimize the downstream task loss (such as cross-entropy) while simultaneously maximizing the entropy (diversity) of the transformations. This forces the module to discover the widest possible range of augmentations that do not degrade the model's ability to predict the correct label.
  • Dynamic $\lambda$ Tuning: To balance accuracy and diversity, the framework employs an automatically tuned weight ($\lambda$) for the entropy term. This prevents augmentations from becoming too extreme early in training when the classifier is still weak.
  • Location-Related Parameterization (LRP): For complex spatial augmentations like cropping, simply predicting coordinates can be unstable. InstaAug utilizes a novel LRP using a Convolutional Neural Network (CNN) where different layers and units represent potential crop patches based on their receptive fields. This structural bias makes learning spatial augmentations significantly more effective.

Key Insights

  • Local vs. Global Invariance: The core realization of InstaAug is that global augmentations are inherently a compromise. By making augmentations input-dependent, the model can be aggressive where it is safe (e.g., rotating a perfectly symmetric object) and conservative where it is risky.
  • Information Preservation: The training objective naturally encourages the module to preserve "salient" information. If a transformation destroys features necessary for classification, the task loss increases, teaching the invariance module to avoid that specific transformation for that specific image.
  • Transferability: Interestingly, an invariance module trained on one architecture (such as ResNet-50) can be "plugged into" a completely different architecture (like an XCiT transformer) to improve its performance. This indicates that InstaAug learns fundamental properties of the data distribution rather than just adapting to a specific model's quirks.

Experimental Results

The framework was evaluated across several benchmarks, demonstrating strong performance in multiple paradigms:

  • Supervised Learning: On Tiny-ImageNet, InstaAug achieved 66.02% accuracy, outperforming standard random cropping (64.49%) and previous learned global methods like Augerino (55.02%).
  • Contrastive Learning: When integrated with SimCLR on Tiny-ImageNet, InstaAug improved representation quality, reaching 55.05% linear probe accuracy compared to 51.63% for standard random cropping.
  • Test-Time Augmentation (TTA): Applying a learned InstaAug module to a fixed, pre-trained ResNet-50 on the full ImageNet dataset boosted accuracy from 80.43% to 81.18%. Notably, standard random cropping actually decreased performance in this same TTA setting.
  • Robustness: Evaluated on RawFooT (a texture dataset with 68 food samples under 46 different lighting conditions), InstaAug demonstrated superior out-of-distribution generalization, successfully handling lighting conditions drastically different from the training set.

Limitations and Future Directions

While InstaAug presents a significant step forward, the authors note a few limitations. First, although $\lambda$ is tuned dynamically, the entropy bounds ($H_{min}$ and $H_{max}$) still require manual tuning. Second, the invariance module adds a slight computational overhead to the training process.

Currently, the study focuses on rotation, color jittering, and cropping in computer vision. Extending this framework to more complex, non-linear transformations, or to domains like Natural Language Processing (NLP) and audio—where invariances are highly context-dependent—remains a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{miao2023learning,
  author = {Ning Miao and Tom Rainforth and Emile Mathieu and Yann Dubois and Yee Whye Teh and Adam Foster and Hyunjik Kim},
  title = {{Learning Instance-Specific Augmentations by Capturing Local Invariances}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=7W1uE3BjPO},
}
Figure