TL;DR
Test-Time Augmentation (TTA) typically averages predictions across multiple data augmentations uniformly, which can degrade performance if some augmentations introduce unwanted noise. This paper introduces VB-TTA, a framework that formalizes TTA as a Bayesian mixture model and uses Variational Bayes to automatically learn optimal weights for each augmentation. This approach suppresses harmful augmentations and significantly boosts model robustness, especially in noisy training environments.
What Problem Does This Paper Address?
Data augmentation is a staple for training robust machine learning models, but applying it at test time—Test-Time Augmentation (TTA)—has also proven highly effective for correcting model predictions. Traditionally, TTA treats all augmentations equally, simply averaging their outputs.
However, different augmentations (like rotation, adding Gaussian noise, or Mixup) contribute differently to performance depending on the input data. Crucially, determining which augmentations to keep or discard is notoriously difficult; an augmentation that performs poorly on its own might actually improve overall accuracy when combined with others. This challenge is amplified in real-world scenarios where training labels are noisy or inconsistent (e.g., due to crowdsourcing errors or ambiguous data).
Methods
The authors reframe the TTA procedure as a Bayesian mixture model. They assume that transformed instances from each data augmentation method represent a perturbation around the original test instance, drawn from a specific probability distribution.
The paper provides two distinct mathematical formulations:
- Continuous Case (Regression): Modeled using Gaussian distributions where the mapping of a given data augmentation is assumed to be normally distributed around the original instance.
- Categorical Case (Classification): Formulated using a latent variable multinomial probit model to handle discrete class labels cleanly.
To optimize the weighting coefficients ($w_k$) for each augmentation without dealing with analytically intractable marginalizations, the authors leverage Automatic Differentiation Variational Inference (ADVI) via PyMC. By maximizing the Evidence Lower Bound (ELBO), the framework automatically downweights or suppresses noisy, unhelpful augmentations while upweighting beneficial ones during the test phase.
Datasets
The framework was evaluated on both synthetic and real-world datasets:
- Artificial Data: Synthetic datasets generated with Gaussian and Gamma distributions to test the core mathematical assumptions of the perturbation model.
- CIFAR-10 N: A variant of the classic CIFAR-10 dataset containing real-world noisy human annotations collected from Amazon Mechanical Turk.
- Food-101: A large-scale dataset of 101 food categories where the training set contains natural label noise, while the test set is manually cleaned.
- UTKFace: A dataset of over 24,000 face images annotated by age, modified with artificial label noise ($\mathcal{N}(y, 5)$) to simulate a noisy regression environment.
Key Insights and Ideas
- The Sum is Greater Than the Parts: Individual performance is a poor metric for filtering augmentations. Preliminary experiments on MNIST showed that while rotation augmentations performed poorly on their own, completely removing them degraded the performance of the overall TTA ensemble.
- Principled Suppression: Instead of relying on ad-hoc heuristics or expensive validation-set meta-learning to select augmentations, maximizing the marginal log-likelihood via Variational Bayes naturally suppresses unwanted or overly noisy augmentations by driving their weights toward zero.
- Data Density Matters: The Gaussian perturbation assumption holds best when the test input lies close to the mean of the training data distribution. Performance behaves optimally in these high-density regions.
Key Results
- Outperforming Uniform TTA: Across all real-world datasets, VB-TTA consistently outperformed standard uniformly weighted TTA. For instance, on CIFAR-10 N, 6-VB-TTA (combining Mixup and CutMix) achieved an accuracy of 0.929 compared to 0.909 for standard 6-TTA.
- Scalability with Augmentations: In standard TTA, adding more candidate augmentations ($K$) can sometimes hurt performance if the new candidates are noisy. In contrast, for VB-TTA, a larger pool of candidate augmentations led to better final performance because the optimization process could selectively exploit the best combinations.
- Variance Reduction: Optimizing the weights significantly reduced the variance of the model's estimations, leading to more stable and reliable predictions during inference.
Limitations and Future Work
- Gaussian Prior Assumption: The current mathematical formulation assumes that augmented instances follow a Gaussian distribution. However, advanced techniques like Mixup and CutMix can induce highly non-Gaussian, multi-modal distributions. Exploring non-Gaussian priors is a key next step.
- Tighter Variational Bounds: The authors suggest that leveraging recent advancements in variational inference to tighten the lower bounds could further improve weight optimization efficiency.
- Distribution Shift: Future work will explore how VB-TTA handles scenarios involving severe covariate or distribution shifts between training and testing data, moving beyond label noise alone.
Summary updated