Semi-supervised Multilayer Perceptron

Machine Learning
Introduced by
Chapelle, O.; Scholkopf, B.; Zien, A. (eds.); Lee, D.-H.
Year
2006–2013
Type
Semi-supervised feedforward neural network
Family
Deep learning / NLP / CV

What does it do?

A semi-supervised multilayer perceptron (SSL-MLP) is a feedforward neural network trained on a small set of labeled examples together with a larger set of unlabeled examples.

It combines a supervised cross-entropy loss on the labeled data with an unsupervised pseudo-label or consistency term on the unlabeled data, so the unlabeled examples contribute to the training signal rather than being discarded.

The intuition behind the method

Labeled data is usually expensive to obtain, while unlabeled data from the same source is often available in large volumes. A semi-supervised MLP uses both: the labeled examples anchor the classification decision, and the unlabeled examples constrain how the network should behave between and around them. Pseudo-labeling is the simplest version of this idea. The network predicts classes for unlabeled inputs, and its own confident predictions are then used as additional training targets. Whether this helps depends on the unlabeled data resembling the labeled data, because the model can only reinforce what it already predicts. The gain rests on standard semi-supervised assumptions: the smoothness assumption (nearby inputs tend to share a label), the cluster assumption (points in the same cluster tend to share a class), and the low-density separation assumption (class boundaries tend to fall in regions where few examples lie). When these assumptions do not hold for the data at hand, unlabeled examples can mislead the model.

History

Semi-supervised learning as a field is surveyed in the 2006 edited volume by Chapelle, Scholkopf and Zien, which is cited on this page as a general reference. Pseudo-labeling for deep neural networks is presented in Lee's 2013 workshop paper at ICML.

When to use it

Choose a semi-supervised MLP when the labeled set is too small for a purely supervised MLP to generalize reliably, the unlabeled examples are plentiful, and the unlabeled data is drawn from the same distribution as the labeled data. Typical cases are text or image classification where annotation is costly. No validated minimum number of labeled examples exists for this method. Whether it helps depends on the task, so the benefit should be measured against a supervised MLP trained on the same labeled examples. Do not use the method when the labeled data is already sufficient for full supervision, because pseudo-labeling and consistency regularization add complexity with limited benefit in that setting. Avoid it when the unlabeled data comes from a different distribution from the labeled data, since the model will then reinforce predictions that do not transfer.

Limitations and considerations

  • Performance depends strongly on the confidence threshold for pseudo-labels: a threshold that is too low admits incorrect targets, while one that is too high discards most unlabeled examples.
  • The weight lambda must be tuned, because a large unsupervised weight can dominate the supervised loss and pull the model toward its own errors.
  • When the unlabeled distribution differs from the labeled distribution, pseudo-labels can reduce accuracy relative to a supervised baseline.
  • The method has more hyperparameters than a purely supervised MLP (threshold, loss weight, schedule, and any pretraining settings), so results are sensitive to these choices.

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

Strengths

  • The total loss is a supervised term plus a weighted unsupervised term, so an existing MLP training procedure can usually be extended with one additional loss component.
  • Pseudo-labeling needs no second network or generative model, because the model's own predictions on unlabeled inputs serve as targets.
  • The loss weight and confidence threshold give explicit control over how much the unlabeled data influences training.
  • Unsupervised pretraining can shape the initial feature space before any labels are used, which may help when labeled examples are few.

Applications

  • Text classification with limited annotation budgets in NLP.
  • Medical image screening where expert-labeled cases are few.
  • Sentiment analysis on social media corpora with partially labeled datasets.
  • Tabular classification tasks in research settings where labeling is expensive.
  • Active-learning loops where a semi-supervised MLP bootstraps annotations for a human reviewer.

How it works

How it works

1

The available examples are divided into a labeled partition and an unlabeled partition, with the labels for the second partition withheld during training. The method is most relevant when unlabeled examples greatly outnumber labeled ones, and the appropriate proportion should be stated explicitly in any study that uses it.

2

An optional unsupervised pretraining stage, such as denoising autoencoder pretraining or contrastive pretraining, initializes the MLP weights using the labeled and unlabeled examples together. This gives the network a starting feature space before the supervised objective is introduced. The stage can be omitted, in which case training begins from the initial weights.

3

For each unlabeled example, the current model outputs a probability for each class, and the most probable class is the candidate pseudo-label, as in the formula. In many pseudo-labeling variants, only examples whose maximum predicted probability exceeds a confidence threshold are kept as pseudo-labeled, which limits the number of incorrect targets. The threshold is a design choice that must be set and checked for the task.

Formula
\hat{y}_u = \arg\max_c P(y=c \mid x_u; \theta)
4

The model is trained by minimizing the total loss given by the formula, which is the sum of L_sup and lambda times L_unsup. Here L_sup is the supervised cross-entropy loss computed over the labeled examples, and L_unsup is the unsupervised term computed over the unlabeled examples, which is either a pseudo-label loss or a consistency regularization term. The weight lambda is a non-negative value that sets the balance between the two objectives. Some implementations increase lambda gradually during training so that the supervised signal dominates at the start; this is a common practice rather than a requirement.

Formula
\mathcal{L} = \mathcal{L}_{sup} + \lambda \mathcal{L}_{unsup}
5

Performance is measured on a held-out labeled test set that was never used for pseudo-labeling or model selection, using metrics such as accuracy, F1, or AUC. Because pseudo-labels can be noisy, validation performance should be monitored throughout training, and early stopping is a standard safeguard.

Common pitfalls

  • Setting the confidence threshold too low, so that many incorrect pseudo-labels enter training and reinforce the model's own errors.
  • Attributing an accuracy gain to the semi-supervised procedure without comparing against a supervised MLP trained on the same labeled examples.
  • Keeping the threshold and loss weight fixed although the model's confidence changes as training proceeds.
  • Evaluating on the pseudo-labeled set or on the training data rather than on a clean held-out labeled test set.
  • Using the unlabeled pool, or the test set, to make model selection decisions, which leaks information into the reported result.

Frequently asked questions

How many labeled examples do I need?

No universal minimum number of labels exists. The benefit of semi-supervised training is usually largest when labels are very scarce, and with more labels a supervised MLP often performs as well. The comparison should therefore be run on the actual task, against a supervised MLP trained on the same labeled examples.

How do I choose the pseudo-label confidence threshold?

The threshold is task-dependent and has no validated default value. A higher threshold admits fewer pseudo-labels, which are more likely to be correct, while a lower threshold admits more examples along with more incorrect targets. Choose the value on a small labeled validation set, and revisit it during training if the model's confidence changes.

Can this approach hurt performance compared to a purely supervised MLP?

Yes. If the unlabeled data comes from a different distribution, or if the confidence threshold is too low, pseudo-labels add noise that can reduce accuracy. Always compare against a supervised baseline trained on the same labeled examples and evaluated on the same held-out test set before concluding that the semi-supervised approach helped.

Is semi-supervised MLP the same as transfer learning?

No. Transfer learning reuses weights pretrained on a separate, usually larger dataset. Semi-supervised learning uses the unlabeled portion of the target dataset itself. The two can be combined, for example by starting from pretrained weights and then applying pseudo-labeling to unlabeled target-domain data.

What evaluation metric should I report?

Report metrics on a held-out labeled test set only, never on the unlabeled pool. For classification, accuracy, macro-F1, and AUC are common choices. If classes are imbalanced, macro-F1 and AUC are more informative than accuracy alone.

Related methods

Sources

  1. Chapelle, O., Scholkopf, B. & Zien, A. (Eds.) (2006). Semi-Supervised Learning. MIT Press.

    ISBN: 978-0-262-03358-9
  2. Lee, D.-H. (2013). Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. ICML 2013 Workshop on Challenges in Representation Learning.

    Open publication reference