TL;DR
MemoryGAN introduces a learnable memory network into the Generative Adversarial Network (GAN) architecture to solve two major hurdles in unsupervised learning: "structural discontinuity" in latent space and discriminator forgetting. By explicitly storing cluster information in memory slots, the model separates the "identity" of an object from its "style." This separation leads to state-of-the-art image quality, cleaner interpolations, and significantly more stable training.
What Problem Does This Paper Address?
Standard unsupervised GANs typically map a simple, continuous latent distribution (like a Gaussian) to complex, multi-modal data (like a dataset containing both "cats" and "buildings"). This architectural norm creates two main issues:
- Structural Discontinuity: Because the latent space is continuous but the data classes are discrete, there is no "natural" transition between distinct classes (e.g., a cat and a building). When interpolating between these points in latent space, a standard GAN often produces unrealistic, "mushy" hybrid images in the transition zones.
- Catastrophic Forgetting: The discriminator in a GAN often focuses only on the most recent samples generated by the generator. As the generator's output changes over time, the discriminator "forgets" what previous iterations looked like. This leads to training instability and "cycling," where the model keeps re-introducing old artifacts.
Methods
To address these challenges, the authors propose MemoryGAN, which consists of two main components that share a common memory module:
- Discriminative Memory Network (DMN): The discriminator uses an inference network to map an input image to a "query" vector. It then compares this query against a set of memory "keys" using a von Mises-Fisher (vMF) mixture model (essentially a Gaussian distribution defined on a unit sphere). This mechanism allows the discriminator to "remember" and categorize clusters of both real and fake data.
- Memory Conditional Generative Network (MCGN): Instead of generating an image from pure noise, the generator first samples a "cluster key" from the memory and then combines it with a noise vector. This allows the memory to handle the discrete "what" (the object class or identity) while the noise handles the continuous "how" (the pose, style, or lighting).
- Incremental EM Update: The memory is not static; it is updated during training using a modified Expectation-Maximization (EM) algorithm. This ensures the memory slots dynamically evolve to represent the most important features of the dataset.
Key Insights and Ideas
- Separation of Concerns: By using memory for discrete clusters and noise for continuous style, the model avoids generating the "monster" images usually found between classes. Interpolation within a memory slot changes the style, while moving between slots changes the object identity.
- Memorization as a Prerequisite: The title "Memorization Precedes Generation" highlights the philosophy that a model must first learn to represent and "remember" the underlying clusters of a dataset before it can reliably generate new, realistic samples from them.
- vMF over Gaussian: Using von Mises-Fisher distributions is a clever choice for high-dimensional feature spaces, where direction (cosine similarity) often matters more than absolute magnitude.
- Discriminator Stability: The memory acts as a long-term buffer. Because the discriminator "remembers" past clusters, the generator cannot easily "fool" it by simply reverting to an old trick the discriminator has already seen and stored.
Key Results
MemoryGAN was evaluated on several standard and specialized benchmarks, including CIFAR10, CelebA, Fashion-MNIST, Chairs, and Affine-MNIST.
- State-of-the-Art Performance: MemoryGAN achieved an Inception Score of 8.04 on CIFAR10, which was the highest for unsupervised GANs at the time of publication, outperforming models like WGAN-GP and Fisher GAN.
- Visual Fidelity: Qualitative results show that MemoryGAN produces much cleaner interpolations. In tests like Affine-MNIST and Fashion-MNIST, the model successfully "jumps" between distinct classes rather than creating distorted, structural hybrids (as seen when compared to standard DCGANs).
- Computational Efficiency: Despite the added complexity of a memory network, the training time per epoch was only ~9% slower than a standard DCGAN, making it a highly practical upgrade.
Limitations and Future Work
- Unsupervised Clustering Errors: Since the model is entirely unsupervised, it occasionally groups different but visually similar classes into the same memory slot (e.g., putting some cats and dogs in the same cluster), which can lead to "near-miss" failure cases during generation.
- Rare Samples: While the memory helps stabilize training, the model still struggles with extremely rare samples in a dataset, as they may not be assigned a dedicated memory slot.
- Future Directions: The authors suggest extending this work to few-shot generation, where the memory network could help the model synthesize rare or novel classes based on very few examples.
Summary updated