StyleMask: Disentangling the Style Space of StyleGAN2 for Neural Face Reenactment

Stella Bounareli, Christos Tzelepis, Vasileios Argyriou, Ioannis Patras, Georgios Tzimiropoulos

TL;DR

StyleMask is a novel face reenactment framework that transfers the head pose and facial expressions of a target image to a source image while faithfully preserving the source's identity. By operating within the highly disentangled "Style Space" ($S$) of a pre-trained StyleGAN2, the authors eliminate the need for paired training data and achieve state-of-the-art results even under extreme pose variations.

What Problem Does This Paper Address?

Neural face reenactment is the task of "driving" a source face with the movements of a target face. The fundamental challenge is disentanglement: how do you separate the "identity" (the shape of the face, hair, and skin) from the "pose" (the orientation of the head and specific muscle movements of an expression)?

Existing methods often suffer from three major flaws:

  1. Data Dependency: They frequently require "paired" training data—videos of the same person moving—which is difficult to collect at scale.
  2. Identity Leakage: When the source and target are different people, the reenacted image often ends up looking like a weird hybrid of both.
  3. Extreme Poses: Most models "break" or produce blurry artifacts when the target head turns at a sharp angle.

Methods

The authors propose StyleMask, which leverages the generative power of StyleGAN2. Instead of training a generator from scratch, they manipulate the latent representations of a pre-trained one.

The Style Space ($S$)

While most StyleGAN research focuses on the $W$ or $W+$ latent spaces, this paper utilizes the Style Space ($S$). Recent research suggests that $S$ is significantly more disentangled; changing a single channel in $S$ often corresponds to a specific, isolated semantic change in the image.

The Mask Network

The core of the architecture is a Mask Network. Given the style codes of a source ($s_s$) and a target ($s_t$), the network learns to produce a mask ($m$). This mask acts as a selector: $$s_r = m \odot s_t + (1 - m) \odot s_s$$ The resulting reenacted code ($s_r$) takes pose-related channels from the target and identity-related channels from the source. Because StyleGAN2 is hierarchical, the authors use a multi-head Mask Network where different sub-networks handle different layers (coarse layers for pose, fine layers for texture).

Supervision via 3DMM

To train the mask without paired data, they use a 3D Morphable Model (3DMM). They generate random images, use the 3DMM to extract their pose and identity coefficients, and then create a "ground truth" 3D shape that combines the source's identity with the target's pose. The loss function encourages the reenacted image to match this 3D geometry.

Recurrent Cycle Consistency

To handle artifacts in large pose changes, they introduce a recurrent cycle consistency loss. They reenact the source with a target, then use that result as a new source to be reenacted again. This "round trip" ensures that identity characteristics remain stable across multiple transformations.

Datasets

  • FFHQ: Used for the initial pre-training of the StyleGAN2 generator.
  • Synthetic Images: The Mask Network is trained entirely on unpaired, randomly generated images from the GAN.
  • CelebA-HQ: Used for evaluating the model's performance on real-world images.
  • VoxCeleb1 & 2: Used as a comparison point for baseline methods that require video data.

Key Insights and Ideas

  • $S$ is better than $W$: The paper confirms that the $S$ space provides the granularity needed for reenactment that $W$ lacks. In their ablation study, using $S$ space significantly improved pose and expression accuracy compared to $W$.
  • Layer-Specific Masking: A single global mask is insufficient. Because StyleGAN2 layers control different levels of detail, the Mask Network must be "aware" of which layer it is masking to effectively separate global pose from local identity.
  • Training on "Fakes": By training on synthetic images and using 3D models for supervision, the framework avoids the need for massive datasets of real people in specific poses.

Key Results

StyleMask outperformed several state-of-the-art methods (including Fast Bi-layer, PIR, and StyleFusion) across both quantitative and qualitative metrics:

  • Identity Preservation (CSIM): Achieved a score of 0.70, indicating superior identity retention.
  • Image Quality (FID): Achieved a score of 10.0, significantly lower (better) than competitors like PIR (27.4) or Fast Bi-layer (90.0).
  • User Preference: In a user study, StyleMask was preferred 46% of the time, with the next closest method trailing at 26%.
  • Qualitative: The model successfully preserves source-specific details like eyeglasses and hair accessories, even when the target face does not have them.

Limitations and Future Work

The authors note that while the model is highly effective, it is ultimately bounded by the capabilities of the underlying pre-trained generator. Specifically:

  • Expression Range: The model can only reconstruct expressions that exist within the distribution of the FFHQ dataset. If a target makes an "extreme" face that the GAN hasn't seen, the reenactment may be less accurate.
  • Real Image Inversion: To use the model on real photos, one must first "invert" the photo into the GAN's latent space. While methods for this are improving, any errors in the inversion process will carry over to the reenactment.

Summary updated

BibTeX
@inproceedings{bounareli2023stylemask,
  author = {Stella Bounareli and Christos Tzelepis and Vasileios Argyriou and Ioannis Patras and Georgios Tzimiropoulos},
  title = {{StyleMask: Disentangling the Style Space of StyleGAN2 for Neural Face Reenactment}},
  booktitle = {FG},
  year = {2023},
  doi = {10.1109/fg57933.2023.10042744},
}
Figure