Expectation Maximization Pseudo Labels

Moucheng Xu, Yukun Zhou, Jin Chen, Marius de Groot, Daniel C. Alexander, Neil P. Oxtoby, Yipeng Hu, Joseph Jacob · DOI

Abstract

In this paper, we study pseudo-labelling, a technique that employs raw inferences on unlabelled data as pseudo-labels for self-training. We elucidate the empirical successes of pseudo-labelling by establishing a link between this technique and the Expectation Maximisation (EM) algorithm. Through this, we realise that the original pseudo-labelling serves as an empirical estimation of its more comprehensive underlying formulation. Following this insight, we present a full generalisation of pseudo-labels under Bayes' theorem, termed Bayesian Pseudo Labels (BPL). Subsequently, we introduce a variational approach to generate these Bayesian Pseudo Labels, involving the learning of a threshold to automatically select high-quality pseudo labels. We showcase the applications of pseudo-labelling and its generalised form, Bayesian Pseudo-Labelling, in the semi-supervised segmentation of medical images across four distinct tasks. We further demonstrate that pseudo-labels can enhance the robustness of the learned representations.

Introduction

Deep learning models for medical imaging are notoriously "data-hungry," yet expert annotations are expensive, time-consuming, and scarce. Semi-supervised learning (SSL) attempts to bridge this gap by leveraging a small amount of labeled data alongside a large pool of unlabeled data.

A popular SSL technique is pseudo-labeling, where a model generates its own labels for unlabeled data to use in further training. However, pseudo-labeling has historically been treated as a heuristic. It suffers from confirmation bias: if the model makes a confident but wrong prediction, it "teaches" itself that error, which then accumulates. Most existing methods attempt to mitigate this with arbitrary, fixed confidence thresholds (e.g., only trusting predictions > 0.95), which are often sub-optimal and difficult to tune for specific medical domains.

Theoretical Framework: The EM Connection

The core contribution of this work is establishing a theoretical foundation for pseudo-labeling by framing it as an Expectation-Maximization (EM) algorithm.

The link between pseudo-labeling and the EM algorithm, showing the transition from pseudo-labels to thresholds as latent variables.

As illustrated in Figure 1, the authors mathematically demonstrate that the pseudo-labeling process is a direct implementation of the EM algorithm. In this framework:

  • The E-step corresponds to generating pseudo-labels, which acts as an estimation of latent variables.
  • The M-step corresponds to updating the model parameters ($\theta$) using those generated labels to maximize the likelihood.

By proving this connection, the authors provide a guarantee of convergence to a local minimum, explaining why this heuristic has been empirically successful in practice. Furthermore, this graphical model perspective allows for a simplification where the threshold ($T$) itself can be treated as a latent variable.

Proposed Method: Bayesian Pseudo Labels (SegPL-VI)

Building on the EM insight, the authors propose treating the confidence threshold ($T$) as a latent variable rather than a fixed hyperparameter. This leads to the development of Bayesian Pseudo Labels (BPL) and the SegPL-VI (Variational Inference) algorithm.

While standard pseudo-labeling (SegPL) typically uses a fixed threshold (often 0.5), SegPL-VI uses a small auxiliary network ($\phi$) to predict the mean ($\mu$) and variance ($\log \sigma$) of the threshold $T$ based on image features.

The SegPL-VI architecture, utilizing an auxiliary network and the reparameterization trick to learn a dynamic threshold distribution.

By employing the reparameterization trick (as shown in Figure 2), the model learns to dynamically adjust its "strictness" during training. This allows the model to automatically ignore low-quality pseudo-labels early in training when the model is uncertain and become more inclusive as its feature representations improve.

Experimental Evaluation

The authors evaluated their approach on four distinct medical imaging tasks to demonstrate versatility:

  1. CARVE: 3D binary segmentation of lung vessels from CT volumes.
  2. BRATS 2018: 2D multi-class segmentation of brain tumors (HGG sub-regions) from MRI.
  3. Task01 (Medical Segmentation Decathlon): 3D binary segmentation of whole brain tumors from MRI.
  4. Task05 (Medical Segmentation Decathlon): 3D binary segmentation of the prostate from MRI.

Key Results

The proposed methods consistently outperformed both purely supervised baselines and state-of-the-art SSL methods like Cross Pseudo Supervision (CPS) and FixMatch.

  • Performance Gains: On the CARVE dataset with only 2 labeled volumes, SegPL-VI achieved a 70.65% IoU, significantly outperforming a supervised U-Net (56.79%) and the best SSL baseline, CPS (66.67%). Similar massive jumps were seen in BRATS 2018, where SegPL-VI reached 71.20% IoU compared to 54.08% for the supervised baseline.
  • Computational Efficiency: Pseudo-labeling is computationally "frugal." SegPL-VI required only ~1715 seconds of training and 6.23 GFlops, making it nearly as efficient as a standard U-Net while being much lighter than competitors like CCT (4129s) or CPS (2730s).
  • Uncertainty Quantification: Because SegPL-VI is probabilistic, it can generate uncertainty maps via Monte Carlo sampling of the threshold, achieving a Brier score of 0.97, which is comparable to the gold-standard Deep Ensembles.

Discussion and Robustness

A significant finding of this research is that pseudo-labels act as a powerful regularizer, enhancing the robustness of the learned representations. Models trained with pseudo-labels were found to be significantly more resilient against Out-of-Distribution (OOD) noise and adversarial attacks (such as FGSM) compared to purely supervised models.

However, some limitations remain. If a model begins to overfit, it may become overconfident, and the learned threshold might converge too quickly, failing to mask out erroneous pseudo-labels. Future work could incorporate explicit calibration techniques or explore different prior distributions for the threshold, such as Beta or Categorical distributions, which might better suit values bounded between 0 and 1. Additionally, moving from batch-level thresholds to pixel-level adaptive thresholds could further improve granularity.

Conclusion

By establishing the theoretical link between pseudo-labeling and the EM algorithm, this work transforms a popular heuristic into a principled framework. The introduction of Bayesian Pseudo Labels and dynamic thresholding via variational inference provides a robust, efficient, and high-performing solution for semi-supervised medical image segmentation, addressing the critical bottleneck of data scarcity in the field.

The code for this project is available at: https://github.com/moucheng2017/EMSSL

Summary updated

BibTeX
@misc{xu2023expectation,
  author = {Moucheng Xu and Yukun Zhou and Jin Chen and Marius de Groot and Daniel C. Alexander and Neil P. Oxtoby and Yipeng Hu and Joseph Jacob},
  title = {{Expectation Maximization Pseudo Labels}},
  year = {2023},
  eprint = {2305.01747},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.01747},
}
Figure