Inductive Unsupervised Domain Adaptation for Few-Shot Classification via Clustering

Xin Cong, Bowen Yu, Tingwen Liu, Shiyao Cui, Hengzhu Tang, Bin Wang

Abstract

Few-shot classification models often struggle with domain shift, where the distribution of the target domain differs significantly from the source training domain. This paper presents DaFeC (Domain adaptation for Few-shot classification via Clustering), an inductive framework for unsupervised domain adaptation. DaFeC utilizes a Clustering Promotion Mechanism (CPM) to learn domain-invariant representations and generates pseudo-labels through unsupervised clustering of target-domain data. Evaluated on the FewRel 2.0 benchmark, DaFeC achieves state-of-the-art performance, with accuracy gains of up to 11.6% over existing methods.

Introduction

Few-shot learning aims to recognize novel classes with very few labeled examples. However, real-world applications often involve a "domain gap"—for example, moving from general-purpose text like Wikipedia to specialized domains like biomedical literature. Standard few-shot models typically fail under such domain shifts.

While Unsupervised Domain Adaptation (UDA) addresses this, few-shot scenarios present unique challenges: the label spaces of the source and target domains are often disjoint, and practical applications require an inductive approach where the model adapts to the target domain without prior knowledge of specific test queries.

The DaFeC Framework

The proposed DaFeC framework addresses these challenges through a four-stage process involving representation learning, feature extraction, cluster mining, and final classifier training.

Overview of the four-stage DaFeC framework: Representation Learning, Feature Extraction, Cluster Mining, and Final Training.

Stage 1: Representation Learning with CPM

The first stage focuses on training a feature extractor $E$ using the Clustering Promotion Mechanism (CPM). This mechanism ensures that the learned features are both domain-invariant and conducive to clustering.

Detail of Stage 1: Representation Learning using the Clustering Promotion Mechanism (CPM) to align source and target distributions.

CPM incorporates three key strategies:

  1. CPM-S (Similarity Entropy Minimization): Encourages the model to produce compact clusters in the feature space by minimizing the entropy of similarity scores between unlabeled instances.
  2. CPM-A (Adversarial Distribution Alignment): Employs a discriminator to align the semantic structures of the source and target domains, making the features indistinguishable by domain.
  3. CPM-C (Cosine Annealing Strategy): A dynamic weighting scheme that prioritizes adversarial alignment early in training and shifts focus to clustering as features stabilize.

Stages 2-4: Pseudo-Labeling and Adaptation

Once the representation extractor is trained, the framework proceeds to extract features for the unlabeled target data (Stage 2). These features are then grouped into $K$ clusters using K-means (Stage 3), which serve as pseudo-labels for the target domain. Finally, the few-shot classifier is re-trained on a combined dataset of labeled source data and pseudo-labeled target data (Stage 4).

Experimental Results

The researchers evaluated DaFeC on the FewRel 2.0 benchmark, using Wikipedia as the source domain and PubMed as the target domain.

DaFeC consistently outperformed previous state-of-the-art methods across all test settings. In the 5-way 5-shot setting, it achieved 76.99% accuracy, a 9.55% improvement over BERT-PAIR. In the more challenging 10-way 5-shot setting, it reached 64.79%, an 11.62% absolute gain. These results demonstrate that DaFeC effectively bridges the domain gap, even with disjoint label spaces.

Conclusion

DaFeC provides a robust, inductive framework for few-shot classification under domain shift. By combining adversarial alignment with unsupervised clustering, it successfully mines target-domain features without requiring labeled data. Future work will focus on mitigating the impact of label noise in the pseudo-labeling stage to further enhance model reliability.

Summary updated

BibTeX
@inproceedings{cong2020inductive,
  author = {Xin Cong and Bowen Yu and Tingwen Liu and Shiyao Cui and Hengzhu Tang and Bin Wang},
  title = {{Inductive Unsupervised Domain Adaptation for Few-Shot Classification via Clustering}},
  booktitle = {ECML/PKDD},
  year = {2020},
  doi = {10.1007/978-3-030-67661-2\_37},
}
Figure