Generative Oversampling for Imbalanced Data via Majority-Guided VAE

Qingzhong Ai, Pengyun Wang, Lirong He, Liangjian Wen, Lujia Pan, Zenglin Xu

Introduction

Learning from imbalanced datasets—where a few majority classes dominate and minority classes are severely underrepresented—remains a significant challenge in deep learning. Standard models often fail to generalize to minority classes, leading to biased predictions. Traditional over-sampling techniques like SMOTE or Random Over-sampling attempt to re-balance the data but often suffer from overfitting because they rely solely on the limited internal information of the minority set. They ignore the valuable "inter-class relationships"—the shared underlying features like lighting, style, or orientation that exist across both majority and minority classes.

To address this, we present Majority-Guided VAE (MGVAE), a novel generative framework that "borrows" the diversity and richness of majority classes to augment minority ones. By leveraging a majority-based prior, MGVAE generates high-quality, diverse minority samples that significantly improve classification performance even under extreme data scarcity.

The MGVAE Framework

MGVAE treats the minority class distribution as a parametric transition from the majority class. The core innovation lies in its two-stage training process and the use of a majority-guided prior.

1. Majority-Based Prior

Unlike standard Variational Autoencoders (VAEs) that use a simple Gaussian prior, MGVAE utilizes a prior conditioned on majority samples. This allows the model to map the "style" or "diversity" (e.g., the tilt of a digit or the pose of a face) directly from the majority class onto the minority class.

2. Two-Stage Training and EWC

The model follows a robust training pipeline to prevent model collapse when data is scarce:

  • Step 1: Pre-training: The model is first trained on abundant majority data to learn a robust latent representation of general dataset features.
  • Step 2: Fine-tuning: The model is fine-tuned on the scarce minority data. To prevent "catastrophic forgetting" of the diversity learned in Step 1, the authors employ Elastic Weight Consolidation (EWC). This regularization technique penalizes changes to weights that were critical for the majority class, ensuring generated minority samples inherit structural richness.
The MGVAE two-stage training process: pre-training on majority samples followed by fine-tuning on minority samples using a majority-based prior.

Experimental Results

The authors evaluated MGVAE against traditional over-sampling (SMOTE, ROS) and other generative models (OCVAE, OCGAN) across various benchmarks:

  • Image Benchmarks: On MNIST and FashionMNIST with extreme imbalance ratios (up to 600), MGVAE consistently outperformed baselines. For instance, on MNIST with a ratio of 600, it improved the Geometric Mean (GM) score by 13.2% over SMOTE.
  • Visual Quality: Qualitative results on the CelebA dataset showed that MGVAE produces clearer and more diverse images than OCVAE, which often produced blurry results, or OCGAN, which suffered from mode collapse.
  • Tabular Data: The method also showed significant gains on real-world tabular datasets like Musk and Water Quality, proving the "majority-guidance" principle is a general feature of data distributions beyond just images.

Conclusion

MGVAE offers a powerful solution for imbalanced learning by effectively transferring diversity from majority to minority classes. By combining a majority-guided prior with EWC-regularized fine-tuning, the model generates semantically consistent and diverse samples that mitigate overfitting in downstream classification tasks. While VAE-based models still face challenges with image blurriness compared to modern diffusion models, MGVAE provides a stable and efficient framework for handling extreme class imbalance.

Summary updated

BibTeX
@inproceedings{ai2023generative,
  author = {Qingzhong Ai and Pengyun Wang and Lirong He and Liangjian Wen and Lujia Pan and Zenglin Xu},
  title = {{Generative Oversampling for Imbalanced Data via Majority-Guided VAE}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2023},
  url = {https://openreview.net/forum?id=lXj36rrkJh},
}
Figure