Abstract
Facial inpainting often faces a trade-off between generating generic, low-detail results and requiring complex user guidance like sketches. We present EXE-GAN, a novel framework for exemplar-guided facial inpainting. EXE-GAN allows users to fill missing facial regions by borrowing semantic styles from a reference "exemplar" image. By combining a multi-style generator with a spatial variant gradient backpropagation (SVGL) technique, the framework achieves high-quality, identity-preserving results with natural transitions.
Introduction
Traditional facial inpainting methods typically struggle with two extremes: producing generic outputs that lack specific detail or overfitting to rigid guidance (e.g., landmarks), which demands significant artistic skill. Furthermore, existing attribute transfer methods often inadvertently alter unmasked regions, failing to preserve the original image's identity. EXE-GAN addresses these challenges by enabling seamless, exemplar-guided inpainting that maintains the integrity of "known" regions while adopting specific features—such as a new hairstyle or eye shape—from a reference image.
Methodology
The EXE-GAN framework consists of four primary components: a mapping network, a style encoder, a multi-style generator, and a discriminator.
Multi-Style Mixing
The generator utilizes a sophisticated style-mixing approach. It integrates the global style of the input image, a stochastic style for variety, and the exemplar style extracted from the reference image. This allows the model to balance realism with user-directed modifications.
Spatial Variant Gradient Backpropagation (SVGL)
A key technical innovation is the SVGL layer. Unlike standard loss functions that apply uniformly, SVGL re-weights gradients during training based on spatial location. Near the mask boundaries, it prioritizes consistency with the original input; towards the center, it prioritizes the exemplar's attributes. This ensures a mathematically smooth and visually natural transition between the original and inpainted regions.
Attribute Similarity Metric
To facilitate learning complex facial features without explicit labels, the authors introduced a self-supervised loss. This metric measures the alignment between the inpainted region and the exemplar in the latent style space, ensuring the "vibe" of the reference is accurately captured.
Experimental Results
The model was trained and evaluated on the CelebA-HQ and FFHQ datasets at 256 × 256 resolution.
Quantitative Performance
EXE-GAN consistently outperformed state-of-the-art (SOTA) methods such as CMOD, PConv, and SC-FEGAN. It achieved lower Fréchet Inception Distance (FID) scores, indicating higher realism, and superior scores on U-IDS and P-IDS metrics, which assess the ability to fool a discriminator.
Qualitative Versatility
The framework demonstrates impressive flexibility across various tasks, including local attribute transfer (e.g., changing eyes or mouth), hairstyle editing, and occlusion removal (e.g., removing sunglasses or face masks).
Conclusion
EXE-GAN represents a significant step forward in controllable facial inpainting. By leveraging gradient flow control and style mixing, it provides a powerful tool for identity-preserving facial editing. Future work will focus on improving robustness for unaligned, "in-the-wild" photos and further mapping the latent space for even finer control over facial attributes.
Summary updated