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

GMM-Based Generative Adversarial Encoder Learning

Yuri Feigin, Hedva Spitzer, Raja GiryesarXiv 2020

Abstract

While GAN is a powerful model for generating images, its inability to infer a latent space directly limits its use in applications requiring an encoder. Our paper presents a simple architectural setup that combines the generative capabilities of GAN with an encoder. We accomplish this by combining the encoder with the discriminator using shared weights, then training them simultaneously using a new loss term. We model the output of the encoder latent space via a GMM, which leads to both good clustering using this latent space and improved image generation by the GAN. Our framework is generic and can be easily plugged into any GAN strategy. In particular, we demonstrate it both with Vanilla GAN and Wasserstein GAN, where in both it leads to an improvement in the generated images in terms of both the IS and FID scores. Moreover, we show that our encoder learns a meaningful representation as its clustering results are competitive with the current GAN-based state-of-the-art in clustering.

Introduction

Generative Adversarial Networks (GANs) have revolutionized image synthesis, producing highly realistic samples from random noise. However, standard GANs are inherently "one-way" models; they lack a direct mechanism to map real images back into the latent space. This limitation prevents their application in tasks such as image reconstruction, semantic editing, and unsupervised clustering. Furthermore, GAN training is often plagued by instability and mode collapse, partly due to the restrictive assumption that the latent space follows a simple Normal distribution.

To address these challenges, we propose GAEL (GMM-based Generative Adversarial Encoder Learning). GAEL introduces an encoder that shares weights with the discriminator, allowing it to leverage the rich feature representations learned during the adversarial process. By modeling the resulting latent space with a Gaussian Mixture Model (GMM) post-training, we achieve both high-quality image generation and state-of-the-art unsupervised clustering.

Methodology

The GAEL framework integrates an encoder into the standard GAN architecture through three primary innovations:

1. Shared-Weight Encoder

Rather than training a standalone encoder, GAEL appends an "encoder head" to the discriminator (or critic). As shown in the architecture diagram below, the encoder and discriminator share the majority of their convolutional layers. This design ensures that the encoder benefits from the discriminative features necessary for distinguishing real from synthetic data, without significantly increasing the model's parameter count.

GAEL Architecture: The encoder shares weights with the discriminator, and a GMM is fitted to the latent space post-training.

2. Simultaneous Training and Weak Constraints

The generator, discriminator, and encoder are trained concurrently. The encoder is optimized to minimize the reconstruction loss of the latent code $z$ used to generate "fake" images. Unlike previous approaches like BiGAN or ALI, GAEL does not impose a strict prior (e.g., a Normal distribution) on the encoder's output during training. This "weak constraint" approach prevents the encoder from interfering with the generator's ability to model complex data distributions.

3. Post-Training GMM Fitting

After training, the entire real dataset is passed through the encoder to obtain latent representations. A Gaussian Mixture Model (GMM) is then fitted to these points. This GMM provides a more flexible and accurate representation of the multi-modal data distribution than a standard Normal prior. For subsequent image generation, samples are drawn from the GMM, leading to improved diversity and quality.

Experimental Results

We evaluated GAEL on several benchmarks, including MNIST, CIFAR-10, CIFAR-100, STL-10, CelebA, and ImageNet (64x64).

Image Generation Quality

GAEL consistently outperforms baseline Vanilla GANs and Wasserstein GANs (WGANs). On the CIFAR-10 dataset, GAEL achieved an Inception Score (IS) of 9.24, a significant improvement over the baseline's 8.49. It also yielded lower (better) Frechet Inception Distance (FID) scores across all tested datasets. The figure below illustrates the high visual fidelity and diversity of images generated by the model.

Samples of generated images across various datasets demonstrating high quality and diversity.

Unsupervised Clustering

The learned latent space proves highly effective for unsupervised clustering. On CIFAR-10, GAEL reached a clustering accuracy of 55.5%, surpassing other GAN-based methods such as ClusterGAN (41.2%) and Deep Adaptive Clustering (DAC, 52.2%). This indicates that the encoder successfully captures meaningful semantic features.

Training Stability

An unexpected benefit of the encoder loss is its stabilizing effect on GAN training. While baseline GAN performance often degrades over long training cycles, GAEL maintains stability or continues to improve, suggesting that the latent reconstruction task provides a useful auxiliary signal for the discriminator.

Conclusion

GAEL provides a simple yet effective method for adding an encoder to GANs. By sharing weights with the discriminator and utilizing a post-training GMM, the model achieves superior image generation, stable training, and competitive unsupervised clustering results. Future work will explore the application of GAEL to semi-supervised learning and few-shot tasks, where its robust latent representations could provide further advantages.

Summary updated

BibTeX
@misc{feigin2020gmm,
  author = {Yuri Feigin and Hedva Spitzer and Raja Giryes},
  title = {{GMM-Based Generative Adversarial Encoder Learning}},
  year = {2020},
  eprint = {2012.04525},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.04525},
}
Figure