ABC: Auxiliary Balanced Classifier for Class-imbalanced Semi-supervised Learning

Hyuck Lee, Seungjae Shin, Heeyoung Kim

Abstract

Existing semi-supervised learning (SSL) algorithms typically assume class-balanced datasets, although the class distributions of many real-world datasets are imbalanced. In general, classifiers trained on a class-imbalanced dataset are biased toward the majority classes. This issue becomes more problematic for SSL algorithms because they utilize the biased prediction of unlabeled data for training. We propose a scalable class-imbalanced SSL algorithm that can effectively use unlabeled data, while mitigating class imbalance by introducing an auxiliary balanced classifier (ABC) of a single layer, which is attached to a representation layer of an existing SSL algorithm. The ABC is trained with a class-balanced loss of a minibatch, while using high-quality representations learned from all data points in the minibatch using the backbone SSL algorithm to avoid overfitting and information loss. Moreover, we use consistency regularization to train the ABC to be balanced among the classes by selecting unlabeled data with the same probability for each class. The proposed algorithm achieves state-of-the-art performance in various class-imbalanced SSL experiments using four benchmark datasets.

The Challenge of Imbalanced Semi-supervised Learning

Semi-supervised learning (SSL) has revolutionized machine learning by allowing models to leverage vast amounts of unlabeled data alongside a small set of labeled examples. Techniques like pseudo-labeling and consistency regularization are standard in modern SSL backbones. However, these algorithms often operate under the idealized assumption that datasets are perfectly balanced across classes.

In reality, most datasets exhibit a "long-tailed" distribution where a few majority classes dominate. When standard SSL models encounter this imbalance, they develop a significant bias toward majority classes. This creates a destructive feedback loop: the biased model generates biased pseudo-labels for unlabeled data, which in turn reinforces the bias during subsequent training cycles. While traditional Class-Imbalanced Learning (CIL) techniques like oversampling or re-weighting exist, they are primarily designed for labeled data and do not translate easily to the unlabeled pools that SSL relies on.

The Auxiliary Balanced Classifier (ABC)

To address this, the authors introduce the Auxiliary Balanced Classifier (ABC). Rather than redesigning the entire SSL architecture, ABC is a lightweight, single-layer module attached to the representation layer of an existing SSL backbone (such as FixMatch or ReMixMatch).

The ABC architecture: A single-layer classifier attached to the representation layer of a backbone SSL algorithm, utilizing stochastic masking to balance training signals.

The core innovation of ABC lies in its dual-masking strategy:

  1. Stochastic 0/1 Masking for Labeled Data: For every sample in a minibatch, a Bernoulli distribution generates a mask with a probability inversely proportional to the class frequency. The ABC’s classification loss is applied only to unmasked samples, creating a balanced training signal. Crucially, the backbone SSL algorithm still processes the entire unmasked minibatch, ensuring it learns robust, high-quality representations without the information loss typical of undersampling.
  2. Balanced Consistency Regularization for Unlabeled Data: To handle unlabeled data, the ABC generates soft pseudo-labels and applies a similar masking strategy based on the predicted class. This forces the model to apply consistency regularization evenly across all classes, preventing majority-class unlabeled data from overwhelming the decision boundaries.

By training the backbone and the ABC end-to-end, the system ensures that the ABC benefits from the backbone's rich feature extraction while providing an unbiased decision boundary.

Experimental Evaluation

The proposed method was tested across several benchmarks, including synthetic long-tailed versions of CIFAR-10, CIFAR-100, and SVHN, as well as the large-scale, naturally imbalanced LSUN dataset (7.5 million images).

Comparison of class distributions: (a) the imbalanced training set, (b) biased predictions from ReMixMatch, and (c) the balanced predictions achieved by the proposed ABC algorithm.

Key Results and Insights

  • Superior Performance: On CIFAR-10-LT (imbalance ratio of 100), ReMixMatch+ABC achieved an overall accuracy of 82.4%, significantly outperforming the baseline ReMixMatch (73.7%) and previous state-of-the-art methods like DARP+cRT (78.5%). Notably, accuracy on minority classes jumped from 55.9% to 75.7%.
  • Scalability and Efficiency: On the massive LSUN dataset, FixMatch+ABC reached 78.9% accuracy, a substantial improvement over standard FixMatch (73.1%). Because ABC is a single layer, it adds negligible computational overhead—only 0.09% more parameters for CIFAR-10—and avoids the complex iterative re-training required by other methods.
  • End-to-End Advantage: While some recent trends suggest decoupling representation learning from classifier training, the authors found that end-to-end training with ABC yields better validation loss and prevents representations from drifting toward majority-class bias.

Conclusion and Future Directions

ABC provides a scalable and effective solution for class-imbalanced SSL by decoupling the balancing loss from the representation learning. While highly effective, the current iteration assumes that labeled and unlabeled data share the same imbalance distribution. Future work aims to relax this assumption by integrating modules that dynamically estimate the class distribution of unlabeled data in real-time. Additionally, the authors highlight the ethical importance of ensuring these techniques are used to improve fairness rather than for discriminatory targeting.

Summary updated

BibTeX
@misc{lee2021abc,
  author = {Hyuck Lee and Seungjae Shin and Heeyoung Kim},
  title = {{ABC: Auxiliary Balanced Classifier for Class-imbalanced Semi-supervised Learning}},
  year = {2021},
  eprint = {2110.10368},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.10368},
}
Figure