Abstract
Large-scale vision foundation models like DINOv2 and DINOv3 excel on general tasks but often underperform on specialized domains such as medical imaging or astronomy. Adapting these models via standard self-supervised learning (SSL) is frequently hindered by missing training states, hyperparameter sensitivity, and data scarcity. We introduce DIET-CP (Datum IndEx as Target for Continued Pretraining), a lightweight, label-free method for domain adaptation. By treating each image's index as a unique class label, DIET-CP "re-centers" the model's feature space with as few as 1,000 samples. Our results show significant performance gains across multiple modalities with minimal computational overhead.
Introduction
Foundation models provide robust general-purpose visual representations, yet they often lag behind "expert" models in niche fields like pathology or satellite imagery. Continued pretraining is the standard adaptation path, but it is plagued by three main issues:
- Missing Information: Released weights often lack the teacher networks or optimizer states required by modern SSL methods.
- Hyperparameter Sensitivity: Tuning SSL methods on small, specialized datasets is computationally expensive and prone to overfitting.
- Data Scarcity: Traditional SSL methods typically require millions of images, often failing when applied to the limited data available in specialized domains.
Methodology
DIET-CP simplifies adaptation by converting unsupervised learning into a supervised classification task. The core idea is to treat the index of each image in the training set as its "class label."
Training Recipe
The adaptation process involves adding a linear classification head to the pretrained backbone. The model is trained for 150 epochs:
- Warm-up: For the first 5% of epochs, the backbone is frozen while the new linear head is trained.
- Fine-tuning: For the remaining epochs, the last two blocks of the backbone are unfrozen and trained jointly with the head.
- Objective: The model uses standard cross-entropy loss with label smoothing to predict the specific image index out of $N$ samples.
Key Results and Insights
DIET-CP was evaluated on medical imaging (MedMNISTv2), astronomy (Galaxy10 DECaLS), and fine-grained natural image datasets.
Performance Gains
The method consistently improved out-of-domain performance. On average, DINOv2 achieved a +17.77 absolute percentage point increase in k-NN F1 score on medical data. In astronomy, k-NN F1 scores for DINOv2 increased by +27.77.
Data and Computational Efficiency
DIET-CP is remarkably efficient, showing significant gains with as few as 500–1,000 samples. While k-NN performance continues to improve with more data (up to 10,000 samples), linear probing performance tends to stabilize early. Furthermore, the entire adaptation process for a ViT-B model takes less than 10 minutes on a single H100 GPU.
Embedding Space Refinement
The most dramatic improvements were observed in unsupervised k-NN performance, suggesting that DIET-CP effectively "untangles" representations, causing similar images in the new domain to cluster more tightly.
Limitations and Future Work
While effective for out-of-domain data, DIET-CP can lead to performance degradation on fine-grained tasks within the model's original training domain (e.g., natural images for DINOv3). Future research will explore the impact of unfreezing different backbone layers and the development of label-free metrics to monitor adaptation progress without requiring ground-truth validation sets.
Conclusion
DIET-CP provides a robust and efficient framework for adapting large vision models to specialized domains. By leveraging instance discrimination as a powerful prior, it achieves state-of-the-art adaptation results with minimal data and compute requirements.
Summary updated