[Paper Review] High Resolution Face Editing with Masked GAN Latent Code Optimization
MaskFaceGAN introduces a high-resolution face editing method that optimizes StyleGAN2's latent code using spatial and semantic constraints via a face parser and attribute classifier, achieving artifact-free, photo-realistic edits at 1024×1024 resolution with reduced attribute entanglement compared to prior GAN-based methods.
Face editing represents a popular research topic within the computer vision and image processing communities. While significant progress has been made recently in this area, existing solutions: (i) are still largely focused on low-resolution images, (ii) often generate editing results with visual artefacts, or (iii) lack fine-grained control and alter multiple (entangled) attributes at once, when trying to generate the desired facial semantics. In this paper, we aim to address these issues though a novel attribute editing approach called MaskFaceGAN that focuses on local attribute editing. The proposed approach is based on an optimization procedure that directly optimizes the latent code of a pre-trained (state-of-the-art) Generative Adversarial Network (i.e., StyleGAN2) with respect to several constraints that ensure: (i) preservation of relevant image content, (ii) generation of the targeted facial attributes, and (iii) spatially--selective treatment of local image areas. The constraints are enforced with the help of an (differentiable) attribute classifier and face parser that provide the necessary reference information for the optimization procedure. MaskFaceGAN is evaluated in extensive experiments on the CelebA-HQ, Helen and SiblingsDB-HQf datasets and in comparison with several state-of-the-art techniques from the literature, i.e., StarGAN, AttGAN, STGAN, and two versions of InterFaceGAN. Our experimental results show that the proposed approach is able to edit face images with respect to several local facial attributes with unprecedented image quality and at high-resolutions (1024x1024), while exhibiting considerably less problems with attribute entanglement than competing solutions. The source code is made freely available from: https://github.com/MartinPernus/MaskFaceGAN.
Motivation & Objective
- Address the limitations of existing GAN-based face editing methods that suffer from visual artifacts, low resolution, or attribute entanglement.
- Enable fine-grained, localized editing of facial attributes such as hair color, makeup, and facial structure at high resolution.
- Preserve global image structure and identity while modifying specific facial attributes through constrained latent space optimization.
- Provide a method that supports both local and global attribute editing with perceptual fidelity and minimal semantic drift.
Proposed method
- Optimizes the latent code of a pre-trained StyleGAN2 generator using gradient-based optimization.
- Enforces semantic constraints via a differentiable attribute classifier to ensure target attribute presence/absence.
- Applies spatial constraints using a pre-trained face parser to define region-specific editing behavior (e.g., modify only eyebrows or lips).
- Uses a blending strategy based on the union of facial regions to preserve original image content during optimization.
- Integrates LPIPS loss with multi-layer feature matching to maintain perceptual similarity to the input image.
- Employs a multi-objective loss combining attribute classification, spatial parsing, and perceptual reconstruction for robust optimization.
Experimental results
Research questions
- RQ1Can latent code optimization in StyleGAN2 achieve high-resolution (1024×1024) face editing with minimal visual artifacts?
- RQ2To what extent can spatial constraints from a face parser reduce attribute entanglement during localized editing?
- RQ3How does the integration of a differentiable attribute classifier improve control over target attribute semantics?
- RQ4Does the proposed method preserve identity and background details better than existing GAN inversion-based approaches?
- RQ5Can the method support both local and global attribute editing with consistent perceptual quality?
Key findings
- MaskFaceGAN generates high-resolution (1024×1024) editing results that are visually superior and artifact-free compared to state-of-the-art methods.
- The method significantly reduces attribute entanglement, particularly for local attributes like eyebrows, hair color, and lipstick.
- User studies show that MaskFaceGAN outperforms competitors in perceptual quality and attribute control, except for 'narrow eyes' where it tends to close eyes instead of narrowing them.
- The optimization process converges faster than similar methods like InterFaceGAN, requiring fewer steps per image.
- The approach maintains strong correspondence with the input image in terms of facial appearance and background, even for global attributes like 'young' and 'male'.
- Limitations arise when the attribute classifier or face parser produces incorrect predictions, leading to unintended edits in specific cases.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.