Supervised, Unsupervised, and Self-Supervised Learning

The three core learning paradigms, explained through clinical examples: classification from labeled data, pattern discovery in unlabeled data, and foundation models trained on massive datasets.


Every machine learning method needs data. They differ in whether the data has to come with answers attached. That one question, labels or no labels, sorts the field into three groups, and it also predicts where most of your project's time and money will go.

Supervised learning: examples with answers

In supervised learning each training example has a label, the answer you want the model to produce. Show it ten thousand chest X-rays marked "pneumothorax" or "no pneumothorax" and it learns to tell them apart.

Nearly every diagnostic AI model you have read about was trained this way. The label takes different forms depending on the task:

  • A category, for classification: malignant or benign, one of five diabetic retinopathy grades.
  • A number, for regression: ejection fraction from an echo, bone age from a hand radiograph.
  • An outline, for segmentation: every pixel that belongs to the tumor.
  • A box, for detection: where each nodule is.
  • An outcome, for prognosis: whether the patient was readmitted within 30 days.

Supervised learning is the best understood of the three and the easiest to evaluate, because you can hold some labeled cases back and count how often the model gets them right.

Its cost is the labels. Someone qualified has to produce each one, and in medicine that someone is expensive. Outlining a tumor on every slice of an MRI can take a radiologist the better part of an hour, at $LOTS per hour. Labels are also less certain than they look. Two experts will disagree on a share of cases, and the model cannot be more right than the labels it learned from (see 2.3 Data Annotation and Labeling for Clinical AI). This means you might have to get two or more labelers for each image, doubling the cost.

In most supervised projects, labeling takes longer and costs way more than modeling.

Cheaper labels

Because expert labels are the bottleneck, people have found ways to get by with fewer or rougher ones.

Weak supervision uses labels that are noisy or coarse but cheap. The usual source is the radiology report: a program reads the report text and marks the image as positive if the report mentions the finding. Large public chest X-ray datasets, CheXpert among them, were labeled this way. You get hundreds of thousands of labels for nothing, and some fraction of them are wrong, so never use labels like these for your test set.

Semi-supervised learning combines a small labeled set with a large unlabeled one. One common version trains a model on the labeled cases, has it label the rest, keeps the predictions it is most confident about, and retrains.

Active learning has the model choose which cases a human should label next, usually the ones it is least sure about, so that expert time goes to the cases that teach it most. That spends the labeler's time on the images that have the most impact on the model.

Unsupervised learning: structure without answers

Unsupervised learning gets no labels. It looks for structure in the data.

Clustering groups similar cases. Give it the clinical variables of a few thousand patients with sepsis or heart failure and it may split them into subgroups that differ in ways nobody defined in advance. This is how proposed disease subtypes, often called phenotypes or endotypes, come out of large cohorts.

Dimensionality reduction compresses many variables into a few while keeping as much of the variation as it can. Principal component analysis is an example of this you've probably encountered. It is used to draw high-dimensional data on a page and to simplify the input to another model.

Anomaly detection learns what normal looks like and flags whatever departs from it. Train on thousands of normal brain MRIs, and a scan the model cannot account for is a candidate abnormality. This is attractive when abnormal cases are rare or come in too many varieties to collect examples of each.

The difficulty with all three is knowing whether the answer means anything. A clustering algorithm will always return clusters, whether or not the data contains any. There is no label to check against, so the test has to come from outside: do the clusters differ in outcome, do they respond differently to treatment, do they reappear in a second cohort? Treat unsupervised results as hypotheses.

Self-supervised learning: labels from the data itself

Self-supervised learning is the newest of the three and the reason foundation models exist. It sets the model a task whose answers can be produced automatically from unlabeled data.

Some examples: hide a word in a sentence and ask the model to fill it in. Mask a square of an image and ask it to reconstruct what was there. Take two differently cropped and tinted copies of the same image and ask the model to recognize that they are the same picture, among thousands of others. With self-supervised learning, nobody has to label anything, and the supply of training data is limited only by how much raw material you can gather.

To do these tasks well the model has to learn something real about the data. A model that can fill in a missing patch of a chest film has learned what ribs and lung markings look like. What it has learned is called a representation, and it is useful for tasks the model was never trained on.

So the usual procedure has two stages. First the model is pretrained by self-supervision on a large unlabeled collection. Then it is fine-tuned on a small labeled set for the task you care about. It's analogous to showing an experienced radiology intern an unfamiliar CT scan and explaining what to look for versus a first year med student: the intern will need far fewer examples to get proficient. For a clinical researcher this is pretty appealing: your hospital archive holds millions of unlabeled images and you can afford to label a few hundred.

Large language models are trained this way, by predicting the next word across enormous amounts of text. So are the general-purpose imaging models that have appeared since about 2021. Both are covered in 1.4 Foundation Models and Large Language Models in Clinical Research.

Self-supervision does not remove the need for labels. You still need a labeled set for fine-tuning, and you need a carefully labeled test set to find out whether any of it worked.

Reinforcement learning, briefly

There is a fourth kind. In reinforcement learning the model takes actions, receives rewards or penalties, and learns a strategy that collects the most reward. It is how game-playing systems such as AlphaGo were trained.

In medicine it has been studied for sequential treatment decisions, such as fluid and vasopressor dosing in the ICU. It remains almost entirely a research topic, because learning by trial and error is not something you can do on patients, and learning from historical records of what clinicians did runs into confounding. You are unlikely to need it.

How they compare

Needs labels? Typical clinical use How you check it
Supervised Yes, for every training case Diagnosis, segmentation, risk prediction Against held-out labeled cases
Unsupervised No Finding subgroups, flagging anomalies, compressing variables Against outcomes or a second cohort
Self-supervised No for pretraining, a few for fine-tuning Building a base model to adapt to several tasks Against held-out labeled cases, after fine-tuning

Which one is your project?

If you have a defined clinical question with a known right answer, it is supervised. Is this fracture displaced, what is this patient's five-year risk, where is the left ventricle. Most clinical AI research is here.

If you are asking whether your data contains groups you don't know about yet, it is unsupervised, and you should plan the validation of whatever comes out before you start.

If you have a great deal of unlabeled data and can label only a little, look at self-supervised pretraining, or more practically at fine-tuning a model somebody else has already pretrained (see 3.3 Transfer Learning).

Projects often combine them: a model pretrained by self-supervision, fine-tuned with supervision, on labels that were partly produced by weak supervision. When you read a paper, find out which parts used which, and above all how the test set was labeled.

Key takeaways

  • Supervised learning trains on labeled examples. It covers most diagnostic AI and is the easiest kind to evaluate.
  • Expert labels are usually the largest cost of a supervised project, and the model cannot be more accurate than they are.
  • Weak supervision, semi-supervised learning and active learning reduce labeling cost. Labels from any of them are unsuitable for a test set.
  • Unsupervised learning finds clusters, compresses variables and flags anomalies. Its results need validation against something external, such as outcomes or a second cohort.
  • Self-supervised learning pretrains a model on unlabeled data by hiding part of the data and predicting it. The pretrained model then needs far fewer labels for a specific task.
  • You still need a carefully labeled test set whichever approach you use.

This article is part of the AI in Clinical Research Knowledge Base.