NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unsupervised Finetuning

Suichan Li, Dongdong Chen, Yinpeng Chen, Lu Yuan, Lei Zhang, Qi Chu, Bin Liu, Nenghai YuarXiv 2021

Abstract: Standard unsupervised pretraining requires massive datasets to learn effective representations. When applied to small-scale target domains, naive unsupervised finetuning often leads to performance degradation due to "data sparsity." This paper introduces unsupervised finetuning, a method that stabilizes adaptation using two key strategies: Sparse Source Data Replaying (SR) and data mixing. By replaying a fraction of source data as anchors and increasing sample density through synthetic mixing, the proposed method maintains structural integrity in the feature space. Experiments across diverse datasets demonstrate significant improvements in few-shot transfer, clustering, and semi-supervised learning.

Introduction

In modern computer vision, the standard recipe involves pretraining a model on a massive dataset (e.g., ImageNet) and subsequently finetuning it for a specific target task. While supervised finetuning is well-understood, obtaining labels for every new domain is often impractical or impossible. Conversely, unsupervised pretraining has gained popularity but typically necessitates millions of images to be effective.

Attempting to "naively" finetune a pretrained model on a small unlabeled dataset—containing only a few thousand images—frequently results in a performance drop. The authors identify that the mathematical formulation of popular unsupervised losses, such as contrastive loss, effectively forces sparse data to scatter across the feature space. This "pushing" force dominates in low-density regimes, destroying the useful structures learned during initial pretraining.

Methodology

To address the instability of unsupervised finetuning on small datasets, two primary strategies are proposed:

Sparse Source Data Replaying (SR)

Instead of finetuning exclusively on new target data, the model "replays" a small portion (approximately 10%) of the original source data. These source images serve as geometric "anchors" in the feature space. By preserving source representations, the target data is constrained to integrate into the existing feature structure rather than scattering into the vacuum of the space.

Contrastive Learning with Data Mixing

To combat low data density, the method employs CutMix to generate synthetic images. By mixing two images, the model creates additional "positive" pairs for the contrastive loss. This increases the "pulling force" between similar images, facilitating the learning of more compact and semantically meaningful clusters. These strategies are implemented atop the MoCoV2 framework but are designed to be generalizable across various pretraining methods.

Experimental Results

The effectiveness of unsupervised finetuning was evaluated on four diverse datasets: Caltech101, Pet, CIFAR100, and Food101.

Feature Space Visualization

The impact of the proposed method is most evident in t-SNE visualizations of the feature space. Naive finetuning often leads to a collapse of the well-defined clusters present in the pretrained model. In contrast, the inclusion of Sparse Source Replaying (SR) recovers and tightens these clusters.

t-SNE visualization of the Pet dataset: (a) training from scratch, (b) ImageNet pretrained, (c) naive unsupervised finetuning, and (d) the proposed unsupervised finetuning with SR.

Performance Metrics

The proposed method significantly outperforms baseline pretrained models and naive finetuning:

  • Few-Shot Transfer: On the Pet dataset, with only one labeled sample per class for evaluation, the method achieved 60.35% accuracy, compared to 41.23% for the base pretrained model and 40.01% for naive unsupervised finetuning.
  • Clustering Accuracy: On the Food101 dataset, clustering accuracy improved from 11.85% (base) to 51.74%.
  • Semi-Supervised Initialization: When used to initialize semi-supervised methods like FixMatch, the unsupervisedly finetuned model provided a superior starting point, leading to higher final accuracy with minimal labels.

Conclusion

Unsupervised finetuning offers a robust pathway for adapting large-scale models to specialized, small-scale domains without requiring target labels. While the requirement for a portion of the source data may pose challenges in privacy-sensitive scenarios, the method's ability to prevent feature collapse is a significant advancement. Future research may explore data-free alternatives or adaptive source replaying strategies based on domain gap analysis.

Summary updated

BibTeX
@misc{li2021unsupervised,
  author = {Suichan Li and Dongdong Chen and Yinpeng Chen and Lu Yuan and Lei Zhang and Qi Chu and Bin Liu and Nenghai Yu},
  title = {{Unsupervised Finetuning}},
  year = {2021},
  eprint = {2110.09510},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.09510},
}
Figure