Using Mixup as a Regularizer Can Surprisingly Improve Accuracy & Out-of-Distribution Robustness

Francesco Pinto, Harry Yang, Ser-Nam Lim, Philip Torr, Puneet K. DokaniaNeurIPS 2022

Deep learning models are notoriously brittle when deployed in the real world. They often struggle with covariate shift (when test data is corrupted or stylistically different from training data) and Out-of-Distribution (OOD) data (when the model is fed completely unseen classes it should ideally reject).

To combat this, researchers frequently rely on Mixup, a popular data augmentation technique that trains models on convex combinations of pairs of images and their labels. While Mixup is fantastic for improving accuracy and covariate shift robustness, it harbors a glaring flaw: it severely degrades OOD detection.

This paper introduces RegMixup, a simple fix that shifts Mixup from being the sole learning objective to acting as a regularizer alongside the standard cross-entropy loss on clean data. This minor tweak allows the model to maintain high confidence on clean data while learning to be uncertain on heavily mixed (OOD-like) samples, significantly boosting accuracy, covariate shift robustness, and OOD detection.

The Problem with Standard Mixup

Because standard Mixup replaces the standard training data with mixed data, the model never actually sees clean, unmixed images during training. Consequently, it learns to output high-entropy (uncertain) predictions for almost everything.

If a model is uniformly uncertain about both familiar in-distribution data and weird OOD data, it becomes impossible to set a confidence threshold to reliably detect and reject OOD inputs. The model essentially loses its ability to distinguish between what it knows and what it doesn't.

The RegMixup Solution

The authors propose a remarkably simple solution: explicitly combine training on mixed samples (Vicinal Risk Minimization) with standard training on clean samples (Empirical Risk Minimization).

The RegMixup loss function is straightforward: Loss = CrossEntropy(clean_image) + η * CrossEntropy(mixed_image)

Comparison of standard Mixup and RegMixup training paradigms.

This addition fundamentally changes how the model utilizes the Mixup hyperparameter $\alpha$, which controls the Beta distribution used to mix images:

  • Standard Mixup uses a small $\alpha$ (e.g., 0.1 or 0.2), meaning it only slightly perturbs one image with another ($\lambda \approx 0$ or $1$). It must do this; otherwise, the model would never learn the original data distribution.
  • RegMixup cross-validates to a massive $\alpha$ (e.g., 10). Because the model is already learning the true distribution from the clean data loss, the Mixup branch is free to generate heavily mixed, 50/50 blended images ($\lambda \approx 0.5$).

Why it Works: The "Entropy Barrier"

By training on clean data (which pushes the model to be confident) and heavily mixed data (which pushes the model to output 50/50, high-entropy predictions), RegMixup naturally builds an "entropy barrier."

Heavily mixed images look like visual garbage, acting as a fantastic "soft proxy" for OOD data. By forcing the model to output uniform probabilities for these weird inputs, RegMixup explicitly teaches the model how to say "I don't know." The model remains highly confident on normal data but becomes highly uncertain on anything that looks mixed or out-of-distribution.

Key Results

The authors evaluated RegMixup across a comprehensive suite of vision benchmarks, including CIFAR-10/100, ImageNet-1K, and various corrupted and OOD datasets (like SVHN and Tiny-ImageNet). RegMixup consistently outperforms vanilla neural networks (DNNs), standard Mixup, and often even computationally expensive Deep Ensembles.

Performance comparison across accuracy, covariate shift, and OOD detection.
  • Fixing OOD Detection: RegMixup successfully repairs Mixup's fatal flaw. On CIFAR-10 tested against SVHN as OOD data, RegMixup achieves a 96.72% AUROC, crushing standard Mixup's dismal 87.53%.
  • Covariate Shift Robustness: On CIFAR-100-C (synthetic corruptions), RegMixup improves accuracy by 6.9% over a vanilla DNN, 2.45% over standard Mixup, and even beats Deep Ensembles by 3.86%.
  • ImageNet Scale: The approach scales beautifully. On ImageNet-1K, RegMixup outperforms Mixup, AugMix, and DNNs on clean accuracy, covariate shift, and OOD detection, proving it isn't just a toy-dataset phenomenon.
  • Efficiency: RegMixup achieves ensemble-like reliability using a single, deterministic model, meaning inference costs are identical to a standard network.

Limitations and Future Work

The primary limitation of RegMixup is its training cost. Because it processes both clean and mixed samples in each pass, training is roughly 1.5× slower than a vanilla DNN and 1.2× slower than standard Mixup. However, inference time remains completely unchanged, making it highly practical for deployment.

Future directions suggested by the authors include applying this "explicit ERM + VRM" philosophy to other augmentation techniques like CutMix or label smoothing, exploring bi-modal vicinal distributions, and testing the approach on Vision Transformers (ViTs).

Summary updated

BibTeX
@inproceedings{pinto2022using,
  author = {Francesco Pinto and Harry Yang and Ser-Nam Lim and Philip Torr and Puneet K. Dokania},
  title = {{Using Mixup as a Regularizer Can Surprisingly Improve Accuracy \& Out-of-Distribution Robustness}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=5j6fWcPccO},
}
Figure