Diverse Rare Sample Generation with Pretrained GANs

Subeen Lee, Jiyeon Han, Soyeon Kim, Jaesik Choi

Introduction

Deep generative models, particularly Generative Adversarial Networks (GANs), have achieved remarkable success in synthesizing high-fidelity images. However, these models often suffer from "mode collapse," where they prioritize high-probability regions of the data distribution. Consequently, GANs struggle to generate "rare" samples—unique or low-density data points such as individuals with specific accessories, extreme ages, or rare animal breeds. This "long-tail" problem limits the utility of GANs in applications requiring diverse and representative data.

The DivRareGen Framework

To address these challenges, this research introduces DivRareGen, a novel framework designed to generate diverse, high-quality rare samples from frozen, pretrained GANs. Unlike existing methods that require computationally expensive fine-tuning or produce repetitive outputs, DivRareGen optimizes the latent space of a fixed generator using a multi-objective approach.

The core of the methodology lies in three distinct loss functions:

  1. Rarity Loss ($L_{rare}$): To overcome the non-differentiability of traditional rarity metrics like $k$-Nearest Neighbors, the authors employ Normalizing Flows (NFs). By using the Glow architecture to estimate the log-likelihood of samples in a feature space (extracted via VGG16), the framework can use gradient-based optimization to "nudge" latent vectors toward low-density regions.
  2. Similarity Loss ($L_{sim}$): This constraint ensures that the generated rare sample maintains a recognizable link to a reference image, preserving core identity or structural features.
  3. Diversity Loss ($L_{div}$): To prevent multiple optimizations from collapsing into the same local rare "mode," an explicit diversity penalty is applied. This forces the model to explore different ways an image can be rare.

Experimental Results

The researchers evaluated DivRareGen on high-resolution ($1024 \times 1024$) datasets including FFHQ, AFHQ (Cats and Dogs), and MetFaces.

Quantitative Performance

On the FFHQ dataset, the method achieved a Rarity Score (RS) of 23.50, a significant improvement over the baseline score of 18.88. Furthermore, the model maintained high visual fidelity, achieving a Precision of 0.92, vastly outperforming alternative techniques like Polarity Sampling (~0.39).

Figure 3: Qualitative examples of the Initial to Rare transformation across various datasets, showing the addition of rare attributes like unique headwear and altered hair colors.

Attribute Boosting and Diversity

The framework successfully increased the prevalence of rare attributes. For instance, the occurrence of "Wearing Hat" rose from 8% to 11.03%, and the frequency of "Bald" samples more than doubled. Crucially, the diversity loss enabled the generation of multiple distinct rare versions from a single starting point.

Figure 6: Demonstration of diverse rare sample generation. From a single reference image (left), the model generates multiple unique rare variations (right), each featuring different types of headwear.

Discussion and Limitations

While DivRareGen effectively navigates the latent space to find rare samples, it faces certain limitations. Attributes are often "entangled," meaning the optimizer might change several features (e.g., age and accessories) simultaneously to achieve rarity, rather than allowing for fine-grained control. Additionally, the method's success is tied to the accuracy of the Normalizing Flow's density estimation. Future work aims to integrate these optimization techniques with more controlled image manipulation methods to enable targeted rare attribute generation.

Summary updated

BibTeX
@inproceedings{lee2025diverse,
  author = {Subeen Lee and Jiyeon Han and Soyeon Kim and Jaesik Choi},
  title = {{Diverse Rare Sample Generation with Pretrained GANs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i5.32480},
}
Figure