Abstract
Data augmentation is a cornerstone of modern computer vision, yet its specific role in contrastive learning remains partially understood. This paper provides a systematic empirical study on how masking and mixing strategies affect contrastive learning across self-, semi-, and fully-supervised regimes. We introduce two metrics, invariance ($L_{inv}$) and diversity ($L_{div}$), to quantify the trade-offs inherent in different augmentations. Our findings demonstrate that MixUp achieves a superior balance between these metrics, leading to improved performance across classification, detection, and segmentation tasks.
Introduction
Contrastive learning relies on generating multiple "views" of the same image to learn robust feature representations. While augmentations like Random Erasing, CutOut, CutMix, and MixUp are widely used in supervised learning, their impact on the learned feature space in contrastive frameworks is not well-quantified. This study aims to move beyond simple accuracy reporting by analyzing how these techniques influence the underlying mechanics of feature embeddings.
Methodology
The researchers integrated four primary augmentation types into the MoCo v2 architecture:
- Random Erasing: Removes a random rectangular region.
- CutOut: Masks square regions with constant values.
- CutMix: Overlays a patch from one image onto another.
- MixUp: Creates a weighted average of two images.
To evaluate these, two key metrics were proposed:
- Invariance ($L_{inv}$): Quantifies the similarity between an augmented view's embedding and the original anchor. High invariance suggests the model recognizes the augmented image as the same object.
- Diversity ($L_{div}$): Quantifies the variance between different augmented views of the same image. High diversity indicates the model is exposed to a wider range of visual patterns.
The study explores these augmentations across three supervision levels: Self-supervised (no labels), Semi-supervised (partial labels), and Fully-supervised (all labels), utilizing contrastive loss functions such as InfoNCE and SupCon.
Experimental Results
The models were pre-trained on ImageNet-100 and ImageNet-1K, then evaluated on downstream tasks including object detection (PASCAL VOC, MS-COCO) and segmentation (LVIS, Cityscapes, ADE20K).
The Invariance-Diversity Trade-off
A core finding is the tension between invariance and diversity. Masking techniques (CutOut, Random Erasing) significantly increase diversity but at a substantial cost to invariance, as critical information is removed. In contrast, mixing techniques—particularly MixUp—provide a "sweet spot."
As shown in the results table, adding MixUp to MoCo v2 on ImageNet-100 improves Top-1 accuracy from 81.65% to 84.08%. When combined with full supervision (100% labels), the performance reaches 87.86%. Notably, MixUp maintains high invariance (0.69 vs. 0.72 baseline) while nearly doubling diversity (0.45 vs. 0.23 baseline).
Impact of Supervision
An intriguing insight is that while adding labels improves final task performance, it does not fundamentally alter the $L_{inv}$ or $L_{div}$ scores of the embeddings. The quality of the views is primarily driven by the augmentation strategy; labels simply help the model better navigate the resulting feature space.
Conclusion and Future Work
This study highlights MixUp as a powerful tool for contrastive learning, offering a robust balance of invariance and diversity that generalizes well to dense downstream tasks. Future research will explore these dynamics in larger-scale datasets and alternative architectures like Vision Transformers (ViTs), as well as evaluating a broader range of automated augmentation strategies.
Summary updated