Skip to main content
QUICK REVIEW

[Paper Review] Connect, Not Collapse: Explaining Contrastive Learning for Unsupervised Domain Adaptation

Kendrick Shen, R. Jones|arXiv (Cornell University)|Apr 1, 2022
Domain Adaptation and Few-Shot LearningComputer Science19 citations
TL;DR

This paper demonstrates that contrastive pre-training on unlabeled source and target data, followed by fine-tuning on labeled source data, achieves state-of-the-art performance in unsupervised domain adaptation (UDA) without requiring domain-invariant features. The key insight is that contrastive learning disentangles class and domain information in the feature space, enabling generalization across domains even when features are highly distinguishable between domains.

ABSTRACT

We consider unsupervised domain adaptation (UDA), where labeled data from a source domain (e.g., photographs) and unlabeled data from a target domain (e.g., sketches) are used to learn a classifier for the target domain. Conventional UDA methods (e.g., domain adversarial training) learn domain-invariant features to improve generalization to the target domain. In this paper, we show that contrastive pre-training, which learns features on unlabeled source and target data and then fine-tunes on labeled source data, is competitive with strong UDA methods. However, we find that contrastive pre-training does not learn domain-invariant features, diverging from conventional UDA intuitions. We show theoretically that contrastive pre-training can learn features that vary subtantially across domains but still generalize to the target domain, by disentangling domain and class information. Our results suggest that domain invariance is not necessary for UDA. We empirically validate our theory on benchmark vision datasets.

Motivation & Objective

  • To challenge the conventional UDA paradigm that relies on learning domain-invariant features for generalization.
  • To investigate why contrastive pre-training—despite not learning domain-invariant features—achieves strong performance in UDA.
  • To theoretically explain how contrastive learning enables transferability across domains when features are easily separable by domain.
  • To empirically validate the proposed theory using benchmark vision datasets and connectivity-based analysis of data augmentations.

Proposed method

  • Proposes a graph-based model where nodes represent data points and edges represent augmentation-induced similarity between inputs.
  • Defines class-domain connectivities as the total edge weight between pairs of class-domain combinations (e.g., photos of clocks vs. sketches of butterflies).
  • Introduces a stochastic block model to formalize the assumption that augmentations are more likely to change class or domain individually than both simultaneously.
  • Theoretically proves that contrastive pre-training can achieve high target accuracy without domain invariance, provided that class and domain connectivities satisfy a specific hierarchy.
  • Empirically estimates connectivities on DomainNet and Living-17, showing they satisfy the theoretical condition.
  • Uses the ratio of estimated connectivities to predict target accuracy, achieving R² = 0.78 on DomainNet.

Experimental results

Research questions

  • RQ1Why does contrastive pre-training generalize to the target domain in UDA without learning domain-invariant features?
  • RQ2What structural property of data augmentations enables contrastive learning to disentangle class and domain information in the feature space?
  • RQ3Can the success of contrastive pre-training be explained by a theoretical model based on connectivity between class-domain pairs?
  • RQ4How do the estimated connectivities between class-domain pairs correlate with actual target accuracy in UDA?
  • RQ5Does adversarial manipulation of data connectivity degrade the performance of contrastive pre-training?

Key findings

  • Contrastive pre-training achieves comparable or better target accuracy than strong UDA baselines like DANN and self-training on DomainNet, BREEDS Living-17, and STL-10 → CIFAR-10.
  • In the SwAV-learned feature space, domain can be predicted with only 8% error, significantly lower than DANN’s 14%, indicating high domain separability.
  • The cosine similarity between class and domain classifier weights in SwAV features is near zero (average 0.18), indicating that class and domain information are encoded along approximately orthogonal directions.
  • Target accuracy on DomainNet is well-predicted by the ratio of estimated connectivities (R² = 0.78), validating the theoretical model.
  • Pre-training on subsets designed to disrupt connectivity ratios leads to 4%–16% drops in target accuracy, confirming the importance of connectivity structure.
  • Contrastive pre-training learns features that are highly predictive of both class and domain, yet still generalize across domains, contradicting the need for domain invariance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.