Abstract
Portrait editing is a popular subject in photo manipulation. The Generative Adversarial Network (GAN) advances the generating of realistic faces and allows more face editing. In this paper, we argue about three issues in existing techniques: diversity, quality, and controllability for portrait synthesis and editing. To address these issues, we propose a novel end-to-end learning framework that leverages conditional GANs guided by provided face masks for generating faces. The framework learns feature embeddings for every face component (e.g., mouth, hair, eye), separately, contributing to better correspondences for image translation, and local face editing. With the mask, our network is available to many applications, like face synthesis driven by mask, face Swap+ (including hair in swapping), and local manipulation. It can also boost the performance of face parsing a bit as an option of data augmentation.
Introduction
While Generative Adversarial Networks (GANs) have become remarkably good at creating realistic faces, they often struggle with three specific areas: diversity, quality, and controllability.
Existing "image-to-image" translation models (like pix2pix) often produce limited variations from a single input, usually restricted to minor changes in lighting or color. Furthermore, these models frequently produce artifacts around complex areas like hair or the transition between the face and the background. Finally, most models treat the face as a single global entity, making it difficult for a user to edit just one specific part—like making a smile wider or changing only the hair color—without affecting the rest of the image.
Methodology
The authors propose a three-part architecture designed to handle facial components independently:
- Local Embedding Sub-network: Instead of one large encoder, the system uses five separate auto-encoders to learn "embeddings" (mathematical representations) for specific facial parts: left eye, right eye, mouth, skin/nose, and hair. This allows the model to capture the unique textures and details of each component.
- Mask-Guided Generative Sub-network: This module takes the learned local embeddings and "re-assembles" them according to a target facial mask. This mask acts as a geometric constraint, telling the GAN exactly where each component should go and what shape it should take.
- Background Fusion Sub-network: To solve the common problem of "pasted-on" looks, this sub-network specifically learns how to blend the newly generated foreground face with the original background, ensuring smooth transitions around the neck and hair.
Training is guided by a combination of losses: standard adversarial loss, reconstruction loss, and a Face Parsing Loss, which penalizes the model if the generated face doesn't align perfectly with the input mask.
Key Results and Applications
The model was evaluated using the Helen, VGGFace2, and CelebA datasets. It achieved a Fréchet Inception Distance (FID) of 8.92, significantly lower (better) than baseline variants, indicating more realistic image generation.
- Superior Diversity: Qualitatively, the model outperformed state-of-the-art tools by producing a wider range of skin tones, hair styles, and makeup while strictly adhering to the input mask.
- Component-Level Control: By treating the face as a collection of parts, the model achieves "local instance equivariance," allowing users to swap a mouth from one person onto another while keeping other features intact.
- Data Augmentation Loop: The authors found that their GAN could generate synthetic training data for face parsing models, improving accuracy on the Helen dataset from 0.728 to 0.871.
Discussion and Limitations
A key insight of this work is the treatment of the background as a learned feature, which significantly reduces artifacts around the neck and hair. However, the authors note that performance is heavily dependent on the quality of the input segmentation mask. For example, if a person is wearing glasses but the mask labels them as "background," the fusion network might struggle to reconstruct them accurately. Future work could involve extending this to video portrait editing or integrating more complex attributes like 3D head pose and fine-grained skin textures.
Summary updated