Table of Contents
Fetching ...

Bridging Contrastive Learning and Domain Adaptation: Theoretical Perspective and Practical Application

Gonzalo Iñaki Quintana, Laurence Vancamberg, Vincent Jugnon, Agnès Desolneux, Mathilde Mougeot

TL;DR

This paper connects contrastive learning with domain adaptation by showing that standard contrastive losses $ ext{$ ext{L}_{NT-Xent}$}$ and $ ext{$ ext{L}_{SupContr}$}$ implicitly reduce the class-wise maximum mean discrepancy $CMMD$, thereby aligning class-conditional embeddings across domains. Through a high-temperature approximation, the authors link $ au ext{L}_{Contr}$ to $CMMD^2$, and extend the theory to inter-class MMD (IMMD), HSIC, and a new DCMMD measure, highlighting how improved domain alignment also enhances class separability. Theoretical results are validated empirically on mammography datasets, including a synthetic patch dataset, showing that SupCon-based training yields better domain adaptation and downstream classification performance in most scenarios, with domain-invariance visualizations supporting the findings. The work provides a solid theoretical foundation for applying contrastive learning to domain adaptation in medical imaging and offers practical guidance for initialization and transfer learning in DA-enabled CL pipelines.

Abstract

This work studies the relationship between Contrastive Learning and Domain Adaptation from a theoretical perspective. The two standard contrastive losses, NT-Xent loss (Self-supervised) and Supervised Contrastive loss, are related to the Class-wise Mean Maximum Discrepancy (CMMD), a dissimilarity measure widely used for Domain Adaptation. Our work shows that minimizing the contrastive losses decreases the CMMD and simultaneously improves class-separability, laying the theoretical groundwork for the use of Contrastive Learning in the context of Domain Adaptation. Due to the relevance of Domain Adaptation in medical imaging, we focused the experiments on mammography images. Extensive experiments on three mammography datasets - synthetic patches, clinical (real) patches, and clinical (real) images - show improved Domain Adaptation, class-separability, and classification performance, when minimizing the Supervised Contrastive loss.

Bridging Contrastive Learning and Domain Adaptation: Theoretical Perspective and Practical Application

TL;DR

This paper connects contrastive learning with domain adaptation by showing that standard contrastive losses ext{L}_{NT-Xent} and ext{L}_{SupContr} implicitly reduce the class-wise maximum mean discrepancy , thereby aligning class-conditional embeddings across domains. Through a high-temperature approximation, the authors link to , and extend the theory to inter-class MMD (IMMD), HSIC, and a new DCMMD measure, highlighting how improved domain alignment also enhances class separability. Theoretical results are validated empirically on mammography datasets, including a synthetic patch dataset, showing that SupCon-based training yields better domain adaptation and downstream classification performance in most scenarios, with domain-invariance visualizations supporting the findings. The work provides a solid theoretical foundation for applying contrastive learning to domain adaptation in medical imaging and offers practical guidance for initialization and transfer learning in DA-enabled CL pipelines.

Abstract

This work studies the relationship between Contrastive Learning and Domain Adaptation from a theoretical perspective. The two standard contrastive losses, NT-Xent loss (Self-supervised) and Supervised Contrastive loss, are related to the Class-wise Mean Maximum Discrepancy (CMMD), a dissimilarity measure widely used for Domain Adaptation. Our work shows that minimizing the contrastive losses decreases the CMMD and simultaneously improves class-separability, laying the theoretical groundwork for the use of Contrastive Learning in the context of Domain Adaptation. Due to the relevance of Domain Adaptation in medical imaging, we focused the experiments on mammography images. Extensive experiments on three mammography datasets - synthetic patches, clinical (real) patches, and clinical (real) images - show improved Domain Adaptation, class-separability, and classification performance, when minimizing the Supervised Contrastive loss.

Paper Structure

This paper contains 27 sections, 7 theorems, 48 equations, 7 figures, 3 tables.

Key Result

Lemma 2.4

In a high temperature regime, both the Supervised Contrastive loss and the NT-Xent loss can be expressed in terms of the CMMD by the following equation:

Figures (7)

  • Figure 1: Examples of synthetic patches (arrows signaling the lesions were inserted).
  • Figure 2: Illustration of a single FFDM image: (a) without LUT application, (b) with LUT application, and (c) the pixel intensity histogram in logarithmic scale for both post-processings.
  • Figure 3: Patch-classifier and whole image classifier architectures for training with the Cross Entropy loss and with the Supervised Contrastive loss. GAP: Global Average Pooling, FC: Fully Connected layer.
  • Figure 4: Evolution of the terms of Equation \ref{['eq:sup_contr_and_cmmd']} during training.
  • Figure 5: Evolution of the Pearson coefficients with the temperature.
  • ...and 2 more figures

Theorems & Definitions (20)

  • Definition 2.1: NT-Xent loss
  • Definition 2.2: Supervised Contrastive loss
  • Definition 2.3: CMMD
  • Lemma 2.4
  • Lemma 2.5
  • Definition 2.6: DCMMD
  • proof
  • proof
  • Lemma 5.1
  • proof
  • ...and 10 more