Technology · Machine learning
Contrastive learning
Neural network training technique
Contrastive learning is a way of training a neural network to turn raw inputs, such as images or heart signals, into compact numerical representations, called embeddings, by teaching it a simple relational rule: representations of things that belong together should end up close, and representations of things that do not belong together should end up far apart.
The method never asks the network to name what it sees. It only asks it to arrange examples in space so that related ones cluster and unrelated ones separate.
Key facts
| 76.5% | SimCLR linear probe top-1 accuracy on ImageNet, matching supervised ResNet-50 (Chen et al., 2020)[1] |
|---|---|
| 51% | PCLR average performance gain over models trained from scratch across four ECG tasks (Diamant et al., 2022)[2] |
| 28% | Average F1 gain of histopathology-pretrained networks over ImageNet-pretrained ones (Ciga et al., 2022)[3] |
| 10% | Share of labels ConVIRT needed to match ImageNet-initialised models on four tasks (Zhang et al., 2020)[4] |
Overview
Contrastive learning
A concrete case makes the rule plain. Take one photograph of a dog and produce two altered copies of it, perhaps cropping each differently or shifting the colours. Those two copies form a positive pair: the network is rewarded for placing their embeddings near each other. Now take a photograph of a different dog, or of a bicycle, and treat it as a negative pair with the first image: the network is rewarded for placing its embedding far away. Repeated over many examples, this pressure forces the network to encode whatever it is that makes two views of the same thing recognisably the same, and whatever distinguishes one thing from another.[5]

What makes the approach attractive is how little it demands of the data. Ordinary supervised training needs a human to attach a correct label to every example, and for many kinds of data that labelling is the expensive, slow part. Contrastive learning needs only a notion of which samples go together and which do not, and that notion can often be manufactured from the data itself. A common recipe perturbs a sample, by cropping it or changing its colour, and trains the network to group an image with its own altered versions while separating it from other images, so that useful representations are learned with no or very minimal amounts of labelled data.[6] The same logic extends past images: two recordings from the same patient, two sentences with the same meaning, or an image and the text that describes it can each supply the pairs.
This is why the method matters most where labels are scarce. When only a small set of labelled examples exists for the task that actually matters, a network can first be trained contrastively on a large pool of unlabelled material, and the representations it learns can then be put to use on the smaller labelled problem. The appeal is strongest in fields where expert annotation is costly or slow, and the scarcity of high-quality annotated data is a recognised obstacle to applying machine learning in medical imaging.[7]
The main variants
The variants differ mainly in where the pairs come from. In self-supervised contrastive learning, no labels are used at all; positives are generated by augmenting or otherwise relating unlabelled samples, as in the two-crops example above.[5] In supervised contrastive learning, the available labels are exploited directly: samples sharing a class are pulled together and samples from different classes are pushed apart, so that the label information shapes the geometry of the embedding space rather than being predicted directly.[8] A further approach works across modalities, treating, say, an image and its accompanying text as a positive pair, which lets a model learn a shared space in which the two kinds of data can be compared.[4]
What remains open
The central design question is what should count as a positive pair, because that choice decides what the representation treats as irrelevant. If two crops of a photo are declared equivalent, the network learns to ignore cropping; if two images of the same skin condition from different angles are declared equivalent, it learns to ignore viewpoint. The choice is not neutral, and a representation trained to disregard some feature will struggle on any later task that depends on it. A general framework for contrastive representation learning treats the method as a family of components, the pair definitions, the loss and the encoder among them, whose settings carry built-in assumptions about what should be ignored.[9] Getting those assumptions right for a given kind of data is the practical heart of the technique, and the sections that follow take up how pairs are built, how the loss works, and where the method has been applied.
Contrastive learning replaces human labels with a simpler signal, which samples belong together, and learns representations by pulling the first kind close and pushing the second kind apart.
History
From metric learning to SimCLR and CLIP
Contrastive learning is often described as a recent idea, but its core operation is old. Long before neural networks were trained this way, researchers in metric learning were building systems that learn a distance function: a rule that says how close two items should be considered, learned from examples of items that ought to match and items that ought not. The origins of contrastive learning date as far back as the 1990s, and its development has spanned many fields and domains, including metric learning and natural language processing.[9] The modern wave is distinguished less by the objective itself than by what it is attached to: deep networks, very large unlabelled datasets, and the realisation that the relational signal can be manufactured from the data without human annotation.

The resurgence in computer vision came from a run of methods that made the recipe simpler and stronger. SimCLR was presented as a deliberately minimal framework: no specialised architecture, no memory bank of stored features, just an encoder, a pair of augmented views of each image, and a loss that rewards agreement between them. Its authors then took the framework apart to see which pieces mattered, and reported that the composition of data augmentations is critical to defining an effective task, that inserting a small learnable nonlinear transformation between the representation and the loss improves the quality of what is learned, and that contrastive training benefits from larger batches and longer training than supervised training does.[1] The value of that work lies as much in the dissection as in the result: it turned a collection of tricks into a small set of design choices that others could reason about.
A parallel line of work took a different route to the same goal. Momentum Contrast, or MoCo, is a contrastive framework to which SimCLR's design improvements can be added; with an MLP projection head and more data augmentation, MoCo establishes stronger baselines that do not require large training batches.[10] The two families are best understood as different answers to a practical question: how does a training run obtain enough informative negatives at reasonable cost? That question is taken up in detail later.
The same relational loss can also be pointed at labels when labels exist. Supervised contrastive learning keeps the batch-contrastive machinery but uses class membership to decide the pairs, pulling together all embeddings of the same class and pushing apart embeddings of different classes, rather than treating each instance as its own class. On ResNet-200 the approach reached 81.4 percent top-1 accuracy on ImageNet, 0.8 percent above the best figure reported for that architecture, and the authors report that the loss was more stable across optimiser and augmentation settings than the standard cross-entropy objective.[8] The finding matters for the idea because it shows the contrastive objective is not merely a substitute for labels: it is a different way of using them, one that shapes the geometry of the embedding space instead of training a classifier to name categories.
The most consequential extension, however, crossed a boundary between data types. CLIP, contrastive language-image pretraining, is a contrastive learning architecture that later work in peptide design borrowed to jointly encode cognate peptide-protein pairs. Later work in peptide design borrowed a CLIP-based contrastive learning architecture to jointly encode cognate peptide-protein pairs, screening generated candidate peptides for target-selective binding, and reported experimentally validated binders to conformationally diverse targets including an enzyme, a transcription factor and a fusion oncoprotein.[11] That a CLIP-based contrastive scheme could be applied to peptide-protein pairs illustrates how the underlying rule can be repointed at new data types: define what belongs together, and the rest is optimisation.
The objective is decades old; what changed was pairing it with deep encoders, huge unlabelled datasets, and the insight that almost any kind of relatedness, between two views, two classes, or an image and its caption, can supply the training signal.
How it works
Positive pairs, negative pairs and the embedding space
Everything in contrastive learning happens inside a geometric space. An encoder, usually a deep network, takes a raw input, an image, a recording, a sentence, and maps it to a list of numbers, a vector. That vector is the embedding, and the whole training run is a process of arranging embeddings so that the distances between them carry meaning. The encoder is not told what a dog is or what a heart rhythm signifies; it is told only which pairs of inputs should land near each other and which should land far apart, and it adjusts its internal weights until the arrangement obeys that instruction. The loss function is the scorekeeper of this arrangement: it measures how well the current embeddings satisfy the closeness and separation requirements, and the network is updated to lower that measure.
The usual source of positive pairs is data augmentation, the practice of generating altered copies of an input. A photograph can be cropped, its colours shifted, its brightness changed, or its orientation flipped; each altered copy is a different view of the same underlying thing, so the pair of views is declared positive. A crop teaches the encoder that position within the frame is irrelevant; a colour shift teaches it that hue is irrelevant. The negatives, by contrast, are usually free: any two different inputs in the same training batch can serve as a negative pair, since the network is asked to keep their embeddings apart.
Between the encoder and the loss, SimCLR inserted a small learnable nonlinear transformation, the projection head, and the authors reported that this addition substantially improves the quality of the learned representations.[1] The arrangement is slightly counterintuitive: the loss is computed on the output of the projection head, but the embeddings used later, for whatever task the network is eventually applied to, are taken from the layer before it. The head acts as a disposable workspace where the contrastive objective can shape the geometry without distorting the representation that will actually be kept.
Training proceeds in batches, groups of examples pushed through the network together, with the loss computed over the pairs available within each batch and the weights updated once per batch. Batch size therefore controls something substantive: a larger batch contains more negatives, and more negatives give the separation pressure more to work with. SimCLR's authors found that contrastive learning benefits from larger batch sizes and more training steps than supervised learning does, which is one reason the method is hungry for memory and compute.[1] The survey of contrastive self-supervised methods describes the standard recipe in the same terms, embedding augmented versions of the same sample close together while pushing away embeddings of different samples.[5]
Not all negatives are equally useful. A hard negative is a sample that is genuinely different from the anchor yet sits close to it in embedding space, so that separating the two requires the encoder to learn a finer distinction. Ordinary random negatives are often easy: a picture of a bicycle is nothing like a picture of a dog, and pushing their embeddings apart teaches little. Work on hard negative sampling argues that contrastive learning benefits from negatives that are difficult to distinguish from the anchor, and develops unsupervised sampling methods that select such negatives without access to true labels, since the method must remain label-free.[12] A related line of work reaches the same conclusion from the other direction, showing that harder negatives are needed for better and faster learning and proposing to mix negatives at the feature level to manufacture them on the fly.[13]
The reason hard negatives matter connects back to what the embedding space is for. If every negative is trivially far away, the encoder can satisfy the loss with coarse distinctions, and the resulting space will separate cats from bicycles but blur the differences between one breed of dog and another. Hard negatives force the space to resolve fine structure. The same logic explains why the choice of positives is delicate: a pair that shares too much, or too little, yields a weak training signal. One analysis of view selection argues that good views should reduce the mutual information between the two members of a positive pair while keeping task-relevant information intact, and shows empirically that increasing the strength of data augmentation does reduce that mutual information and improves downstream classification accuracy.[14] In plain terms, the two views should be different enough that agreeing on them is informative, but not so different that the shared content is lost.
The embedding space also has a shape that can go wrong. Because the loss only asks for relative distances, there is nothing in the objective that forbids the encoder from crowding all embeddings into a small region, or from using only a few of the available dimensions while leaving the rest unused. These failure modes, and the sampling biases that produce them, are taken up later. For now the essential picture is a space populated by vectors, pulled and pushed by a loss, with the strength and honesty of that pull depending on how the pairs were chosen and how many useful negatives the batch supplies.
The encoder learns nothing about categories; it learns a geometry, and the quality of that geometry depends on which pairs were declared similar, which were declared different, and how hard the differences were to resolve.
Choosing what counts as similar
The rule at the centre of contrastive learning sounds like it settles everything: bring related things together, push unrelated things apart. It leaves the hardest question untouched. What makes two samples related? Nothing in the data answers this. The answer is supplied by whoever designs the training run, and it is a decision, not a discovery. Two crops of one photograph, two recordings from one patient, a picture and its caption, two consecutive seconds of a heartbeat: each of these can be declared a positive pair, and each declaration teaches the network a different lesson about what to ignore.
The most common declaration treats altered copies of one input as equivalent. A photograph is cropped, recoloured, or rotated, and the network is trained to give both versions the same embedding. The consequence is direct: the encoder learns that the feature being altered does not matter. Crop the image and the network learns to disregard where an object sits in the frame; shift the colours and it learns to disregard hue. This is efficient when the alteration destroys nothing the later task needs, and harmful when it does. A representation trained to ignore colour will serve a task that asks whether a car is red or yellow poorly, because the training has already thrown away the very distinction the task depends on. Work on this problem notes that contrastive methods implicitly assume a particular set of invariances, such as invariance to colour, and can perform badly when a downstream task violates the assumption; the proposed remedy is to build separate embedding spaces, each invariant to all but one augmentation, so that the information discarded in one space survives in another.[15]
The same tension appears in the choice of how strongly to alter the copies. Weak alterations leave the two views nearly identical, so agreeing on them is easy and teaches little. Strong alterations risk removing the content that made the pair a pair. One analysis frames the trade-off in information terms, arguing that good views should reduce the mutual information between the two members of a positive pair while keeping task-relevant information intact, and shows empirically that increasing the strength of augmentation does reduce that mutual information and improves downstream classification accuracy.[14] The practical reading is that the two views should differ enough for agreement to be informative, yet share enough that the shared content is real.
Augmentation is only one way to build a pair, and for some kinds of data it is the wrong way. A medical image can be flipped or brightened, but the useful relationships in clinical data often lie between records rather than within one. The alternative is to let an external fact define the pair.
In Patient Contrastive Learning of Representations, the pair is two electrocardiograms taken from the same person at different times, and the network is trained to place them in the same region of the embedding space while separating recordings from different people.[2] No augmentation is applied at all; the shared biology of one patient's heart supplies the signal. The choice carries its own assumption, namely that what stays constant across a person's recordings is worth encoding. That assumption is plausible for traits that change slowly, such as sex or inherited cardiac features, and weaker for a condition that comes and goes between recordings, since a rhythm that is present in one trace and absent in the next will not look like a stable patient signature.[2]
A third route crosses modalities entirely. When each image arrives with an accompanying report, the image and its text can be declared a positive pair and mismatched pairs treated as negatives, so the network learns a shared space in which a picture and a sentence can be compared.[4]
Signals offer a further option, because time itself can generate pairs. Two non-overlapping segments of one recording, or the same segment under two different leads, can be treated as related, and the network is pushed to align them. The pair definition here encodes a claim about physiology: that the same underlying state shows up in different leads and at different moments.
Pairs can also be defined by shared experience rather than shared identity. In work on emotion recognition from brain signals, the positive pair is the same emotional stimulus as it appears in two different people, and the network is trained to maximise similarity of the representations across subjects while separating representations of different stimuli.[16] The aim is to strip out the person-specific variation that makes one individual's brain response look unlike another's, so that a classifier trained on some subjects transfers to unseen ones. The pair definition is doing exactly the work described above: it names the variation to be discarded, and here that variation is individual physiology.
These examples share a structure. Every positive pair is a statement that some difference between two samples is irrelevant, and every such statement is a gamble on what later tasks will need. The gamble can be examined rather than guessed. A representation can be tested on tasks that depend on the discarded feature, and if it fails there, the pair definition, not the training procedure, is the thing to change.
A positive pair is a claim about what does not matter; the quality of a contrastive representation is largely the quality of those claims.
Uses
Beyond pictures: text, graphs, molecules and more
The relational rule does not care what an input is made of. An image, a sentence, a molecule and a network of relationships can all be mapped to embeddings, and in each case the training signal comes from declaring which samples belong together. What changes from one domain to the next is where those declarations come from, and that is where the interesting engineering lies. Pictures offer an easy answer, because a photograph can be cropped or recoloured and still show the same thing. Sentences, graphs and protein sequences do not offer that convenience in the same form, so each field has had to invent its own way of saying that two things are the same.

Text was an early test of whether the rule survives without a picture to lean on. A sentence can be altered by deleting a word, removing a span, reordering its clauses or substituting synonyms, and the altered version can be declared a positive pair with the original on the grounds that it still means the same thing. CLEAR, contrastive learning for sentence representation, applied exactly these augmentations and trained a sentence encoder to be noise-invariant, then reported that it outperformed several existing methods on the SentEval and GLUE benchmarks. The work also turned up a detail that matters for anyone choosing augmentations: different sentence augmentations during pretraining led to different improvements on different downstream tasks.[17] Deleting words and reordering clauses are not interchangeable lessons, and which one helps depends on what the representation will later be asked to do.
Graphs pose a sharper version of the same problem. A graph is a set of nodes and the edges between them, and the augmentations that make sense for an image, cropping and colour shifting, have no direct analogue. Graph contrastive learning handles this by designing augmentations suited to graph structure, such as dropping nodes or edges, and by treating two differently augmented versions of one graph as a positive pair while separating augmented versions of different graphs.
The GraphCL framework introduced four types of graph augmentation and tested their combinations across semi-supervised, unsupervised and transfer settings as well as under adversarial attack, finding that the resulting representations were similar to or better than state-of-the-art methods in generalizability, transferability and robustness without tuning the extent of the augmentations or using elaborate network architectures.[18] The finding carries a warning as much as a result: because the augmentations had to be chosen by hand for each dataset, the method's effectiveness depended on a choice that was being made by rule of thumb or trial and error. A later framework automated that choice, selecting augmentations for each graph dataset through a bi-level optimisation and reporting performance on par with or sometimes better than GraphCL across graphs of various scales and types, without dataset-specific tuning.[19] The pair definition, in other words, had become a parameter to be learned rather than a decision to be made.
Molecules push the idea further, because the relevant relationship is often functional rather than structural. CLEAN, contrastive learning-enabled enzyme annotation, assigns enzyme commission numbers, the standard labels for what reaction an enzyme catalyses, by learning a representation in which enzymes with the same function sit close together. The method was reported to assign commission numbers with better accuracy, reliability and sensitivity than BLASTp, the standard sequence-similarity tool, and to do three things that comparison tool could not: confidently annotate understudied enzymes, correct mislabelled ones, and identify promiscuous enzymes carrying two or more commission numbers, demonstrated through systematic in silico and in vitro experiments.[20] The point of contrastive training here is that similarity of sequence is a poor stand-in for similarity of function. Two enzymes can share little sequence and do the same chemistry, and a representation shaped by functional relatedness can capture that where a direct sequence comparison cannot.
Peptide design shows the rule operating across two kinds of data at once. The candidates that rank highly were validated experimentally, both as inhibitory peptides and as fusions to a degradation domain, showing functionally potent binding and degradation of conformationally diverse targets including an enzyme, a transcription factor and an undruggable fusion oncoprotein.[11] What makes the example instructive is the division of labour: one model proposes, another judges by embedding candidate and target in a shared space and asking how close they land. The contrastive component is not learning to see; it is learning what fits together.
Retrieval is the task where this shared-space idea pays off most directly, since the whole job is to rank items by how well they match a query. Dense retrievers, neural networks that map queries and documents into a common embedding space, had reached strong results where large training sets existed but transferred poorly to new applications with no training data, where the classical term-matching method BM25 beat them. Training contrastively without supervision changed that picture: on the BEIR benchmark the unsupervised model outperformed BM25 on 11 of 15 datasets at Recall@100, and used as pretraining before fine-tuning on a few thousand in-domain examples it improved results further. The same study found the approach worked for multilingual retrieval, including retrieving English documents from Arabic queries, a match that term-matching methods cannot make because the scripts share no terms.[21]
Time series bring the problem back to a form that resembles images, but with a twist: the natural axis of variation is time itself. One framework generates new training samples by mixing two series together and asks the network to predict the mixing proportion, using that proportion as a soft target in the loss, and reported better performance than other representation learning approaches on both univariate and multivariate time series, with benefits for transfer learning on clinical series.[22] Mixing two recordings produces a sample that is neither one nor the other, and forcing the representation to reflect the degree of mixture is a way of extracting a graded signal from data that has no labels.
Across all of these domains the pattern repeats. The encoder and the loss barely change; what changes is the story told about why two samples belong together, whether that story is a deleted word, a dropped edge, a shared reaction, a binding affinity or a mixing proportion. Each story is a claim about which differences can be safely ignored, and each is only as good as the later task's agreement with it.
Research
Evidence from images and general benchmarks
The first serious test of any representation method is whether what it learns transfers. A network trained contrastively on unlabelled images produces embeddings, and the standard way to judge those embeddings is the linear probe: freeze the encoder, train nothing but a simple linear classifier on top of its output, and measure accuracy on a labelled benchmark. If a plain linear layer on frozen features classifies well, the representation itself has captured the structure that matters, since the classifier has no power to reshape it. ImageNet, with its thousand categories of ordinary photographs, became the common yardstick, and the numbers reported there are what made the approach credible.

SimCLR supplied the clearest set. A linear classifier trained on its self-supervised representations reached 76.5 percent top-1 accuracy on ImageNet, a 7 percent relative improvement over the previous state of the art and a match for a supervised ResNet-50 trained on the full label set.[1] The comparison is the interesting part: the contrastive model had never seen a single ImageNet label, yet its frozen features supported a classifier as accurate as one built on features learned from all of them. The same work probed how little labelling the representations needed. Fine-tuned on just 1 percent of the labels, the model reached 85.8 percent top-5 accuracy, which the authors note outperforms AlexNet trained with a hundred times more labels.[1] A small fraction of the annotations, in other words, went considerably further when the starting point was a good unlabelled representation rather than a network beginning from scratch.
Supervised contrastive learning shows what happens when the same machinery is handed labels instead of being asked to invent its own pairs. Rather than treating each instance as its own class, it pulls together all embeddings sharing a class and pushes apart embeddings of different classes, and on ResNet-200 it reached 81.4 percent top-1 on ImageNet, 0.8 percent above the best figure reported for that architecture. The gain over the best prior result for the same network is modest in absolute terms, but the authors report the loss was consistently better than cross-entropy across other datasets and two ResNet variants, and more stable with respect to choices such as optimiser and augmentation.[8] Stability of that kind matters practically, because it means the result does not hinge on a lucky combination of settings.
The MoCo line of work approached the same target from a different direction, and its later baselines are worth stating precisely because they are often confused with SimCLR's. Taking two of SimCLR's ingredients, a projection head and heavier augmentation, and folding them into the MoCo framework produced stronger baselines that outperform SimCLR while not requiring large training batches. The claim is comparative and specific: the modified MoCo recipe outperforms SimCLR and does not require large training batches.[10] The two results sit together without contradiction. SimCLR established that large batches help contrastive training; MoCo's modification established that stronger baselines can outperform SimCLR without requiring large training batches.[1][10]
How the two views are chosen turns out to shape these numbers as much as the architecture does. One analysis of view selection argues that good views should reduce the mutual information between the two members of a positive pair while keeping task-relevant information intact, and tests the argument by strengthening data augmentation, which does reduce that mutual information and improves downstream classification accuracy. A separate analysis of view selection reports 73 percent top-1 linear readout on ImageNet with a ResNet-50 under unsupervised pretraining, and finds that transferring the resulting models to PASCAL VOC object detection and COCO instance segmentation consistently outperforms supervised pretraining.[14] That last comparison extends the evidence past classification: the learned features carried over to locating and delineating objects, tasks the contrastive objective never addressed directly.
Read together, these results support a narrow conclusion rather than a sweeping one. On ImageNet classification with a linear probe, contrastive representations came to match or approach supervised ones, and with a small fraction of labels they closed much of the remaining gap.[1] Under supervision the contrastive loss edged past the best prior figure for a large architecture, and a leaner recipe reached the same territory without enormous batches.[8][10] The choice of views moved the downstream numbers too.[14] Each figure belongs to its own dataset, architecture and evaluation protocol; what they jointly establish is that the relational objective, given enough data and well-chosen pairs, produces features that generalize well beyond the training signal, which is the property the rest of the method's applications depend on.
The benchmark evidence is consistent on one point: representations learned by arranging embeddings, without labels or with few of them, transfer to new tasks about as well as representations learned by predicting labels directly.
Medical imaging and scarce labels
Medical images are expensive to label in a way that ordinary photographs are not. A photograph of a dog can be tagged by anyone who recognises a dog, but deciding whether a tile of breast tissue contains cancer, or which of several tumour types a slide shows, takes a pathologist, and the annotation process is slow, costly, and complicated by patient privacy.[7] The images themselves are also awkward: a whole slide image can be hundreds of thousands of pixels larger than the inputs deep networks were designed for, and the interesting structures within it are small and unevenly distributed.[6] Contrastive pretraining fits this situation closely, because it can consume the large unlabelled archive a hospital already holds and produce representations that a small labelled set can then be used to adapt.

Pretraining on the unlabelled archive
The simplest demonstration is to pretrain on as much unlabelled pathology as can be gathered and see whether the resulting features beat features learned from ordinary photographs. One study collected 57 histopathology datasets and pretrained a contrastive model on them with no labels at all, then tested the frozen features with linear classifiers on several downstream tasks. Combining multiple multi-organ datasets, with their different staining and resolution properties, improved the quality of the learned features, and using more images for pretraining helped further, though with diminishing returns as more unlabelled images were added. Networks pretrained this way outperformed ImageNet-pretrained networks by more than 28 percent in F1 score on average.[3] That comparison is the one that matters in this field, because transferring weights from a model trained on natural photographs had been the standard workaround, and the study's result says the workaround is a poor substitute for pretraining on the right kind of image.
A detail from the same study complicates the intuition that one should pretrain on the organ one intends to classify. No consistent relationship turned up between the pretraining dataset's organ or site and the downstream task: pretraining on breast images alone did not necessarily give better results on breast-related tasks.[3] What seems to transfer is something more general, the texture and structure of stained tissue, rather than the specific anatomy.
Making the pairs fit the images
The pairs themselves need rethinking for pathology. Cropping and recolouring a photograph leaves the object recognisable, but the same operations on a tissue slide can destroy exactly the information a diagnosis depends on. Magnification is a clear case: in histopathological images, different information can be obtained at different magnification levels, so a pair that treats two magnifications as equivalent throws away a distinction that carries meaning.[7] Colour is another, since staining varies widely between laboratories and batches, and a colour shift may be noise in one setting and a genuine difference in another.
Semantically-relevant contrastive learning takes a different route to the positive pair. Instead of pairing two views of one image, it pairs multiple instances that share a similar visual concept, which increases the diversity of positives and yields more informative representations. The pretrained model built on this strategy was tested across five kinds of downstream task, patch retrieval, patch classification, weakly supervised whole-slide classification, mitosis detection and gland segmentation, spanning nine public datasets, and the resulting representations were reported as state of the art on each dataset and more robust and transferable than other self-supervised methods and than ImageNet pretraining, both supervised and self-supervised.[23] The breadth of that evaluation is the point: a representation that survives retrieval, detection and segmentation has captured something general about the tissue rather than fitting one task.
Borrowing the report as a label
Hospitals already write text about their images. A radiology report accompanying an X-ray is a description produced by an expert, and it can serve as the other half of a positive pair without anyone annotating anything new. ConVIRT trains an image encoder and a text encoder with a bidirectional contrastive objective between the two modalities, using the naturally occurring paired text as supervision and requiring no additional expert input. The method was tested by transferring the pretrained weights to four medical image classification tasks and two zero-shot retrieval tasks, and in all four classification tasks it needed only 10 percent as much labelled training data as an ImageNet-initialised counterpart to reach better or comparable performance.[4] That figure is the practical argument for the approach: the labels were already sitting in the reports, and the contrastive objective turned them into a reusable representation.
The same study records a warning about importing methods wholesale. Contrastive methods developed on natural images helped little on medical images, the authors found, because medical images have high inter-class similarity: an X-ray of one condition can look very much like an X-ray of another, so negatives drawn at random are often not truly different.[4] This is the general hazard of the field in concrete form. The properties that distinguish medical images from natural ones, their channel counts, their intensity conventions, the significance of location and scale, all bear on whether a pair definition borrowed from computer vision will mean what it was meant to mean.[7]
What the evidence supports
Taken together, these studies show contrastive pretraining doing the job it was designed for in a setting that needs it most: extracting usable representations from unlabelled images when expert annotation is the bottleneck. The gains are measured against the alternatives that were actually available, ImageNet transfer in pathology and ImageNet initialisation in radiology, and in both cases the domain-specific contrastive representation came out ahead.[3][4] The caveats are equally concrete. Pair definitions must respect what the images encode, since magnification and staining carry information that a careless augmentation would erase, and negatives must be chosen with the high similarity between medical classes in mind.[7][4] The broader question of how such representations behave on signals and patient records, where the pair can be built from a person rather than a picture, is taken up later.
In medical imaging the unlabelled archive is large and the labelled set is small, so the value of a contrastive representation is judged by how far a little annotation goes once the pretraining has done its work.
Signals, patients and the PCLR example
Physiological signals arrive in a form that suits contrastive learning unusually well. A hospital accumulates millions of electrocardiograms, the ten-second recordings of the heart's electrical activity that are among cardiology's oldest tools, and most of them carry no research label at all. What they do carry is an identity: each trace belongs to a known person, and that person may have been recorded many times over the years. The relationship between two recordings from one patient is a fact about the data that requires no expert to supply, which makes it a candidate positive pair.

Patient Contrastive Learning of Representations, or PCLR, is built on exactly that substitution. It is a clinically driven modification of the SimCLR recipe: where SimCLR is graded on whether the model can resolve artificial alterations such as crops and colour shifts, PCLR is graded on whether it can resolve patient identity over time, mapping recordings taken at different moments from one person to the same region of the embedding space while separating recordings from different people.[2] No augmentation is applied, so the model trains on the unmodified traces it will later be asked to analyse. The training set was drawn from a single large health care system and comprised more than 3.2 million twelve-lead recordings.[2]
The test of such a representation is what a simple model can do with it. Linear models trained on the PCLR embeddings achieved a 51 percent performance increase, on average, over neural networks trained from scratch, measured across six training set sizes and four tasks: classifying sex, regressing age, and detecting left ventricular hypertrophy and atrial fibrillation.[2] The comparison was extended to three other ways of pretraining an ECG model, supervised pretraining, unsupervised pretraining with an autoencoder, and a contrastive approach that pairs different segments of the same recording. Against those, PCLR showed significant benefits on three of the four tasks, with an average performance benefit of 47 percent over the other models and an average 9 percent benefit over whichever model was best for each task. The design goal behind those numbers was practicality as much as accuracy: the representations are meant to be used out of the box by clinical researchers who can train a standard linear or survival model on them without retraining a deep network.[2]
Why should pairing a person's recordings teach anything useful? The answer lies in what two traces from one patient genuinely share. The features common to a person's electrocardiograms are those tied to sex, to genetics, and to health states that progress slowly; recordings in the training data were taken on average 262 days apart.[2]
A representation organised around those shared features should therefore serve tasks that depend on stable traits, which is the pattern observed for sex classification and hypertrophy detection. The same reasoning predicts where the method should be weaker. A rhythm that comes and goes, as in paroxysmal atrial fibrillation, will be present in one recording and absent in the next, so the pair no longer shares the feature the task cares about, and the approach may lose its advantage there.[2] The pair definition, as always, is a claim about what stays the same, and the claim holds better for some conditions than others.
Cardiac signals had already been used to test a richer set of pair definitions. The CLOCS family of methods encourages representations across space, time, and patients to be similar to one another. These methods were reported to outperform the BYOL and SimCLR baselines on linear evaluation and on fine-tuning of downstream tasks, and to retain strong performance when only 25 percent of the labelled training data was available. The training procedure also produced patient-specific representations as a by-product, which could be used to quantify how similar one patient is to another.[24] That last point is worth pausing on: a representation trained to tell patients apart ends up encoding something about each patient, which is a different kind of output from a classifier's verdict.
Biosignal datasets bring a complication that image datasets do not. They tend to be small in the number of subjects, often fewer than a hundred, and their labels are frequently noisy, so a model can latch onto the peculiarities of the individuals it was trained on rather than the physiology under study. One approach addresses this by making the training explicitly subject-aware, combining a subject-specific contrastive loss with an adversarial step that pushes the representation toward being subject-invariant, and developing time-series augmentations suited to the contrastive objective. Evaluated on public datasets for two different signals and tasks, electroencephalogram decoding and electrocardiogram anomaly detection, the embeddings learned this way gave classification results competitive with fully supervised methods, and subject-invariance was found to improve representation quality while the subject-specific loss helped when fine-tuning with labels.[25] The two goals pull in opposite directions, and the work suggests both can be pursued at once.
Across these studies the same design question recurs in a new guise. For photographs, the question was which alterations leave an image's meaning intact. For a patient's recordings, the question is which constancy across time reflects biology and which reflects a condition that happens to be present on the day. The evidence from PCLR and CLOCS indicates that patient identity is a workable substitute for labels, and that its usefulness depends on the downstream task sharing the features the pairs hold in common. How such representations fail when the negatives themselves are badly chosen, and what happens when unlabelled data is gathered without care, is covered later.
When the data are recordings rather than photographs, the most natural positive pair is often the same person at a different moment, and the value of that pair depends on which traits persist between the two moments.
Risks and limits
Failure modes: false negatives, collapse and poisoning
The rule that organises the embedding space assumes the labels attached to pairs are honest. In practice they are often wrong, and the errors are systematic rather than random. A false negative is a sample that has been declared different from the anchor when it is in fact the same kind of thing. In self-supervised training, negatives are drawn at random from the batch, and nothing checks whether a randomly chosen sample shares the anchor's underlying category. Two photographs of the same breed of dog, taken on different days, will land in the same batch and be pushed apart simply because they are different images. The network is then taught a distinction that does not exist.

The damage is not hypothetical. In a synthetic setting where labels were available, sampling negatives from truly different labels improved performance, suggesting that randomly sampled negatives may in reality share the anchor's label. The remedy developed in that work is a debiased contrastive objective, a loss that corrects for the presence of same-label samples among the negatives without knowing which samples those are.[26] The correction is statistical rather than surgical: since the training run cannot tell a true negative from a false one, it adjusts the loss to account for the expected rate of mistakes.
The problem grows sharper when the data themselves make categories similar. Medical images are the clearest case, because an image of one condition can closely resemble an image of another, so negatives drawn at random are frequently not truly different. Contrastive methods developed on natural photographs helped little on medical images because of their high inter-class similarity.[4]
A related difficulty arises when images and reports are paired across patients: two records from separate people may describe the same clinical picture, yet the training treats them as a negative pair. One medical vision-language framework responds by decoupling images from texts, which enlarges the usable training data combinatorially, and by replacing the standard contrastive loss with a semantic matching loss built on medical knowledge to eliminate the false negatives. With only 20,000 pre-training examples, that framework was reported to outperform a prior method trained on roughly 200,000.[27] The lesson is that a false negative is a claim about difference that the data never supported, and the fix is to build the pair definitions from knowledge rather than from whatever happened to share a batch.
When the space folds
A second failure is structural. The loss asks only for relative distances, and nothing in it forbids the encoder from satisfying those distances in a cramped region. Dimensional collapse is the case where embeddings end up spanning a lower-dimensional subspace than the space available, so that many of the network's output dimensions carry no information. Analysis of the dynamics of contrastive training showed that dimensional collapse happens there too, and inspired a method that optimises the representation space directly without relying on an explicit trainable projector.[28] The practical consequence is that a model can report a healthy contrastive loss while wasting most of its capacity, and the usual diagnostic, watching the loss fall, will not reveal it.
When the alterations destroy the signal
The third failure comes from the pair definition itself, and it was flagged earlier in the discussion of invariances. Declaring two altered copies equivalent teaches the encoder to disregard whatever the alteration changed. That is the point of augmentation and also its hazard. A representation trained to be invariant to colour will serve poorly on a task that asks whether a car is red or yellow, because the training has already discarded the distinction the task depends on. The problem is that the invariances are implicit: nothing in the method announces which features have been thrown away, and the loss gives no warning when a downstream task needs one of them. Building separate embedding spaces, each invariant to all but one augmentation, is one response, so that information discarded in one space survives in another.[15] The general shape of the failure is worth stating plainly, since it recurs across domains: every positive pair is a bet that some difference does not matter, and a bet placed wrongly is invisible until a task calls for the discarded feature.
Poisoned data
The fourth failure belongs to the data rather than the objective. Multimodal contrastive models are often trained on noisy, uncurated material scraped from the internet, which is cheaper than manual labelling and can even improve robustness to out-of-distribution inputs. That practice opens the door to poisoning, in which an attacker inserts crafted examples into the training set, and to backdooring, in which the trained model learns to misbehave on inputs carrying a trigger the attacker controls. Poisoning just 0.01 percent of a dataset, roughly 300 images out of the 3 million in Conceptual Captions, was enough to make a model misclassify test images when a small patch was overlaid, and a targeted attack that forces a particular test input to a chosen label required control of only 0.0001 percent, about three images in 3 million.[29] The asymmetry is the alarming part: a handful of examples among millions can install behaviour that the ordinary training signal never asked for.
These four failures share a common root. Contrastive learning trusts its pairs, and each failure is a case where that trust was misplaced: the negative was not really different, the space quietly lost its dimensions, the positive pair discarded something needed, or the data itself was tampered with. None of them announces itself in the training curve, which is why the design of pairs and the provenance of data carry as much weight as the architecture.
A contrastive model cannot tell a mistaken pair from a correct one, so false negatives, collapsed dimensions, over-aggressive invariances and poisoned examples all pass through training looking like ordinary data.
Later developments
Where the method is heading
The directions now being pursued share a common aim: to make the relational rule cheaper to apply, less dependent on hand-made choices, and more faithful to what the data actually contain.
Pairing the two objectives
Contrastive training and generative training have usually been treated as rival uses of a network. A contrastive objective shapes an embedding space by comparison; a generative objective, such as captioning, asks a model to produce text token by token. CoCa, a contrastive captioner, trains one image-text encoder-decoder on both at once, applying a contrastive loss between unimodal image and text embeddings and a captioning loss on the decoder's outputs, so that the two objectives are computed through the same computational graph with minimal overhead. The arrangement is not a compromise between the two but a way of getting both kinds of capability from one pretraining run, and the reported transfer results across recognition, retrieval, visual question answering and captioning suggest the combination holds up across task types rather than only on the task it was trained for.[30]
Automating the choices
The graph contrastive learning work described earlier noted that the effectiveness of GraphCL hinges on ad-hoc data augmentations that had to be manually picked per dataset, by rule of thumb or trial and error, which limited the more general applicability of GraphCL. The response was to make the choice itself learnable, selecting augmentations for each graph dataset through a bi-level optimisation and reporting performance on par with or sometimes better than the hand-tuned framework across graphs of various scales and types, with no dataset-specific tuning.[19]
Doing more with less
A contrastive model's appetite for data is its practical liability. CLIP required 400 million image-text pairs to pretrain, a scale that restricts who can build such a model at all.[31] One line of work attacks this by extracting more supervision from the pairs already present: rather than relying on the single image-text contrast, it adds self-supervision within each modality, multi-view supervision across modalities, and nearest-neighbour supervision drawn from other similar pairs. The resulting model reached 60.4 percent zero-shot top-1 accuracy on ImageNet, 0.8 percent above the CLIP-ResNet50 baseline while using 7.1 times fewer data, and outperformed its counterpart on 8 of 11 visual datasets when transferred to downstream tasks.[31] Data efficiency of this kind changes the economics of the method, since it determines whether a domain with a modest archive can pretrain its own representation rather than borrowing one.
Centring the patient
In health care one important direction is a change of unit, from the sample to the person. The patient-identity objective described earlier produced representations that served several clinical tasks from simple linear models, and its authors argue that building patient-centred representations of multi-modal health care data, not just electrocardiograms, is an important direction, suggesting for instance that the patient-identity component could be merged with joint modelling of echocardiogram images and their text reports to yield unified representations of a patient's heart health across modalities.[2] The appeal is that the pair definition would then rest on something the clinic already knows, namely whose record is whose, rather than on an augmentation chosen in advance.
What the directions have in common
Across graphs, images, text and clinical records, the movement is away from decisions made once by a designer and toward signals extracted from the data or the setting itself. Self-supervised learning on graphs has followed the same arc, with contrastive methods standing alongside generative and predictive ones as parallel answers to the problem of learning from unlabelled structure.[32] None of these directions removes the underlying bet. Every pair still declares some difference irrelevant, and every automated choice still encodes an assumption about what may be safely ignored. What is changing is who makes that bet, and how much evidence stands behind it.
The field's momentum is toward extracting the pair definition from the data, the setting or a learned parameter, rather than fixing it in advance.
Key studies
| Year | Study | Sample | Design | Finding |
|---|---|---|---|---|
| 2020 | Chen et al.[1] | ImageNet dataset | framework study with ablations | SimCLR reached 76.5% top-1 accuracy with a linear classifier, a 7% relative improvement over the previous state of the art. |
| 2020 | Khosla et al.[8] | ResNet-200 on ImageNet | supervised contrastive learning | Supervised contrastive loss reached 81.4% top-1 accuracy, 0.8% above the best number reported for that architecture. |
| 2020 | Kiyasseh et al.[24] | cardiac signal datasets | contrastive pretraining | CLOCS outperformed BYOL and SimCLR and achieved strong generalization with only 25% of labeled training data. |
| 2020 | Zhang et al.[4] | 4 medical image classification tasks and 2 zero-shot retrieval tasks | medical image-text pretraining | In all 4 classification tasks, ConVIRT reached better or comparable performance with just 10% of the labeled training data that an ImageNet-initialized counterpart required. |
| 2021 | Yangguang et al.[31] | DeCLIP-ResNet50 | data-efficient CLIP | DeCLIP reached 60.4% zero-shot top-1 accuracy on ImageNet, 0.8% above CLIP-ResNet50 while using 7.1 times fewer data. |
| 2021 | Carlini & Terzis[29] | 3 million-example Conceptual Captions dataset | poisoning and backdoor attack study | Poisoning 0.01% of the dataset, or 300 images, caused misclassification when a small patch was overlaid. |
| 2022 | Yu et al.[30] | ImageNet and other benchmarks | image-text foundation model | CoCa reached 86.3% zero-shot top-1 accuracy on ImageNet and 91.0% with a finetuned encoder. |
| 2022 | Wang et al.[27] | medical image-text contrastive learning | MedCLIP outperformed the state-of-the-art method while using only 20K pre-training examples, against roughly 200K for that method. | |
| 2022 | Ciga et al.[3] | 57 histopathology datasets | self-supervised pretraining | Histopathology-pretrained networks beat ImageNet-pretrained networks by more than 28% in F1 scores on average. |
| 2022 | Diamant et al.[2] | over 3.2 million 12-lead ECGs | patient contrastive learning | Linear models on PCLR representations achieved a 51% performance increase, on average, over models trained from scratch. |
See also
References
- Chen, T., Kornblith, S., Norouzi, M., & Hinton, G. E. (2020). A Simple Framework for Contrastive Learning of Visual Representations. arXiv. doi:10.48550/arxiv.2002.05709 Free full text
- Diamant, N., Reinertsen, E., Song, S., Aguirre, A. D., Stultz, C. M., & Batra, P. (2022). Patient contrastive learning: A performant, expressive, and practical approach to electrocardiogram modeling. PLOS Computational Biology, 18(2), e1009862. doi:10.1371/journal.pcbi.1009862
- Ciga, O., Xu, T., & Martel, A. L. (2022). Self supervised contrastive learning for digital histopathology. Machine Learning with Applications, 7, 100198. doi:10.1016/j.mlwa.2021.100198
- Zhang, Y., Jiang, H., Miura, Y., Manning, C. D., & Langlotz, C. P. (2020). Contrastive Learning of Medical Visual Representations from Paired Images and Text. arXiv. doi:10.48550/arxiv.2010.00747 Free full text
- Jaiswal, A., Babu, A. R., Zadeh, M. Z., Banerjee, D., & Makedon, F. (2020). A Survey on Contrastive Self-Supervised Learning. Technologies, 9(1), 2. doi:10.3390/technologies9010002
- Mandair, D., Reis-Filho, J. S., & Ashworth, A. (2023). Biological insights and novel biomarker discovery through deep learning approaches in breast cancer histopathology. npj Breast Cancer, 9(1). doi:10.1038/s41523-023-00518-1
- Shurrab, S., & Duwairi, R. (2022). Self-supervised learning methods and applications in medical imaging analysis: a survey. PeerJ Computer Science, 8, e1045. doi:10.7717/peerj-cs.1045
- Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., & Krishnan, D. (2020). Supervised Contrastive Learning. arXiv. doi:10.48550/arxiv.2004.11362 Free full text
- Le-Khac, P. H., Healy, G., & Smeaton, A. F. (2020). Contrastive Representation Learning: A Framework and Review. IEEE Access, 8, 193907-193934. doi:10.1109/access.2020.3031549
- Chen, X., Fan, H., Girshick, R., & He, K. (2020). Improved Baselines with Momentum Contrastive Learning. arXiv. doi:10.48550/arxiv.2003.04297 Free full text
- Bhat, S., Palepu, K., Hong, L., Mao, J., Ye, T., Iyer, R., Zhao, L., Chen, T., Vincoff, S., Watson, R., Wang, T. Z., Srijay, D., Kavirayuni, V. S., Kholina, K., Goel, S., Vure, P., Deshpande, A. J., Soderling, S. H., DeLisa, M. P., & Chatterjee, P. (2025). De novo design of peptide binders to conformationally diverse targets with contrastive language modeling. Science Advances, 11(4). doi:10.1126/sciadv.adr8638
- Robinson, J., Chuang, C. Y., Sra, S., & Jegelka, S. (2020). Contrastive Learning with Hard Negative Samples. arXiv. doi:10.48550/arxiv.2010.04592 Free full text
- Kalantidis, Y., Sarıyıldız, M. B., Pion, N., Weinzaepfel, P., & Larlus, D. (2020). Hard Negative Mixing for Contrastive Learning. arXiv. doi:10.48550/arxiv.2010.01028 Free full text
- Tian, Y., Sun, C., Poole, B., Krishnan, D., Schmid, C., & Isola, P. (2020). What Makes for Good Views for Contrastive Learning? arXiv. doi:10.48550/arxiv.2005.10243 Free full text
- Xiao, T., Wang, X. L., Efros, A. A., & Darrell, T. J. (2020). What Should Not Be Contrastive in Contrastive Learning. arXiv. doi:10.48550/arxiv.2008.05659 Free full text
- Shen, X., Liu, X., Hu, X., Zhang, D., & Song, S. (2023). Contrastive Learning of Subject-Invariant EEG Representations for Cross-Subject Emotion Recognition. IEEE Transactions on Affective Computing, 14(3), 2496-2511. doi:10.1109/taffc.2022.3164516
- Wu, Z., Wang, S., Gu, J., Khabsa, M., Sun, F., & Ma, H. (2020). CLEAR: Contrastive Learning for Sentence Representation. arXiv. doi:10.48550/arxiv.2012.15466 Free full text
- You, Y., Chen, T., Sui, Y., Ting, C., Wang, Z., & Shen, Y. (2020). Graph Contrastive Learning with Augmentations. arXiv. doi:10.48550/arxiv.2010.13902 Free full text
- You, Y., Chen, T., Shen, Y., & Wang, Z. (2021). Graph Contrastive Learning Automated. arXiv. doi:10.48550/arxiv.2106.07594 Free full text
- Yu, T., Cui, H., Li, J. C., Luo, Y., Jiang, G., & Zhao, H. (2023). Enzyme function prediction using contrastive learning. Science, 379(6639), 1358-1363. doi:10.1126/science.adf2465
- Izacard, G., Mathilde, C., Hosseini, L., Riedel, S., Bojanowski, P., Joulin, A., & Grave, É. (2021). Unsupervised Dense Information Retrieval with Contrastive Learning. arXiv. doi:10.48550/arxiv.2112.09118 Free full text
- Wickstrøm, K., Kampffmeyer, M., Mikalsen, K. Ø., & Jenssen, R. (2022). Mixing up contrastive learning: Self-supervised representation learning for time series. Pattern Recognition Letters, 155, 54-61. doi:10.1016/j.patrec.2022.02.007
- Wang, X., Yang, S., Zhang, J., Wang, M., Zhang, J., Yang, W., Huang, J., & Han, X. (2022). Transformer-based unsupervised contrastive learning for histopathological image classification. Medical Image Analysis, 81, 102559. doi:10.1016/j.media.2022.102559
- Kiyasseh, D., Zhu, T., & Clifton, D. A. (2020). CLOCS: Contrastive Learning of Cardiac Signals Across Space, Time, and Patients. arXiv. doi:10.48550/arxiv.2005.13249 Free full text
- Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020). Subject-Aware Contrastive Learning for Biosignals. arXiv. doi:10.48550/arxiv.2007.04871 Free full text
- Chuang, C. Y., Robinson, J., Lin, Y. C., Torralba, A. B., & Jegelka, S. (2020). Debiased Contrastive Learning. arXiv. doi:10.48550/arxiv.2007.00224 Free full text
- Wang, Z., Wu, Z., Agarwal, D., & Sun, J. (2022). MedCLIP: Contrastive Learning from Unpaired Medical Images and Text. Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, 3876-3887. doi:10.18653/v1/2022.emnlp-main.256
- Jing, L., Vincent, P., LeCun, Y., & Tian, Y. (2021). Understanding Dimensional Collapse in Contrastive Self-supervised Learning. arXiv. doi:10.48550/arxiv.2110.09348 Free full text
- Carlini, N., & Terzis, A. (2021). Poisoning and Backdooring Contrastive Learning. arXiv. doi:10.48550/arxiv.2106.09667 Free full text
- Yu, J., Wang, Z., Vijay, V., Yeung, L., Seyedhosseini, M., & Wu, Y. (2022). CoCa: Contrastive Captioners are Image-Text Foundation Models. arXiv. doi:10.48550/arxiv.2205.01917 Free full text
- Yangguang, L., Feng, L., Zhao, L. C., Cui, Y., Ouyang, W., Shao, J., Yu, F., & Junjie, Y. (2021). Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training Paradigm. arXiv. doi:10.48550/arxiv.2110.05208 Free full text
- Wu, L., Lin, H., Tan, C., Gao, Z., & Li, S. Z. (2023). Self-Supervised Learning on Graphs: Contrastive, Generative, or Predictive. IEEE Transactions on Knowledge and Data Engineering, 35(4), 4216-4235. doi:10.1109/tkde.2021.3131584
Cite this page: Atlas Nova editors. (2026). Contrastive learning. Atlas Nova. https://velocer.io/atlas/contrastive-learning/