NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contrastive Adaptation Network for Unsupervised Domain Adaptation

Guoliang Kang, Lu Jiang, Yi Yang, Alexander G. Hauptmann

Introduction

Unsupervised Domain Adaptation (UDA) aims to leverage labeled data from a source domain to improve performance on an unlabeled target domain. A common challenge in UDA is "domain shift," where differences in data distributions between domains (e.g., synthetic vs. real images) lead to poor model generalization. Traditional methods often attempt global alignment by minimizing the distance between domain distributions as a whole. However, these class-agnostic approaches risk "misalignment," where samples from different classes are incorrectly mapped together across domains.

Conceptual comparison of domain adaptation strategies. Previous methods often align domains globally, potentially mixing classes. The proposed method performs class-aware alignment by minimizing intra-class and maximizing inter-class discrepancy.

The Contrastive Adaptation Network (CAN)

To address the limitations of global alignment, the Contrastive Adaptation Network (CAN) introduces a class-aware approach. The core of CAN is the Contrastive Domain Discrepancy (CDD) metric, which explicitly considers class labels (or pseudo-labels) during the alignment process.

Contrastive Domain Discrepancy (CDD)

Unlike standard metrics like Maximum Mean Discrepancy (MMD) that treat all samples from a domain as a single distribution, CDD decomposes the discrepancy into class-specific components. It aims to:

  1. Minimize Intra-class Discrepancy: Pull source and target samples belonging to the same class closer together in the feature space.
  2. Maximize Inter-class Discrepancy: Push samples from different classes further apart, regardless of their domain.

Architecture and Optimization

CAN employs an Alternative Optimization (AO) strategy to handle the lack of target labels. The process alternates between two steps:

  • Clustering: Using current feature representations, the model applies spherical K-means to estimate pseudo-labels for target data. A filtering mechanism discards ambiguous samples far from cluster centers to reduce noise.
  • Feature Adaptation: The network parameters are updated to minimize the CDD loss alongside a standard cross-entropy loss on the source data.
The CAN architecture featuring the clustering-then-adapting loop and the calculation of Contrastive Domain Discrepancy (CDD).

To ensure stable CDD estimation, CAN utilizes Class-aware Sampling (CAS). This strategy ensures that each mini-batch contains a balanced representation of classes from both domains, preventing the vanishing of specific class gradients during training.

Experimental Evaluation

The researchers evaluated CAN on two benchmark datasets:

  • Office-31: A dataset with 31 categories across three domains (Amazon, DSLR, Webcam). CAN achieved a state-of-the-art average accuracy of 90.6%.
  • VisDA-2017: A large-scale dataset focusing on the Synthetic-to-Real shift. CAN reached 87.2% accuracy, outperforming complex ensemble methods with a single-model approach.

Visual analysis using t-SNE plots confirmed that CAN produces significantly tighter clusters and clearer class boundaries in the target domain compared to previous class-agnostic methods.

Conclusion

The Contrastive Adaptation Network demonstrates that effective domain adaptation requires more than just global distribution matching. By incorporating class-aware constraints through the CDD metric and an iterative clustering-adaptation loop, CAN successfully prevents class misalignment and sets new performance benchmarks for unsupervised domain adaptation.

Summary updated

BibTeX
@inproceedings{kang2019contrastive,
  author = {Guoliang Kang and Lu Jiang and Yi Yang and Alexander G. Hauptmann},
  title = {{Contrastive Adaptation Network for Unsupervised Domain Adaptation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00503},
}
Figure