TL;DR
This paper introduces Self-Distilled Self-Supervised Learning (SDSSL), a novel approach that enhances self-supervised learning (SSL) by encouraging intermediate layers of a neural network to mimic the final layer's representations. This "self-distillation" process improves the instance discrimination capabilities of lower layers, leading to better overall representation learning and outperforming existing SSL methods like SimCLR, BYOL, and MoCo v3 on various downstream tasks.
What Problem Does This Paper Address?
Self-supervised learning (SSL) has made significant strides, particularly with the advent of transformer architectures like Vision Transformers (ViTs). These methods typically train models by maximizing the agreement between different augmented views of the same image, often using contrastive losses on the final layer's representations. However, the internal workings of these complex models, especially how representations evolve across layers, remain less understood. The paper aims to bridge this gap by exploring how to leverage knowledge from the final, well-trained representations to guide the learning of intermediate layers, thereby improving the overall representation quality and making the SSL task more effective.
Methods
The core innovation is Self-Distilled Self-Supervised Learning (SDSSL). It builds upon existing SSL frameworks (like SimCLR, BYOL, and MoCo v3) by adding an intermediate self-distillation loss ($L_{isd}$). This loss encourages the representations from an intermediate layer ($l$) to mimic the representations of the final layer ($L$) using a contrastive objective.
Specifically, for a student network and a teacher network (often an EMA version of the student), SDSSL adds:
- Intermediate Self-Distillation Loss ($L_{isd}$): This loss aligns the output of an intermediate layer's projector ($q_l$) with the teacher's final output ($z_L$) using a contrastive loss. The gradient is stopped at the teacher's output ($sg(z_L)$) so that only the intermediate layer learns.
- Predictor Distillation Loss ($L_{pred}$): For frameworks that use predictor heads (like BYOL and MoCo v3), an additional loss is introduced to ensure that these intermediate predictors also learn effectively from the final teacher output. This prevents intermediate predictors from becoming suboptimal.
The final objective is a combination of the original SSL loss ($L_{ssl}$) and these new distillation losses ($L_{isd}$ and $L_{pred}$), weighted by hyperparameters $\alpha$ and $\beta$.
Datasets
The paper uses the following datasets:
- ImageNet: Used for pretraining the ViT models.
- Downstream Tasks:
- Image Classification: CIFAR-10, CIFAR-100, Oxford Flowers-102, Oxford-IIT-Pets, CUB, AirCraft, Cars, Dogs, NABirds.
- Image Retrieval: Oxford and Paris datasets.
- Copy Detection: INRIA Copydays dataset.
- Video Segmentation: DAVIS-2017 dataset.
No new benchmarks were introduced.
Key Insights and Ideas
- Intermediate layers benefit from final layer knowledge: The core idea is that by explicitly teaching intermediate layers to mimic the final, well-trained representations, they become more effective at instance discrimination. This is analogous to self-distillation in supervised learning but applied to the SSL pretext task.
- Improved layer-wise representations: SDSSL doesn't just boost final performance; it demonstrably improves the quality of representations in lower layers, making them more separable and useful for downstream tasks.
- Easier pretext task for subsequent layers: When lower layers are better at instance discrimination, the overall SSL task becomes easier for the subsequent layers, leading to a cascading improvement.
- ViT architectures are particularly amenable: The paper shows strong results using Vision Transformers (ViTs), suggesting that the layered, attention-based structure of ViTs might be well-suited for this type of inter-layer distillation.
- Uniformity and Alignment: The paper connects SDSSL's success to improved uniformity and alignment metrics, suggesting it helps create a more structured and discriminative feature space.
Key Results
- Outperforms Baselines: SDSSL consistently outperforms competitive SSL baselines (SimCLR, BYOL, MoCo v3) when applied to ViT architectures across various tasks.
- ImageNet Pretraining: On ImageNet, SDSSL achieved superior k-NN and linear evaluation accuracies compared to baselines. For example, SD-MoCo v3 achieved 76.0% k-NN accuracy with ViT-B/16, compared to 72.0% for MoCo v3.
- Improved Lower Layer Performance: Multi-exit evaluations (testing each layer independently) showed that SDSSL's lower layers achieved significantly better performance than their counterparts in baseline methods. For instance, in MoCo v3, the 6th layer accuracy improved from 24.3% to 58.9% with SDSSL.
- Transferability: SDSSL demonstrated improved performance on diverse downstream tasks including image retrieval, copy detection, and video segmentation. For copy detection, SD-MoCo v3 achieved higher mAP scores than MoCo v3.
- Qualitative Improvements: t-SNE visualizations showed that SDSSL leads to more class-separable representations in lower layers compared to baselines. CKA analysis indicated a more uniform similarity structure across layers.
Limitations and Future Work
- Increased Computational Cost: SDSSL introduces additional MLP heads and distillation losses, leading to a moderate increase in memory footprint (less than 6%) and training time (around 16.9% for ViT-B/16). However, this increase is considered manageable, especially with parallel computing.
- Hyperparameter Sensitivity: The effectiveness of SDSSL depends on the weighting of the distillation losses ($\alpha$ and $\beta$), which require careful tuning. The paper suggests ratio annealing for $\alpha$ is crucial.
- Future Work: The authors suggest exploring applying self-distillation to more intermediate activations (beyond just residual block outputs in ResNet) and investigating its application to other SSL frameworks and architectures. They also note that the current implementation for ResNet optimizes the distillation loss only for output activations of residual blocks, implying potential for further gains by distilling from more internal activations.
Summary updated