Source-linked AI summary
BAGAN: Data Augmentation with Balancing GAN
Giovanni Mariani, Florian Scheidegger, Roxana Istrate, Costas Bekas, Cristiano Malossi
TL;DR
Imbalanced image-classification datasets can reduce classifier accuracy, while scarce minority examples make minority-focused GAN training difficult. BAGAN trains on all available classes, uses class-conditioned latent representations initialized through an autoencoder, and is reported to generate higher-quality images and improve classifiers on augmented datasets. The paper compares BAGAN with state-of-the-art GANs and reports superior generated-image quality under imbalance.
Problem
Imbalanced image-classification datasets can significantly deteriorate classifier accuracy, while scarce minority-class images make training a GAN on minority data difficult.
Method
BAGAN trains adversarially with all available classes, applies latent-space class conditioning, and initializes GAN modules using an autoencoder.
Results
BAGAN is reported to outperform other GANs in generating high-quality images from imbalanced training sets, with higher classifier accuracy after augmentation.
Takeaways & Limitations
BAGAN restores dataset balance by generating minority-class images while using learned class representations to guide generation.
Takeaways & Limitations
ACGAN-style minority generation can be undermined by contradictory realism and class objectives when minority examples are scarce.
Abstract
from arXiv · showhide
Image classification datasets are often imbalanced, characteristic that negatively affects the accuracy of deep-learning classifiers. In this work we propose balancing GAN (BAGAN) as an augmentation tool to restore balance in imbalanced datasets. This is challenging because the few minority-class images may not be enough to train a GAN. We overcome this issue by including during the adversarial training all available images of majority and minority classes. The generative model learns useful features from majority classes and uses these to generate images for minority classes. We apply class conditioning in the latent space to drive the generation process towards a target class. The generator in the GAN is initialized with the encoder module of an autoencoder that enables us to learn an accurate class-conditioning in the latent space. We compare the proposed methodology with state-of-the-art GANs and demonstrate that BAGAN generates images of superior quality when trained with an imbalanced dataset.
1 Introduction
BAGAN addresses imbalanced image-classification datasets by generating minority-class images, using all available classes to learn features and class-conditioned generation. Its autoencoder initialization supports latent-space class encoding, and experiments report higher generated-image quality and variety than state-of-the-art GANs.
- Problem: BAGAN augments imbalanced classification datasets by generating new minority-class images.The approach targets degraded classification accuracy caused by nonuniform class distributions.
- Method: BAGAN trains with all available majority- and minority-class images, allowing features learned from majority classes to support minority-class generation.Class conditioning directs generation toward a desired target class.
- Contribution: The proposed training approach specifically aims to generate minority-class images from imbalanced datasets.
- Contribution: Autoencoder-based initialization starts GAN training from a good solution and learns how to encode classes in the generator’s latent space.
- Evaluation: BAGAN is evaluated empirically against state-of-the-art GAN methodologies.
- Results: BAGAN outperforms state-of-the-art GAN approaches in generated-image variety and quality, leading to higher accuracy for classifiers trained on the augmented dataset.
2 Background
GANs generate images through adversarial generator–discriminator training, but can suffer mode collapse that undermines dataset diversity. BAGAN combines GANs with autoencoding to initialize training away from mode collapse and condition generation on image class.
- GANs: GANs generate realistic images by training a generative network adversarially against a discriminator network.
- Challenges: Mode collapse occurs when a GAN generates only one or a few repeated examples while learning to fool the discriminator.For augmentation, insufficient variety can make the generated dataset unsuitable.
- Related approaches: Prior approaches address mode collapse through diversity-promoting losses, adaptive discriminator strategies, class discrimination, regularization, or autoencoder coupling.
- BAGAN: BAGAN uses an autoencoder to initialize GAN modules near a good solution and far from mode collapse.
- BAGAN: BAGAN also makes generation controllable by conditioning the generator on the image class, similarly to ACGAN.
3 Motivating Example
The motivating MNIST example shows why conventional GAN training struggles with severe class imbalance: majority classes dominate, while minority-only training lacks data. ACGAN’s objectives can conflict for minority classes, motivating BAGAN’s single-output discriminator and autoencoder coupling.
- Motivating Example: In the motivating MNIST dataset, 97.5% of available zero images are removed, creating severe minority-class imbalance.
- Conventional GAN: Training a conventional GAN on all data favors majority-class generation and can collapse modes associated with minority classes.
- Conventional GAN: Only minority-class training is impractical because scarce images provide too few examples for GAN learning.After removing 97.5% of zeros, approximately 150 minority-class images remain.
- ACGAN: ACGAN explicitly conditions generation on classes, but its realism and class-association objectives can become contradictory for minority classes.
- Architectures: Figure 1 contrasts ACGAN’s discriminator architecture with BAGAN’s discriminator architecture.The cited text states that ACGAN uses separate real/fake and class outputs, whereas BAGAN uses a single output for class labels or fake.
- BAGAN: BAGAN uses a single discriminator objective and couples GAN training with autoencoding to improve class conditioning and avoid mode collapse.For the imbalanced MNIST example, BAGAN images are reported as superior in quality.
4 BAGAN
BAGAN couples autoencoder initialization with class-conditioned GAN training to generate minority-class images from imbalanced datasets. It uses all available images to learn features and class-specific latent distributions before adversarial fine-tuning.
- Method: BAGAN jointly uses majority- and minority-class images during training to generate realistic minority-class samples.The approach combines GAN and autoencoder capabilities rather than training only on scarce minority examples.
- Autoencoder training: The autoencoder is trained on all training images without explicit class knowledge using l2 loss minimization.This provides the initial representation used by the later GAN components.
- GAN initialization: BAGAN initializes the generator from the autoencoder decoder and discriminator feature layers from its encoder, while randomly initializing the discriminator’s final softmax layer.The shared network topology enables transfer of autoencoder knowledge into the class-aware GAN.
- Latent-space conditioning: The encoder maps real images of each class into latent space, where BAGAN fits a multivariate normal distribution N_c = N(µ_c, Σ_c) for class-conditioned sampling.Sampling from the class-specific distribution produces latent vectors Z_c associated with a selected target class.
- Adversarial training: During adversarial training, the discriminator classifies images as one of n problem-specific classes or fake, while the generator learns from uniformly sampled class labels.Generator outputs are evaluated against the selected conditioning labels during optimization.
5 Results
The evaluation compares BAGAN with ACGAN and a minority-only GAN across balanced datasets made imbalanced and the naturally imbalanced GTSRB dataset. BAGAN generally produces more accurate, varied, and class-representative images, improving final classification performance.
- Experimental setup: The experiments use MNIST, CIFAR-10, Flowers, and GTSRB; imbalance is artificially induced in the first three by dropping instances from one class.GTSRB is already imbalanced, while Flowers images are reshaped to 224x224.
- Experimental setup: BAGAN is compared with ACGAN and a simple GAN under similar architecture settings, with both conditioned models trained jointly on majority and minority classes.The simple GAN trains only on minority-class images and removes class conditioning.
- Generated-image quality: For CIFAR-10, the minority-only GAN collapses toward one image per class after training on 3000 minority-class images.The figure shows five generated samples per class after dropping 40% of that class’s images.
- Generated-image quality: For GTSRB majority classes, ACGAN and BAGAN generate high-quality images, but ACGAN collapses on minority classes and can produce images from the wrong class.BAGAN is not rewarded for realistic images that fail to represent the requested class.
- Quantitative assessment: BAGAN generally achieves the highest generated-image accuracy and the best variability, with SSIM values closest to reference real-image variability.The ResNet-18 classifier evaluates target-class accuracy, while SSIM measures similarity and diversity; the reported comparisons show no overfitting.
- Quality of final classification: BAGAN achieves the best final-classifier accuracy for GTSRB and usually MNIST, while mirroring performs best for CIFAR-10 and Flowers.For orientation-sensitive datasets, mirroring disrupts relevant features; BAGAN still outperforms ACGAN and the simple GAN.
- Conclusion: The authors conclude that BAGAN is superior for generating minority-class images from imbalanced datasets and is useful when geometric augmentation disrupts orientation-related features.The stated assessment goals are class representation, non-repetition, and difference from training images.
6 Conclusion
BAGAN restores balance in imbalanced datasets using autoencoder-initialized adversarial training. Compared with other GANs, it generates higher-quality images and improves classifiers trained on the augmented data.
- BAGAN restores imbalanced-dataset balance using generative adversarial networks initialized with an autoencoder.The autoencoder initializes the generator and discriminator and helps represent classes in the generator’s latent space.
- BAGAN outperforms other GANs for generating high-quality images from imbalanced training sets, improving classifier accuracy after augmentation.