Skip to main content
QUICK REVIEW

[Paper Review] Mask-Guided Discovery of Semantic Manifolds in Generative Models

Mengyu Yang, David Rokeby|ArXiv.org|May 15, 2021
Generative Adversarial Networks and Image SynthesisComputer Science10 references4 citations
TL;DR

This paper proposes a mask-guided optimization method to discover smooth, localized semantic manifolds in the latent space of generative models like StyleGAN2. By using a perceptual loss and spring-based regularization, it generates sequences of latent vectors that produce realistic, region-specific facial changes—enabling controlled animation and disentangled manipulation without labeled data or model modification.

ABSTRACT

Advances in the realm of Generative Adversarial Networks (GANs) have led to architectures capable of producing amazingly realistic images such as StyleGAN2, which, when trained on the FFHQ dataset, generates images of human faces from random vectors in a lower-dimensional latent space. Unfortunately, this space is entangled - translating a latent vector along its axes does not correspond to a meaningful transformation in the output space (e.g., smiling mouth, squinting eyes). The model behaves as a black box, providing neither control over its output nor insight into the structures it has learned from the data. We present a method to explore the manifolds of changes of spatially localized regions of the face. Our method discovers smoothly varying sequences of latent vectors along these manifolds suitable for creating animations. Unlike existing disentanglement methods that either require labelled data or explicitly alter internal model parameters, our method is an optimization-based approach guided by a custom loss function and manually defined region of change. Our code is open-sourced, which can be found, along with supplementary results, on our project page: https://github.com/bmolab/masked-gan-manifold

Motivation & Objective

  • To uncover smooth, meaningful manifolds in the latent space of generative models that correspond to localized facial attribute changes.
  • To enable user-controlled, localized manipulation of generated faces (e.g., mouth shape, eye expression) without requiring labeled data.
  • To provide a method for generating high-quality, smooth animations by traversing these semantic manifolds.
  • To explore the geometric structure of disentangled facial variations in a way that is interpretable and controllable.
  • To offer a black-box, optimization-based alternative to existing disentanglement methods that rely on supervision or architectural modifications.

Proposed method

  • Define a region-specific loss function ℒ_X that minimizes distance in the masked region (e.g., mouth) while preserving the rest of the face, using perceptual or L2 distance.
  • Use a user-provided initial latent vector z* and a rectangular mask M to isolate the target facial region for manipulation.
  • Apply a spring-based regularization loss ℒ_spring to ensure smooth transitions between consecutive latent vectors in the sequence.
  • Use second-order spring constraints (k=1,2) to minimize curvature and maintain even spacing along the path in latent space.
  • Optimize the full objective using L-BFGS to find a sequence of latent vectors Z that minimize the combined loss: αℒ_X + βℒ_spring(k=1) + γℒ_spring(k=2).
  • The resulting path in latent space produces visually smooth, localized facial animations when decoded through the generator.

Experimental results

Research questions

  • RQ1Can we discover smooth, localized semantic manifolds in the latent space of a pre-trained GAN without requiring labeled data?
  • RQ2How can we guide optimization to ensure that only a specific facial region changes while the rest of the face remains stable?
  • RQ3To what extent can spring-based regularization produce visually smooth and natural-looking facial animations from latent space paths?
  • RQ4Can the method generalize across different initial face images and arbitrary mask regions?
  • RQ5What is the impact of perceptual vs. pixel-wise distance in preserving semantic consistency during manipulation?

Key findings

  • The method successfully generates smooth, localized facial changes confined to the masked region, with minimal distortion in non-masked areas.
  • The use of perceptual loss (LPIPS) yields more natural-looking transitions compared to L2 distance, especially in facial texture and structure.
  • Spring regularization effectively produces low-curvature, evenly spaced paths in latent space, enabling high-quality animations.
  • The approach generalizes across diverse initial faces and mask regions, as demonstrated across multiple examples in the supplementary material.
  • The optimization process discovers meaningful semantic manifolds without modifying model weights or requiring attribute annotations.
  • The method enables puppetry-like control over facial attributes, such as mouth shape and eye expression, through unconstrained, user-defined masks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.