AutoMix: Unveiling the Power of Mixup for Stronger Classifiers

Zicheng Liu, Siyuan Li, Di Wu, Zihan Liu, Zhiyuan Chen, Lirong Wu, Stan Z. Li

Abstract

Data mixing augmentation have proved to be effective in improving the generalization ability of deep neural networks. While early methods mix samples by hand-crafted policies (e.g., linear interpolation), recent methods utilize saliency information to match the mixed samples and labels via complex offline optimization. However, there arises a trade-off between precise mixing policies and optimization complexity. To address this challenge, we propose a novel automatic mixup (AutoMix) framework, where the mixup policy is parameterized and serves the ultimate classification goal directly. Specifically, AutoMix reformulates the mixup classification into two sub-tasks (i.e., mixed sample generation and mixup classification) with corresponding sub-networks and solves them in a bi-level optimization framework. For the generation, a learnable lightweight mixup generator, Mix Block, is designed to generate mixed samples by modeling patch-wise relationships under the direct supervision of the corresponding mixed labels. To prevent the degradation and instability of bi-level optimization, we further introduce a momentum pipeline to train AutoMix in an end-to-end manner. Extensive experiments on nine image benchmarks prove the superiority of AutoMix compared with state-of-the-art in various classification scenarios and downstream tasks.

Introduction

Data mixing techniques, such as Mixup and CutMix, have become essential tools for regularizing Deep Neural Networks (DNNs). Despite their success, existing methods face a significant trade-off. Hand-crafted methods, while computationally efficient, often suffer from label mismatch when discriminative object parts are obscured. Conversely, optimization-based methods like PuzzleMix improve semantic alignment using saliency information but introduce high computational complexity, making them difficult to integrate into standard training pipelines.

AutoMix addresses these issues by transforming mixup into a learnable, end-to-end framework. By parameterizing the mixing policy, the model learns to generate semantically aligned samples that directly optimize the final classification objective.

Methodology

AutoMix reformulates the mixup process as a bi-level optimization problem consisting of two primary components: mixed sample generation and mixup classification.

Conceptual comparison between traditional handcrafted mixup and the learnable AutoMix framework.

The Mix Block (MB)

At the core of AutoMix is the Mix Block, a lightweight module that replaces fixed mathematical mixing formulas. It utilizes a cross-attention mechanism on intermediate feature maps from a pair of images to identify discriminative pixels. The block then generates a pixel-wise mask that determines the optimal combination of the two inputs. By embedding the mixing ratio $\lambda$ into the feature maps, the generated mask remains consistent with the target label.

The Momentum Pipeline (MP)

To overcome the "gradient entanglement" problem—where simultaneous training of the generator and classifier leads to instability—AutoMix employs a momentum-based teacher-student framework. The Student Network is updated via standard backpropagation, while the Teacher Network is maintained as an Exponential Moving Average (EMA) of the student. This provides stable, "frozen" feature maps to the Mix Block, decoupling the generation task from the student's rapid gradient fluctuations and preventing collapse into trivial solutions.

Results and Discussion

AutoMix was evaluated across nine diverse benchmarks, ranging from small-scale datasets like CIFAR-10 to large-scale challenges like ImageNet-1k and long-tail scenarios like iNaturalist.

AutoMix achieves superior Top-1 accuracy with competitive training time compared to state-of-the-art methods, alongside visual examples of mixed samples.

Performance and Efficiency

AutoMix consistently outperforms state-of-the-art methods. On ImageNet-1k using a ResNet-101, it achieved a top-1 accuracy of 80.89%, a substantial improvement over the 78.71% baseline. Crucially, as shown in the performance analysis, AutoMix maintains a favorable accuracy-to-training-time ratio. Unlike saliency-based methods that significantly increase training overhead, AutoMix adds minimal cost during training and zero cost during inference, as the Mix Block is discarded post-training.

Robustness and Calibration

The framework also enhances model reliability. AutoMix demonstrated superior resilience to image corruptions and adversarial attacks. Furthermore, it significantly improved model calibration, reducing the Expected Calibration Error (ECE) from 18.1% in vanilla models to just 2.3%, ensuring that confidence scores are more representative of actual performance.

Conclusion

AutoMix successfully bridges the gap between efficient hand-crafted mixup and precise optimization-based methods. By treating mixup as a learnable auxiliary task, it provides a robust and efficient way to boost DNN performance. Future work may explore extending this automatic mixing logic to non-visual domains such as NLP and audio processing, as well as refining hyperparameter selection for non-convolutional architectures.

Summary updated

BibTeX
@misc{liu2021automix,
  author = {Zicheng Liu and Siyuan Li and Di Wu and Zihan Liu and Zhiyuan Chen and Lirong Wu and Stan Z. Li},
  title = {{AutoMix: Unveiling the Power of Mixup for Stronger Classifiers}},
  year = {2021},
  eprint = {2103.13027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.13027},
}
Figure