Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
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.

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.

The shortcut

Ask "Who made the labels?"

Labels made by Type
A person, for every example Supervised
A person, for a few, with many unlabelled examples also used Semi-supervised
The data itself, by hiding and predicting parts Self-supervised
Nobody, and none are needed Unsupervised
One round of pseudo-labellingStep 1 of 4
  1. Train on the few

    Fit a detector on the 200 hand-labelled listings.

Drills

Answer fast — trust the rule.

quick drill

A model learns by predicting a hidden word in a million listing descriptions, with no human labels. What kind of learning is this?

quick drill

A detector is trained on 300 hand-labelled listings together with 30,000 unlabelled ones. What kind of learning is this?

quick drill

With a 0.95 threshold, predictions are 0.99 fake, 0.60 fake, 0.97 genuine and 0.80 genuine. How many become pseudo-labels?

quick drill

What is the main risk of pseudo-labelling?

Remember

  • Few labels? Borrow structure from unlabelled data, or make labels from the data itself.
  • Shortcut: ask who made the labels.
  • Trap: trusting pseudo-labels without a strict threshold and a held-out check.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWho made the labels?

The agency has 200 listings hand-labelled as fake or genuine and 20,000 unlabelled listings with descriptions. Explain how semi-supervised pseudo-labelling could use the unlabelled data, how a self-supervised task could use the descriptions, and one risk of pseudo-labelling.