Abstract
Unsupervised Domain Adaptation (UDA) addresses the challenge of transferring knowledge from a labeled source domain to an unlabeled target domain. While global domain alignment is a common strategy, it often fails to account for class-level distributions, leading to suboptimal feature discriminability and potential misalignment. This paper proposes the Contrastive Adaptation Network (CAN), which introduces Contrastive Domain Discrepancy (CDD) to explicitly model class-specific distributions. By minimizing intra-class discrepancy and maximizing inter-class discrepancy, CAN achieves superior alignment and state-of-the-art results on major benchmarks.
The Challenge of Domain Misalignment
In UDA, the goal is to mitigate the "domain shift" between a labeled source dataset and an unlabeled target dataset. Traditional approaches typically employ domain-agnostic alignment, attempting to make the global feature distributions of both domains indistinguishable.
However, as illustrated above, global alignment can lead to class misalignment—where, for instance, a "car" in the source domain is mapped to a "truck" in the target domain. This lack of class-awareness results in features that are not sufficiently discriminative, hindering the model's ability to generalize to the target data.
Contrastive Adaptation Network (CAN)
The proposed CAN framework moves beyond global alignment by focusing on class-aware contrastive learning. The core of the method is the Contrastive Domain Discrepancy (CDD) metric, which looks at class-specific distributions rather than the whole domain.
Contrastive Domain Discrepancy (CDD)
CDD decomposes the domain discrepancy into two essential parts:
- Intra-class Discrepancy: This component is minimized to pull samples of the same class from different domains closer together.
- Inter-class Discrepancy: This component is maximized to push samples of different classes further apart, creating a clearer and more robust decision boundary.
Iterative Optimization and Clustering
Since target labels are unknown, CAN employs an Alternative Optimization (AO) strategy. It uses the current model to perform spherical K-means clustering on target features to generate "pseudo-labels." To ensure reliability, the model filters out "ambiguous" samples far from cluster centers, using only high-confidence samples to calculate the CDD and update the network.
Class-aware Sampling (CAS)
To facilitate efficient training, the authors implement Class-aware Sampling. This ensures that each mini-batch contains a balanced representation of classes from both domains, providing a stable and reliable estimate of the CDD at every training step.
Experimental Evaluation
The model was evaluated on two major UDA benchmarks:
- Office-31: A standard dataset containing 4,110 images across 31 classes from three domains: Amazon, Webcam, and DSLR.
- VisDA-2017: A large-scale challenge dataset focused on the synthetic-to-real shift, containing approximately 280,000 images across 12 categories.
Key Results and Insights
CAN achieved state-of-the-art results at the time of publication:
- Office-31: Achieved an average accuracy of 90.6%, outperforming the previous best (MADA) by 5.4%.
- VisDA-2017: Achieved a mean accuracy of 87.2%, surpassing the 2017 competition winner by 2.9%.
- Discriminative Features: Qualitative evidence from t-SNE visualizations confirms that CAN produces much tighter, better-separated clusters for target data compared to domain-agnostic methods.
- Robustness through Averaging: By utilizing MMD-based metrics like CDD, which rely on mean embeddings of distributions, the method remains robust to the noise inherent in individual pseudo-labels.
Conclusion and Limitations
CAN effectively addresses the limitations of global domain alignment by introducing class-aware contrastive learning. However, the method's reliance on clustering introduces certain constraints. It requires a minimum number of target samples per class for accurate CDD estimation and assumes that the initial domain shift is not so severe that the first clustering step fails completely. Despite these considerations, CAN represents a significant step forward in learning discriminative, domain-invariant features for unsupervised adaptation.
Summary updated