Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Learn from your own best guesses
A student with only six worked examples could practise on a stack of unmarked exercises: answer the ones they are sure about, treat those answers as correct, learn from them, and try again. Self-training does exactly this with a classifier. It is cheap and often helpful, but the danger is plain: if a confident answer is wrong, the student now practises the mistake.
Labels are expensive: an expert must inspect each fault, image or report, while unlabelled data pile up for free. Self-training (pseudo-labelling) is the first thing people try to exploit them, and it underlies modern methods such as Noisy Student and FixMatch. Knowing when it silently degrades a model is essential before deploying it on safety-relevant data.
- 1. Self-training adds to the training set…
- 2. The main risk of self-training is…
- 3. Self-training tends to work when classes…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The algorithm by hand
Algorithm.
- Train classifier f on the labelled set L.
- Predict the unlabelled set U. Confidence is max(p, 1 − p) for binary problems: p = 0.1 gives confidence 0.9.
- Move every unlabelled point with confidence ≥ τ into L, labelled with its prediction (p > 0.5 gives class 1). For probabilities 0.95, 0.5, 0.03, 0.8 and τ = 0.9, points 0 and 2 are added.
- Retrain, and repeat until no point passes τ or U is empty.
Variants.
- Add only the top m most confident points per class per round, which limits the damage from one bad round.
- Allow pseudo-labels to be revised in later rounds.
- Weight pseudo-labelled points less than true labels.
Tracking error. The pseudo-label error rate is the fraction of added points whose pseudo-label is wrong. Pseudo-labels 1, 0, 1, 1 against truth 1, 1, 1, 0 give 0.5: half of what the model then learns is wrong.
One gradient step of logistic regression: w ← w − η Fᵀ(p − y)/n. With rows (1, 2) and (1, −2), labels 1 and 0, w = 0 and η = 1, the step gives w = (0, 1).
- 1. Binary confidence for p = 0.3 is…
- 2. Capping additions per round mainly limits…
- 3. Once added, a wrong pseudo-label…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.Why it can work, and why it can fail
Assumptions.
- Cluster assumption: points in the same cluster share a label.
- Low-density separation: the true boundary passes through a sparse region.
Under these assumptions, confident predictions lie deep inside clusters and are right. Training on them pushes the boundary away from dense regions toward the gap, which is the same effect as entropy minimisation (Grandvalet and Bengio, 2005).
Confirmation bias. If classes overlap, or the initial boundary is badly placed, some confident predictions are wrong. The refitted model becomes more confident in them, so more neighbouring points are mislabelled and the boundary drifts further. Nothing in the loop can detect this.
Calibration. A model fitted to a handful of separable points has large weights and reports probabilities near 0 or 1 almost everywhere, so its confidence says little about correctness. Raising τ then admits only extreme points, far out along the classes’ long axis, which carry little information about where the boundary belongs.
Exercise 1 (two elongated Gaussian classes, 6 labelled and 994 unlabelled points, 8 datasets):
- mean test accuracy 0.992 with the labels alone, 0.999 with self-training at τ = 0.9, and 1.000 with all labels;
- the gain per dataset ranged from +0.000 to +0.050;
- the mean pseudo-label error rate was 0.001.
The classes were well separated, so the pseudo-labels were nearly all correct.
from sklearn.semi_supervised import SelfTrainingClassifier
from sklearn.linear_model import LogisticRegression
clf = SelfTrainingClassifier(LogisticRegression(), threshold=0.9).fit(X, y_with_minus_one_for_unlabelled)- 1. Self-training's effect under the cluster assumption resembles…
- 2. A model trained on a few separable points tends to be…
- 3. Confirmation bias means…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Relation to EM. Self-training with hard pseudo-labels is “classification EM”: assign each unlabelled point to its most probable class (a hard E-step), then refit (M-step). Soft EM with a generative model (Nigam et al., 2000, for text) uses probabilistic labels instead. Both depend on the model’s assumptions matching the data; when they do not, unlabelled data can reduce accuracy (Cozman and Cohen, 2002).
Guarantees. Wei et al. (2021) proved that self-training with input-consistency regularisation provably improves when the classes satisfy an expansion assumption, meaning that neighbourhoods of the correctly pseudo-labelled region grow into the rest of each class. Without such structure, no guarantee holds.
Modern pseudo-labelling.
- FixMatch (Sohn et al., 2020) uses high-confidence predictions on weakly augmented images as targets for strongly augmented versions.
- Noisy Student (Xie et al., 2020) trains a larger, noised student on teacher pseudo-labels.
Augmentation and consistency make the confidence more meaningful and reduce confirmation bias.
Interview questions.
- When would you not use self-training? When classes overlap, when the base model is poorly calibrated or very weak, or when the unlabelled data come from a different distribution. Prefer graph-based methods, co-training with good views, or simply labelling more data.
- How do you make it safer? Use a small labelled validation set to monitor accuracy each round, caps per class, calibrated probabilities, pseudo-label weights below 1, revisable pseudo-labels and early stopping.
- 1. Self-training with hard labels is a form of…
- 2. Unlabelled data can reduce accuracy when…
- 3. FixMatch uses predictions on weakly augmented data as targets for…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.When does self-training help?
History.
- H. Scudder (1965) described self-learning adaptive pattern recognition.
- D. Yarowsky (1995) used self-training for word-sense disambiguation.
- K. Nigam et al. (2000) applied EM with unlabelled text.
- D.-H. Lee (2013) introduced pseudo-labelling for deep networks.
- K. Sohn et al. (2020) introduced FixMatch, and Q. Xie et al. (2020) Noisy Student.
Exercise 2. Two elongated classes with varying separation, 6 labelled and 994 unlabelled points, 8 datasets per setting. Each cell gives the mean gain in test accuracy over the labelled-only model, then the worst gain over the 8 datasets, then the pseudo-label error rate.
| class separation | labelled only → all labelled | τ = 0.7 | τ = 0.9 | τ = 0.99 |
|---|---|---|---|---|
| 0.4 (overlapping) | 0.918 → 0.981 | −0.011, −0.078, 0.063 | −0.072, −0.217, 0.076 | −0.129, −0.332, 0.100 |
| 0.6 | 0.974 → 0.999 | +0.013, −0.001, 0.010 | −0.020, −0.149, 0.022 | −0.125, −0.312, 0.031 |
| 0.8 | 0.992 → 1.000 | +0.008, +0.000, 0.003 | +0.007, +0.000, 0.001 | −0.110, −0.298, 0.020 |
| 1.2 | 0.999 → 1.000 | +0.001, +0.000, 0.000 | +0.001, +0.000, 0.000 | −0.024, −0.185, 0.004 |
- With overlapping classes, self-training hurt at every threshold, by up to 33 points of accuracy on the worst dataset, even though full labels would reach 98%.
- With well-separated classes it helped a little, and never hurt at τ ≤ 0.9. There was little room to improve, since 6 labels were already nearly enough.
- The strictest threshold, τ = 0.99, was the worst everywhere, even at 1.2 separation, where its pseudo-labels were 99.6% correct. It admitted only far-out points along the classes’ long axis, which tilted the linear boundary. “Only trust very confident predictions” is not a safe rule when the confidence comes from a model fitted to 6 points.
- The mean gains hide large variation between datasets. Monitor a labelled validation set every round.
Self-training in AI, robotics and aerospace
- Defect and anomaly classification: pseudo-label large archives of inspection images or telemetry windows from a few expert labels, with validation monitoring.
- Perception domain adaptation: adapt a detector to a new site or sensor by pseudo-labelling confident detections, a standard technique in autonomous driving.
- Text triage: extend a small labelled set of maintenance reports with confident predictions.
References
- D. Yarowsky (1995). “Unsupervised word sense disambiguation rivaling supervised methods.” Proc. ACL.
- K. Nigam, A. McCallum, S. Thrun, T. Mitchell (2000). “Text classification from labeled and unlabeled documents using EM.” Machine Learning 39.
- Y. Grandvalet, Y. Bengio (2005). “Semi-supervised learning by entropy minimization.” Advances in NeurIPS 17.
- K. Sohn et al. (2020). “FixMatch: simplifying semi-supervised learning with consistency and confidence.” Advances in NeurIPS 33.
- C. Wei, K. Shen, Y. Chen, T. Ma (2021). “Theoretical analysis of self-training with deep networks on unlabeled data.” Proc. ICLR.