# Contrastive learning (InfoNCE)

Source: https://onco.cc/terms/contrastive-learning/  
OnCo record `contrastive-learning` (Term). Data CC BY-NC 4.0, attribute "Data from OnCo (onco.cc)"; commercial use needs a licence.

## TL;DR

Contrastive learning trains a model to pull matching pairs (two views of one slide, or one patient's RNA and protein) close together in embedding space and push non-matching pairs apart.

## Summary

Contrastive methods are a branch of self-supervised learning in which the model learns by comparing positive pairs against negatives drawn from the batch (Wikipedia on self-supervised learning); the InfoNCE loss is the usual objective. It powers vision-language pathology models that align tile images with report text (CONCH) and multimodal patient models that align a patient's modalities. Its weakness is that it needs many negatives and can learn the batch rather than the biology.

## Fields

- Kind: Term
- Last checked: 2026-09-24
- Also known as: contrastive learning; contrastive objective; contrastive alignment; InfoNCE; InfoNCE loss; contrastive pretraining
- Tags: cansim-terms

## Notes

- Listed in the CanSim terms map 1.0.0 (docs/onco/terms.json, generated 2026-09-24), CC BY 4.0, attribution: CanSim project, an open, public-data-first cancer foundation-model programme; CanSim page path /terms/contrastive-learning.

## Sources

- Wikipedia: https://en.wikipedia.org/wiki/Self-supervised_learning
- Wikipedia: https://en.wikipedia.org/wiki/Self-supervised_learning

## Connected records

- terms: [Cancer AI vocabulary (CanSim terms map)](https://onco.cc/terms/cancer-ai-vocabulary/), [Embedding (learned representation)](https://onco.cc/terms/embedding/), [Multimodal fusion (early, late, modality dropout)](https://onco.cc/terms/multimodal-fusion/), [Self-supervised pretraining (SSL)](https://onco.cc/terms/self-supervised-pretraining/)

---
JSON: https://onco.cc/api/v1/entities/contrastive-learning.json