I've been experimenting with Generative Adversarial Networks (GANs) to create synthetic medical images for training. However, my generator keeps producing the same three images over and over again. How do I fix this "mode collapse" and ensure the model captures the full diversity of the original dataset?
3 answers
Mode collapse is the "final boss" of GAN training! It happens when the generator finds a specific output that the discriminator can't easily distinguish as fake, so it stops exploring other possibilities. To solve this, you should look into Wasserstein GANs (WGANs) with Gradient Penalty. WGANs use a different loss function that provides much smoother gradients, making training far more stable. Another technique is "Minibatch Discrimination," which allows the discriminator to look at a whole batch of images at once to see if they are too similar, forcing the generator to diversify.
Have you tried using an Unrolled GAN approach to let the generator "see" how the discriminator will respond several steps ahead?
Simply adding more noise to the input or using Label Smoothing on the discriminator can sometimes give the generator enough "breathing room" to explore other data modes.
Adding noise is a classic fix. I’d also suggest checking your learning rate; if it’s too high, the generator often settles into a local minimum too quickly.
I haven't tried unrolling yet. Ryan, does that significantly increase the computational overhead? I'm currently training on a single A100 GPU and I'm worried about the training time doubling if the backpropagation becomes too complex.