Abstract: This paper describes a simple technique to analyze Generative Adversarial Networks (GANs) and create interpretable controls for image synthesis, such as change of viewpoint, aging, lighting, and time of day. We identify important latent directions based on Principal Components Analysis (PCA) applied either in latent space or feature space. Then, we show that a large number of interpretable controls can be defined by layer-wise perturbation along the principal directions. Moreover, we show that BigGAN can be controlled with layer-wise inputs in a StyleGAN-like manner. We show results on different GANs trained on various datasets, and demonstrate good qualitative matches to edit directions found through earlier supervised approaches.
Introduction
Generative Adversarial Networks (GANs) like StyleGAN and BigGAN produce stunningly realistic images, but they are notoriously difficult to "steer." Traditionally, modifying a generated image—such as making a face smile or changing the lighting—required supervised approaches involving labeled datasets or pretrained classifiers to identify the correct directions in the latent space. GANSpace addresses this bottleneck by introducing an unsupervised method to discover these controls automatically by analyzing the internal structure of the GAN itself.
Unsupervised Discovery via PCA
The core methodology relies on Principal Component Analysis (PCA) to find directions of maximum variance within the model's internal representations. For StyleGAN, PCA is performed on the "style" vectors ($w$) in the mapping network. For BigGAN, which lacks a dedicated style space, PCA is applied to the activations (feature maps) of early layers, with linear regression used to map these directions back to the original latent space ($z$).
Layer-wise Control and Disentanglement
A critical discovery in this work is the importance of layer-wise application. Applying a PCA direction to all layers simultaneously often leads to "entanglement," where changing one attribute (like pose) inadvertently alters another (like identity). By restricting edits to specific layer ranges, the authors can isolate semantic effects. For example, early layers typically control coarse structure and viewpoint, while later layers handle fine textures and background details.
This technique even allows BigGAN to exhibit StyleGAN-like behavior. By varying its "Skip-z" inputs independently across layers, users can achieve precise control over class-agnostic features like lighting or zoom, which often generalize across different object categories.
Qualitative Results
The authors demonstrated a vast array of controls across multiple datasets, including FFHQ (faces), Cars, and Landscapes. These automatically discovered directions are often indistinguishable from those found using supervised methods. Notable successes include the ability to modify camera angles, add wrinkles for aging, and alter environmental factors like the time of day.
Beyond simple edits, the unsupervised nature of GANSpace allows it to act as a diagnostic tool for training data bias. It can reveal "disallowed combinations" within a model, such as a GAN's inability to apply certain attributes to specific demographics if those combinations were absent from the training set.
Conclusion
GANSpace provides a computationally efficient, unsupervised framework for GAN steering that requires no optimization or backpropagation. While some residual entanglement remains due to correlations in training data, the simplicity and effectiveness of layer-wise PCA directions offer a powerful new tool for artists and researchers to explore and control generative models.
Summary updated