ManiCLIP: Multi-attribute Face Manipulation from Text

Hao Wang, Guosheng Lin, Ana Garcia del Molino, Anran Wang, Jiashi Feng, Zhiqi Shen

Introduction

Text-based face editing has advanced significantly through the integration of StyleGAN2 for high-quality image generation and CLIP for semantic text-to-image alignment. However, current methodologies encounter a "Goldilocks" problem when processing multiple attributes simultaneously (e.g., "The person is chubby and has blond hair"). Existing approaches typically fall into two categories: optimization-based methods, which are computationally expensive and slow, and mapper-based methods, which often suffer from excessive editing.

Excessive editing manifests in two primary ways. First, "easy" attributes, such as lipstick, are often over-amplified to unnatural proportions because they are easier for the model to optimize than structural "hard" attributes like face shape. Second, "text-irrelevant" attributes, such as background or skin tone, may change unintentionally, leading to a loss of the subject's original identity. ManiCLIP addresses these issues by providing natural, multi-attribute edits in a single feed-forward pass.

Comparison of excessive vs. natural editing for multi-attribute prompts.

Methodology

The ManiCLIP architecture utilizes a pretrained StyleGAN2 generator and a CLIP text encoder, centered around a transformer-based Attentional Decoder that predicts latent code offsets ($\Delta w$). To mitigate excessive editing, the framework introduces two primary innovations:

1. Decoupling Training Scheme

The authors observed that mixing heterogeneous attributes (easy vs. hard) during training causes the model to prioritize easy attributes to satisfy the global CLIP loss. To counteract this, ManiCLIP categorizes 40 facial attributes into five distinct groups: Hair, Eye, Mouth, Fashion, and Others. By employing "group sampling" during training, the model is forced to focus on attributes within the same category for any given instance, preventing it from over-optimizing simpler attributes at the expense of complex ones.

2. Entropy-Based Sparsity Constraint

While StyleGAN2’s latent space is high-dimensional, a specific edit should ideally only affect a subset of dimensions. ManiCLIP applies a Shannon Entropy loss to the predicted offsets ($\Delta w$). Minimizing entropy encourages the model to produce sparse offsets, ensuring that only the most relevant latent dimensions are modified. This approach preserves the person's identity and background more effectively than standard L1 or L2 norms.

Experimental Results

ManiCLIP was evaluated using standard benchmarks, including FFHQ, CelebA-HQ, and Multi-Modal-CelebA-HQ. The framework demonstrates superior performance both quantitatively and qualitatively:

  • Quantitative Performance: On the Multi-Modal-CelebA-HQ benchmark, ManiCLIP achieved a Frechet Inception Distance (FID) of 31.57, significantly lower than StyleCLIP’s 44.41. Furthermore, it maintained a substantially higher Identity Similarity (ID) score of 76.55, compared to 44.77 for StyleCLIP.
  • Qualitative Performance: Visual comparisons indicate that ManiCLIP produces subtle, context-aware modifications. Unlike previous models that might inadvertently alter a subject's race, gender, or pose, ManiCLIP respects the original image's integrity while accurately reflecting the text prompt.

Discussion and Limitations

A key advantage of ManiCLIP is its efficiency; as a pure feed-forward model, it can edit unseen faces in milliseconds without test-time optimization. However, the authors note a persistent challenge in gender manipulation. The strict identity preservation enforced by the ID loss and entropy constraints can sometimes hinder the significant structural changes required for a convincing gender swap. Future research may explore more granular control mechanisms, allowing users to adjust the intensity of individual attributes within a single complex prompt.

Summary updated

BibTeX
@article{wang2022maniclip,
  author = {Hao Wang and Guosheng Lin and Ana Garcia del Molino and Anran Wang and Jiashi Feng and Zhiqi Shen},
  title = {{ManiCLIP: Multi-attribute Face Manipulation from Text}},
  journal = {Int. J. Comput. Vis.},
  year = {2022},
}
Figure