Foundations to Frontier
Tests
D. Classical Machine Learning › D15 Semi-Supervised Learning

Label Spreading

Label spreading (Zhou, Bousquet, Lal, Weston and Schölkopf, 2004) is the soft version of label propagation. Each point repeatedly combines its neighbours' label scores, through a symmetrically normalised graph, with a pull back toward its own initial label, weighted by a parameter α. Unlike propagation, labelled points are not clamped: a given label that disagrees with its whole neighbourhood can be outvoted, which makes the method robust to some wrong labels. The closed form F = (1 − α)(I − αS)⁻¹Y is the minimiser of a smoothness term plus a fit-to-labels term, and α sets how far labels travel. This page covers the iteration and closed form, the regularisation framework, the normalised Laplacian, the role of α, the link to personalised PageRank, and how to read the scores. In the exercises you implement label spreading, compare it with propagation when some labels are wrong, then map how α and label noise interact, including when spreading corrects flipped labels and when it cannot.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Labels that can be overruled

Label propagation treats every given label as gospel. But labels come from people and processes that make mistakes. Label spreading lets every point, labelled or not, listen to its neighbours: a labelled point keeps a pull toward its own label, but if all its neighbours say otherwise, they can win.

Label spreading: letting the graph overrule wrong labels
✗
accuracy on unlabelled points 0.989 · flipped labels corrected: 2 of 3
Propagation must keep every given label, so a flipped label becomes a seed of the wrong colour inside the other moon. Spreading weighs each point's own label against what its neighbourhood says. With α close to 1 the neighbourhood wins and most flipped labels are corrected. With α = 0.5 or 0.9 each labelled point mostly keeps its own label, and the influence of the labels fades within a few hops.
Why engineers care

Expert labels on telemetry, images or reports are never perfect: annotators disagree, and logs mislabel events. A method that both spreads labels and flags labels that disagree with their neighbourhood doubles as a label-cleaning tool before training a supervised model.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Unlike label propagation, label spreading…
  2. 2. A labelled point is outvoted when…
  3. 3. Label spreading can be used to…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The algorithm by hand

1. Normalised affinity. S = D^(−½) W D^(−½), so Sᵢⱼ = wᵢⱼ / √(dᵢdⱼ). S is symmetric. For weights 1 between nodes of degrees 1 and 4, Sᵢⱼ = 1/√4 = 0.5.

2. Iterate. F ← αSF + (1 − α)Y, where Y holds one-hot rows for labelled points and zeros elsewhere. For two linked nodes with only node 1 labelled and α = 0.8, one step from F = Y gives node 1 a score of 0.2 and node 2 a score of 0.8.

3. Closed form. The iteration converges to

F = (1 − α)(I − αS)⁻¹Y.

For two linked nodes and α = 0.5, the labelled node ends at 2/3 and its neighbour at 1/3.

4. Predict. Take the argmax of each row, optionally after class mass normalisation.

How far labels travel. Expanding the inverse gives (1 − α) Σₜ αᵗ SᵗY: walks of length t count with weight (1 − α)αᵗ, a geometric distribution with mean α/(1 − α). With α = 0.5 labels reach about 1 hop; with α = 0.99, about 99 hops.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Sᵢⱼ for w = 3 between degrees 4 and 3 is…
  2. 2. Mean walk length for α = 0.9 is…
  3. 3. In F ← αSF + (1 − α)Y, the second term…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.

Regularisation view

Objective. The closed form minimises

Q(F) = ½ Σᵢⱼ wᵢⱼ ‖Fᵢ/√dᵢ − Fⱼ/√dⱼ‖² + μ Σᵢ ‖Fᵢ − Yᵢ‖²,

with α = 1/(1 + μ). The first term asks for smoothness over the graph and the second for agreement with the given labels. Small μ (α near 1) trusts the graph; large μ (small α) trusts the labels. Label propagation is the limit where labelled points are clamped exactly.

Exercise 1 (two moons, 10 labels per class with 4 of the 20 flipped, 10 datasets). Accuracy on the unlabelled points:

method mean worst
label propagation (labels clamped) 0.872 0.707
label spreading, α = 0.99 0.941 0.843

Spreading corrected 65% of the flipped labels, and the iteration converged to the closed form.

from sklearn.semi_supervised import LabelSpreading
LabelSpreading(kernel="knn", n_neighbors=10, alpha=0.99)  # alpha = weight on the neighbours

In scikit-learn’s LabelSpreading, alpha (which it calls the clamping factor) is the weight on the neighbours, the same α as here, with default 0.2: a small α that trusts the given labels heavily.

🐍 Exercise 1: label spreading
Implement label spreading in closed form and by iteration, add noisy labels, and compare spreading with label propagation; measure how many flipped labels spreading corrects.
📝 Quick check (Level 2)
0/3 answered
  1. 1. α near 1 means trusting…
  2. 2. Label propagation is the limit where labelled points are…
  3. 3. In exercise 1 spreading corrected about what share of flipped labels?

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Normalised Laplacian. I − S = D^(−½) L D^(−½) is the normalised graph Laplacian, with eigenvalues in [0, 2]. So I − αS is invertible for α < 1, and the series Σ αᵗSᵗ converges.

Personalised PageRank. Using the random-walk matrix D⁻¹W instead of S gives F = (1 − α)(I − αD⁻¹W)⁻¹Y. Each column is a personalised PageRank vector: a random walk that restarts at the labelled class-c nodes with probability 1 − α. Label spreading is the symmetrically normalised cousin.

Behaviour as α → 1. F approaches a multiple of the leading eigenvector of S, which is proportional to √dᵢ, plus slowly decaying label information. Raw scores then mostly reflect node degree and how much label mass each class put in. Class mass normalisation, or normalising each column, becomes important.

Interview questions.

  • Why use symmetric normalisation? It keeps S symmetric with eigenvalues in [−1, 1], which gives a convex quadratic objective. It also stops high-degree hubs from dominating.
  • How would you find mislabelled training data? Run spreading with α near 1 and flag labelled points whose argmax disagrees with their given label, then send them for expert review.
📝 Quick check (Level 3)
0/3 answered
  1. 1. I − αS is invertible for α &lt; 1 because…
  2. 2. With D⁻¹W instead of S, each column is a…
  3. 3. As α → 1, raw scores increasingly reflect…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

How much label noise can spreading absorb?

History.

  • D. Zhou, O. Bousquet, T. N. Lal, J. Weston and B. Schölkopf (2004) introduced learning with local and global consistency.
  • M. Belkin, P. Niyogi and V. Sindhwani (2006) introduced manifold regularisation, which extends graph smoothness to out-of-sample prediction.
  • Personalised PageRank variants were later used for graph neural networks (APPNP, Gasteiger et al., 2019).

Exercise 2. Two moons, 10 labels per class with 0–6 flipped, 10-NN graph, 10 datasets. Each cell gives the mean, then the worst accuracy on the unlabelled points, with class mass normalisation.

flipped propagation α = 0.5 α = 0.9 α = 0.99 α = 0.999 flipped corrected at α = 0.99 / 0.999
0 of 20 0.999, 0.993 0.981, 0.900 0.996, 0.986 0.998, 0.993 0.998, 0.993 –
2 of 20 0.964, 0.836 0.912, 0.807 0.959, 0.843 0.999, 0.993 0.998, 0.993 95% / 100%
4 of 20 0.872, 0.707 0.817, 0.696 0.879, 0.768 0.941, 0.843 0.997, 0.993 65% / 95%
6 of 20 0.795, 0.454 0.705, 0.429 0.771, 0.554 0.894, 0.779 0.973, 0.843 48% / 70%
  • α near 1 turned spreading into a label cleaner. At α = 0.999 it corrected 95% of 4 flipped labels and kept accuracy at 0.997, while propagation fell to 0.872.
  • Small α was worse than propagation. At α = 0.5 and 0.9, no flipped label was ever corrected, because each labelled point’s own label outweighed its neighbours. Labels also faded within a few hops, so even clean labels gave lower accuracy (0.981 at α = 0.5).
  • At α near 1, class mass normalisation mattered. With 6 flipped labels and α = 0.999, the plain argmax gave 0.835 against 0.973 with normalisation, because the raw scores drift toward the degree-shaped leading eigenvector.
  • Label noise has a limit. With 6 of 20 flipped (30%), even the best setting left 30% of them uncorrected.
  • scikit-learn’s default alpha=0.2 trusts the given labels heavily. Raise it when labels are noisy.
🐍 Exercise 2 (research): α versus label noise
For 0–6 flipped labels out of 20 and α = 0.5, 0.9, 0.99, 0.999, compare propagation and spreading accuracy (with class mass normalisation and plain argmax) and the share of flipped labels spreading corrects.

Label spreading in AI, robotics and aerospace

  • Cleaning annotation sets: flag images, scans or telemetry windows whose labels disagree with their neighbourhood before training a detector.
  • Semi-supervised mapping: spread a few ground-truth land-cover labels across satellite imagery while tolerating some mislabelled reference plots.
  • Graph neural networks: APPNP-style propagation (personalised PageRank) smooths a network’s predictions over a graph of sensors or parts.

References

  1. D. Zhou, O. Bousquet, T. N. Lal, J. Weston, B. Schölkopf (2004). “Learning with local and global consistency.” Advances in NeurIPS 16.
  2. M. Belkin, P. Niyogi, V. Sindhwani (2006). “Manifold regularization: a geometric framework for learning from labeled and unlabeled examples.” JMLR 7.
  3. J. Gasteiger, A. Bojchevski, S. Günnemann (2019). “Predict then propagate: graph neural networks meet personalized PageRank.” Proc. ICLR.
  4. X. Zhu (2005). “Semi-supervised learning literature survey.” University of Wisconsin–Madison TR 1530.