Abstract
Techniques combining multiple images as input/output have proven to be effective data augmentations for training convolutional neural networks. In this paper, we present StackMix: each input is presented as a concatenation of two images, and the label is the mean of the two one-hot labels. On its own, StackMix rivals other widely used methods in the "Mix" line of work. More importantly, unlike previous work, significant gains across a variety of benchmarks are achieved by combining StackMix with existing Mix augmentation, effectively mixing more than two images. E.g., by combining StackMix with CutMix, test error in the supervised setting is improved across a variety of settings over CutMix, including 0.8% on ImageNet, 3% on Tiny ImageNet, 2% on CIFAR-100, 0.5% on CIFAR-10, and 1.5% on STL-10. Similar results are achieved with Mixup. We further show that gains hold for robustness to common input corruptions and perturbations at varying severities with a 0.7% improvement on CIFAR-100-C, by combining StackMix with AugMix over AugMix. On its own, improvements with StackMix hold across different number of labeled samples on CIFAR-100, maintaining approximately a 2% gap in test accuracy—down to using only 5% of the whole dataset—and is effective in the semi-supervised setting with a 2% improvement with the standard benchmark $\Pi$-model. Finally, we perform an extensive ablation study to better understand the proposed methodology.
Introduction
Training deep convolutional neural networks (CNNs) requires massive amounts of data to generalize effectively. Data augmentation—the creation of synthetic training examples—has become a standard solution to this requirement. A popular family of these techniques is the "Mix" line of work, which includes methods like Mixup (linearly interpolating images) and CutMix (pasting a patch of one image onto another).
While effective, these methods face two primary challenges. First, they often involve information loss; CutMix deletes parts of an image, while Mixup can create "ghostly" artifacts that do not resemble real-world objects. Second, these methods are often mutually exclusive. Because they compete for the same "regularization budget," combining Mixup and CutMix typically results in interference rather than additive performance gains. StackMix was developed as a complementary algorithm designed to preserve original image information and integrate seamlessly into existing augmentation pipelines.
Methodology
The core mechanism of StackMix is elegantly simple. Instead of blending or patching, it concatenates two images ($x_1$ and $x_2$) into a single input. This is typically achieved by stacking them along the channel dimension or placing them side-by-side. The target label is then defined as the simple average of the two original one-hot labels.
While this requires a minor modification to the network's first layer to accommodate the increased input size, the rest of the architecture remains unchanged. The true innovation lies in the Synergy approach, or the "A $\rightarrow$ B" pipeline. In a configuration like CutMix $\rightarrow$ StackMix, the system first generates two CutMixed images (each already a combination of two images) and then applies StackMix to those results. This allows the network to process features from four distinct images in a single forward pass.
Experimental Results
The researchers evaluated StackMix across a diverse set of benchmarks, ranging from small-scale datasets like CIFAR-10 to large-scale challenges like ImageNet. The results consistently demonstrated that StackMix acts as a force multiplier when layered with other techniques.
On ImageNet, combining StackMix with Mixup improved top-1 accuracy by 1.2% over Mixup alone. On Tiny ImageNet, the CutMix $\rightarrow$ StackMix combination reduced test error by a substantial 3% compared to CutMix alone. These gains were mirrored in smaller datasets like STL-10 and CIFAR-100, where the additive nature of StackMix provided consistent improvements over standalone Mixup or CutMix baselines.
Analysis and Robustness
Beyond raw accuracy, StackMix demonstrates significant utility in specialized training scenarios:
- Robustness: When combined with AugMix, a method specifically designed for robustness, StackMix provided a 0.7% improvement on the CIFAR-100-C benchmark, which features common corruptions like blur and noise.
- Data Efficiency: StackMix is particularly effective when labeled data is scarce. On CIFAR-100, it maintained a 2% accuracy gap over the baseline even when using only 5% of the total dataset. In semi-supervised settings (e.g., 4,000 labels for CIFAR-10), adding StackMix to a standard $\Pi$-model improved accuracy by 2.16%.
- Feature Extraction: Using t-SNE visualizations, the authors confirmed that the network learns to distinguish between the two stacked images. Rather than seeing a jumbled input, the model learns to extract distinct features from both "slots" in the stack.
Limitations and Conclusion
Despite its benefits, StackMix introduces a minor trade-off in inference speed. Because the input size is larger, the first layer of the network performs more computation. Additionally, the authors found a "sweet spot" at $k=2$ images; stacking 3 or 5 images caused performance to degrade, likely because the task of disentangling features becomes too complex for the network.
In conclusion, StackMix offers a simple, highly effective, and uniquely complementary approach to data augmentation. By preserving full-resolution features and enabling the simultaneous processing of multiple mixed images, it provides a new path for pushing the performance boundaries of modern CNN architectures.
Summary updated