SketchHairSalon: Deep Sketch-based Hair Image Synthesis
Introduction: The Challenge of Realistic Hair Generation
Generating realistic hair is a notorious challenge in computer vision due to its complex geometry, fine-grained textures, and "fuzzy" boundaries that blend into backgrounds. Existing sketch-to-hair systems typically suffer from two major bottlenecks. First, they often require labor-intensive manual pre-processing, such as user-provided binary masks, which fail to capture the soft, semi-transparent alpha matting seen in real hair. Second, many current methods rely on "orientation maps" as an intermediate step. While effective for local texture, these maps often "wash out" global structural information, such as occlusion between wisps or the topological construction of complex styles like braids.
SketchHairSalon addresses these issues by allowing freehand colored sketches to define shape, structure, and appearance simultaneously, moving away from rigid masks and lossy orientation maps.
Methodology: A Two-Stage Pipeline
The researchers propose a two-stage "coarse-to-fine" pipeline consisting of two primary networks: S2M-Net and S2I-Net.
- S2M-Net (Sketch-to-Matte): This network takes a sparse sketch—including optional "non-hair" strokes to define boundaries—and predicts a high-quality hair matte. This matte provides the "soft" shape necessary for realistic blending with the background.
- S2I-Net (Sketch-to-Image): This network utilizes the original sketch and the predicted matte from the first stage to synthesize the final image. It incorporates a background blending module to ensure the generated hair integrates naturally with an existing portrait.
To maintain global coherence, the authors integrated self-attention modules into the encoder-decoder architectures. This allows the model to capture long-range dependencies, ensuring that hair flow remains consistent across the entire head. Additionally, the system includes procedural tools for sketch auto-completion, such as using parametric 3D models to generate complex braid sketches from simple boundary lines.
Dataset and Annotation
A major contribution of this work is a new, high-quality dataset of 4,500 manually annotated hair sketch-image pairs. This significantly expands upon previous datasets, which were often too small and lacked variety. The dataset includes 3,000 unbraided and 1,000 braided hairstyles for training, with 500 pairs reserved for testing. Each pair consists of a manually traced structural sketch and a high-quality hair matte.
Key Insights
- Mattes over Masks: Transitioning from binary masks to alpha mattes is crucial for realism, allowing the model to learn natural diffusion into the background.
- Sketches as Implicit Geometry: Sketches can represent T-junctions and occlusions—critical for braids—which orientation maps tend to flatten.
- Global Context via Attention: Self-attention enables the network to treat hair as a collection of continuous wisps rather than isolated local patches, resulting in more cohesive hairstyles.
Results and Evaluation
SketchHairSalon achieves state-of-the-art performance both quantitatively and qualitatively. The model reached a Fréchet Inception Distance (FID) of 15.553, significantly outperforming competitors like MichiGAN (24.327) and HIS (29.857).
In user studies, the system was voted "most natural" in 95.8% of cases compared to mask-based alternatives. Users were able to design complete, realistic hairstyles in a matter of minutes, demonstrating the system's efficiency and intuitive control.
Limitations and Future Work
While highly effective, the model faces challenges with extreme layering due to the lack of explicit depth information in 2D sketches. Highly textured styles like dreadlocks or tight coils are currently approximated as wavy patterns. Future work will focus on improving lighting consistency between generated hair and background portraits, as well as adapting the tool for fine-grained editing of existing hair.
Summary updated