A Style-Based Generator Architecture for Generative Adversarial Networks

by   Tero Karras, et al.

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.


page 3

page 4

page 5

page 6

page 8

page 9

page 10

page 11


EvolGAN: Evolutionary Generative Adversarial Networks

We propose to use a quality estimator and evolutionary methods to search...

LoGANv2: Conditional Style-Based Logo Generation with Generative Adversarial Networks

Domains such as logo synthesis, in which the data has a high degree of m...

Semantically Decomposing the Latent Spaces of Generative Adversarial Networks

We propose a new algorithm for training generative adversarial networks ...

StyleWaveGAN: Style-based synthesis of drum sounds with extensive controls using generative adversarial networks

In this paper we introduce StyleWaveGAN, a style-based drum sound genera...

Structured Generative Adversarial Networks

We study the problem of conditional generative modeling based on designa...

Swap-Free Fat-Water Separation in Dixon MRI using Conditional Generative Adversarial Networks

Dixon MRI is widely used for body composition studies. Current processin...

Alias-Free Generative Adversarial Networks

We observe that despite their hierarchical convolutional nature, the syn...

Code Repositories


StyleGAN - Official TensorFlow Implementation

view repo


Flickr-Faces-HQ Dataset (FFHQ)

view repo


Implementation A Style-Based Generator Architecture for Generative Adversarial Networks in PyTorch

view repo


StyleGAN made with Keras

view repo


Reimplementation of https://arxiv.org/abs/1812.04948

view repo

1 Introduction

The resolution and quality of images produced by generative methods — especially generative adversarial networks (GAN) [21] — have seen rapid improvement recently [29, 43, 5]. Yet the generators continue to operate as black boxes, and despite recent efforts [3], the understanding of various aspects of the image synthesis process, e.g., the origin of stochastic features, is still lacking. The properties of the latent space are also poorly understood, and the commonly demonstrated latent space interpolations [12, 50, 35] provide no quantitative way to compare different generators against each other.

Motivated by style transfer literature [26]

, we re-design the generator architecture in a way that exposes novel ways to control the image synthesis process. Our generator starts from a learned constant input and adjusts the “style” of the image at each convolution layer based on the latent code, therefore directly controlling the strength of image features at different scales. Combined with noise injected directly into the network, this architectural change leads to automatic, unsupervised separation of high-level attributes (e.g., pose, identity) from stochastic variation (e.g., freckles, hair) in the generated images, and enables intuitive scale-specific mixing and interpolation operations. We do not modify the discriminator or the loss function in any way, and our work is thus orthogonal to the ongoing discussion about GAN loss functions, regularization, and hyper-parameters

[23, 43, 5, 38, 42, 34].

Our generator embeds the input latent code into an intermediate latent space, which has a profound effect on how the factors of variation are represented in the network. The input latent space must follow the probability density of the training data, and we argue that this leads to some degree of unavoidable entanglement. Our intermediate latent space is free from that restriction and is therefore allowed to be disentangled. As previous methods for estimating the degree of latent space disentanglement are not directly applicable in our case, we propose two new automated metrics — perceptual path length and linear separability — for quantifying these aspects of the generator. Using these metrics, we show that compared to a traditional generator architecture, our generator admits a more linear, less entangled representation of different factors of variation.

Finally, we present a new dataset of human faces (Flickr-Faces-HQ, FFHQ) that offers much higher quality and covers considerably wider variation than existing high-resolution datasets (Appendix A). We have made this dataset publicly available, along with our source code and pre-trained networks.111https://github.com/NVlabs/stylegan The accompanying video can be found under the same link.

2 Style-based generator

(a) Traditional (b) Style-based generator

Figure 1: While a traditional generator [29] feeds the latent code though the input layer only, we first map the input to an intermediate latent space , which then controls the generator through adaptive instance normalization (AdaIN) at each convolution layer. Gaussian noise is added after each convolution, before evaluating the nonlinearity. Here “A” stands for a learned affine transform, and “B” applies learned per-channel scaling factors to the noise input. The mapping network consists of 8 layers and the synthesis network consists of 18 layers — two for each resolution (). The output of the last layer is converted to RGB using a separate convolution, similar to Karras et al. [29]. Our generator has a total of 26.2M trainable parameters, compared to 23.1M in the traditional generator.

Traditionally the latent code is provided to the generator through an input layer, i.e., the first layer of a feedforward network (Figure 1a). We depart from this design by omitting the input layer altogether and starting from a learned constant instead (Figure 1b, right). Given a latent code in the input latent space , a non-linear mapping network first produces (Figure 1b, left). For simplicity, we set the dimensionality of both spaces to 512, and the mapping is implemented using an 8-layer MLP, a decision we will analyze in Section 4.1. Learned affine transformations then specialize to styles that control adaptive instance normalization (AdaIN) [26, 16, 20, 15] operations after each convolution layer of the synthesis network . The AdaIN operation is defined as


where each feature map is normalized separately, and then scaled and biased using the corresponding scalar components from style . Thus the dimensionality of is twice the number of feature maps on that layer.

Comparing our approach to style transfer, we compute the spatially invariant style

from vector

instead of an example image. We choose to reuse the word “style” for because similar network architectures are already used for feedforward style transfer [26]

, unsupervised image-to-image translation

[27], and domain mixtures [22]. Compared to more general feature transforms [36, 55], AdaIN is particularly well suited for our purposes due to its efficiency and compact representation.

Finally, we provide our generator with a direct means to generate stochastic detail by introducing explicit noise inputs. These are single-channel images consisting of uncorrelated Gaussian noise, and we feed a dedicated noise image to each layer of the synthesis network. The noise image is broadcasted to all feature maps using learned per-feature scaling factors and then added to the output of the corresponding convolution, as illustrated in Figure 1b. The implications of adding the noise inputs are discussed in Sections 3.2 and 3.3.

Method CelebA-HQ FFHQ
a Baseline Progressive GAN [29] 7.79 8.04
b + Tuning (incl. bilinear up/down) 6.11 5.25
c + Add mapping and styles 5.34 4.85
d + Remove traditional input 5.07 4.88
e + Add noise inputs 5.06 4.42
f + Mixing regularization 5.17 4.40
Table 1: Fréchet inception distance (FID) for various generator designs (lower is better). In this paper we calculate the FIDs using 50,000 images drawn randomly from the training set, and report the lowest distance encountered over the course of training.

2.1 Quality of generated images

Before studying the properties of our generator, we demonstrate experimentally that the redesign does not compromise image quality but, in fact, improves it considerably. Table 1 gives Fréchet inception distances (FID) [24] for various generator architectures in CelebA-HQ [29] and our new FFHQ dataset (Appendix A). Results for other datasets are given in Appendix E. Our baseline configuration (a) is the Progressive GAN setup of Karras et al. [29]

, from which we inherit the networks and all hyperparameters except where stated otherwise. We first switch to an improved baseline (

b) by using bilinear up/downsampling operations [62], longer training, and tuned hyperparameters. A detailed description of training setups and hyperparameters is included in Appendix C. We then improve this new baseline further by adding the mapping network and AdaIN operations (c), and make a surprising observation that the network no longer benefits from feeding the latent code into the first convolution layer. We therefore simplify the architecture by removing the traditional input layer and starting the image synthesis from a learned

constant tensor (

d). We find it quite remarkable that the synthesis network is able to produce meaningful results even though it receives input only through the styles that control the AdaIN operations.

Finally, we introduce the noise inputs (e) that improve the results further, as well as novel mixing regularization (f) that decorrelates neighboring styles and enables more fine-grained control over the generated imagery (Section 3.1).

Figure 2: Uncurated set of images produced by our style-based generator (config f) with the FFHQ dataset. Here we used a variation of the truncation trick [40, 5, 32] with for resolutions . Please see the accompanying video for more results.

We evaluate our methods using two different loss functions: for CelebA-HQ we rely on WGAN-GP [23], while FFHQ uses WGAN-GP for configuration a and non-saturating loss [21] with regularization [42, 49, 13] for configurations bf. We found these choices to give the best results. Our contributions do not modify the loss function.

We observe that the style-based generator (e) improves FIDs quite significantly over the traditional generator (b

), almost 20%, corroborating the large-scale ImageNet measurements made in parallel work 

[6, 5]. Figure 2 shows an uncurated set of novel images generated from the FFHQ dataset using our generator. As confirmed by the FIDs, the average quality is high, and even accessories such as eyeglasses and hats get successfully synthesized. For this figure, we avoided sampling from the extreme regions of using the so-called truncation trick [40, 5, 32] — Appendix B details how the trick can be performed in instead of . Note that our generator allows applying the truncation selectively to low resolutions only, so that high-resolution details are not affected.

All FIDs in this paper are computed without the truncation trick, and we only use it for illustrative purposes in Figure 2 and the video. All images are generated in resolution.

2.2 Prior art

Much of the work on GAN architectures has focused on improving the discriminator by, e.g., using multiple discriminators [17, 45], multiresolution discrimination [58, 53], or self-attention [61]. The work on generator side has mostly focused on the exact distribution in the input latent space [5]

or shaping the input latent space via Gaussian mixture models

[4], clustering [46], or encouraging convexity [50].

Recent conditional generators feed the class identifier through a separate embedding network to a large number of layers in the generator [44], while the latent is still provided though the input layer. A few authors have considered feeding parts of the latent code to multiple generator layers [9, 5]. In parallel work, Chen et al. [6] “self modulate” the generator using AdaINs, similarly to our work, but do not consider an intermediate latent space or noise inputs.

 destination        source Coarse styles copied Middle styles copied Fine styles
Figure 3: Visualizing the effect of styles in the generator by having the styles produced by one latent code (source) override a subset of the styles of another one (destination). Overriding the styles of layers corresponding to coarse spatial resolutions (), high-level aspects such as pose, general hair style, face shape, and eyeglasses get copied from the source, while all colors (eyes, hair, lighting) and finer facial features of the destination are retained. If we instead copy the styles of middle layers (), we inherit smaller scale facial features, hair style, eyes open/closed from the source, while the pose, general face shape, and eyeglasses from the destination are preserved. Finally, copying the styles corresponding to fine resolutions () brings mainly the color scheme and microstructure from the source.

3 Properties of the style-based generator

Our generator architecture makes it possible to control the image synthesis via scale-specific modifications to the styles. We can view the mapping network and affine transformations as a way to draw samples for each style from a learned distribution, and the synthesis network as a way to generate a novel image based on a collection of styles. The effects of each style are localized in the network, i.e., modifying a specific subset of the styles can be expected to affect only certain aspects of the image.

To see the reason for this localization, let us consider how the AdaIN operation (Eq. 1

) first normalizes each channel to zero mean and unit variance, and only then applies scales and biases based on the style. The new per-channel statistics, as dictated by the style, modify the relative importance of features for the subsequent convolution operation, but they do not depend on the original statistics because of the normalization. Thus each style controls only one convolution before being overridden by the next AdaIN operation.

3.1 Style mixing

To further encourage the styles to localize, we employ mixing regularization, where a given percentage of images are generated using two random latent codes instead of one during training. When generating such an image, we simply switch from one latent code to another — an operation we refer to as style mixing — at a randomly selected point in the synthesis network. To be specific, we run two latent codes through the mapping network, and have the corresponding control the styles so that applies before the crossover point and after it. This regularization technique prevents the network from assuming that adjacent styles are correlated.

Table 2 shows how enabling mixing regularization during training improves the localization considerably, indicated by improved FIDs in scenarios where multiple latents are mixed at test time. Figure 3 presents examples of images synthesized by mixing two latent codes at various scales. We can see that each subset of styles controls meaningful high-level attributes of the image.

Mixing Number of latents during testing
regularization 1 2 3 4
e 0% 4.42 8.22 12.88 17.41
50% 4.41 6.10 08.71 11.61
f 90% 4.40 5.11 06.88 09.03
100% 4.83 5.17 06.63 08.40
Table 2: FIDs in FFHQ for networks trained by enabling the mixing regularization for different percentage of training examples. Here we stress test the trained networks by randomizing latents and the crossover points between them. Mixing regularization improves the tolerance to these adverse operations significantly. Labels e and f refer to the configurations in Table 1.

3.2 Stochastic variation

Figure 4:

Examples of stochastic variation. (a) Two generated images. (b) Zoom-in with different realizations of input noise. While the overall appearance is almost identical, individual hairs are placed very differently. (c) Standard deviation of each pixel over 100 different realizations, highlighting which parts of the images are affected by the noise. The main areas are the hair, silhouettes, and parts of background, but there is also interesting stochastic variation in the eye reflections. Global aspects such as identity and pose are unaffected by stochastic variation.

There are many aspects in human portraits that can be regarded as stochastic, such as the exact placement of hairs, stubble, freckles, or skin pores. Any of these can be randomized without affecting our perception of the image as long as they follow the correct distribution.

Let us consider how a traditional generator implements stochastic variation. Given that the only input to the network is through the input layer, the network needs to invent a way to generate spatially-varying pseudorandom numbers from earlier activations whenever they are needed. This consumes network capacity and hiding the periodicity of generated signal is difficult — and not always successful, as evidenced by commonly seen repetitive patterns in generated images. Our architecture sidesteps these issues altogether by adding per-pixel noise after each convolution.

Figure 4 shows stochastic realizations of the same underlying image, produced using our generator with different noise realizations. We can see that the noise affects only the stochastic aspects, leaving the overall composition and high-level aspects such as identity intact. Figure 5 further illustrates the effect of applying stochastic variation to different subsets of layers. Since these effects are best seen in animation, please consult the accompanying video for a demonstration of how changing the noise input of one layer leads to stochastic variation at a matching scale.

Figure 5: Effect of noise inputs at different layers of our generator. (a) Noise is applied to all layers. (b) No noise. (c) Noise in fine layers only (). (d) Noise in coarse layers only (). We can see that the artificial omission of noise leads to featureless “painterly” look. Coarse noise causes large-scale curling of hair and appearance of larger background features, while the fine noise brings out the finer curls of hair, finer background detail, and skin pores.

We find it interesting that the effect of noise appears tightly localized in the network. We hypothesize that at any point in the generator, there is pressure to introduce new content as soon as possible, and the easiest way for our network to create stochastic variation is to rely on the noise provided. A fresh set of noise is available for every layer, and thus there is no incentive to generate the stochastic effects from earlier activations, leading to a localized effect.

3.3 Separation of global effects from stochasticity

The previous sections as well as the accompanying video demonstrate that while changes to the style have global effects (changing pose, identity, etc.), the noise affects only inconsequential stochastic variation (differently combed hair, beard, etc.). This observation is in line with style transfer literature, where it has been established that spatially invariant statistics (Gram matrix, channel-wise mean, variance, etc.) reliably encode the style of an image [19, 37] while spatially varying features encode a specific instance.

In our style-based generator, the style affects the entire image because complete feature maps are scaled and biased with the same values. Therefore, global effects such as pose, lighting, or background style can be controlled coherently. Meanwhile, the noise is added independently to each pixel and is thus ideally suited for controlling stochastic variation. If the network tried to control, e.g., pose using the noise, that would lead to spatially inconsistent decisions that would then be penalized by the discriminator. Thus the network learns to use the global and local channels appropriately, without explicit guidance.

4 Disentanglement studies

(a) Distribution of (b) Mapping from (c) Mapping from
features in training set to features to features

Figure 6: Illustrative example with two factors of variation (image features, e.g., masculinity and hair length). (a) An example training set where some combination (e.g., long haired males) is virtually non-existent. (b) This forces the mapping from to image features to become curved so that the forbidden combination disappears in to prevent the sampling of invalid combinations. (c) However, the learned mapping from to is able to “undo” much of the warping.

There are various definitions for disentanglement [52, 48, 2, 7, 18], but a common goal is a latent space that consists of linear subspaces, each of which controls one factor of variation. However, the sampling probability of each combination of factors in needs to match the corresponding density in the training data. As illustrated in Figure 6, this precludes the factors from being fully disentangled with typical datasets and input latent distributions.222The few artificial datasets designed for disentanglement studies (e.g., [41, 18]) tabulate all combinations of predetermined factors of variation with uniform frequency, thus hiding the problem.

A major benefit of our generator architecture is that the intermediate latent space does not have to support sampling according to any fixed distribution; its sampling density is induced by the learned piecewise continuous mapping . This mapping can be adapted to “unwarp” so that the factors of variation become more linear. We posit that there is pressure for the generator to do so, as it should be easier to generate realistic images based on a disentangled representation than based on an entangled representation. As such, we expect the training to yield a less entangled in an unsupervised setting, i.e., when the factors of variation are not known in advance [10, 33, 47, 8, 25, 30, 7].

Unfortunately the metrics recently proposed for quantifying disentanglement [25, 30, 7, 18] require an encoder network that maps input images to latent codes. These metrics are ill-suited for our purposes since our baseline GAN lacks such an encoder. While it is possible to add an extra network for this purpose [8, 11, 14], we want to avoid investing effort into a component that is not a part of the actual solution. To this end, we describe two new ways of quantifying disentanglement, neither of which requires an encoder or known factors of variation, and are therefore computable for any image dataset and generator.

4.1 Perceptual path length

As noted by Laine [35], interpolation of latent-space vectors may yield surprisingly non-linear changes in the image. For example, features that are absent in either endpoint may appear in the middle of a linear interpolation path. This is a sign that the latent space is entangled and the factors of variation are not properly separated. To quantify this effect, we can measure how drastic changes the image undergoes as we perform interpolation in the latent space. Intuitively, a less curved latent space should result in perceptually smoother transition than a highly curved latent space.

As a basis for our metric, we use a perceptually-based pairwise image distance [63] that is calculated as a weighted difference between two VGG16 [56] embeddings, where the weights are fit so that the metric agrees with human perceptual similarity judgments. If we subdivide a latent space interpolation path into linear segments, we can define the total perceptual length of this segmented path as the sum of perceptual differences over each segment, as reported by the image distance metric. A natural definition for the perceptual path length would be the limit of this sum under infinitely fine subdivision, but in practice we approximate it using a small subdivision epsilon . The average perceptual path length in latent space , over all possible endpoints, is therefore


where , is the generator (i.e., for style-based networks), and evaluates the perceptual distance between the resulting images. Here denotes the spherical interpolation operation [54] that is the most appropriate way of interpolating in our normalized input latent space [59]. To concentrate on the facial features instead of background, we crop the generated images to contain only the face prior to evaluating the pairwise image metric. As the metric happens to be quadratic in nature [63], we divide by instead of in order to cancel out the unwanted dependence on subdivision granularity. We compute the expectation value by taking 100,000 samples.

Figure 7: The FFHQ dataset offers a lot of variety in terms of age, ethnicity, viewpoint, lighting, and image background.

Computing the average perceptual path length in is carried out in a similar fashion:


where the only difference is that interpolation happens in space. Because vectors in are not normalized in any fashion, we use linear interpolation ().

Method Path length Separa-
full end bility
b Traditional generator 412.0 415.3 10.78
d Style-based generator 446.2 376.6 03.61
e + Add noise inputs 200.5 160.6 03.54
+ Mixing 50% 231.5 182.1 03.51
f + Mixing 90% 234.0 195.9 03.79
Table 3: Perceptual path lengths and separability scores for various generator architectures in FFHQ (lower is better). We perform the measurements in for the traditional network, and in for style-based ones. Making the network resistant to style mixing appears to distort the intermediate latent space somewhat. We hypothesize that mixing makes it more difficult for to efficiently encode factors of variation that span multiple scales.

Table 3 shows that this full-path length is substantially shorter for our style-based generator with noise inputs, indicating that is perceptually more linear than . Yet, this measurement is in fact slightly biased in favor of the input latent space . If is indeed a disentangled and “flattened” mapping of , it may contain regions that are not on the input manifold — and are thus badly reconstructed by the generator — even between points that are mapped from the input manifold, whereas the input latent space has no such regions by definition. It is therefore to be expected that if we restrict our measure to path endpoints, i.e., , we should obtain a smaller while is not affected. This is indeed what we observe in Table 3.

Table 4 shows how path lengths are affected by the mapping network. We see that both traditional and style-based generators benefit from having a mapping network, and additional depth generally improves the perceptual path length as well as FIDs. It is interesting that while improves in the traditional generator, becomes considerably worse, illustrating our claim that the input latent space can indeed be arbitrarily entangled in GANs.

Method FID Path length Separa-
full end bility
b Traditional 0 5.25 412.0 415.3 010.78
Traditional 8 4.87 896.2 902.0 170.29
Traditional 8 4.87 324.5 212.2 006.52
Style-based 0 5.06 283.5 285.5 009.88
Style-based 1 4.60 219.9 209.4 006.81
Style-based 2 4.43 217.8 199.9 006.25
f Style-based 8 4.40 234.0 195.9 003.79
Table 4: The effect of a mapping network in FFHQ. The number in method name indicates the depth of the mapping network. We see that FID, separability, and path length all benefit from having a mapping network, and this holds for both style-based and traditional generator architectures. Furthermore, a deeper mapping network generally performs better than a shallow one.

4.2 Linear separability

If a latent space is sufficiently disentangled, it should be possible to find direction vectors that consistently correspond to individual factors of variation. We propose another metric that quantifies this effect by measuring how well the latent-space points can be separated into two distinct sets via a linear hyperplane, so that each set corresponds to a specific binary attribute of the image.

In order to label the generated images, we train auxiliary classification networks for a number of binary attributes, e.g., to distinguish male and female faces. In our tests, the classifiers had the same architecture as the discriminator we use (i.e., same as in

[29]), and were trained using the CelebA-HQ dataset that retains the 40 attributes available in the original CelebA dataset. To measure the separability of one attribute, we generate 200,000 images with and classify them using the auxiliary classification network. We then sort the samples according to classifier confidence and remove the least confident half, yielding 100,000 labeled latent-space vectors.

For each attribute, we fit a linear SVM to predict the label based on the latent-space point —  for traditional and for style-based — and classify the points by this plane. To measure how well the hyperplane is able to separate the points into correct groups, we compute the conditional entropy where are the classes predicted by the SVM and are the classes determined by the pre-trained classifier. The conditional entropy thus tells how much additional information is required to determine the true class of a sample, assuming that we know on which side of the hyperplane it lies. The intuition is that if the associated factor of variation, or combination thereof, has inconsistent latent space directions, it will be more difficult to separate the sample points by a hyperplane, yielding high conditional entropy. A low value indicates easy separability and thus more consistent latent space direction for the particular factor or set of factors that the attribute corresponds to.

We calculate the final separability score as , where enumerates the 40 attributes. Similar to the inception score [51], the exponentiation brings the values from logarithmic to linear domain so that they are easier to compare.

Tables 3 and 4 show that is consistently better separable than , suggesting a less entangled representation. Furthermore, increasing the depth of the mapping network improves both image quality and separability in , which is in line with the hypothesis that the synthesis network inherently favors a disentangled input representation. Interestingly, adding a mapping network in front of a traditional generator results in severe loss of separability in but improves the situation in the intermediate latent space , and the FID improves as well. This shows that even the traditional generator architecture performs better when we introduce an intermediate latent space that does not have to follow the distribution of the training data.

5 Conclusion

Based on both our results and parallel work by Chen et al. [6], it is becoming clear that the traditional GAN generator architecture is in every way inferior to a style-based design. This is true in terms of established quality metrics, and we further believe that our investigations to the separation of high-level attributes and stochastic effects, as well as the linearity of the intermediate latent space will prove fruitful in improving the understanding and controllability of GAN synthesis.

We note that our average path length metric could easily be used as a regularizer during training, and perhaps some variant of the linear separability metric could act as one, too. In general, we expect that methods for directly shaping the intermediate latent space during training will provide interesting avenues for future work.

6 Acknowledgements

We thank Jaakko Lehtinen, David Luebke, and Tuomas Kynkäänniemi for in-depth discussions and helpful comments; Janne Hellsten, Tero Kuosmanen, and Pekka Jänis for compute infrastructure and help with the code release.

Appendix A The FFHQ dataset

We have collected a new dataset of human faces, Flickr-Faces-HQ (FFHQ), consisting of 70,000 high-quality images at resolution (Figure 7). The dataset includes vastly more variation than CelebA-HQ [29] in terms of age, ethnicity and image background, and also has much better coverage of accessories such as eyeglasses, sunglasses, hats, etc. The images were crawled from Flickr (thus inheriting all the biases of that website) and automatically aligned and cropped. Only images under permissive licenses were collected. Various automatic filters were used to prune the set, and finally Mechanical Turk allowed us to remove the occasional statues, paintings, or photos of photos. We have made the dataset publicly available at https://github.com/NVlabs/ffhq-dataset

Appendix B Truncation trick in

If we consider the distribution of training data, it is clear that areas of low density are poorly represented and thus likely to be difficult for the generator to learn. This is a significant open problem in all generative modeling techniques. However, it is known that drawing latent vectors from a truncated [40, 5] or otherwise shrunk [32] sampling space tends to improve average image quality, although some amount of variation is lost.

We can follow a similar strategy. To begin, we compute the center of mass of as . In case of FFHQ this point represents a sort of an average face (Figure 8, ). We can then scale the deviation of a given from the center as , where . While Brock et al. [5] observe that only a subset of networks is amenable to such truncation even when orthogonal regularization is used, truncation in space seems to work reliably even without changes to the loss function.

Figure 8: The effect of truncation trick as a function of style scale . When we fade , all faces converge to the “mean” face of FFHQ. This face is similar for all trained networks, and the interpolation towards it never seems to cause artifacts. By applying negative scaling to styles, we get the corresponding opposite or “anti-face”. It is interesting that various high-level attributes often flip between the opposites, including viewpoint, glasses, age, coloring, hair length, and often gender.

Appendix C Hyperparameters and training details

We build upon the official TensorFlow 

[1] implementation of Progressive GANs by Karras et al. [29], from which we inherit most of the training details.333https://github.com/tkarras/progressive_growing_of_gans This original setup corresponds to configuration a in Table 1. In particular, we use the same discriminator architecture, resolution-dependent minibatch sizes, Adam [31] hyperparameters, and exponential moving average of the generator. We enable mirror augmentation for CelebA-HQ and FFHQ, but disable it for LSUN. Our training time is approximately one week on an NVIDIA DGX-1 with 8 Tesla V100 GPUs.

For our improved baseline (b in Table 1), we make several modifications to improve the overall result quality. We replace the nearest-neighbor up/downsampling in both networks with bilinear sampling, which we implement by low-pass filtering the activations with a separable 2nd order binomial filter after each upsampling layer and before each downsampling layer [62]. We implement progressive growing the same way as Karras et al. [29], but we start from images instead of . For the FFHQ dataset, we switch from WGAN-GP to the non-saturating loss [21] with regularization [42] using . With we found that the FID scores keep decreasing for considerably longer than with WGAN-GP, and we thus increase the training time from 12M to 25M images. We use the same learning rates as Karras et al. [29] for FFHQ, but we found that setting the learning rate to 0.002 instead of 0.003 for and leads to better stability with CelebA-HQ.

For our style-based generator (f in Table 1

), we use leaky ReLU

[39] with and equalized learning rate [29] for all layers. We use the same feature map counts in our convolution layers as Karras et al. [29]. Our mapping network consists of 8 fully-connected layers, and the dimensionality of all input and output activations — including and  — is 512. We found that increasing the depth of the mapping network tends to make the training unstable with high learning rates. We thus reduce the learning rate by two orders of magnitude for the mapping network, i.e., . We initialize all weights of the convolutional, fully-connected, and affine transform layers using . The biases and noise scaling factors are initialized to zero, except for the biases associated with that we initialize to one.

The classifiers used by our separability metric (Section 4.2) have the same architecture as our discriminator except that minibatch standard deviation [29] is disabled. We use the learning rate of , minibatch size of 8, Adam optimizer, and training length of 150,000 images. The classifiers are trained independently of generators, and the same 40 classifiers, one for each CelebA attribute, are used for measuring the separability metric for all generators. We will release the pre-trained classifier networks so that our measurements can be reproduced.

We do not use batch normalization

[28], spectral normalization [43], attention mechanisms [61], dropout [57], or pixelwise feature vector normalization [29] in our networks.

Appendix D Training convergence

Figure 9: FID and perceptual path length metrics over the course of training in our configurations b and f using the FFHQ dataset. Horizontal axis denotes the number of training images seen by the discriminator. The dashed vertical line at 8.4M images marks the point when training has progressed to full resolution. On the right, we show only one curve for the traditional generator’s path length measurements, because there is no discernible difference between full-path and endpoint sampling in (Section 4.1).
Figure 10: Uncurated set of images produced by our style-based generator (config f) with the LSUN Bedroom dataset at .

Figure 9 shows how the FID and perceptual path length metrics evolve during the training of our configurations b and f with the FFHQ dataset. With regularization active in both configurations, FID continues to slowly decrease as the training progresses, motivating our choice to increase the training time from 12M images to 25M images. Even when the training has reached the full resolution, the slowly rising path lengths indicate that the improvements in FID come at the cost of a more entangled representation. Considering future work, it is an interesting question whether this is unavoidable, or if it were possible to encourage shorter path lengths without compromising the convergence of FID.

Appendix E Other datasets

Figures 1011, and 12 show an uncurated set of results for LSUN [60] Bedroom, Cars, and Cats, respectively. In these images we used the truncation trick from Appendix B with for resolutions . The accompanying video provides results for style mixing and stochastic variation tests. As can be seen therein, in case of Bedroom the coarse styles basically control the viewpoint of the camera, middle styles select the particular furniture, and fine styles deal with colors and smaller details of materials. In Cars the effects are roughly similar. Stochastic variation affects primarily the fabrics in Bedroom, backgrounds and headlamps in Cars, and fur, background, and interestingly, the positioning of paws in Cats. Somewhat surprisingly the wheels of a car never seem to rotate based on stochastic inputs.

These datasets were trained using the same setup as FFHQ for the duration of 70M images for Bedroom and Cats, and 46M for Cars. We suspect that the results for Bedroom are starting to approach the limits of the training data, as in many images the most objectionable issues are the severe compression artifacts that have been inherited from the low-quality training data. Cars has much higher quality training data that also allows higher spatial resolution ( instead of ), and Cats continues to be a difficult dataset due to the high intrinsic variation in poses, zoom levels, and backgrounds.

Figure 11: Uncurated set of images produced by our style-based generator (config f) with the LSUN Car dataset at .
Figure 12: Uncurated set of images produced by our style-based generator (config f) with the LSUN Cat dataset at .