Abstract
Image-to-image (I2I) translation has seen significant progress with the advent of Generative Adversarial Networks (GANs). However, existing methods often struggle with precise spatial control and the elimination of artifacts during structural transformations. We present Segmentation Guided Generative Adversarial Networks (SGGAN), a framework that incorporates pixel-level spatial guidance through a segmentor network. By utilizing semantic segmentation maps as a spatial blueprint, SGGAN enables high-fidelity attribute translation and precise facial expression morphing while significantly reducing "ghosting" artifacts.
Introduction
Recent advancements in I2I translation, exemplified by models like StarGAN and CycleGAN, have demonstrated impressive results in changing global image attributes. Despite these successes, two primary challenges remain: a lack of spatial controllability and the presence of unrealistic artifacts. Most current models rely on domain-level labels (e.g., "blonde hair"), which provide no mechanism to dictate the specific movement of pixels. This often leads to "ghosting"—blurry, misaligned features where the model fails to reconcile the target domain with the subject's underlying anatomy. SGGAN addresses these issues by integrating semantic layout information directly into the generation process.
Methodology
The SGGAN architecture introduces a novel tripartite structure designed to enforce spatial consistency:
- The Generator (G): Unlike standard architectures, this generator accepts three inputs: the source image, target attribute labels, and a target segmentation map. This map serves as a spatial constraint, guiding the generator on where specific features should be located in the output.
- The Discriminator (D): The discriminator performs a dual role, evaluating the realism of the generated images and classifying attributes to ensure the generator adheres to the requested domain changes.
- The Segmentor (S): This is the central innovation of SGGAN. The segmentor is trained to identify semantic regions such as eyes, nose, mouth, and skin. During training, it computes a segmentation loss, penalizing the generator if the output's geometry deviates from the provided target map.
The model is optimized using a weighted combination of four loss functions: adversarial loss for realism, classification loss for attribute accuracy, reconstruction loss for identity preservation, and the new segmentation loss for spatial precision.
Experimental Setup and Results
The model was evaluated using the CelebA dataset, comprising over 200,000 celebrity images. To generate the necessary training masks, a landmark detector (Dlib) was employed to extract 68 facial points, which were then converted into semantic regions for the segmentor.
Key Insights
- Spatial Control: By treating the segmentation map as an active input, SGGAN allows for structural manipulation. Users can modify the map (e.g., widening a smile), and the generator will attempt to align the facial features accordingly.
- Artifact Reduction: The segmentation loss acts as a regularizer that prevents the formation of "ghost" faces. By enforcing strict spatial boundaries, the model ensures that features like mouths and eyes are rendered in anatomically correct positions.
- Expression Morphing: SGGAN excels at expression interpolation. By gradually transitioning a segmentation map from a neutral state to a smile, the model generates smooth, realistic sequences of expression changes.
Performance Comparison
Qualitative results indicate that SGGAN produces sharper images with higher contrast compared to StarGAN. In tasks involving significant structural changes, such as gender swapping or expression modification, SGGAN consistently outperformed CycleGAN and UNIT. While baseline models often left "shadows" of original features or distorted face shapes, SGGAN successfully re-aligned features to match the target pose while maintaining the subject's core identity.
Conclusion and Future Work
SGGAN demonstrates that semantic guidance is a powerful tool for improving the quality and controllability of I2I translation. While currently dependent on external landmark detectors for training data, the framework provides a robust foundation for spatial manipulation in generative tasks. Future research may extend this unsupervised semantic guidance to more complex domains, such as full-body pose estimation or landscape synthesis, where structural alignment is critical.
Summary updated