Conditional Image Generation and Manipulation for User-Specified Content

David Stap, Maurits J. R. Bleeker, Sarah Ibrahimi, Maartje ter HoevearXiv 2020

TL;DR

This paper introduces textStyleGAN, a novel pipeline that combines text-to-image generation with semantic manipulation for user-specified content. It allows users to generate a high-quality image from a textual description and then fine-tune it by manipulating specific attributes in the latent space, addressing the challenge of generating images that precisely match a user's vision.

What Problem Does This Paper Address?

Generating realistic images from text descriptions has seen significant progress with Generative Adversarial Networks (GANs). However, a key limitation is that a single text description can often correspond to a vast number of visually plausible images. This ambiguity makes it difficult for users to obtain an image that precisely matches their mental model, which is a significant hurdle for practical applications like creating stock photos or facial composites. The paper aims to bridge this gap by not only generating an image from text but also providing a mechanism to manipulate it semantically to better align with user intent.

Methods

The proposed approach is a two-part pipeline:

  1. textStyleGAN (Text-to-Image Generation): This part builds upon the StyleGAN architecture, conditioning it on textual descriptions. The generator combines a latent noise vector ($z$) with a text embedding ($e_{sent}$) to produce an image. To enhance the text representation, they use pre-trained encoders from a cross-modal matching work. Conditioning Augmentation (CA) is employed to encourage smoother latent conditioning. Additionally, an attentional guidance mechanism is incorporated, allowing the generator to focus on relevant words for different image regions. The training involves adversarial losses for visual realism and conditional losses for semantic consistency.
  2. Semantic Manipulation: This part leverages the disentangled latent space of the trained textStyleGAN. The core idea is to find "semantic directions" in this latent space that correspond to specific attributes (e.g., smiling, gender, age). This is achieved through a four-step process:
  3. Sample images from the pre-trained textStyleGAN.
  4. Use an external classifier (Face API) to label these images for specific attributes.
  5. Train a simple logistic regression classifier on the latent codes to find a direction vector ($\theta$) that separates the attribute labels.
  6. Manipulate an image by adding or subtracting this direction vector from its latent code ($w_{im} \pm \theta$). This method is described as data-agnostic and computationally efficient, as it doesn't require retraining the GAN.

Datasets

  • CelebTD-HQ: A newly introduced dataset, created as an extension of CelebA-HQ. It consists of facial images paired with fine-grained textual descriptions. These descriptions are generated using a probabilistic context-free grammar (PCFG) based on facial attributes, aiming to provide natural language descriptions for image manipulation tasks.
  • CUB [22]: Used for text-to-image generation evaluation, containing images of bird species with visual descriptions.
  • MS COCO [10]: Also used for text-to-image generation evaluation, featuring complex scenes with multiple object types and textual descriptions.
  • FFHQ [8]: A large dataset of high-quality, unlabeled facial images, used for training the base StyleGAN model.

Key Insights and Ideas

  • Unifying Generation and Manipulation: The paper's main contribution is demonstrating that text-to-image generation and semantic manipulation can be effectively combined within a single pipeline. This is crucial for practical content creation where precise control is needed.
  • Leveraging StyleGAN's Latent Space: The method effectively utilizes the disentangled latent space of StyleGAN for semantic manipulation. By finding attribute-specific directions in this space, they can modify images without needing to retrain the entire GAN, making it efficient.
  • Data Agnostic Manipulation: The semantic manipulation technique is presented as data-agnostic, meaning it can be applied to any domain for which a suitable classifier and latent space can be found, not just faces.
  • Importance of Cross-Modal Similarity Loss: The inclusion of a cross-modal similarity loss significantly improves semantic consistency in text-to-image generation, as evidenced by their evaluation results.

Key Results

  • Text-to-Image Performance: textStyleGAN achieves state-of-the-art or near state-of-the-art results on CUB (IS: 4.78) and COCO (IS: 33.00) datasets for text-to-image generation.
  • Image Quality: For the CelebTD-HQ dataset, their conditional model achieves slightly better Fréchet Inception Distance (FID) scores than the unconditional StyleGAN.
  • Semantic Consistency: R-precision scores show significant improvements with their full model, especially with the cross-modal similarity loss, reaching 74.72 for CUB and 87.02 for COCO (k=1).
  • Attribute Classification: For generated images on CelebTD-HQ, attribute classification scores are high, indicating good semantic alignment with the text descriptions.
  • Disentanglement: The perceptual path length scores suggest a similar level of disentanglement in the latent space for their conditional textStyleGAN compared to unconditional StyleGAN.
  • Qualitative Results: The paper presents compelling qualitative examples demonstrating successful attribute manipulation (smile, gender, age) and artifact removal.

Limitations and Future Work

  • Coupled Attributes: The paper acknowledges that due to coupled attributes in the training data, manipulating one attribute can sometimes unintentionally affect others (e.g., editing for gender might also change accessories).
  • Future Work: The authors suggest exploring more complex attributes for semantic manipulation and believe their approach has potential applications in areas like facial stock photo creation. They also highlight the possibility of extending their method to other domains beyond faces.

Summary updated

BibTeX
@misc{stap2020conditional,
  author = {David Stap and Maurits J. R. Bleeker and Sarah Ibrahimi and Maartje ter Hoeve},
  title = {{Conditional Image Generation and Manipulation for User-Specified Content}},
  year = {2020},
  eprint = {2005.04909},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.04909},
}
Figure