Bayesian CycleGAN via Marginalizing Latent Sampling

Haoran You, Yu Cheng, Tianheng Cheng, Chun-Liang Li, Pan ZhouarXiv 2018

Abstract

Generative Adversarial Networks (GANs), particularly in the context of unpaired image-to-image translation (CycleGAN), often suffer from training instability, mode collapse, and deterministic output mappings. This paper introduces Bayesian CycleGAN, a framework that treats the translation model as a Bayesian system. By marginalizing over sampled latent variables and introducing an integrated adversarial loss for reconstructed images, the authors achieve significant gains in accuracy, training resilience, and output diversity across multiple benchmarks.

Introduction

Unsupervised image-to-image translation aims to learn a mapping between two domains without paired training examples. While CycleGAN has become a standard approach, it faces two primary challenges. First, the "min-max" game between the generator and discriminator is frequently unbalanced; if the discriminator becomes too powerful, the generator's gradients vanish, leading to mode collapse. Second, the cycle-consistency loss ($L1$ distance) typically forces the model to learn a deterministic, one-to-one mapping, ignoring random noise and preventing the generation of diverse styles from a single input.

The Challenge of Training Stability

The authors identify "weak training stability" as a primary driver of failure in standard GANs. When a discriminator successfully distinguishes real from fake data with high confidence, the loss function for the generator becomes saturated.

Figure 1: Visualization of the "Unfair Game." When the discriminator is too successful (right side of the x-axis), the generator's gradient (orange) flattens, leading to training stagnation and mode collapse.

As shown in Figure 1, the gradient for the generator becomes nearly flat as the discriminator's performance peaks. This imbalance prevents the generator from learning effectively, often resulting in the model collapsing to a few "safe" samples.

Methodology: A Bayesian Approach

To address these issues, the authors propose a Bayesian framework that explores the full posterior distribution of the model rather than relying on a single Maximum Likelihood Estimation (MLE) point.

Marginalizing Latent Sampling

Instead of the computationally prohibitive task of sampling all network weights, Bayesian CycleGAN samples latent variables. By combining source images with sampled noise to create "variant-concatenate" inputs, the model can explore the posterior distribution efficiently during training.

Integrated Cyclic Framework and the Balance Factor ($\gamma$)

In standard CycleGANs, the reconstructed image (e.g., Domain A $\rightarrow$ B $\rightarrow$ A) is only constrained by an $L1$ reconstruction loss. This paper introduces an integrated adversarial loss for these reconstructed images. A hyperparameter $\gamma$ is used to balance the influence of this new loss, preventing the discriminator from dominating the training process prematurely.

Statistic Feature Map (SFM)

To ensure the model utilizes the latent noise rather than ignoring it, the authors implement a VAE-like encoder to generate a restricted latent space called a Statistic Feature Map (SFM). This allows users to swap SFMs during inference to generate multiple, distinct artistic or structural interpretations of the same input image.

Experimental Results

The model was evaluated on the Cityscapes, Maps, and Monet2Photo datasets. The results demonstrate that the Bayesian formulation acts as a powerful regularizer, providing an inductive bias that prevents over-fitting to a limited set of samples.

Figure 5: Qualitative and quantitative comparison on the Cityscapes dataset. Bayesian CycleGAN significantly outperforms the baseline CycleGAN in both visual fidelity and per-pixel accuracy metrics.

As detailed in Figure 5, Bayesian CycleGAN achieved a per-pixel accuracy of 0.65 on the Cityscapes semantic segmentation task, a substantial improvement over the 0.45 achieved by the original CycleGAN. Furthermore, the model reduced the Frechet Inception Distance (FID) score from 264.64 to 103.91, indicating much higher image quality and diversity.

Conclusion

Bayesian CycleGAN successfully addresses the core limitations of unpaired image translation by incorporating latent variable marginalization and an integrated adversarial framework. By stabilizing the adversarial game and providing a mechanism for many-to-many mappings via SFMs, the model offers a more robust and versatile solution for complex image translation tasks. Future work may explore dynamic priors and more fine-grained control over the generated diversity.

Summary updated

BibTeX
@misc{you2018bayesian,
  author = {Haoran You and Yu Cheng and Tianheng Cheng and Chun-Liang Li and Pan Zhou},
  title = {{Bayesian CycleGAN via Marginalizing Latent Sampling}},
  year = {2018},
  eprint = {1811.07465},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.07465},
}
Figure