- Introduced by
- Zhu, X. & Ghahramani, Z.
- Year
- 2002
- Type
- Graph-based semi-supervised classification
What does it do?
Label Propagation is a graph-based semi-supervised classification method introduced by Zhu and Ghahramani in 2002.
It spreads class labels from a small set of labeled nodes to unlabeled nodes by iteratively diffusing label information along the edges of a similarity graph built over all data points. Its predictions rest on the assumption that points linked by strong similarity edges tend to share a label.
The intuition behind the method
Consider a few people in a social network who have already been assigned a category, and the idea that each person tends to adopt the label most common among close contacts. Label Propagation applies this idea to data: it connects similar points with weighted edges and lets the known labels flow outward along those edges. Each unlabeled point then receives a score for each class based on the labels that reach it through the graph. Because the spreading follows the structure of the data rather than a separately learned decision boundary, unlabeled points can inform the predictions when labeled examples are few.
History
Xiaojin (Jerry) Zhu and Zoubin Ghahramani introduced Label Propagation in a 2002 Carnegie Mellon University technical report (CMU-CALD-02-107). In 2003, Zhu, Ghahramani, and John Lafferty published the related Gaussian fields and harmonic functions framework at ICML, which gave a probabilistic interpretation based on random walks and Gaussian Markov random fields. Label Spreading, a regularized variant in which labeled nodes can be partially overridden rather than fixed, was proposed later in the literature. Semi-Supervised Learning, edited by Chapelle, Scholkopf and Zien (2006), collects work on this family of semi-supervised methods.
When to use it
Choose Label Propagation when only a small fraction of the data carries labels, when there are good reasons to expect that points close together in feature space share a class (the smoothness and cluster assumptions), and when a transductive setting is acceptable, meaning predictions are needed only for the unlabeled points already in the graph. Examples include classifying documents when few have been annotated, or predicting node labels in a network where a few nodes are known. Every unlabeled node must be connected to at least one labeled node through the graph, because a node in a component without labels receives no label information. Choose sigma and the neighborhood size by checking predictions on held-out labeled nodes. Avoid the method when the feature space does not reflect class similarity, when class boundaries pass through dense regions of the data, when new points must be classified often without rebuilding the graph, or when most of the data is already labeled and a supervised classifier would suffice.
Limitations and considerations
- Scalability: the weight matrix is n x n before sparsification, and the closed form requires solving a system over the unlabeled nodes. Without sparse graphs, memory and computation grow quickly with the number of points, as the naive O(n^2) cost in the method facts indicates.
- Graph construction drives the result: the bandwidth sigma and neighborhood size determine which points are linked, and poor choices can shift the predicted labels substantially.
- The smoothness assumption is essential: where the class boundary passes through a dense region of the feature space, neighboring points carry different labels and propagation mixes them.
- Transductive by default: a new test point is not part of the graph and receives no propagated label, so classifying it requires adding the point and rerunning propagation, or using an inductive extension.
- Labeled nodes are clamped in the standard form, so an incorrect label is held fixed and spreads through its neighborhood with no mechanism in the update to correct it.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Uses unlabeled points through the graph structure, so it can yield usable class scores from very few labeled nodes when the similarity graph reflects the classes.
- The unlabeled scores have a closed-form expression in terms of the graph and the labeled nodes, so the fixed point is determined directly rather than by a stopping rule, provided the unlabeled block is invertible (every unlabeled node can reach a labeled node).
- Multi-class problems need no change to the method: each class is one column of F and the same update applies to every column.
- The propagation step has no separately learned parameters. The graph settings (kernel bandwidth sigma and neighborhood size) are the main tunable choices, while the clamping rule, the composition of the labeled set and the stopping tolerance also affect results.
Applications
- Text and document classification when only a small fraction of documents carry human-assigned labels.
- Image or video annotation where manual labeling is expensive and unlabeled images are plentiful.
- Social-network and citation-graph node classification (e.g., inferring user interests or paper topics).
- Bioinformatics: predicting gene function or protein interaction roles from partially annotated biological networks.
- Semi-supervised anomaly detection by propagating known normal/anomalous labels through a similarity graph.
How it works
How it works
All n data points, labeled and unlabeled, are placed in a weighted similarity graph. The Gaussian (RBF) kernel in the mechanics formula makes the weight W_ij fall as the squared Euclidean distance between points i and j grows, with the bandwidth sigma controlling how quickly it falls off. A small sigma makes the graph nearly disconnected, and a large sigma links dissimilar points. In practice the graph is often sparsified by keeping only k-nearest or epsilon-radius neighbors, which reduces the number of edges to store and process.
Formula
W_{ij} = \exp\!\left(-\frac{\|x_i - x_j\|^2}{2\sigma^2}\right)The weights are row-normalized as in the formula T_ij = W_ij / sum_k W_ik, so each row of T sums to one. T_ij is then the probability that a random walk at node i steps to node j, and the score of node i after an update is a weighted average of the scores of its neighbors.
Formula
T_{ij} = \frac{W_{ij}}{\sum_k W_{ik}}Starting from an initial label matrix F with one column per class, each step multiplies F by T and then resets the rows of the labeled nodes to their known one-hot labels Y_L. This reset, written as clamping in the formula, keeps labeled nodes fixed so that their labels act as a constant source of information (labeled nodes behave as absorbing states of the random walk). Iteration continues until the unlabeled rows of F stop changing.
Formula
F^{(t+1)} = T F^{(t)}, \quad F_L = Y_L \text{ (clamp labeled rows after each step)}The fixed point for the unlabeled rows, F_U*, has the closed form (I - T_UU)^{-1} T_UL Y_L, where T_UU holds transitions among unlabeled nodes and T_UL holds transitions from unlabeled nodes to labeled nodes. The closed form requires inverting a matrix over the unlabeled nodes, so the iterative update is the practical route on large graphs. Both routes give the same solution.
Formula
F_U^* = (I - T_{UU})^{-1} T_{UL} Y_LCommon pitfalls
- Using a fully connected graph without sparsification, which keeps weak long-range links that blur local structure and is costly for large n.
- Choosing sigma without checking predictions against the labeled nodes: too large a bandwidth links dissimilar points and over-smooths the label scores, while too small a bandwidth leaves many nodes disconnected.
- Ignoring class imbalance in the labeled set: under clamped propagation, a dominant class can spread into much of the graph, so the labeled set may need re-weighting or stratified selection.
- Treating the transductive scores as a trained model and applying them to new points without an inductive wrapper, which gives no principled prediction for those points.
- Not checking graph connectivity: unlabeled nodes in components with no labeled node receive no propagated label information, so their scores remain at their initial values and should be reported as unpredicted rather than assigned a class.
Frequently asked questions
What is the difference between Label Propagation and Label Spreading?
Label Spreading is a later, regularized variant that adds a parameter alpha setting how much a node keeps its initial label relative to the label it receives from its neighbors. In classic Label Propagation the labeled nodes are clamped and cannot change. Allowing labeled nodes to be partly overridden makes the method less sensitive to noisy labels, at the cost of one additional hyperparameter.
Does Label Propagation scale to large datasets?
The closed form requires inverting a matrix over the unlabeled nodes, which is impractical for large n, so the iterative update is used instead. Each iteration costs O(n^2) for a naive dense graph and O(|E|) for a sparse graph with |E| edges, which is O(n) when the average degree is bounded. The number of iterations needed for convergence depends on the graph.
How many labeled examples are needed?
The method is designed for very few labels. Each class needs at least one labeled node to act as a label source, so the minimum total equals the number of classes. Predictions become less reliable as label noise increases or as the graph carries less information about class membership, so several labeled examples per class are advisable in practice.
Can Label Propagation predict on new, unseen data points?
In its standard transductive form, no. The algorithm works on a fixed graph and does not define a prediction for points outside it. Two workarounds are used: connecting a new point to its nearest neighbors in the existing graph and propagating again, or using the converged label scores as training targets for a standard supervised classifier. Neither workaround is part of the update in the mechanics above, and both need separate validation.
Related methods
Sources
Zhu, X., & Ghahramani, Z. (2002). Learning from labeled and unlabeled data with label propagation. Technical Report CMU-CALD-02-107, Carnegie Mellon University.
Open publication referenceZhu, X., Ghahramani, Z., & Lafferty, J. (2003). Semi-supervised learning using Gaussian fields and harmonic functions. Proceedings of the 20th International Conference on Machine Learning (ICML-2003), pp. 912–919.
Open publication referenceChapelle, O., Scholkopf, B., & Zien, A. (Eds.) (2006). Semi-Supervised Learning. MIT Press.
ISBN: 978-0-262-03358-9