[Paper Review] Barbershop: GAN-based Image Compositing using Segmentation Masks
Barbershop proposes a GAN-based image compositing framework that uses a novel latent space combining W+ style codes with a structure tensor to enable high-fidelity, globally consistent hairstyle transfer. By aligning reference images to a common segmentation mask and embedding them into this enhanced latent space, the method achieves superior blending quality with 95% user preference over SOTA methods, minimizing artifacts and preserving fine details like wrinkles and moles.
Seamlessly blending features from multiple images is extremely challenging because of complex relationships in lighting, geometry, and partial occlusion which cause coupling between different parts of the image. Even though recent work on GANs enables synthesis of realistic hair or faces, it remains difficult to combine them into a single, coherent, and plausible image rather than a disjointed set of image patches. We present a novel solution to image blending, particularly for the problem of hairstyle transfer, based on GAN-inversion. We propose a novel latent space for image blending which is better at preserving detail and encoding spatial information, and propose a new GAN-embedding algorithm which is able to slightly modify images to conform to a common segmentation mask. Our novel representation enables the transfer of the visual properties from multiple reference images including specific details such as moles and wrinkles, and because we do image blending in a latent-space we are able to synthesize images that are coherent. Our approach avoids blending artifacts present in other approaches and finds a globally consistent image. Our results demonstrate a significant improvement over the current state of the art in a user study, with users preferring our blending solution over 95 percent of the time.
Motivation & Objective
- Address the challenge of seamless image compositing, particularly for hairstyle transfer, where lighting, geometry, and occlusion create strong interdependencies between image regions.
- Overcome limitations in existing GAN-based editing methods that produce disjointed or inconsistent results due to semantic misalignment between source and target regions.
- Develop a latent space representation that preserves spatial structure and fine details while enabling coherent blending across multiple image sources.
- Enable users to transfer both appearance (e.g., hair color, texture) and structural attributes (e.g., hair shape, pose) from multiple references into a single, realistic composite image.
- Achieve global consistency in lighting, shadows, and facial geometry to produce plausible composites that avoid common artifacts like unnatural boundaries or disocclusion issues.
Proposed method
- Introduce a novel latent space, denoted as $FS$, which combines the standard W+ latent code with a learned structure tensor to enhance spatial awareness and preserve fine-grained facial details.
- Propose a GAN-embedding algorithm that optimizes an image to be similar to a reference while subtly modifying it to conform to a target segmentation mask, ensuring semantic alignment.
- Use the $FS$ latent space to embed multiple reference images (e.g., face, background, hair) into a shared representation that maintains identity and structural consistency.
- Perform image compositing by blending the embedded latent codes in the $FS$ space, leveraging the GAN’s generative prior to synthesize a coherent, high-resolution output image.
- Apply a loss function during embedding that balances reconstruction fidelity, identity preservation, and mask compliance, using perceptual and L2 losses.
- Utilize StyleGAN-ADA as the underlying generator, enabling high-quality synthesis while maintaining disentanglement of content and style attributes.
Experimental results
Research questions
- RQ1Can a modified latent space representation improve the fidelity and spatial coherence of GAN-based image compositing, especially for complex attributes like hair?
- RQ2How does semantic alignment via segmentation masks affect the quality and realism of blended image regions compared to unconstrained blending?
- RQ3To what extent can a GAN-embedding algorithm preserve fine details (e.g., moles, wrinkles) while conforming to a new segmentation mask?
- RQ4Does blending in a spatially aware latent space reduce common artifacts such as unnatural boundaries, lighting mismatches, or disocclusion issues?
- RQ5How does the proposed method compare to SOTA approaches in terms of user preference and perceptual quality in real-world editing tasks?
Key findings
- The proposed $FS$ latent space significantly improves detail preservation and spatial consistency compared to standard W+ space, especially for facial features and hair structure.
- The GAN-embedding algorithm successfully modifies reference images to align with a target segmentation mask while maintaining high perceptual quality and identity fidelity.
- The compositing pipeline achieves a 95% user preference rate over existing SOTA methods in a controlled user study, demonstrating strong perceptual superiority.
- The method effectively reduces blending artifacts such as hard transitions, unnatural lighting, and disocclusion issues by enforcing semantic and structural alignment.
- The approach handles complex cases like non-overlapping masks and perspective mismatches better than prior work, though some limitations remain with extreme geometric distortions.
- Failure modes include poor reconstruction of underrepresented features (e.g., jewelry) and challenges with thin, translucent hair strands or misaligned masks, indicating room for future refinement.
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.