Enhancing Information Maximization With Distance-Aware Contrastive Learning for Source-Free Cross-Domain Few-Shot Learning

Huali Xu, Li Liu, Shuaifeng Zhi, Shaojing Fu, Zhuo Su, Ming-Ming Cheng, Yongxiang Liu

Introduction

Few-Shot Learning (FSL) has emerged as a critical paradigm for training models to recognize novel classes from a limited number of labeled examples. However, the challenge intensifies in Cross-Domain Few-Shot Learning (CDFSL), where the target task belongs to a significantly different visual domain than the source data used for pre-training. Traditionally, bridging this domain gap requires access to the original source dataset to perform distribution alignment.

In many real-world scenarios, however, source data is inaccessible due to privacy regulations (e.g., medical records), intellectual property restrictions, or the logistical burden of transferring massive datasets. This paper addresses the Source-Free Cross-Domain Few-Shot Learning (SF-CDFSL) problem, proposing a framework that adapts pre-trained models to new domains without ever accessing the original training data.

The SF-CDFSL Challenge

The primary hurdle in SF-CDFSL is the lack of a reference point. Without source data, standard domain adaptation techniques that minimize the distance between source and target distributions are inapplicable. Models must instead rely entirely on the pre-trained weights and a sparse set of target-domain examples. The goal is to extract and refine features that are relevant to the target domain while avoiding the "catastrophic forgetting" of useful representations learned during pre-training.

Methodology: The IM-DCL Framework

The authors introduce IM-DCL (Enhanced Information Maximization with Distance-Aware Contrastive Learning), a transductive learning framework designed to optimize model performance on the target domain through three integrated strategies:

1. Transductive Learning

Unlike inductive methods that only use the labeled support set for adaptation, IM-DCL adopts a transductive approach. It leverages the unlabeled query set—the very images the model is tasked with classifying—to better understand the underlying structure of the target data distribution.

2. Information Maximization (IM)

To compensate for the lack of source data, the model employs Information Maximization. This objective encourages the model to produce predictions that are:

  • Individually Confident: Forcing the model to make decisive predictions on each sample.
  • Globally Diverse: Ensuring the model does not collapse into predicting a single class for all samples, thereby maintaining a balanced distribution across the label space.

3. Distance-Aware Contrastive Learning (DCL)

While IM encourages confidence, it lacks semantic grounding and can lead to high-confidence misclassifications. To provide structural guardrails, the authors introduce Distance-Aware Contrastive Learning. Since ground-truth labels for the query set are unavailable, DCL treats every feature in the dataset as both a potential positive and negative pair.

By calculating the relative distances between features in the embedding space, the model assigns weights: closer features are treated as "positives" and pulled together, while distant features act as "negatives" and are pushed apart. This soft-labeling approach allows the model to learn robust, cluster-aware representations without requiring explicit supervision.

Experimental Evaluation

The framework was evaluated using the BSCD-FSL benchmark, which spans four datasets representing varying degrees of domain shift from natural images (ImageNet):

  • CropDiseases: Plant pathology (Near domain)
  • EuroSAT: Satellite imagery (Mid-near domain)
  • ISIC 2018: Skin lesion dermoscopy (Mid-distant domain)
  • ChestX: Medical X-rays (Distant domain)

Key Results

IM-DCL demonstrated significant performance gains over standard fine-tuning and existing SF-CDFSL baselines:

  • Superior Accuracy: In 5-way 1-shot tasks, IM-DCL achieved an average accuracy of 55.91%, a substantial improvement over the 40.90% baseline. Notably, on the EuroSAT dataset, 1-shot accuracy rose from 49.34% to 77.14%.
  • 5-Shot Performance: The model reached an average accuracy of 66.72% in 5-shot scenarios, confirming the scalability of the method as more labeled data becomes available.
  • Robustness: The method proved effective even when the initial source model was not perfectly optimized, suggesting that IM-DCL is resilient to the quality of the starting weights.

Discussion and Limitations

While IM-DCL sets a new state-of-the-art for source-free adaptation, challenges remain. The authors noted that the model is sensitive to background noise; for instance, in the ISIC dataset, the model occasionally grouped images based on the presence of hair rather than clinical features. Furthermore, while performance improved on the ChestX dataset, the absolute accuracy remains low (23-28%), highlighting the extreme difficulty of bridging the gap between natural photography and specialized medical imaging.

Conclusion

This research demonstrates that source data is not a strict requirement for effective cross-domain adaptation. By combining Information Maximization with a distance-aware contrastive objective, IM-DCL provides a powerful, privacy-preserving pathway for deploying few-shot models in sensitive or data-constrained environments. Future work will focus on incorporating attention mechanisms to mitigate background noise and exploring the use of larger vision foundation models to tackle extreme domain shifts.

Summary updated

BibTeX
@article{xu2024enhancing,
  author = {Huali Xu and Li Liu and Shuaifeng Zhi and Shaojing Fu and Zhuo Su and Ming-Ming Cheng and Yongxiang Liu},
  title = {{Enhancing Information Maximization With Distance-Aware Contrastive Learning for Source-Free Cross-Domain Few-Shot Learning}},
  journal = {IEEE Trans. Image Process.},
  year = {2024},
  doi = {10.1109/tip.2024.3374222},
}
Figure