NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MEGAN: Mixture of Experts of Generative Adversarial Networks for Multimodal Image Generation

David Keetae Park, Seungjoo Yoo, Hyojin Bahng, Jaegul Choo, Noseong Park

TL;DR

MEGAN (Mixture of Experts GAN) tackles the challenge of generating complex, multimodal datasets by training an ensemble of specialized generator networks. Using a gating network driven by the Straight-Through Gumbel-Softmax trick and a novel load-balancing loss, MEGAN automatically assigns different data clusters to different generators in an end-to-end manner. This significantly improves image diversity and quality without requiring any handcrafted pre-clustering.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) excel at creating realistic images, but they frequently stumble when faced with multimodal datasets—datasets containing highly distinct categories or sub-features (e.g., different object classes, varied facial features, or distinct architectural styles). When a single generator tries to master all these diverse modes simultaneously, it often suffers from mode collapse or produces blurry, low-quality mixtures.

While previous approaches tried ensembling multiple generators or using handcrafted pre-clustering, these methods are often sub-optimal, complex, or fail to force true specialization among the generators. The authors of this paper wanted a way to let multiple generators automatically "divide and conquer" a dataset in a completely end-to-end, trainable framework.

Methods

The authors introduce MEGAN, which adapts the classic "Mixture of Experts" paradigm to GANs. Instead of a single generator, MEGAN uses $n$ separate generators ($G_1, G_2, \dots, G_n$).

The core architecture consists of:

  1. Gating Networks: An auxiliary network that takes the latent vector $z$ and intermediate feature maps from the generators to decide which single generator is best suited to produce the final image.
  2. Straight-Through Gumbel-Softmax (STGS): Selecting a single generator requires a discrete (categorical) choice, which normally breaks backpropagation because the argmax operation has zero gradients. STGS provides a clever detour, outputting a discrete one-hot vector during the forward pass while allowing continuous gradients to flow backward during training.
  3. Load-Balancing Regularization: Gating networks tend to converge too quickly, favoring a few initial generators and leaving others untrained. To combat this, the authors introduce a load-balancing loss ($L_{LB}$) that penalizes unequal generator selection within a mini-batch, forcing the system to distribute the data space evenly across all available experts.
Figure 2: The proposed architecture of MEGAN; (a) shows the overview of our main networks. Given a latent vector z, each of the n generators produces an output oi. The latent vector z and n feature vectors (denoted in yellow) extracted from the generators are given as input to the gating networks that produce a one-hot vector g, as shown in the middle. The chosen image by the one-hot vector (marked as “Fake Image”) will be fed into the discriminator that measures the adversarial loss with regard to both real and fake classes. (b) illustrates an in-depth view on the gating networks. The gating networks output a one-hot vector g.

Datasets

The model was evaluated on three standard image generation benchmarks:

  • CIFAR-10: 60,000 images across 10 distinct object classes.
  • CelebA: 202,599 celebrity facial images exhibiting diverse features and ethnicities.
  • LSUN (Church Outdoor subset): 126,227 scenic images of outdoor churches.

No new datasets or benchmarks were introduced in this paper.

Key Insights and Ideas

  • Implicit Specialization: Remarkably, MEGAN forces generators to specialize without an explicit loss function telling them how to divide the data. The natural competitive dynamics between the generators and the discriminator cause individual experts to automatically latch onto distinct local clusters (e.g., one generator focuses on dark-haired celebrities, another on light-haired smiling faces).
  • Shared Latent Space: Unlike previous multi-generator models (like MAD-GAN) where experts operate on entirely separate latent spaces, MEGAN's generators all share the same latent space, making the gating network's routing decisions highly efficient.
  • The Balancing Act: The load-balancing hyperparameter $\lambda$ is crucial. If $\lambda$ is too large, the gating network outputs a uniform distribution, destroying the specialization effect. Finding the sweet spot ensures stable training and distinct expert behaviors.

Key Results

  • High Diversity: On the CelebA dataset, MEGAN achieved a Multiscale Structural Similarity (MS-SSIM) score of 0.2470 (with 5 generators), outperforming baselines like BEGAN (0.4636) and MGAN (0.2611). Lower MS-SSIM scores indicate higher image diversity.
  • State-of-the-Art Quality: On CIFAR-10, MEGAN achieved an Inception Score of 8.33, matching the performance of MGAN but with a tighter variance (0.09 vs 0.10).
  • Human Realism: In a web-based user study, images generated by MEGAN (especially on the LSUN-Church dataset) achieved lower human detection rates than baseline models, meaning users struggled to distinguish MEGAN's fake images from real ones.

Limitations and Future Work

  • Hyperparameter Sensitivity: The performance relies heavily on tuning the load-balancing weight $\lambda$. If it's set too high, the gating network yields a uniform distribution, failing to properly assign specific modes to specific generators.
  • Scalability to More Experts: While the paper tests up to 10 generators, scaling to dozens or hundreds of experts could increase computational overhead during training, as intermediate features from all generators must be processed by the gating network.
  • Future Directions: The authors suggest extending this mixture-of-experts framework to other modern GAN architectures and a broader range of generative tasks beyond image synthesis.

Summary updated

BibTeX
@inproceedings{park2018megan,
  author = {David Keetae Park and Seungjoo Yoo and Hyojin Bahng and Jaegul Choo and Noseong Park},
  title = {{MEGAN: Mixture of Experts of Generative Adversarial Networks for Multimodal Image Generation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.24963/ijcai.2018/122},
}
Figure