Abstract
StyleGAN has demonstrated remarkable capabilities in high-fidelity image synthesis, yet controlling its latent space for specific semantic edits typically requires extensive manual effort or labeled datasets. This paper introduces CLIP2StyleGAN, a novel framework that leverages the multimodal semantic space of CLIP to automatically discover, label, and disentangle semantic editing directions in StyleGAN without human supervision. By extracting principal components from CLIP embeddings and optimizing text labels, the method identifies complex transformations across diverse domains, including human faces and vehicles.
Introduction
Generative Adversarial Networks (GANs), particularly the StyleGAN family, have set the standard for realistic image generation. However, "steering" these models—applying specific, localized edits like changing a person's age or a car's color—remains a significant challenge. Existing approaches generally fall into two categories: supervised learning, which necessitates large-scale labeled datasets, or unsupervised methods that require human-in-the-loop intervention to interpret and label discovered latent directions. CLIP2StyleGAN addresses this gap by providing a fully automated pipeline for semantic latent space exploration.
Methodology
The CLIP2StyleGAN framework bridges StyleGAN’s latent space and CLIP’s semantic space through a multi-stage process:
- Direction Extraction: The system performs Principal Component Analysis (PCA) on CLIP image embeddings of a target dataset (e.g., FFHQ). This identifies the primary axes of semantic variation within the CLIP space.
- Unsupervised Labeling: To assign human-readable names to these axes, the authors employ a "CLIP Text Optimizer." By sampling images at the extremes of a discovered direction, the system identifies the centroid of the difference in CLIP space and optimizes a selection vector over a broad lexicon to find the most descriptive terms (e.g., "smiling," "children").
- Disentanglement and Refining: PCA directions often suffer from entanglement, where a single axis affects multiple attributes. The framework uses linguistic similarity (Wu-Palmer similarity) to detect multi-concept directions and applies gradient-descent optimization to split them into independent, "atomic" directions.
- Latent Mapping: Finally, these labeled CLIP directions are mapped into StyleGAN’s $W^+$ latent space using a linear SVM, enabling precise editing of both synthetic and real images.
Key Insights
A central finding of this work is that the principal components of CLIP's image space naturally align with human-understandable concepts. Unlike StyleGAN's internal space, which is optimized for pixel-level reconstruction, CLIP's space is optimized for semantic meaning. Furthermore, the use of language as a mathematical tool for disentanglement represents a significant departure from purely geometric methods, allowing the system to recognize when a direction represents semantically distant concepts like "Kid" and "Smile."
Results and Evaluation
The framework was evaluated on the FFHQ face dataset and the LSUN-CAR dataset. Qualitative results demonstrate the successful extraction of fine-grained edits such as gender, eyewear, and expression for faces, as well as color and style attributes for cars.
Quantitative analysis shows that these automatically discovered directions perform comparably to, or better than, manually curated directions from state-of-the-art methods like GANSpace. For instance, the "Smile" direction achieved a zero-shot classification score of 0.9092. A user study on Amazon Mechanical Turk further validated the labeling accuracy, with a 75% match between machine-generated labels and human descriptions for the "glasses" direction.
Furthermore, identity preservation tests using the dlib face recognition framework confirmed that edits maintain subject identity with over 90% accuracy, indicating high localization of the discovered attributes. The method also discovered non-trivial edits, such as a "Scrap to Car" direction that transforms rusted vehicles into functional-looking ones.
Conclusion and Future Work
CLIP2StyleGAN provides a powerful, unsupervised tool for exploring the semantic capabilities of generative models. While the method is subject to the inherent biases of the CLIP training data and depends on the provided lexicon, it offers a scalable way to audit large-scale multimodal models and discover non-trivial editing directions. Future work may focus on refining the labeling process to handle complex grammatical structures and further mitigating dataset-induced biases.
Summary updated