Improving GANs for Long-Tailed Data Through Group Spectral Regularization

Harsh Rangwani, Naman Jaswani, Tejan Karmali, Varun Jampani, R. Venkatesh Babu

Abstract

Deep long-tailed learning aims to train useful deep networks on practical, real-world imbalanced distributions, wherein most labels of the tail classes are associated with a few samples. There has been a large body of work to train discriminative models for visual recognition on long-tailed distribution. In contrast, we aim to train conditional Generative Adversarial Networks (cGANs), a class of image generation models, on long-tailed distributions. We find that similar to recognition, state-of-the-art methods for image generation also suffer from performance degradation on tail classes. The performance degradation is mainly due to class-specific mode collapse for tail classes, which we observe to be correlated with the spectral explosion of the conditioning parameter matrix. We propose a novel group Spectral Regularizer (gSR) that prevents the spectral explosion, alleviating mode collapse and resulting in diverse and plausible image generation even for tail classes. We find that gSR effectively combines with existing augmentation and regularization techniques, leading to state-of-the-art image generation performance on long-tailed data. Extensive experiments demonstrate the efficacy of our regularizer on long-tailed datasets with different degrees of imbalance.

The Challenge of Long-Tailed Image Generation

In real-world scenarios, data is rarely distributed uniformly. Most datasets follow a "long-tail" distribution where a few "head" classes possess thousands of samples, while many "tail" classes have only a handful. While significant progress has been made in training classifiers on such data, generative models like conditional GANs (cGANs) still struggle.

When a cGAN encounters a tail class, it often undergoes class-specific mode collapse. Instead of producing a variety of images for that class, the generator begins outputting repetitive, low-quality patterns. The authors identified a critical driver for this failure: the spectral explosion of the parameters used for class conditioning—specifically the gain ($\gamma$) and bias ($\beta$) parameters in Conditional Batch Normalization (cBN) layers. As training progresses, the spectral norms (the largest singular values) of these parameter matrices skyrocket exactly when the visual quality of tail classes collapses.

Correlation between spectral explosion and class-specific mode collapse over training steps.

Group Spectral Regularization (gSR)

To address this, the authors introduce Group Spectral Regularization (gSR). This method stabilizes training by constraining the spectral norm of the generator's conditioning parameters. The process involves:

  1. Parameter Grouping: Class-specific gain and bias parameters from cBN layers are grouped into matrices.
  2. Spectral Estimation: The maximum spectral norm ($\sigma_{max}$) of these matrices is estimated efficiently using the Power Iteration method.
  3. Regularization Loss: A penalty term is added to the generator's loss function to discourage these norms from exploding.
  4. Class-Aware Weighting: The regularization strength is dynamically weighted based on the "effective number of samples" in a class. Tail classes receive stronger regularization than head classes to compensate for their lack of data.

Unlike standard Spectral Normalization, which is typically applied to the discriminator to ensure Lipschitz continuity, gSR focuses on the generator to ensure feature decorrelation and diversity.

Experimental Evaluation

The authors evaluated gSR on several datasets, including synthetic long-tail versions of CIFAR-10 and LSUN, as well as the naturally imbalanced iNaturalist 2019 dataset.

Comparison of class distribution, generated samples, and training stability (FID) between the baseline and gSR.

Key Results

  • Quantitative Gains: On CIFAR-10 and LSUN, gSR provided a relative improvement in Fréchet Inception Distance (FID) of 20.33% for SNGAN and 39.08% for BigGAN baselines.
  • Tail Class Recovery: In extreme imbalance scenarios (where the head class has 1000x more samples than the tail), gSR prevented total collapse, enabling the generation of plausible images for classes with as few as 5 training samples.
  • Real-World Performance: On iNaturalist 2019, BigGAN + gSR achieved an FID of 6.36, significantly outperforming specialized baselines like CBGAN (9.01).
  • Complementary Nature: gSR works alongside existing techniques like DiffAugment or LeCam regularization. While those methods focus on the discriminator, gSR addresses a fundamental instability in the generator's conditioning.

Conclusion

Group Spectral Regularization offers a simple yet powerful plug-and-play solution for training GANs on imbalanced data. By identifying and penalizing the spectral explosion in conditioning parameters, gSR prevents class-specific mode collapse and ensures high-quality image generation across the entire data distribution. Future work may explore hyperparameter-free versions of this decorrelation or its application to newer architectures like Diffusion Models.

Summary updated

BibTeX
@inproceedings{rangwani2022improving,
  author = {Harsh Rangwani and Naman Jaswani and Tejan Karmali and Varun Jampani and R. Venkatesh Babu},
  title = {{Improving GANs for Long-Tailed Data Through Group Spectral Regularization}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=RePm-Ot64K},
}
Figure