EnergyMatch: Energy-based Pseudo-Labeling for Semi-Supervised Learning

Zhuoran Yu, Yin Li, Yong Jae Lee

Introduction

Semi-supervised learning (SSL) aims to leverage vast amounts of unlabeled data alongside a small set of labeled examples. The dominant paradigm for this is pseudo-labeling, where a model generates labels for unlabeled data and incorporates high-confidence predictions into the training set. However, standard methods like FixMatch rely on softmax confidence, which is prone to overconfidence—particularly on out-of-distribution (OOD) samples and long-tailed datasets.

EnergyMatch introduces a novel framework that replaces traditional confidence-based thresholds with an energy-based approach. By framing pseudo-labeling as an evolving "in-distribution vs. out-of-distribution" classification task, EnergyMatch significantly improves performance on imbalanced datasets while remaining highly competitive on balanced benchmarks.

The Problem with Confidence

Deep neural networks are notoriously overconfident. They often assign high softmax probabilities (e.g., >0.95) to samples that are entirely outside the training distribution. In SSL, this leads to "false positives" where incorrect pseudo-labels are treated as ground truth, polluting the training process.

This issue is exacerbated in long-tailed datasets, where common classes dominate. Models become biased toward these majority classes, producing high-confidence but incorrect labels for rare "tail" classes. This effectively "drowns out" minority classes, preventing the model from learning them effectively.

The EnergyMatch Approach

EnergyMatch addresses these flaws by swapping the softmax confidence threshold for an energy score. Borrowed from OOD detection literature, the energy score is a non-probabilistic scalar derived from the model's raw logits. A lower energy score indicates that a sample is more likely to be "in-distribution" (ID)—meaning it resembles the data the model has already learned.

Comparison between confidence-based (prior work) and energy-based (ours) pseudo-labeling workflows.

Instead of asking "How sure is the model of this specific class?", EnergyMatch asks "Does this image belong to the distribution we are currently learning?". This creates an evolving boundary: early in training, the ID area is small, centered on the few labeled samples. As training progresses, this boundary expands, allowing the model to safely incorporate more complex unlabeled samples over time.

Experimental Results

The authors evaluated EnergyMatch across several benchmarks, including CIFAR10/100-LT (long-tailed) and standard balanced sets like SVHN and STL-10.

Key Insights: Why Energy Works

Empirical analysis shows that energy scores are far superior at filtering out incorrect pseudo-labels. While confidence-based methods often accept many "false positives" (incorrect labels with high confidence), energy-based selection maintains higher precision.

Scatter plots of Confidence vs Energy showing that energy-based decisions better separate correct from incorrect pseudo-labels.

In imbalanced settings, EnergyMatch identifies "tail" class samples as being "close enough" to the distribution even when softmax confidence is low. This effectively doubles the recall for minority classes without sacrificing precision, leading to a 4-6% absolute accuracy improvement on CIFAR10-LT over the standard FixMatch baseline.

Robustness and Efficiency

EnergyMatch also demonstrates superior robustness to "poisoned" unlabeled sets. When CIFAR10 training is mixed with OOD noise from SVHN, EnergyMatch maintains an accuracy of 67.02%, significantly outperforming FlexMatch at 60.03%. Furthermore, unlike other uncertainty-based methods that require multiple forward passes to estimate variance, the energy score is computationally efficient, requiring only a single forward pass.

Conclusion

EnergyMatch provides a simple yet powerful "plug-and-play" replacement for traditional pseudo-labeling. By shifting the focus from class-specific confidence to distributional energy, it overcomes the overconfidence bias of deep networks. This makes it a robust choice for real-world scenarios where data is often imbalanced or noisy.

Summary updated

Abstract

Recent state-of-the-art methods in semi-supervised learning (SSL) combine consistency regularization with confidence-based pseudo-labeling. To obtain high-quality pseudo-labels, a high confidence threshold is typically adopted. However, it has been shown that softmax-based confidence scores in deep networks can be arbitrarily high for samples far from the training data, and thus, the pseudo-labels for even high-confidence unlabeled samples may still be unreliable. In this work, we present a new perspective of pseudo-labeling: instead of relying on model confidence, we instead measure whether an unlabeled sample is likely to be "in-distribution"; i.e., close to the current training data. To classify whether an unlabeled sample is "in-distribution" or "out-of-distribution", we adopt the energy score from out-of-distribution detection literature. As training progresses and more unlabeled samples become in-distribution and contribute to training, the combined labeled and pseudo-labeled data can better approximate the true distribution to improve the model. Experiments demonstrate that our energy-based pseudo-labeling method, albeit conceptually simple, significantly outperforms confidence-based methods on imbalanced SSL benchmarks, and achieves competitive performance on class-balanced data. For example, it produces a 4-6% absolute accuracy improvement on CIFAR10-LT when the imbalance ratio is higher than 50. When combined with state-of-the-art long-tailed SSL methods, further improvements are attained.
BibTeX
@misc{yu2022energymatch,
  author = {Zhuoran Yu and Yin Li and Yong Jae Lee},
  title = {{EnergyMatch: Energy-based Pseudo-Labeling for Semi-Supervised Learning}},
  year = {2022},
  eprint = {2206.06359},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.06359},
}
Figure