Abstract
Self-supervised pre-training (SSP) employs random image transformations to generate training data for visual representation learning. In this paper, we first present a modeling framework that unifies existing SSP methods as learning to predict pseudo-labels. Then, we propose new data augmentation methods of generating training examples whose pseudo-labels are harder to predict than those generated via random image transformations. Specifically, we use adversarial training and CutMix to create hard examples (HEXA) to be used as augmented views for MoCo-v2 and DeepCluster-v2, leading to two variants HEXA_{MoCo} and HEXA_{DCluster}, respectively. In our experiments, we pre-train models on ImageNet and evaluate them on multiple public benchmarks. Our evaluation shows that the two new algorithm variants outperform their original counterparts, and achieve new state-of-the-art on a wide range of tasks where limited task supervision is available for fine-tuning. These results verify that hard examples are instrumental in improving the generalization of the pre-trained models.
Introduction
Self-supervised pre-training (SSP) has revolutionized visual representation learning by allowing models to learn from vast amounts of unlabeled data. Traditionally, these models solve "pretext tasks"—such as determining if two different crops originate from the same image—using random data augmentations like cropping, flipping, or color jittering. However, these transformations are often "task-agnostic" and may result in tasks that are too simple, leading models to focus on low-level textures rather than high-level semantics.
This paper introduces HEXA (Hard EXAmples), a framework designed to boost SSP by generating challenging training examples tailored to the model's current state. By moving beyond simple random crops, HEXA forces models to learn more robust and transferable visual features, particularly beneficial in data-scarce scenarios.
Methods: Generating Hard Examples
The authors unify existing self-supervised methods, such as contrastive learning and clustering, into a single pseudo-label prediction framework. Within this framework, they propose two primary methods for generating hard examples:
- Adversarial Examples: Utilizing Projected Gradient Descent (PGD), the framework adds imperceptible perturbations to images. These are mathematically optimized to "fool" the model's current pseudo-label predictions, forcing it to become robust to noise and focus on essential semantic features.
- Cut-Mixed Examples: By applying "CutMix," where a patch from one image is pasted onto another, the model is tasked with predicting a mixture of pseudo-labels. This encourages the model to identify objects from partial views and improves feature localization.
These hard examples are integrated into popular frameworks like MoCo-v2 and DeepCluster-v2, resulting in HEXA-MoCo and HEXA-DCluster. To maintain training stability despite varying data distributions, the authors employ AdvProp, which utilizes separate Batch Normalization layers for "clean" and "hard" examples.
Experimental Results
The models were pre-trained on ImageNet (ILSVRC-2012) without labels and evaluated across several benchmarks, including PASCAL VOC, CIFAR-10/100, and semi-supervised ImageNet tasks.
Performance Highlights
- Linear Probing: HEXA-MoCo achieved 71.7% Top-1 accuracy on ImageNet, surpassing the standard MoCo-v2 baseline.
- Data-Scarce Scenarios: The benefits of "harder" pre-training are most evident when labels are limited. With only 1% of ImageNet labels, HEXA-DCluster reached 57.3% Top-1 accuracy, significantly outperforming SwAV (53.9%) and BYOL (53.2%).
- Transferability: In object detection on PASCAL VOC, HEXA-MoCo consistently outperformed standard MoCo-v2, demonstrating that features learned from hard examples generalize better to localization tasks.
Discussion and Conclusion
The success of HEXA suggests a "difficulty sweet spot" in self-supervised learning: just as students learn more from challenging exams, neural networks develop better representations when pretext tasks are difficult. Adversarial training, typically used for defense, proves to be a powerful tool for general representation learning by pushing models toward "core" object features rather than brittle shortcuts.
While HEXA introduces some computational overhead due to the gradient calculations required for adversarial examples, its efficiency in low-data regimes makes it a compelling approach for practical applications. Future work may explore scaling these hard examples to larger architectures like Vision Transformers and massive, uncurated datasets.
Summary updated