StyleFusion: A Generative Model for Disentangling Spatial Segments

Omer Kafri, Or Patashnik, Yuval Alaluf, Daniel Cohen-OrarXiv 2021

Abstract

We present StyleFusion, a new mapping architecture for StyleGAN, which takes as input a number of latent codes and fuses them into a single style code. Inserting the resulting style code into a pre-trained StyleGAN generator results in a single harmonized image in which each semantic region is controlled by one of the input latent codes. Effectively, StyleFusion yields a disentangled representation of the image, providing fine-grained control over each region of the generated image. Moreover, to help facilitate global control over the generated image, a special input latent code is incorporated into the fused representation. StyleFusion operates in a hierarchical manner, where each level is tasked with learning to disentangle a pair of image regions (e.g., the car body and wheels). The resulting learned disentanglement allows one to modify both local, fine-grained semantics (e.g., facial features) as well as more global features (e.g., pose and background), providing improved flexibility in the synthesis process. As a natural extension, StyleFusion enables one to perform semantically-aware cross-image mixing of regions that are not necessarily aligned. Finally, we demonstrate how StyleFusion can be paired with existing editing techniques to more faithfully constrain the edit to the user's region of interest.

Introduction

Generative Adversarial Networks (GANs), particularly StyleGAN, have set the standard for high-fidelity image synthesis. However, a significant hurdle remains: the entanglement of latent representations. In standard StyleGAN architectures, a single latent code governs the entire image. Consequently, attempting to modify a specific attribute—such as a subject's hairstyle—often results in unintended "leakage," where other features like face shape, skin tone, or background are inadvertently altered. StyleFusion addresses this by providing a framework for precise, disentangled control over disjoint spatial segments.

Methods: The FusionNet Architecture

The core of StyleFusion is FusionNet, a mapping architecture designed to operate within StyleGAN’s StyleSpace ($S$). The authors choose $S$-space due to its inherent disentanglement compared to $W$ or $W+$. FusionNet utilizes three primary mechanisms:

  1. Latent Blender (LB): The fundamental unit that learns per-channel fusion coefficients to interpolate between style channels of two input codes.
  2. Hierarchical Multi-Fusion: Semantic regions are organized into a binary tree (e.g., splitting "Face" into "Eyes" and "Skin"). This structure facilitates coarse-to-fine control.
  3. Global Alignment: A dedicated alignment latent code ($s_{align}$) defines the global structure and pose. This ensures that semantic parts from different source images—even those with mismatched poses—are harmonized into a coherent final image.
Hierarchical disentanglement of car components (background, body, and wheels) using StyleFusion.

The model is optimized using a combination of Mask, Localization, and Fusion losses to ensure spatial accuracy and attribute fidelity.

Key Insights

A pivotal innovation is the use of StyleFusion as a constraint layer for existing editing tools. For instance, an edit generated by StyleCLIP can be passed through StyleFusion to ensure the modification is strictly localized to the target region (e.g., the hair), preserving the rest of the image's identity. This makes StyleFusion complementary to, rather than a replacement for, current state-of-the-art editing techniques.

Experimental Results

The researchers evaluated StyleFusion on human faces (FFHQ), cars (LSUN Cars), and churches (LSUN Churches). The results demonstrate superior local semantic control.

Comparison of StyleGAN2 and StyleFusion across car and face domains, demonstrating disentangled control over semantic regions.

Key findings include:

  • Precise Local Edits: Ability to change specific features like "Hair Albedo" or eye expressions without affecting identity.
  • Robust Hair Transfer: Successful transfer of hairstyles between unaligned images with varying poses and demographics.
  • Real-World Application: When paired with latent space inversion (e.g., e4e), StyleFusion enables more localized edits on real photographs than standard StyleGAN2.

Conclusion and Future Work

StyleFusion provides a powerful method for spatial disentanglement in GANs. While highly effective, challenges remain with extreme poses and residual entanglement in overlapping semantic areas. Future research may explore designing generators that are natively "fusion-ready" to further enhance disentanglement and image quality.

Summary updated

BibTeX
@misc{kafri2021stylefusion,
  author = {Omer Kafri and Or Patashnik and Yuval Alaluf and Daniel Cohen-Or},
  title = {{StyleFusion: A Generative Model for Disentangling Spatial Segments}},
  year = {2021},
  eprint = {2107.07437},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.07437},
}
Figure