Imbalanced data learning by minority class augmentation using capsule adversarial networks

Pourya Shamsolmoali, Masoumeh Zareapoor, Linlin Shen, Abdul Hamid Sadka, Jie Yang

TL;DR

This paper introduces CapsAN (Capsule Adversarial Networks), a novel framework that combines Generative Adversarial Networks (GANs) with Capsule Networks to solve the "imbalanced data" problem. By using a capsule-based discriminator and a generator that learns from a mixture of class distributions, the model generates high-quality minority class samples that significantly improve classification accuracy in severely skewed datasets.

What Problem Does This Paper Address?

In the real world, data is rarely perfectly balanced. Whether it’s medical diagnosis (where healthy patients far outnumber sick ones) or fraud detection, machine learning models often struggle because they are "biased" toward the majority class.

Deep learning models, particularly GANs, face specific hurdles here. Standard GANs require a lot of data to learn a distribution; when a class is underrepresented, the generator often suffers from mode collapse (producing the same few images over and over) or simply ignores the minority class entirely. Furthermore, traditional Convolutional Neural Networks (CNNs) used in GAN discriminators often lose crucial spatial relationship information due to pooling layers. The authors aim to bridge this gap by creating a more robust "competitive game" between the generator and a more sophisticated, capsule-based discriminator.

Methods

The core innovation is the Capsule Adversarial Network (CapsAN). It departs from standard GAN architectures in two major ways:

  1. The Capsule-Discriminator (DC): Instead of a standard CNN, the discriminator uses Capsule Networks. Capsules are groups of neurons that represent the "instantiation parameters" of an object (like pose, lighting, and thickness). This allows the discriminator to recognize complex hierarchical relationships with fewer parameters. Unlike a binary "real vs. fake" discriminator, this one is a multiclass classifier that maps inputs into several clusters (Real Class 1, Real Class 2, ..., Fake).
  2. Multivariate Generator: The generator doesn't just guess; it uses a multivariate mixture distribution that incorporates the structure of the majority class to help "fill in the blanks" for the minority class. It is trained using a feature matching loss, which forces the generator to match the internal feature statistics of real data, leading to better convergence and fewer outliers.
The proposed CapsAN architecture showing the flow from Gaussian noise and class information through the generator and into the capsule-based discriminator.

Datasets

The authors evaluated their model on five widely recognized image datasets, manually inducing different levels of imbalance (from 40% down to a severe 2.5%):

  • MNIST: Handwritten digits.
  • CIFAR-10: General objects (birds, planes, cars).
  • CelebA: Celebrity faces.
  • Fashion-MNIST: Clothing items.
  • GTSRB: German Traffic Sign Recognition Benchmark.

Key Insights and Ideas

  • Capsules > Convolutions for Imbalance: The "aha moment" here is that Capsule Networks are inherently better at recognizing overlapping classes because they preserve spatial hierarchies. This makes them much more effective at distinguishing a "fake" minority sample from a "real" one, even when data is scarce.
  • Leveraging the Majority: Instead of treating classes in isolation, the generator uses the distribution of the majority class as a scaffold to generate more diverse and realistic minority samples.
  • Stability through Loss: By using a "pull-away term" in the loss function, the authors force the discriminator to keep its internal representations of different classes far apart, which prevents the model from getting "confused" between similar-looking classes.

Key Results

CapsAN consistently outperformed standard GANs and traditional oversampling methods like SMOTE and ADASYN across all metrics (Precision, Recall, F-measure, and G-mean).

  • Accuracy at the Edge: In cases of severe imbalance (2.5% ratio), CapsAN maintained high balanced accuracy where other models plummeted. For example, on the MNIST dataset, CapsAN achieved significantly higher accuracy than ACGAN and standard GANs as the imbalance became more extreme.
  • Image Quality: The quality of generated images was measured using Frechet Inception Distance (FID). CapsAN achieved the lowest (best) FID scores on MNIST (4.81) and CIFAR-10 (9.07) compared to other GAN variants, indicating the generated images were both diverse and realistic.
Comparison of Balanced Accuracy across different imbalance percentages (Data 1 to Data 5). CapsAN (Proposed) consistently stays at the top.

Limitations and Future Work

While CapsAN shows impressive results, the authors note that the performance of the generative model is highly dependent on accurately computing the distance to multivariate samples. If the initial distribution estimation is poor, the generator's quality may suffer.

For future work, the authors suggest exploring new loss functions for the generator to further enrich the diversity of the generated samples. They also see potential in applying this framework to even more complex domains, such as medical imaging or remote sensing, where data imbalance is a critical bottleneck.

Summary updated

BibTeX
@inproceedings{shamsolmoali2021imbalanced,
  author = {Pourya Shamsolmoali and Masoumeh Zareapoor and Linlin Shen and Abdul Hamid Sadka and Jie Yang},
  title = {{Imbalanced data learning by minority class augmentation using capsule adversarial networks}},
  booktitle = {Neurocomputing},
  year = {2021},
  url = {https://openreview.net/forum?id=LidHEy9LNZd},
}
Figure