Imbalance-Agnostic Source-Free Domain Adaptation via Avatar Prototype Alignment

Hongbin Lin, Mingkui Tan, Yifan Zhang, Zhen Qiu, Shuaicheng Niu, Dong Liu, Qing Du, Yanxia LiuarXiv 2023 · DOI

Introduction

Domain Adaptation (DA) is essential for deploying machine learning models in new environments where data distributions may differ from the training set. However, practical constraints often introduce two major hurdles: Source-Free constraints, where privacy or data size prevents access to original training data, and Class Imbalance, where data is "long-tailed" rather than uniformly distributed. This paper introduces T-CPGA (Target-aware Contrastive Prototype Generation and Adaptation), a novel framework designed for "imbalance-agnostic" scenarios where class distributions in both source and target domains are unknown and potentially highly skewed.

The Imbalance-Agnostic Challenge

Standard Source-Free Unsupervised Domain Adaptation (SF-UDA) methods often assume balanced class distributions. They typically fail when the source and target distributions are mismatched—for example, if a model trained on a domain dominated by one class is applied to a domain where that class is rare.

Comparison of different domain adaptation settings, highlighting the unique challenges of the imbalance-agnostic SF-UDA task.

As shown in the comparison above, the imbalance-agnostic setting is the most challenging and realistic, requiring the model to handle shifts between various skewed or balanced states without any prior knowledge of the distributions.

Methodology: CPGA and T-CPGA

The proposed solution operates in two distinct stages to bridge the gap between source and target domains without requiring direct access to source data.

The two-stage T-CPGA framework: Stage 1 generates synthetic 'avatar prototypes' from the source model, and Stage 2 adapts the target feature extractor using these prototypes and a target-aware classifier.

Stage 1: Prototype Generation

In the absence of source data, the authors "hallucinate" representative features by mining the source model's classifier. A generator $G_g$ is trained to produce Avatar Prototypes—synthetic feature vectors that represent the "ideal" version of each class according to the source model. A contrastive loss ensures these prototypes are distinct and well-separated in the feature space, effectively creating a proxy for the missing source data.

Stage 2: Prototype Adaptation

Once the prototypes are established, the unlabeled target data is aligned with them. To handle potential imbalances, the authors extend the base CPGA into T-CPGA:

  • Target-Aware Pseudo-Labeling: Rather than relying solely on the potentially biased source model, T-CPGA uses a dynamic ensemble of the source model and CLIP (a zero-shot vision-language model) to generate more accurate pseudo-labels.
  • Distribution-Aware Classifier: A new classifier is trained specifically to match the target domain's unidentified class distribution.
  • Weighted Contrastive Alignment: Higher importance is assigned to target samples closer to class centroids, reducing the impact of noisy or mislabeled data.

Experimental Evaluation

The researchers evaluated T-CPGA on standard benchmarks (Office-31, VisDA-2017, Office-Home) and newly introduced imbalanced variants (VisDA-I and Office-Home-I). These variants simulate various skewness levels, including forward and backward long-tailed distributions, with imbalance ratios as high as 100.

Key Results

  • Significant Performance Gains: T-CPGA consistently outperformed existing state-of-the-art methods. On the Cl → Pr task of the imbalanced Office-Home dataset, it achieved a 25.1% accuracy gain over the base CPGA.
  • Robustness to Extreme Skew: In tests with an imbalance ratio of 100, T-CPGA maintained high performance while competitors' accuracies plummeted, demonstrating its effectiveness in truly imbalance-agnostic scenarios.
  • Generalization to Balanced Data: Even in standard balanced scenarios, the "avatar prototype" approach proved superior to previous SF-UDA methods on datasets like Office-31 and VisDA.

Insights and Discussion

A key insight of this work is the use of CLIP as an anchor. While the source model is biased by its training distribution, CLIP’s broad zero-shot capabilities provide a neutral perspective that helps identify the true target distribution. Furthermore, the authors leverage the observation that deep networks learn clean patterns before memorizing noise, using early learning regularization to stabilize the adaptation process.

While T-CPGA offers substantial improvements, it is more computationally intensive than simple fine-tuning due to the multi-stage training and ensemble requirements. Future research may explore even more complex shifts, such as open-set domain adaptation where the target domain contains entirely new classes.

Summary updated

BibTeX
@misc{lin2023imbalance,
  author = {Hongbin Lin and Mingkui Tan and Yifan Zhang and Zhen Qiu and Shuaicheng Niu and Dong Liu and Qing Du and Yanxia Liu},
  title = {{Imbalance-Agnostic Source-Free Domain Adaptation via Avatar Prototype Alignment}},
  year = {2023},
  eprint = {2305.12649},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.12649},
}
Figure