Skip to content
OpenTrain AIFor AI Companies

Supervised Contrastive Learning

Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian +4 morePublished Apr 23, 2020
arXiv PDF
Researcher verdict
Starting point
Use as implementation starting point
Benchmark evidence
Thin evidence
Verify before relying
Time to first repro
A few days
Plan setup time
Risk flags
2
Review before use

Abstract

Domain fit: AI-adjacent · Paper appears method- or tooling-adjacent to AI workflows with partial ecosystem coverage.

Contrastive learning applied to self-supervised representation learning has seen a resurgence in recent years, leading to state of the art performance in the unsupervised training of deep image models. Modern batch contrastive approaches subsume or significantly outperform traditional contrastive losses such as triplet, max-margin and the N-pairs loss. In this work, we extend the self-supervised batch contrastive approach to the fully-supervised setting, allowing us to effectively leverage label information. Clusters of points belonging to the same class are pulled together in embedding space, while simultaneously pushing apart clusters of samples from different classes. We analyze two possible versions of the supervised contrastive (SupCon) loss, identifying the best-performing formulation of the loss. On ResNet-200, we achieve top-1 accuracy of 81.4% on the ImageNet dataset, which is 0.8% above the best number reported for this architecture. We show consistent outperformance over cross-entropy on other datasets and two ResNet variants. The loss shows benefits for robustness to natural corruptions and is more stable to hyperparameter settings such as optimizers and data augmentations. Our loss function is simple to implement, and reference TensorFlow code is released at https://t.ly/supcon.

Results and benchmarks

Freshness tier: cold
Contrastive learning applied to self-supervised representation learning has seen a resurgence in recent years, leading to state of the art performance in the unsupervised training of deep image models.
Task Dataset Metric Value Source
Image classification CIFAR-10 mAP 101 paper-derived
Image classification CIFAR-100 mAP 50 paper-derived
Image classification PASCAL VOC mAP 88.20 paper-derived

Audit each benchmark finding before selecting an implementation path. Evidence refs map to the disclosure below.

Implementation

Best maintained implementation now

Recommended
Confidence: High
Reproducibility: Limited

Google Research

38,606 stars · 8,465 forks · Last push Aug 21, 2026 · Apache-2.0 license

  • License
  • CI
  • Dependencies
  • Docker

Official implementation from Papers with Code · Community adoption signal (38606 stars)

Why this implementation
Confidence: high

google-research/google-research is the strongest maintained implementation based on ranking signals. License is declared (Apache-2.0).

Open google-research/google-research
Reproduction risks
  • No CI workflows detected
  • Dependency manifest is missing
  • Selected google-research/google-research as the strongest maintained implementation for new work.
  • Repository activity is within the last 24 months.
  • Official repository is preserved separately as historical context.

Compare implementation paths

Compare maintenance quality, reproducibility coverage, and evidence confidence before choosing a reproduction baseline.

HobbitLong/SupContrast
historical official
Maintenance
Stale
Confidence
High
Reproducibility
Limited
Stars
3,449
Last push
Dec 26, 2023 (972d)

Official implementation from Papers with Code · Repository link is mentioned in the paper metadata

  • No push in 12+ months
  • No CI pipeline detected
  • No tagged releases
Maintenance
Active
Confidence
High
Reproducibility
Limited
Stars
38,606
Last push
Aug 21, 2026 (3d)

Official implementation from Papers with Code · Community adoption signal (38606 stars)

  • No CI pipeline detected
  • No tagged releases
  • No Docker setup
Maintenance
Stale
Confidence
Low
Reproducibility
Moderate
Stars
27
Last push
Jul 10, 2023 (1141d)

Community adoption signal (27 stars) · Repository appears stale (>24 months since last push)

  • No push in 12+ months
  • No CI pipeline detected
  • No tagged releases

Reproduction readiness

Time to first repro: days
Last checked: Aug 23, 2026

Major work

No dependency manifest, manual reconstruction required

  • google-research/google-research has no requirements.txt, environment.yml, pyproject.toml, or Dockerfile.
  • You will need to reverse-engineer dependencies from import statements in the source code.
Open google-research/google-research

Hardware requirements

  • Expect multi-day setup/compute for meaningful reproduction based on current guidance.

Repositories and ecosystem

No additional verified repositories beyond the primary recommendation.

Hugging Face artifacts

No direct paper-linked artifacts were found. Showing strongest curated related artifacts for faster exploration.

Datasets

No trustworthy datasets matches right now.

Search datasets on Hugging Face

Spaces

No trustworthy spaces matches right now.

Search spaces on Hugging Face

Research context

Tasks

Image classification

Methods

None detected

Domains

Computer vision

Evaluation and human feedback data

Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.

Open in HFEPX
Explore similar papers

Jump to Paper2Code search queries derived from this paper's research context.

Data includes links from Papers with Code ( CC-BY-SA-4.0 ).