Abstract: We propose an alternative generator architecture for generative adversarial networks, borrowing from style transfer literature. The new architecture leads to an automatically learned, unsupervised separation of high-level attributes (e.g., pose and identity when trained on human faces) and stochastic variation in the generated images (e.g., freckles, hair), and it enables intuitive, scale-specific control of the synthesis. The new generator improves the state-of-the-art in terms of traditional distribution quality metrics, leads to demonstrably better interpolation properties, and also better disentangles the latent factors of variation. To quantify interpolation quality and disentanglement, we propose two new, automated methods that are applicable to any generator architecture. Finally, we introduce a new, highly varied and high-quality dataset of human faces.
Introduction
Traditional Generative Adversarial Networks (GANs) have largely treated the image synthesis process as a "black box." While capable of producing high-resolution images, these architectures offer little insight into how the latent space maps to specific visual features. A significant challenge is entanglement: in a standard GAN, the input latent space ($\mathcal{Z}$) must follow the probability density of the training data. If the data lacks certain attribute combinations, the latent space becomes warped, meaning a change in one latent variable often affects multiple unrelated features in the output image.
The Style-Based Architecture
To address these limitations, we introduce a "Style-based Generator" that departs from the standard feed-forward design. Instead of feeding a latent code directly into the generator, our architecture employs several key innovations:
- Mapping Network: Latent codes $z \in \mathcal{Z}$ are first passed through an 8-layer MLP to produce a vector $w$ in an intermediate latent space $\mathcal{W}$. This space is not restricted to the training data's density, allowing it to "unwarp" and represent factors of variation more linearly.
- Constant Input: The generator no longer begins with a sampled latent code. Instead, it starts with a learned constant $4 \times 4 \times 512$ tensor.
- Style Injection (AdaIN): The latent code $w$ is transformed into "styles" that control the generator via Adaptive Instance Normalization (AdaIN) after every convolution layer. This allows $w$ to dictate the scale and bias of feature maps at every level of the network.
- Noise Injection: To handle stochastic variation (e.g., the exact placement of hair or freckles), we inject per-pixel Gaussian noise directly into the network. This effectively separates global attributes from local, random details.
Scale-Specific Control and Style Mixing
Because styles are injected at every layer, the architecture naturally separates features by scale. Coarse layers ($4^2 - 8^2$) control high-level aspects like pose and face shape; middle layers ($16^2 - 32^2$) control finer facial features and expression; and fine layers ($64^2 - 1024^2$) dictate color schemes and micro-structures like skin pores.
To further improve disentanglement, we use mixing regularization. During training, we occasionally switch between two different latent codes at a random point in the network. This prevents the network from assuming that adjacent styles are correlated, enabling "style mixing" where one can combine the pose of one person with the facial features of another.
Results and Datasets
A major contribution of this work is the Flickr-Faces-HQ (FFHQ) dataset, consisting of 70,000 high-quality images at $1024^2$ resolution. FFHQ is significantly more diverse than previous standards, covering a wider range of ages, ethnicities, and accessories.
StyleGAN achieves a new state-of-the-art in image quality, reaching a Fréchet Inception Distance (FID) of 4.40 on FFHQ. We also introduce two new metrics—Perceptual Path Length (PPL) and Linear Separability—to quantitatively demonstrate that our intermediate latent space $\mathcal{W}$ is significantly less entangled and more linear than traditional architectures.
Conclusion
While StyleGAN offers unprecedented control, it remains computationally expensive to train and can occasionally produce "droplet-like" artifacts in feature maps. However, by moving toward a style-based approach, we have demonstrated that it is possible to achieve both high-quality synthesis and meaningful, scale-specific control over the generative process.
Summary updated