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

Multi-Similarity Contrastive Learning

Emily Mu, John V. Guttag, Maggie MakararXiv 2023 · DOI

Abstract

Multi-Similarity Contrastive Learning (MSCon) moves beyond standard contrastive methods that rely on a single definition of "similarity." By utilizing multiple projection heads and automatically down-weighting noisy or uncertain similarity metrics, MSCon learns more robust embeddings that significantly improve generalization to unseen tasks.

Introduction

Contrastive learning has become a cornerstone of representation learning, famously used in models like SimCLR and CLIP. The core idea is simple: push "similar" images together in embedding space and pull "dissimilar" ones apart. However, most existing methods define similarity through a single lens—either self-supervised augmentations or a single class label.

The authors argue this is too simplistic. Real-world objects have multiple facets of similarity. For example, two shoes might be similar in category (both are sneakers) but dissimilar in closure type (velcro vs. laces). Relying on just one metric ignores valuable supervisory signals. Furthermore, in multi-task settings, some labels are naturally noisier or more "uncertain" than others. If a model treats a noisy similarity metric with the same weight as a clean one, the resulting embeddings fail to generalize well to new, out-of-domain tasks.

The MSCon Framework

The authors introduce MSCon, a framework that jointly utilizes supervision from multiple similarity metrics. Its architecture consists of a shared base encoder followed by multiple parallel projection heads, each dedicated to a specific similarity task.

The MSCon architecture uses a shared CNN encoder followed by parallel projection heads for different similarity tasks.

The key technical innovations are:

  1. Multi-Similarity Loss: Instead of one contrastive loss, the model calculates a loss for each similarity metric (e.g., one for "shoe category," one for "gender").
  2. Uncertainty-Based Weighting: The authors derive a "pseudo-likelihood" function for contrastive learning. This allows them to treat the temperature of the contrastive loss as a learnable parameter ($\sigma_c$) representing the uncertainty of a specific task.
  3. Automated Optimization: During training, the model uses gradient descent to learn these weights. If a task is noisy or uninformative, the model automatically increases its $\sigma_c$, effectively down-weighting that task's contribution to the shared embedding.

This approach ensures the shared encoder focuses on the most reliable and informative features across all provided metrics.

Datasets

The researchers evaluated MSCon on two primary multi-label datasets:

  • Zappos50k: 50,000 images of shoes labeled with category, closure mechanism, and suggested gender. They used "brand" as an unseen, out-of-domain task for evaluation.
  • MEDIC: A large-scale disaster-related dataset (~71,000 images) with four tasks: disaster type, informativeness, humanitarian categories, and damage severity.

Key Insights

  • Contrastive Learning as Likelihood: One of the most elegant parts of the paper is framing the non-parametric contrastive loss as a pseudo-likelihood. This bridges the gap between contrastive learning and established Bayesian multi-task learning techniques.
  • Generalization through Robustness: The results suggest that "overfitting" to a single similarity metric limits a model's "vocabulary." By forcing the model to reconcile multiple (weighted) similarities, it learns a more nuanced feature space that is more useful for tasks it hasn't seen yet.
  • Handling Label Noise: In experiments where labels were artificially corrupted, MSCon successfully identified the noisy task and "muted" it. This prevents the noise from one task from "poisoning" the shared representation used by other tasks.

Key Results

MSCon demonstrates superior performance in both standard and challenging out-of-domain scenarios.

  • In-Domain Superiority: On the Zappos50k dataset, MSCon achieved 97.17% accuracy on shoe category classification, outperforming standard Supervised Contrastive learning (SupCon) and multi-task cross-entropy baselines.
  • Out-of-Domain (OOD) Generalization: This is where MSCon shined brightest. When evaluated on the unseen task of predicting shoe brands, MSCon achieved 42.62% accuracy, a massive jump over the 32.10% achieved by a standard multi-task cross-entropy model.
  • Robustness to Corruption: Even when one task's labels were 100% randomized (maximum noise), the weighted version of MSCon maintained high performance on other tasks, whereas unweighted versions saw significant performance degradation.
Out-of-domain evaluation on shoe brand accuracy shows MSCon's superior performance and robustness compared to unweighted versions as closure labels are corrupted.

Limitations and Future Work

Currently, MSCon learns a weight for an entire task, but it doesn't yet account for data-dependent uncertainty (e.g., a specific image that is blurry). Furthermore, the framework is designed for categorical labels; extending this to continuous similarity metrics remains an open challenge. Finally, the paper assumes available labels are relevant, but a formal criterion for task selection would be a valuable addition to future research.

Summary updated

BibTeX
@misc{mu2023multi,
  author = {Emily Mu and John V. Guttag and Maggie Makar},
  title = {{Multi-Similarity Contrastive Learning}},
  year = {2023},
  eprint = {2307.02712},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.02712},
}
Figure