Semi-supervised Random Forest

Machine Learning
Introduced by
Leistner, C., Saffari, A., Santner, J., & Bischof, H.
Year
2009
Type
Semi-supervised ensemble classifier
Family
Machine learning

What does it do?

Semi-supervised Random Forest (SSL-RF) adapts the Random Forest to settings where most training observations are unlabeled.

Leistner et al. (2009) extend the forest so that the predicted labels of unlabeled samples enter the training objective, and they add a control based on out-of-bag error that limits harm when the unlabeled data does not help the task.

The intuition behind the method

Imagine a panel of experts (the trees) classifying cases, where most case files have no confirmed diagnosis. The panel first learns from the confirmed cases, then assigns provisional labels to the unlabeled files it is most sure about, and retrains with them included. In the cited formulation, the unlabeled samples are not simply appended: their predicted labels are treated as variables to be optimised together with the forest's margins. The out-of-bag error serves as a safeguard rather than a measure of benefit: in the cited work it is used to prevent the algorithm from degrading when the unlabeled data does not help the task. The method can improve on purely supervised training when labels are scarce, but only if the early labels are good enough to guide the process.

History

Xiaojin Zhu's 2005 literature survey (Computer Sciences Technical Report 1530, University of Wisconsin-Madison) is commonly cited as a general review of semi-supervised learning, although it was not verified in the databases used here. Leistner, Saffari, Santner and Bischof (ICCV 2009) extended Random Forests to semi-supervised problems, defining a multi-class margin for unlabeled data and training with an iterative deterministic annealing-style algorithm that uses out-of-bag error as a control. The method was evaluated on the Caltech-101 object categorization task.

When to use it

Choose SSL-RF when a large pool of unlabeled observations is available, labels are costly to obtain, and a Random Forest is a sensible base learner for the features. The cited evaluation is on Caltech-101 image categorization; use on tabular or mixed-type data is an extrapolation that should be validated on held-out labeled data. The method is most sensible when the labeled set is large enough for the initial supervised forest to make reasonable predictions. Do not use it when the labeled set is so small that the first forest is unreliable, because its errors would be carried into every pseudo-labeling round. Avoid it when a supervised Random Forest already performs adequately on the labeled data, or when there is reason to think the unlabeled observations come from a different distribution than the labeled ones.

Limitations and considerations

  • The quality of pseudo-labels depends on the initial supervised forest; a weak starting model propagates errors through later rounds.
  • The choice of threshold in the common variant is not trivial and can strongly affect results.
  • Each round retrains a forest on a larger pool, so computation grows with the number of unlabeled observations and the number of rounds.
  • If the unlabeled data follows a different distribution from the labeled data (covariate shift), pseudo-labels may be systematically biased.
  • The iterative procedure can amplify early misclassifications, and convergence is not guaranteed without a careful stopping rule.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • It can use unlabeled observations, which the cited work reports as improving performance on the tested tasks, including the Caltech-101 object categorization task.
  • It keeps the bagging and random feature selection of the Random Forest, so the base learner's usual handling of mixed inputs and out-of-bag error estimates remains available.
  • The out-of-bag control mechanism described by Leistner et al. is designed to stop the method degrading when unlabeled data is unhelpful, which is a safeguard that plain self-training does not provide.
  • The confidence threshold in the common variant gives direct control over how much unlabeled data is incorporated.

Applications

  • Medical image classification where expert annotation is expensive, such as histopathology and radiology.
  • Remote sensing and satellite imagery analysis with limited ground-truth labels.
  • Text and document categorization when only a subset of documents can be manually labeled.
  • Biological and genomic data analysis where wet-lab validation is resource-intensive.
  • Industrial quality control with sparse fault labels but abundant unlabeled sensor readings.
  • Fraud detection where confirmed fraud cases are rare relative to unlabeled transactions.

How it works

How it works

1

The process starts from a small labeled set and a larger unlabeled set. Only the labeled observations carry ground truth, so the first forest is built on them alone, and its quality limits the quality of any later pseudo-labels.

2

A standard Random Forest is trained on the labeled data only, using bootstrap sampling and random feature selection as in the supervised case. Its out-of-bag predictions on the labeled observations provide an internal error estimate at this stage; this estimate is computed on labeled data only.

3

The trained forest predicts class probabilities for each unlabeled observation. A common practical variant assigns a pseudo-label only when the predicted probability exceeds a confidence threshold, often chosen by cross-validation, and leaves low-confidence observations unlabeled. The cited formulation differs: it treats the predicted labels of unlabeled data as optimisation variables rather than applying a fixed threshold rule.

4

The forest is retrained on the labeled observations together with the pseudo-labeled ones. In the cited work, a multi-class margin is defined for the unlabeled data as well, motivated by the observation that decision trees already optimise multi-class margin-maximising loss functions. The training objective maximises this margin over both labeled and unlabeled samples, and the predicted labels of the unlabeled data enter as additional optimisation variables. Training uses an iterative deterministic annealing-style algorithm. Down-weighting pseudo-labeled instances relative to true labels is an optional practical choice, not a documented step of the cited method.

5

The cited work trains iteratively in an annealing-style manner, and its out-of-bag control is meant to prevent degradation when the unlabeled data is not useful. In the threshold-based variant, pseudo-labeling and forest retraining are repeated for a fixed number of rounds or until pseudo-label assignments stop changing. Convergence is not guaranteed in general, so the stopping rule should be monitored, and early stopping limits how far early mistakes can propagate.

6

Predictions are obtained by aggregating the trees of the final forest: majority vote for classification or mean response for regression. Vote shares can be inspected as scores, but their reliability as probability estimates has not been established from the cited sources and should be checked on held-out labeled data.

Formula
\hat{y} = \text{mode/mean of } T \text{ trees over labeled + pseudo-labeled data}

Common pitfalls

  • Setting the confidence threshold too low and adding many noisy pseudo-labels to the training set.
  • Ignoring covariate shift between the labeled and unlabeled pools, which can make performance worse rather than better.
  • Relying only on out-of-bag estimates, which are computed on the labeled data and do not replace a held-out labeled test set.
  • Running many self-training rounds without early stopping, so that errors accumulate across iterations.
  • Treating pseudo-labeled observations as equally reliable as true labels when no sample weighting is applied.

Frequently asked questions

How much labeled data do I need to start?

The cited sources do not give a minimum. Before adding pseudo-labels, check whether a supervised forest trained on your labeled set makes reasonable predictions on held-out labeled examples; if it does not, the pseudo-labels will be unreliable. With very few labels, co-training or graph-based methods may be worth considering instead.

How do I choose the confidence threshold for pseudo-labeling?

Cross-validate on the labeled set across a grid of threshold values (for example 0.60 to 0.95) and select the value that performs best on held-out labeled data. The grid and a starting value of about 0.80 are an illustrative heuristic, not a source-based recommendation; the appropriate range depends on the data. A higher threshold reduces noise but also reduces the volume of unlabeled data used.

Can SSL-RF handle class imbalance?

The cited formulation does not address class imbalance specifically, and imbalance in the labeled set propagates to pseudo-labels. Class-weighted splitting or oversampling the minority class before the first training step are general supervised-learning practices, not documented properties of SSL-RF. Monitor per-class precision and recall rather than overall accuracy.

Is SSL-RF the same as self-training with a random forest base learner?

Self-training is the general schema of repeatedly pseudo-labeling and retraining with a base learner. A random forest used this way is close to the common threshold-based variant, but the cited formulation by Leistner et al. is a margin-based training procedure in which predicted labels of unlabeled data are optimised jointly, with an out-of-bag control, so the two should not be treated as identical.

When should I prefer gradient boosting over SSL-RF?

No source here establishes which approach is better on fully labeled data. When all data is labeled, benchmark a supervised baseline such as gradient boosting or a plain Random Forest on held-out data before choosing SSL-RF. SSL-RF is most relevant when the labeled fraction is small and a large pool of unlabeled data is available.

Related methods

Sources

  1. Leistner, C., Saffari, A., Santner, J., & Bischof, H. (2009). Semi-supervised random forests. In Proceedings of the IEEE 12th International Conference on Computer Vision (ICCV), pp. 506–513. IEEE.

    Open DOI reference
  2. Zhu, X. (2005). Semi-supervised learning literature survey. Computer Sciences Technical Report 1530, University of Wisconsin-Madison.

    Open publication reference