Supervised Contrastive Learning
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
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.
Evidence graph: 4 refs, 4 links.
Utility signals: depth 100/100, grounding 95/100, status high.
Implementation
Best maintained implementation now
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)
google-research/google-research is the strongest maintained implementation based on ranking signals. License is declared (Apache-2.0).
Open google-research/google-research- 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.
- 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
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.
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.
These repositories had low-confidence matching signals and are hidden by default.
- flyingsheepbin/pet-biometrics
Confidence: Low · 27 stars
Hugging Face artifacts
No direct paper-linked artifacts were found. Showing strongest curated related artifacts for faster exploration.
Models
- keras-io/supervised-contrastive-learning-cifar10
26 downloads · 3 likes
Broaden model search
Datasets
No trustworthy datasets matches right now.
Search datasets on Hugging FaceSpaces
No trustworthy spaces matches right now.
Search spaces on Hugging FaceResearch context
Tasks
Image classification
Methods
None detected
Domains
Computer vision
Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.
Open in HFEPXJump to Paper2Code search queries derived from this paper's research context.
Data includes links from Papers with Code ( CC-BY-SA-4.0 ).