Stein Latent Optimization for Generative Adversarial Networks

Uiwon Hwang, Heeseung Kim, Dahuin Jung, Hyemi Jang, Hyungyu Lee, Sungroh Yoon

TL;DR

SLOGAN is a novel framework for unsupervised conditional image generation that excels even when dataset attributes are heavily imbalanced. By using Stein’s lemma to optimize a Gaussian Mixture Model (GMM) prior, the model automatically learns the distribution and "imbalance ratio" of unlabeled data, achieving state-of-the-art performance in clustering and conditional synthesis.

The Challenge of Imbalanced Attributes in GANs

Generative Adversarial Networks (GANs) are highly effective at creating realistic images. However, directing them to generate specific types of images (e.g., "only faces with glasses") typically requires a massive amount of labeled data.

Unsupervised conditional GANs, such as InfoGAN or ClusterGAN, attempt to solve this by automatically discovering "clusters" or attributes within the data. Unfortunately, these models share a significant flaw: they assume that attributes are balanced. In the real world, data is rarely distributed evenly. For example, in a dataset of faces, only a small fraction might be wearing sunglasses. Existing models struggle to identify these "minority" attributes because their latent spaces are hard-coded for uniform distributions, leading to poor clustering and generation of underrepresented features.

Introducing SLOGAN

To address this limitation, the authors introduce Stein Latent Optimization for GANs (SLOGAN). The core innovation lies in how the model structures and learns its latent space to naturally accommodate imbalanced data.

Overview of the SLOGAN architecture, featuring the Gaussian mixture prior and Unsupervised Conditional Contrastive (U2C) loss.

Key Methodological Innovations

  1. Gaussian Mixture Prior: Instead of relying on a single standard Gaussian distribution, SLOGAN uses a Gaussian Mixture Model (GMM) as its prior. This allows the latent space to naturally form multiple distinct "blobs," with each component representing a different attribute.
  2. Stein Latent Optimization: To update the parameters of this GMM (the means, covariances, and mixing coefficients), the authors derive gradient identities based on Stein’s lemma. This provides an "implicit reparameterization" trick that is more stable and has lower variance than standard methods. Crucially, this allows the model to learn the mixing coefficients, which represent the actual ratio of attributes in the dataset.
  3. Unsupervised Conditional Contrastive (U2C) Loss: SLOGAN introduces an encoder network that maps generated images back to the latent space. The U2C loss ensures that images generated from a specific GMM component are pulled toward that component’s center, strongly reinforcing the association between a latent cluster and a visual attribute.
  4. Attribute Manipulation: By providing a tiny amount of "probe data" (just a few labeled examples), the model can be steered to associate specific GMM components with desired, human-interpretable attributes.

Key Insights and Results

The model was evaluated on a wide range of benchmarks, including synthetic 2D datasets, standard vision datasets (MNIST, CIFAR-10), high-resolution faces (CelebA-HQ), animal faces (AFHQ), and even biomedical RNA transcript counts (10x_73k).

To accurately measure the quality of unsupervised conditional generation, the authors proposed a new metric: ICFID (Intra-cluster FID).

  • Learning the Imbalance: Unlike previous state-of-the-art models that force clusters to be the same size, SLOGAN actually discovers the "imbalance ratio." If 70% of the data consists of one attribute and 30% of another, the model learns mixing coefficients that accurately reflect that 7:3 ratio.
  • Superior Clustering: On an imbalanced CIFAR-2 dataset (7:3 ratio), SLOGAN achieved a Normalized Mutual Information (NMI) of 0.69, vastly outperforming PGMGAN (0.42) and InfoGAN (0.05).
SLOGAN successfully clustering an imbalanced 2D synthetic dataset, maintaining distinct and accurate cluster separations.
  • High-Fidelity Synthesis: SLOGAN successfully generated high-quality, attribute-consistent images on complex datasets like CelebA-HQ (256x256) and AFHQ, even when one class was significantly rarer than the other.
  • Robustness to Extreme Imbalance: In experiments varying the imbalance ratio from 9:1 to 1:9, SLOGAN maintained high performance, whereas competitors' results degraded sharply as the imbalance became more extreme.
  • Continuous vs. Discrete: While most prior work uses discrete variables for attributes, SLOGAN uses a continuous GMM. The authors argue this models real-world attributes (like hair color or age) more naturally.

Limitations and Future Work

While SLOGAN represents a significant step forward, it does have limitations:

  • Pre-defining Clusters ($K$): The user still needs to pre-define the number of components ($K$) in the mixture. Future work could involve automatically learning the optimal number of clusters or establishing a hierarchy of attributes.
  • Minority Class Quality: Although SLOGAN is vastly better at finding minority attributes than previous methods, the visual quality of samples drawn from extremely small clusters (e.g., a 1:14 ratio) still has room for improvement compared to majority classes.

Summary updated

BibTeX
@inproceedings{hwang2022stein,
  author = {Uiwon Hwang and Heeseung Kim and Dahuin Jung and Hyemi Jang and Hyungyu Lee and Sungroh Yoon},
  title = {{Stein Latent Optimization for Generative Adversarial Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=2-mkiUs9Jx7},
}
Figure