TL;DR
This paper tackles the performance drop of self-supervised contrastive learning on lightweight models. They propose a new training recipe and a "SoftNCE" loss function to improve performance without relying on large, pretrained teacher models, significantly closing the accuracy gap with larger models.
What Problem Does This Paper Address?
Self-supervised contrastive learning has shown impressive results, often surpassing supervised methods on downstream tasks. However, this success typically relies on large, computationally expensive models. When applied to smaller, more efficient architectures like MobileNet or EfficientNet, performance plummets. A common workaround is to use knowledge distillation from a large "teacher" model to guide the training of a smaller "student" model. While effective, this approach has drawbacks: pre-training a teacher is time-consuming and resource-intensive, and a teacher model might not always be available or feasible to load alongside the student. This paper aims to establish a strong baseline for lightweight contrastive models without relying on any pretrained teacher, addressing the need for efficient and effective self-supervised learning on resource-constrained devices.
Methods
The authors propose two main contributions:
- A New Training Recipe for Lightweight Models: They argue that the standard training settings used for large models (like ResNet50) are suboptimal for lightweight architectures. Through extensive hyperparameter tuning and an additive study, they identify key factors that significantly boost performance. These include:
- Wider MLP Projector: Using a two-layer MLP projector with a larger hidden dimension (2048, 128) compared to the typical one-layer projector.
- Optimized Temperature (T): Finding the right temperature hyperparameter is crucial for controlling gradient signals from hard negatives.
- Larger Learning Rate (LR) with Warmup: Lightweight models benefit from larger learning rates, but direct increases can lead to instability. A warmup strategy is introduced to address this.
- Momentum Encoder Strategy: While a cosine momentum strategy benefits some models, it slightly decreased accuracy for EfficientNet-B0 in their experiments.
- Symmetric Loss: Swapping the roles of augmented views (similar to BYOL) improves performance.
- SoftNCE Loss Function: To address the issue of "noisy views" (false positives and false negatives) in contrastive learning, they introduce SoftNCE. This loss function smooths the hard, one-hot labels of the standard InfoNCE loss. Instead of assigning a probability of 1 to the positive pair and 0 to all negatives, SoftNCE assigns a weighted distribution. This helps the model become more robust to mislabeled or ambiguous augmented views, leading to better generalization. They explore different strategies for assigning these weights, ultimately favoring a linear weight decay pattern for hard negatives.
Datasets
- ImageNet: Used extensively for pre-training and linear evaluation.
- VOC (PASCAL VOC): Used for object detection transfer learning.
- COCO (Common Objects in Context): Used for object detection and instance segmentation transfer learning.
Key Insights and Ideas
- "One-size-fits-all" training recipes are detrimental: The optimal hyperparameters for contrastive learning are significantly different for lightweight models compared to larger ones. Simply porting settings from ResNet50 is a mistake.
- Noisy views are a significant bottleneck: Even with good architectures, the presence of false positive and false negative augmented views can severely hinder performance.
- Smoothing the loss is a powerful regularization technique: SoftNCE provides a simple yet effective way to mitigate the impact of noisy labels, improving robustness and generalization without complex architectural changes.
- Eliminating the need for a teacher model is feasible: The paper demonstrates that strong performance can be achieved on lightweight models without the overhead of a pretrained teacher, making self-supervised learning more accessible.
Key Results
- Significant accuracy improvements:
- MobileNet-V3-Large: Linear evaluation accuracy improved from 36.3% to 62.3%.
- EfficientNet-B0: Linear evaluation accuracy improved from 42.2% to 65.8%.
- Closing the gap with large models: The improved lightweight models achieve accuracy close to ResNet-50 (67.4% for EfficientNet-B0 vs. 67.5% for MoCo-V2 on ResNet50) while using only 16.3% of the parameters.
- Competitive transfer learning: Light-MoCo showed competitive performance on VOC and COCO object detection and instance segmentation tasks, outperforming previous methods.
- SoftNCE effectiveness: Ablation studies showed that SoftNCE consistently improved performance, with optimal settings for $\alpha$ around 0.7-0.9 and $K=20$.
Limitations and Future Work
- Computational Cost: While the methods are designed for lightweight models, the pre-training still requires significant GPU resources (8 Nvidia-32G-V100 GPUs for 200 epochs).
- Hyperparameter Sensitivity: Although they provide a better recipe, finding the absolute optimal hyperparameters might still require careful tuning.
- Future Work: The authors suggest that their work will facilitate the wider adoption of lightweight contrastive models. Further research could explore even more efficient architectures or investigate other novel loss functions. The paper also hints at the potential for incremental smoothing strategies, though static smoothing performed better in their experiments.
Summary updated