Consistency Regularization for Generalizable Source-free Domain Adaptation

Longxiang Tang, Kai Li, Chunming He, Yulun Zhang, Xiu Li

Abstract

Source-free Domain Adaptation (SFDA) is a critical task where a model must adapt to a target domain without access to source data. Current SFDA methods often overfit the target training set, leading to poor generalization on unseen test data. This paper introduces a consistency regularization framework that shifts the focus from transductive performance to model generalization. By combining soft pseudo-labeling with global calibration techniques—specifically class-wise weighting and prototype calibration—the proposed method achieves state-of-the-art results. Notably, it significantly reduces the performance gap between training and testing sets on major benchmarks like VisDA-2017.

Introduction

Domain adaptation (DA) enables models to bridge the gap between a source domain and a related target domain. In many real-world scenarios, privacy concerns or storage limits prevent access to the original source data, necessitating Source-free Domain Adaptation (SFDA). However, existing SFDA research has largely overlooked the generalization capability of adapted models. Most methods optimize for the specific target images available during training, leading to a "transductive" bias.

As illustrated in Figure 1, previous state-of-the-art methods like SHOT exhibit a substantial accuracy drop (nearly 10%) when evaluated on unseen test data. This overfitting suggests that the models are memorizing the target training set rather than learning the underlying domain characteristics.

Comparison of adaptation effects and accuracy drops between training and testing sets.

Methodology

The proposed framework moves beyond simple self-training by adopting a robust consistency regularization approach. The architecture integrates several key components to enhance generalization and prevent the model from collapsing into trivial solutions.

1. Consistency Regularization (CR)

The model is trained to maintain consistent predictions for an image under different augmentations. "Soft" pseudo-labels are generated from weakly augmented images (e.g., simple flips) to supervise the model's output on strongly augmented versions (e.g., RandAugment). This encourages a smoother decision manifold.

2. Sampling-based Pseudo-label Selection

Traditional hard-thresholding often discards difficult samples that carry vital information about domain shifts. We employ a probabilistic sampling strategy to include these "hard" samples, ensuring the model learns from the most challenging parts of the target distribution rather than just the easiest ones.

3. Global-oriented Calibration

To prevent the model from collapsing into a few dominant classes, we introduce two calibration mechanisms:

  • Class-wise Weighting: This dynamically adjusts the loss based on the predicted class distribution to favor minority classes, ensuring balanced learning across the dataset.
  • Prototype Calibration: By calculating class prototypes (average feature vectors), the model can identify and down-weight outliers whose predictions conflict with their feature clusters, acting as a global denoising mechanism.
The overall framework of the proposed SFDA method, highlighting the augmentation pipeline and global calibration modules.

Experimental Evaluation

The method was evaluated on three major benchmarks: VisDA-2017, Office-Home, and DomainNet.

On the VisDA-2017 dataset, the proposed approach reached an average accuracy of 88.7%, outperforming the previous best method (DaC) by 1.4%. Crucially, the gap between training and testing accuracy was reduced to just 0.9%, a significant improvement over SHOT's 9.7% gap. This demonstrates that the model is learning generalizable features rather than memorizing training samples. The class-wise weighting was particularly effective in preventing accuracy for difficult classes, like "truck," from dropping to zero.

Discussion and Conclusion

This work highlights the importance of generalization in SFDA. By leveraging consistency regularization and global calibration, we demonstrate that models can adapt to new domains without sacrificing performance on unseen data. While the increased complexity of strong augmentations requires more data for convergence, the resulting robustness makes this approach highly suitable for real-world deployment where data privacy is paramount and test-time data is unpredictable. Future work may explore these generalization-focused techniques in other source-free tasks such as semantic segmentation.

Summary updated

BibTeX
@inproceedings{tang2023consistency,
  author = {Longxiang Tang and Kai Li and Chunming He and Yulun Zhang and Xiu Li},
  title = {{Consistency Regularization for Generalizable Source-free Domain Adaptation}},
  booktitle = {Workshops @ ICCV},
  year = {2023},
}
Figure