Conditional Adversarial Generative Flow for Controllable Image Synthesis

Rui Liu, Yu Liu, Xinyu Gong, Xiaogang Wang, Hongsheng Li

Abstract

Flow-based generative models show great potential in image synthesis due to its reversible pipeline and exact log-likelihood target, yet it suffers from weak ability for conditional image synthesis, especially for multi-label or unaware conditions. This is because the potential distribution of image conditions is hard to measure precisely from its latent variable z. In this paper, based on modeling a joint probabilistic density of an image and its conditions, we propose a novel flow-based generative model named conditional adversarial generative flow (CAGlow). Instead of disentangling attributes from latent space, we blaze a new trail for learning an encoder to estimate the mapping from condition space to latent space in an adversarial manner. Given a specific condition c, CAGlow can encode it to a sampled z, and then enable robust conditional image synthesis in complex situations like combining person identity with multiple attributes. The proposed CAGlow can be implemented in both supervised and unsupervised manners, thus can synthesize images with conditional information like categories, attributes, and even some unknown properties. Extensive experiments show that CAGlow ensures the independence of different conditions and outperforms regular Glow to a significant extent.

Introduction

Generative modeling has traditionally been dominated by three paradigms: Generative Adversarial Networks (GANs), which produce sharp images but lack an inference mechanism; Variational Autoencoders (VAEs), which provide encoders but often yield blurry results; and Flow-based models, which offer exact log-likelihood and reversibility but struggle with precise control.

CAGlow (Conditional Adversarial Generative Flow) addresses the limitations of standard flow models like Glow. While flow models require a bijective mapping between image and latent space, they often fail when conditions are complex—such as managing thousands of distinct identities. In these scenarios, the latent space can become "clumpy," leading to distorted images or identity loss when attributes are modified. CAGlow overcomes this by learning an adversarial mapping from condition space to latent space.

The CAGlow Architecture

The core innovation of CAGlow is a three-part architecture that decouples the generation of natural image features from the application of specific conditions:

  1. Reversible Flow (F): A standard Glow-based architecture that maps an image $x$ to a latent vector $z$, learning the general distribution of natural images.
  2. Condition Encoder (E): An irreversible network that maps conditions $c$ (e.g., "smiling," "wearing glasses," or a specific identity) and random noise into the latent space $z$.
  3. Supervision Block: This block contains sub-networks acting on the latent space, including a Discriminator for adversarial training to ensure generated $z$ vectors match the distribution of real images, and a Classifier to ensure attributes are correctly represented.
Overview of the CAGlow architecture, illustrating the training procedure (a) and the image synthesis process (b).

By training the Encoder adversarially within the structured latent space rather than the high-dimensional image space, CAGlow achieves the representative power of GANs with the stability and reversibility of flow models.

Experimental Evaluation

The authors validated CAGlow on the MNIST and CelebA datasets. On CelebA, which contains over 200,000 images and 10,000+ identities, CAGlow demonstrated significant improvements in both quality and controllability.

Key Results and Insights

  • Identity Preservation: Unlike previous methods where adding an attribute (like a beard) might inadvertently change the subject's eyes or nose, CAGlow maintains identity consistency. This is achieved through direct mapping from labels to the latent space, allowing for cumulative conditions where attributes are added sequentially.
  • Quantitative Performance: CAGlow achieved a classification accuracy of 95.16% on CelebA (compared to 87.43% for CGlow) and a superior FID score of 104.91, indicating higher image diversity and quality.
  • Unsupervised Discovery: By utilizing a reconstruction loss on unlabeled portions of the condition vector, the model can "discover" interpretable features like image rotation or lighting without explicit supervision.
Sequential attribute manipulation on CelebA, demonstrating how CAGlow preserves identity while adding multiple attributes.

Conclusion

CAGlow represents a significant step forward for flow-based generative models, providing a robust framework for multi-label conditional synthesis. While the model is computationally intensive—limiting current experiments to $64 \times 64$ resolution—its ability to maintain identity while precisely manipulating attributes sets a new standard for controllable generation. Future work will focus on scaling the architecture to higher resolutions and exploring more complex, non-categorical conditions.

Summary updated

BibTeX
@inproceedings{liu2019conditional,
  author = {Rui Liu and Yu Liu and Xinyu Gong and Xiaogang Wang and Hongsheng Li},
  title = {{Conditional Adversarial Generative Flow for Controllable Image Synthesis}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  url = {https://openreview.net/forum?id=O5NmvY1SmM},
}
Figure