Skip to main content
QUICK REVIEW

[Paper Review] Supervised Contrastive Learning with Heterogeneous Similarity for Distribution Shifts

Takuro Kutsuna|arXiv (Cornell University)|Apr 7, 2023
Domain Adaptation and Few-Shot LearningComputer Science3 citations
TL;DR

This paper proposes a novel regularization method for deep neural networks using supervised contrastive learning with heterogeneous similarity, where distinct similarity parameters are applied for positive and negative pairs to implicitly introduce a margin. The method improves robustness under distribution shifts—such as subpopulation shift and domain generalization—by reducing overfitting to training-domain or majority-group features, outperforming standard regularization and baseline contrastive learning on benchmark datasets like CelebA and Camelyon17.

ABSTRACT

Distribution shifts are problems where the distribution of data changes between training and testing, which can significantly degrade the performance of a model deployed in the real world. Recent studies suggest that one reason for the degradation is a type of overfitting, and that proper regularization can mitigate the degradation, especially when using highly representative models such as neural networks. In this paper, we propose a new regularization using the supervised contrastive learning to prevent such overfitting and to train models that do not degrade their performance under the distribution shifts. We extend the cosine similarity in contrastive loss to a more general similarity measure and propose to use different parameters in the measure when comparing a sample to a positive or negative example, which is analytically shown to act as a kind of margin in contrastive loss. Experiments on benchmark datasets that emulate distribution shifts, including subpopulation shift and domain generalization, demonstrate the advantage of the proposed method over existing regularization methods.

Motivation & Objective

  • To address performance degradation in deep neural networks under distribution shifts, such as subpopulation shift and domain generalization.
  • To mitigate overfitting to majority groups or training domains, which can cause significant accuracy drops when test data distributions shift.
  • To improve generalization by introducing a margin-like effect in contrastive learning through asymmetric similarity parameters.
  • To demonstrate that extending cosine similarity to a generalized form (t-vMF) with different parameters for positive and negative pairs enhances robustness.
  • To validate the method's superiority over standard regularization and standard contrastive learning on benchmark datasets with distribution shift.

Proposed method

  • Extends supervised contrastive learning by replacing standard cosine similarity with a generalized t-vMF similarity measure.
  • Introduces distinct similarity parameters for positive and negative pairs, enabling asymmetric treatment in the loss function.
  • Analytically demonstrates that this asymmetric parameterization acts as a margin in the contrastive loss, promoting better separation between positive and negative pairs.
  • Applies the modified loss during end-to-end training of deep neural networks, combining it with cross-entropy for classification.
  • Employs principal component analysis (PCA) to visualize embeddings and validate improved clustering of same-class samples.
  • Evaluates performance on datasets simulating subpopulation shift (CelebA) and domain generalization (Camelyon17, iWildCam).

Experimental results

Research questions

  • RQ1Can asymmetric similarity parameters in contrastive learning improve model robustness under distribution shifts?
  • RQ2Does extending cosine similarity to a generalized t-vMF form with different parameters for positive and negative pairs act as a margin in the loss function?
  • RQ3How does the proposed method compare to standard regularization (weight decay, label smoothing, RandAug) in mitigating performance degradation on out-of-distribution or minority group samples?
  • RQ4In what settings—subpopulation shift or domain generalization—does the method show the most significant improvement?
  • RQ5Does the method generalize to self-supervised contrastive learning, and what are its limitations in data regimes with minimal distribution shift?

Key findings

  • On the CelebA dataset, the proposed method achieved the highest worst-group accuracy (84.5%) among all methods, significantly outperforming standard regularization and baseline SupCon.
  • On Camelyon17, the proposed method achieved 80.24% accuracy on the most out-of-distribution split (OOD1), surpassing even the best-performing baseline (72.69% with RandAug).
  • The method reduced performance degradation on OOD splits by up to 25% compared to standard cross-entropy training, particularly benefiting minority or unseen domains.
  • PCA visualization confirmed that the proposed method produces more compact, class-aggregated embeddings, especially for the same-class samples, indicating improved representation learning.
  • The method showed limited improvement on iWildCam, where no significant OOD degradation occurred during training, suggesting it is most effective when overfitting to training domains is present.
  • The ablation study confirmed that using different parameters for positive and negative pairs is essential—using the same parameter value negated the benefit of the generalized similarity measure.

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.