Skip to the workspace
Pebellslearn by building
Types of Machine Learning  ›  Lesson

Semi-supervised and Self-supervised Learning

Semi-supervised Learning 15 minSemi-supervised learning combines a few labelled examples with many unlabelled ones, while self-supervised learning creates its labels from the data itself, for example by hiding part of it and predicting it back.

machine learning / Semi-supervised and Self-supervised Learning

Explore each scene at your own pace.

01 · The rule

The rule

Semi-supervised and Self-supervised Learning

The agency wants a fake-listing detector. An expert has checked 200 listings by hand and marked each fake or genuine; that took a week. Meanwhile 20,000 unchecked listings sit in the database. Labels are expensive and unlabelled data is cheap, and two families of methods are built to exploit that gap.

The rule

Few labels? Borrow structure from unlabelled data, or make labels from the data itself.

Semi-supervised learning uses a small labelled set together with a large unlabelled one. It relies on one assumption: items that are close together, or in the same dense cluster, probably share a label. A common method is pseudo-labelling:

  1. Train a model on the 200 labelled listings.
  2. Predict on the 20,000 unlabelled ones.
  3. Keep only very confident predictions (say above 0.95) as new "pseudo-labels".
  4. Retrain on the labelled plus pseudo-labelled data, and repeat.

The risk: a confident mistake becomes a training label, and the model learns its own error more firmly. A high threshold and a check on the held-out labelled set keep this in check.

Self-supervised learning needs no human labels at all for its first stage. It invents a task whose answers come from the data itself:

  • Hide a word in a listing description and predict it: "Sunny two-room flat near the ___ station."
  • Predict the next word of a sentence.
  • Blank out a patch of a flat photo and reconstruct it, or check that two crops of the same photo match.

To solve such tasks well, the model must learn a lot about language or images. That learned knowledge is then fine-tuned on the small labelled task, the 200 fake-or-genuine examples. Large language models are pretrained this way, which is why they could learn from enormous amounts of text nobody labelled.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.