[Paper Review] Removing Class Imbalance using Polarity-GAN: An Uncertainty Sampling Approach
This paper proposes Polarity-GAN, a GAN-based method that mitigates class imbalance in visual datasets by training a generator to produce synthetic samples within the convex hull of minority classes, while competing against both a discriminator and a classifier to improve boundary learning. The approach achieves state-of-the-art performance across multiple extreme visual classification benchmarks, including FashionMNIST, SVHN, and COVIDx, with F1-scores up to 0.98 on imbalanced bird species data.
Class imbalance is a challenging issue in practical classification problems for deep learning models as well as for traditional models. Traditionally successful countermeasures such as synthetic over-sampling have had limited success with complex, structured data handled by deep learning models. In this work, we propose to use a Generative Adversarial Network (GAN) equipped with a generator network G, a discriminator network D and a classifier network C to remove the class-imbalance in visual data sets. The generator network is initialized with auto-encoder to make it stable. The discriminator D ensures that G adheres to class distribution of imbalanced class. In conventional methods, where Generator G competes with discriminator D in a min-max game, we propose to further add an additional classifier network to the original network. Now, the generator network tries to compete in a min-max game with Discriminator as well as the new classifier that we have introduced. An additional condition is enforced on generator network G to produce points in the convex hull of desired imbalanced class. Further the contention of adversarial game with classifier C, pushes conditional distribution learned by G towards the periphery of the respective class, compensating the problem of class imbalance. Experimental evidence shows that this initialization results in stable training of the network. We achieve state of the art performance on extreme visual classification task on the FashionMNIST, MNIST, SVHN, ExDark, MVTec Anomaly Detection dataset, Chest X-Ray dataset and others.
Motivation & Objective
- Address the challenge of extreme class imbalance in visual datasets where minority classes have very few training samples.
- Overcome limitations of traditional data-level methods like SMOTE and oversampling, which struggle with complex, high-dimensional data and risk overfitting.
- Improve deep learning model performance on minority classes by generating high-quality, diverse synthetic samples that lie at the boundary of the minority class distribution.
- Introduce a novel uncertainty sampling framework using a modified GAN architecture that actively identifies and generates hard, informative samples for minority classes.
- Stabilize GAN training through autoencoder initialization and enforce structural constraints on generated samples to improve generalization and robustness.
Proposed method
- Propose a modified GAN architecture with three components: a generator G, a discriminator D, and a classifier C, forming a min-max game where G competes with both D and C.
- Initialize the generator with a pre-trained autoencoder to improve training stability and ensure better feature reconstruction.
- Enforce a geometric constraint that generated samples must lie within the convex hull of the minority class training data to preserve class-specific structure.
- Use uncertainty sampling metrics—Least Confidence, Margin of Confidence, Ratio of Confidence, and Entropy—to identify and prioritize hard-to-classify samples for generation.
- Train the generator to produce samples that maximize uncertainty (i.e., low confidence predictions) in the classifier, thereby improving model robustness on ambiguous or rare examples.
- Leverage the adversarial loss from D and the classification loss from C to push generated samples toward the periphery of the minority class distribution, enhancing boundary learning.
Experimental results
Research questions
- RQ1Can a GAN-based approach effectively generate high-quality synthetic samples for extreme class imbalance scenarios where minority classes have fewer than 100 samples?
- RQ2How does enforcing generator output within the convex hull of minority class samples affect model generalization and minority class performance?
- RQ3To what extent does adding a classifier as an additional adversary improve the quality and diversity of generated samples compared to standard GANs?
- RQ4Can the proposed method serve as an effective uncertainty sampling strategy in active learning settings with limited labeled data?
- RQ5Does the combination of autoencoder initialization and convex hull constraints lead to more stable GAN training compared to standard GANs on imbalanced visual data?
Key findings
- Polarity-GAN achieves an F1-score of 0.98 on the Kaggle Birds dataset with a highly imbalanced class ratio of 300:100:100:100, outperforming prior methods on this extreme imbalance setting.
- On the Covidx dataset, PGAN achieves an F1-score of 0.96, correctly classifying 0.4% of the rare COVID-19 cases—previously misclassified by baseline models—demonstrating strong performance on ultra-rare classes.
- On SVHN, with class ratios ranging from 5000 to 50 samples, PGAN achieves an F1-score of 0.78, showing robustness across varying degrees of imbalance.
- On ExDark, a low-light image classification dataset with 12 classes and extreme imbalance, PGAN achieves an F1-score of 0.54, indicating effectiveness in challenging visual conditions.
- On UCF101, a video action recognition dataset with class imbalance (e.g., 399 vs. 2000+ samples), PGAN achieves an F1-score of 0.74, confirming applicability beyond static image data.
- The method consistently outperforms state-of-the-art baselines across all evaluated datasets, including MNIST, FashionMNIST, and MVTec Anomaly Detection, demonstrating broad effectiveness in extreme visual classification tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.