Segmentation Guided Image-to-Image Translation with Adversarial Networks

Songyao Jiang, Zhiqiang Tao, Yun Fu

TL;DR

SGGAN (Segmentation Guided Generative Adversarial Networks) improves image-to-image translation by using semantic segmentation maps as a spatial "roadmap." By incorporating a dedicated segmentor network, the model achieves higher image quality and enables precise spatial control, such as morphing facial expressions and shapes, which standard domain-level GANs struggle to handle.

What Problem Does This Paper Address?

Image-to-image translation—mapping an image from one domain (e.g., a neutral face) to another (e.g., a smiling face)—has seen massive leaps thanks to Generative Adversarial Networks (GANs). However, two major hurdles remain:

  1. Image Quality: Many models focus on domain-level relationships (e.g., "make this look like a woman") but ignore instance-specific spatial details. This often results in unrealistic artifacts, like the blurry "ghost faces" seen in multi-attribute transfers.
  2. Spatial Controllability: Existing methods lack a mechanism to gradually change the geometry of a face. If you want to morph a face shape or an expression smoothly, domain-level labels (like "smiling: 1") aren't enough to guide the pixel-level transformation.

Methods

The authors propose SGGAN, which adds a third pillar to the traditional GAN architecture. While standard models use a Generator (G) and a Discriminator (D), SGGAN introduces a Segmentor (S).

  • The Generator (G): Unlike previous models that just take an image and an attribute label, SGGAN's generator also takes a target segmentation map as input. This map acts as a spatial constraint, telling the generator exactly where the eyes, nose, and mouth should be.
  • The Segmentor (S): This network is trained to predict segmentation maps from images. During training, it analyzes the generator's output. If the generated face doesn't match the target segmentation map, the segmentor provides a "segmentation loss" that guides the generator to correct the spatial alignment.
  • The Discriminator (D): Performs its usual role of distinguishing real from fake, while also using an auxiliary classifier to ensure the generated image matches the requested attributes (like hair color or age).
Fig. 2: Illustration of SGGAN. SGGAN contains (a) a generator G, (b) a discriminator with auxiliary classifier D and (c) a segmentor S. During training, S provides spatial guidance to G to ensure the generated images comply with input segmentations. D aims to ensure the translated images are realistic as the real images. The training procedure of the whole framework is illustrated in (d).

Datasets

The model was evaluated using the CelebA dataset, which contains over 200,000 celebrity images with 40 attribute labels. To generate the ground-truth segmentation maps needed for training, the authors used an unsupervised approach: they extracted 68 facial landmarks using the Dlib library and automatically classified pixels into regions like eyes, eyebrows, nose, lips, and skin.

Key Insights and Ideas

  • Segmentation as a Strong Prior: By feeding the generator a segmentation map, the authors effectively decouple "style" (attributes like hair color) from "geometry" (face shape and expression). This prevents the model from getting "confused" about where features should be placed.
  • Expression Morphing: Because the model follows a segmentation map, you can create smooth morphing effects by interpolating between two different maps (e.g., moving from a closed mouth to a wide smile). Standard GANs usually just "fade" between two states; SGGAN actually warps the features.
  • Reducing Artifacts: The pixel-level guidance from the segmentor significantly reduces "ghosting" and blurry details in the mouth and eye regions, which are common failure points for models like StarGAN.

Key Results

SGGAN was compared against state-of-the-art models like StarGAN, CycleGAN, and UNIT.

  • Superior Multi-Attribute Transfer: As shown in the figure below, SGGAN produces much sharper results than StarGAN when changing multiple attributes at once (e.g., changing hair color, gender, and age simultaneously). StarGAN often produces blurry, unrealistic results in these complex cases.
  • Bi-directional Expression Translation: In tasks like converting a smile to a neutral expression, SGGAN maintained identity and facial structure far better than CycleGAN or UNIT, which often distorted the face shape.
  • Spatial Control: The authors demonstrated the ability to morph faces into entirely new expressions or orientations simply by providing a new target segmentation map, a feat not possible with attribute-only models.
Comparison between StarGAN and SGGAN. SGGAN (labeled "Ours") shows significantly clearer details and better attribute consistency, especially in the eye and mouth regions highlighted by yellow boxes.

Limitations and Future Work

  • Dependency on Landmarks: The system relies on accurate facial landmark detection to create the initial segmentation maps. If the landmark detector fails (e.g., due to extreme head tilts or occlusions), the segmentor's training data becomes noisy.
  • Manual Target Maps: While the model is powerful, a user still needs to provide or generate a target segmentation map to achieve spatial morphing. Automating the generation of these target maps for specific desired effects could be a future research direction.
  • Computational Complexity: Adding a third network (the segmentor) increases the training overhead, though the authors note the model converges stably.

Summary updated

BibTeX
@inproceedings{jiang2019segmentation,
  author = {Songyao Jiang and Zhiqiang Tao and Yun Fu},
  title = {{Segmentation Guided Image-to-Image Translation with Adversarial Networks}},
  booktitle = {FG},
  year = {2019},
  doi = {10.1109/fg.2019.8756542},
}
Figure