{'fraction_non_alphanumeric': 0.028082115980522356, 'fraction_numerical': 0.011177512173528109, 'mean_word_length': 4.631816765347461, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Diamond in the rough: Improving image realism by traversing the GAN latent space

In just a few years, the photo-realism of images synthesized by Generative Adversarial Networks (GANs) has gone from somewhat reasonable to almost perfect largely by increasing the complexity of the networks, e.g., adding layers, intermediate latent spaces, style-transfer parameters, etc. This trajectory has led many of the state-of-the-art GANs to be inaccessibly large, disengaging many without large computational resources. Recognizing this, we explore a method for squeezing additional performance from existing, low-complexity GANs. Formally, we present an unsupervised method to find a direction in the latent space that aligns with improved photo-realism. Our approach leaves the network unchanged while enhancing the fidelity of the generated image. We use a simple generator inversion to find the direction in the latent space that results in the smallest change in the image space. Leveraging the learned structure of the latent space, we find moving in this direction corrects many image artifacts and brings the image into greater realism. We verify our findings qualitatively and quantitatively, showing an improvement in Frechet Inception Distance (FID) exists along our trajectory which surpasses the original GAN and other approaches including a supervised method. We expand further and provide an optimization method to automatically select latent vectors along the path that balance the variation and realism of samples. We apply our method to several diverse datasets and three architectures of varying complexity to illustrate the generalizability of our approach. By expanding the utility of low-complexity and existing networks, we hope to encourage the democratization of GANs.


Introduction
Generative Adversarial Networks (GANs) are powerful algorithms capable of mapping latent vectors z 0 into novel, photo-realistic images X [19,18,4,17,26]. Unfortunately, Figure 1. Randomly generated samples from a PGAN trained on CelebA [22] alongside the outputs of our algorithm. The majority of the random images are easily detectable as synthetic. Compare these with the results after applying our proposed framework. Good images generated by PGAN are improved but poorly generated images are dramatically enhanced. not all latent vectors yield photo-realistic images. Imagine we had a simple algorithm that for every latent vector z 0 it gave you an alternative latent vectorẑ that yielded a much more photo-realistic imageX of the same class identity and attributes as X. This paper defines such an algorithm, Fig.  1. We achieve this by constraining the latent space in a specific way that lends to improvement in realism.
Since the original algorithm derived by [10], many variants have been proposed to improve the photo-realism of the generated images [19,18,4,16,17]. Typically, improvements in photo-realism have come at the cost of increasing the network complexity [18,7,28,19]. However, the large computational requirements of these state-of-the-art networks has instilled a disconnect within the GAN community, alienating those without industrial resources and limiting the applicability of GANs for large-scale use. In order to promote the integration of GANs into real-world applications, we must look for accessible, alternative methods.
Here, we take a different approach. Rather than increasing the network's complexity, we constrain the typically used Normal distribution in latent space to a set of great circles on it. We show that these great circles include average sample (proto) images of high realism, Fig. 2. Hence, moving about the great circle toward the converged face and away from the original latent vector improves the realism. We also show that this great circle is easily defined by the geodesic of z 0 and z 1 , where z 1 is the estimated latent vector of the image X computed by inverting the GAN's generator function, Fig. 2. Finally, we derive a simple, efficient algorithm to identify a photo-realistic generator latent vectorẑ about these great circles. A sample of the resulting improved (optimized) images were shown in Fig. 1.
We show how the proposed algorithm allows us to achieve consistent photo-realistic images even when using lower-cost networks like PGAN. Through utilizing the full capability of lower-complexity and existing networks, we hope to stimulate the accessibility of GANs.

Sampling from areas of high probability
Brock et al. [4] proposed to draw latent vectors from a truncated distribution of the original prior p(z). Given a sample drawn from p(z), the values of vector z above a given threshold are resampled to be within the threshold. As the threshold becomes smaller, the samples are drawn from a smaller area of higher likelihood resulting in an increase in photo-realism.
Alternatively, Menon et al. [24] approximates the natural image manifold by projecting sampled vectors onto the hypersphere of radius √ n, n the number of dimensions of the latent space. High-dimensional Gaussian distributions take the form of a "soap bubble" with probability mass lying at or near √ nS n−1 , where S n−1 is the n-dimensional unit hypersphere. This allows the authors to constrain the latent space in a way that results in increased consistency in the realism of the generated images.
While these two approaches have shown improvements for specific GAN architectures, they do not fully describe the natural image manifold. As most of the mass of the distribution is on the surface of √ nS n−1 , the truncation trick is not guaranteed to find an area of high probability. Importantly, for architectures like PGAN where the input vector is scaled to be on the hypersphere before passing it to the generator, the approach from [24] cannot identify the regions associated to photo-realistic images.
Contrary to these approaches, our framework shows that the great circle on this hypersphere in the latent space given by z 0 and z 1 contains the photo-realistic images we desire, Fig. 2. This is because this great circle contains a "protoimage", a highly-realistic sample average of sample images. Hence, moving away from z 0 and z 1 increases the realism of the generated image, Fig. 2.

GAN Manipulation
Several other recent works have investigated the capability of controlling the behavior of GANs through exploring the latent space. The goal of these methods is to find directions in the latent space that allow for interpretable semantic changes in the resulting images. [27] discovered the vector arithmetic effect allowing attributes to be added to images by adding an appropriate vector in the latent space. [33,29] expand this idea by finding a hyperplane where latent vectors on one side exhibit a binary attribute, e.g. presence of glasses, and vectors on the other side do not. By moving latent vectors in the normal direction of the hyperplanes, they are able to semantically manipulate the resulting image for desired attributes. [9] uses a pretrained assessor network to study the direction of varying image memorability. These methods rely on pretrained classifier networks or manual annotations which may be unavailable or expensive to obtain. [14,25] utilize a self-supervision framework that transforms a generated image in the pixel space and finds the resulting direction of change in the latent space. However, both these approaches are limited to simple transformations such as rotation, zoom, and translation. [32] takes an unsupervised approach with a trainable reconstructor network and direction matrix which find directions that are easily distinguishable, and [13,30] learn interpretable directions by performing principle component analysis (PCA) on samples in the latent space or on the learned weights that map the latent vector to the first convolutional layers.
While these methods are able to find directions that allow users to manipulate semantic features like rotation, hair color, lighting, etc., only [29] discovers a direction that allows for the control of photo-realism. The approach in [29], however, requires sampling images and manual annotations of "good" and "bad" synthesized images which can be expensive and noisy. Contrary to this approach, our method finds the mentioned direction without supervision by ex- Figure 2. The latent vector z0 generates image X. Inverting the process we estimate the latent vector z1 associated with X. The geodesic between z0 and z1 defines a great circle on the hypersphere. These great circles include a number of highly realistic protoimages. Moving towards these protoimages about this great circle, increases the realism of the generated image. Our goal is to define a criterion that when optimized yields a photo-realistic image of the same class identity and attributes as X.
ploiting the learned semantic structure of the latent space to find the direction of the protoimages vectors that represent photo-realistic sample means with well-structured data.

Generator Inversion
To begin our analysis of the generator latent space, we need a mapping from the image space to the generator's latent space. The inversion of the generator has two common approaches. The first approach is to use an optimization method to minimize the reconstruction loss [21][5] [23]. Given an initial latent vector z ∈ R n , the objective function is min where X is the image, G(z) is the generated image given latent vector z, and · F denotes the Frobenius norm. It is also common for a perceptual loss term to be added to this optimization [15,8]. The perceptual loss term forces the distance between the original image and recovered image to be small in the feature space of a trained feature extraction network such as a VGG-16 pretrained on ImageNet [31]. We will use both of these criteria in our approach.
Another common approach is to train a separate encoder network [35,2,36]. Using randomly generated latent vectors and their corresponding generated images, an encoder network can be trained to map the images to the latent vector space. While this method is not sensitive to the initialization of z as in the optimization approach, it does typically result in overfitting to the training data. For these reasons, we elected to use the optimization approach together with a perceptual loss in our framework, but we show that one can also use the encoder approach efficiently in our framework.

Methods
Let the latent vector z 0 generate image X through generator G(·), i.e. X = G(z 0 ). Our framework seeks to find aẑ and correspondingX = G(ẑ) which contains the same semantic attributes as X while appearing more photo-realistic than X.
We achieve this by leveraging the discovery of a subset of similar, high-fidelity images that we call protoimages. The latent vector, z p , corresponding to a protoimage lies along a great circle passing through z 0 and z 1 . z 1 is found by inverting the generator to approximate the latent vector which produced X. By optimizing the interpolation between z 0 and z p , we are able to find aẑ, which satisfies our conditions.
The overall structure of the framework can be found in Fig. 3. A visualization of the movement along the hypersphere was shown in Fig. 2. We detail each of the steps in the next few sections.

Latent Vector Recovery
For a given latent vector, z 0 ∼ N (0, I n ), we pass the vector through the generator to obtain the original generated image, X ∈ R d , d the number of pixels in the image. Given X, the goal is to now find a vector z 1 which will produce a similar image G(z 1 ) to X. For this optimization problem, we utilize three loss terms.
1. A reconstruction loss, given by where · 1 is the L1 norm. We use the L1 norm to prevent outlier-valued pixels from overtaking the optimization. 2. A perceptual loss with the features extracted from the feature space of the discriminator. As [27] demonstrated the utility of the discriminator as a feature extractor for classification, we use the discriminator for our perceptual loss to keep the framework isolated from other networks. With this in mind, the perceptual loss term was formatted as where D f (·) are the features from the discriminator. 3. As previously mentioned, the majority of the probability mass of a high-dimensional Gaussian lies on the surface Figure 3. Overview of our framework. We find a latent vector z1 that visually resembles the latent vector z0 by using the optimization proposed in (5) (green box). We traverse the latent space along the great circle that passes through z0 and z1 to find zp by iteratively projecting the direction of travel onto the hypersphere as explained in (6) (blue box). We then use the interpolation technique in (8) to get an optimized image (orange box) of a √ dS n−1 hypersphere. A proof of this can be found in the Supplemental Material. To keep our search in the space of high probability, we add a simple L2 regularization term to keep the latent vector search near the surface of the hypersphere. Formally, where n is the dimensionality of the latent space and · 2 is the L2-norm. Putting all three of these terms together, we arrive at the final objective function, where α and β are chosen weight parameters.
The results of this algorithm can be seen in Fig. 1. We note that while the original and recovered images are nearly identical, the pairwise Euclidean distance between the original and recovered latent vectors may not be small. For example, with PGAN on CelebA, the average distance is 25.
To demonstrate the difference that such a Euclidean distance can make in the pixel-space, we added noise vectors of an equivalent magnitude to the original latent vectors and generated the images of the resulting vectors. These can be seen in Fig. 4. While an equivalent distance away, these vectors provide dramatically different images from the original. Thus, this suggests that our recovered latent vectors are in a particular direction where the image attributes do not change very much. We further explore this hypothesis in the next section.

Traversing the Latent Space
In this section, we explore the effects of moving along the hypersphere in the direction of the recovered latent vector.
As a simple experiment, we take the difference between the recovered, z 1 , and original latent vector, z 0 and add it to the recovered latent vector. The resulting vector is projected onto the hypersphere and named z 2 . By repeating the sequence, z k+1 = proj(z k +(z k −z k−1 )) (where proj() is the projection onto the hypersphere), we are able to traverse the hypersphere in the direction of the recovered latent vector. The results of this visualization can be seen in Fig. S1.
Note that as the latent vector is moved about the hypersphere, the image quality improves by bringing clarity to the already well-defined faces or by bringing previously unidentifiable faces to images that resemble a face. The key to this process is to note that this walk arrives at a similar set of protoimage around the same iteration of the sequence. These protoimages are in fact sample mean images. For the CelebA dataset, for example, the protoimage resembles a mean face of a subset of the training set.
Up until this point, each iteration improves quality but retains most of the unique attributes of the original image. After the protoimage, the subsequent iterations provide a completely new identity, which worsens in quality as the walk continues. This behavior is similar to the effects seen using the truncation trick [4]. [18] report a similar effect with the truncation trick applied to the intermediate latent space. In their experiment, they also show different identities, often antifaces, once the mean image is crossed. However, separate from those experiments, our latent vectors are not converging to the same latent vector. In fact, the latent vectors of the mean images are separated by a large angle. While the effects of moving towards the mean images appear to be the same as the truncation trick, here the generator has designed the latent space to have mean images about every great circle on the hypersphere.

Protoimage Recovery
As we observed the improvement in image quality near the protoimages, we would like to be able to find the locations of these protoimages given a random set of latent vectors.
An interesting feature of some GANs is the inclusion of a minibatch standard deviation layer in the discriminator. This layer encourages variation among the images of an input batch, which results in a lower discriminator score for images that are similar. As the mean images all have a similar look, the resulting discriminator score is very low for a batch of protoimages. There is also always a large angle between the original latent vector and the protoimage latent vectors. With this in mind, we can establish a criterion for finding the protoimages about the hypersphere walk. The objective function below seeks to minimize the discriminator score for a batch of images while also encouraging a small cosine similarity value. Formally, where D(·) is the discriminator score, z p is the latent vector of the protoimage, z 0 is the original latent vector, λ is a chosen weight parameter, and M (·, ·) is the cosine similarity, which can be expressed as With this objective function, we would like to restrict the search space to vectors along the walk around the hypersphere in the direction of the difference vector.
First, we initialize a vector q 1 to control the magnitude and forward/backward direction of the next step. We utilize a vector for controlling the hypersphere traversal to provide more robustness in the optimization. For each iteration, we find the difference vector between the current latent vector and the previous. For the first iteration, this is the difference between the recovered z 1 and original latent vector, z 0 . The vector, q k , is projected onto the difference vector and added to the previous vector. The new vector, z k+1 , is, then, projected onto the hypersphere. The loss is calculated using (6), and this loss is backpropagated through the network to update q k+1 . The entire algorithm is summarized in Algorithm 1.

Optimizing for Improved Images
With the protoimages found, improving any randomly generated image is simply a matter of pushing the latent vectors towards the latent vectors corresponding to the protoimages.
This can be accomplished with an easy linear interpolation between the original latent vector z 0 and the protoimage latent vector, z p and then projecting the point onto the hypersphere.ẑ where the value of σ controls the proximity to the original latent vector and the protoimage latent vector. While setting a constant σ can yield a decent balance between fidelity improvement and variation as seen in Fig.  6, we recognize that certain images need more improvement and some minor improvements to already good images are not worth the reduction in variation.
To automate the balance between fidelity and variation, we optimize for the linear interpolation coefficient, σ. The discriminator is trained to discriminate between real photos and generated images. With the Wasserstein loss [1], the discriminator acts as a critic, providing higher scores for real images and lower scores for images that are believed to be fake. As the image quality of generated images improves, the discriminator score improves. However, as the improved images begin to lose variation, the discriminator score drops again due to the minibatch standard deviation layer. While one option would be to find the σs which provided the highest discriminator score for a batch of images, the optimization tends to favor the extremes, bringing some values of σ up very high towards 1 but dropping σ for other images to counteract for the loss of variation.
To derive a criterion that is beneficial for most images, we instead bring the discriminator score to the middle ground between scores given for real images and scores given for poorly generated images. We find bringing the discriminator score towards this center value allows the optimization to find values of σ that balance realism and variation. Thus, we set the objective to minimize the meansquared L2 norm of the discriminator score vector. For a set of k original latent vectors Z 0 ∈ R k×n and the protoimage vectors Z p ∈ R k×n where each row is a vector, we can define the optimization problem as σ * = arg min where σ ∈ [0, 1] k is a vector of linear interpolation coefficients with elements σ i , Z p,i is the i th row of Z p , and Z 0,i is the i th row of Z 0 . Results of the optimization can be seen in Fig. 6 along with the resulting values of σ. It can be

Experimental Results
We apply our framework to a multitude of experiments to evaluate the effectiveness of the image quality improvements, the possible use cases, and the limitations of our method.
For the latent vector recovery, we use an Adam optimizer [20] with learning rate of 0.01, β 1 = 0.9, and β 2 = 0.999. The α and β coefficients from equation 5 are set to 2 and 1, respectively. For the initialization, we randomly generate 1, 000 latent vectors and chose the latent vector with the smallest Euclidean distance to the original image in the feature space of the discriminator. In searching for the protoimages, we use an Adam optimizer with a learning rate of 0.1, β 1 = 0.9, β 2 = 0.999, and a λ of 3. This algorithm must be applied to a batch of latent vectors in order for the minibatch standard deviation layer to give the protoimages small discriminator scores. Finally, for finding the linear interpolation coefficient, we use a learning rate of 0.01 and set the initial values of σ to 0.7, again with an Adam optimizer of the same β 1 and β 2 .

Quantitative Evaluation
To evaluate the improvement of image quality and balance of image variation, we compare the Frechet Inception Distance (FID) score [12] of several variations. In Table 1, we compare two popular GANs with and without our proposed optimization with three datasets. For the truncation trick, we take the best score given for a sequence of threshold values from 0.1 to 1.0. Similarly, for our method, we take the best score given for a series of σ values, which gives the top score along the path towards the protoimages. We also compare our method to the top score along the direction found using the supervised approach of [29] [29]. (b) The progression along our prescribed direction. We illustrate both a differentiation from [29] as well as comparable visual performance even without supervision.
CelebAHQ1024x1024 [17] dataset. Our algorithm successfully improves the FID score (by making it smaller) of the original GAN without making any changes to the network itself, and we outperform the truncation trick for all datasets and networks. Surprisingly, we are able to improve upon the performance of [29] even though our method is completely unsupervised. Qualitative comparisons can be seen in Fig.  7. This result shows that the proposed algorithm consistently improves FID across different GANs and datasets.

Attribute Control
We explore if we can apply our framework to retrieve higher-quality images with a particular attribute using one of the methods described in Sec. 2.2. Following the same procedure as [27], we find a set of generated images with a particular attribute and a set without the attribute. By taking the difference vector between the mean vectors of both sets, we can obtain a vector which adds or subtracts the attribute Figure 8. Controlling image attributes. We show the compatibility of our proposed method with an attribute control method [27]. By first adding or subtracting the "male" vector to a randomly generated image and then applying our method, we are able to obtain high-fidelity images of a particular gender. from a given image. However, the method in [27] does not necessarily result in realistic images. Thankfully, by applying our method on the resulting images, we can drastically increase the image realism while preserving the target attribute.
To demonstrate this, we found a set of 100 generated images of males and 100 generated images of females. By adding the difference vector between the set averages, we can make any randomly generated image into a male. By subtracting the vector, the resulting image is of a female. Then, we apply our method to improve the photo-realism. Figs. 8 shows qualitative results of our experiment, compared to Figs. 8(b) and 8(c). We can see a significantly improvement in image realism with target female/male attribute preserved when using our proposed algorithm.

LSUN Church Dataset
To evaluate the scope of our framework, we investigate the structure of PGAN trained on another dataset, the LSUN Church Dataset [34]. As the structure of the church set is much more complex than the CelebA set, we found the latent vector recovery to be much more sensitive to the initialization of the latent vector than in the CelebA set. To provide more consistent performance, we trained and utilized an encoder using the procedure of [2]. The encoder is able to provide a very good initial vector, and our optimization method brings the recovered image to nearly the same as the original.
As with the CelebA set, we see a similar structure in the latent space with the presence of protoimages. Following the same framework, we are able to find images of improved realism, which maintain most of the features of the original images. The outcome of this is shown in Fig. 9.

Other Architectures
We further explore the scope of our proposed algorithm as it applies to other GAN architectures. We start with one of the simplest convolution GAN, DCGAN [27].
We trained a DCGAN on the CelebA dataset for 10 epochs with a 512-dimensional generator latent space to match the dimensions of the PGAN latent space. Applying our latent vector recovery algorithm and traversing the latent space as described in Section 3.2, we identify the presence of protoimages. Because the underlying space of faces is not as well estimated in DCGAN compared to PGAN, the protoimages are not as distinct as those found in the PGAN latent space. The protoimages are more blended, so the image quality does not necessarily improve as the latent vectors approach the protoimage latent vectors.
Training with the WGAN-GP loss [11], the network provides more distinct protoimages. As seen with the PGAN, the images improve as they approach the protoimages, resembling more of a face when the original image is distorted. Results of our framework with the WGAN can be found in the Fig. 9.
While we have focused on enhancing the applicability of low-complexity networks, another branch of GAN accessibility is making the most of existing networks. Thus, we investigate the generalizability and utility of our method by applying it to BigGAN [4] pretrained on ImageNet [6]. For the latent vector recovery procedure in Sec. 3.1, we leave the class-conditional code fixed when searching over the latent space. Performing the walk as in Sec. 3.2 reveals a similar behavior as before with image realism improving until the walk reaches a protoimage. Examples can be seen in Fig. 10. This illustrates the generality of the latent space direction we define. Without a minibatch standard deviation layer in the discriminator, our method can be simplified to a user-controlled manipulation as in [29,30,33,9,32] allowing users to specify the amount to travel in our discovered direction.

Conclusion
We presented a novel method for navigating the GAN latent space to increase the photo-realism of images. While previous work has achieved improvements through increasing the model complexity, our framework improves photorealism on even shallow networks. Paired with the ability to control the attributes of generated images, we provide new insights into the structure of GAN's latent space by demonstrating the existence of protoimages. By understanding the structure of the latent space, we open opportunities to manipulate the structure during training in order to provide higher-realism and improve class variability. We showed the effectiveness of our method with different architectures and different datasets. The results presented above show great improvements on realism, especially in datasets with controlled pose structure such as faces as protoimages resemble the object itself.

S1. Summary
In Section S2, we prove that a high-dimensional Gaussian distribution is a soap-bubble. Section S3 discusses the traits of the protoimages and show examples of the protoimages for different datasets. Section S4 provides implementation details of our method with different architectures and datasets. Section S5 describes variations of our method that can improve speed and user control. Finally, Section S6 includes additional images of our results with more sideby-side comparisons of randomly generated images and our optimized output.

S2. Proof for High-dimensional Gaussians
As previously mentioned, the majority of the probability mass of high-dimensional Gaussians lie within a thin shell of a hypersphere. Due to this phenomena, our method of traversing the latent space becomes a simple walk along the great circles of a hypersphere. Here, we provide a formal proof of this mathematical fact. Let X = [X 1 , ..., X n ] where X i ∼ N (0, 1) are i.i.d. Denote the norm of this vector as Q follows a chi distribution with variance where E[·] denotes the expected value. The variance for a chi distribution tends toward 1 2 for large n, which gives Thus, the norm of X follows a distribution with a mean of approximatedly √ n and a very small variance, proving that X must have the majority of its probability mass in a thin shell around a hypersphere of radius √ n. Additional and alternate proofs can be found in [3,29,25].

S3. The Protoimage
Here we present a more detailed discussion and analysis of the protoimages. These images serve as a step in our method of improving image realism, but their existence and qualities are interesting in themselves, warranting further study.
By following our procedure for traversing the latent space in Section 3.2 of the main paper, we are able to observe the protoimage along the path around the hypersphere. This effect can be seen in Fig. S1. The protoimages are very similar in appearance and seem to represent a sample mean. Despite the similarity between these images, the corresponding latent vectors are distinct and a large distance from one another. As we approach the protoimages, we can observe an improvement in image fidelity. The protoimages are observed in the same iteration of the traversal, and the proceeding iteration yields a new identity or scene, as shown in the last row of Fig. S1. Additionally, we observe that the protoimages take the attributes of the majority class within the training set. For the CelebA dataset, the protoimages are all female as the dataset contains more images of female celebrities than male. Likewise, the protoimages of the LSUN Church dataset are images of white churches as the majority of churches in the dataset are white. Interestingly, we observe changes in the protoimages for PGAN trained on different resolutions of CelebAHQ. For Cele-bAHQ 512x512, the protoexhibit the same behavior as previously described. For CelebAHQ 1024x1024, the protoimages start to include a unique artifact, Fig. S2. Despite the presence of the artifact, we do find that moving towards the protoimage still improves the realism of the face but warrants earlier stopping along the path.

S4. Implementation Details
We outline the different hyperparameters used for different networks and datasets. For the PGAN with CelebA, we used α = 2, β = 1, λ = 3. For the PGAN with LSUN Church and Train, we used the same values for α and β but set λ = 5. For the PGAN with CelebAHQ, we used α = 10, β = 1, and λ = 100. While using BigGAN pretrained on ImageNet, the hyperparameters were α = 15, β = 1, and λ = 100. When searching for the protoimage with WGAN-GP trained on CelebA, we found we needed to add two addition terms to the loss function to prevent overshooting the protoimage. For this case, we add a term for the standard deviation of the discriminator scores and standard deviation of the cosine similarity between the original latent vectors and the current latent vectors in the batch. This allows the latent vectors to move along the hypersphere at a similar pace, which makes the detection of the protoimages more apparent. For a set of k original latent vectors Z 0 ∈ R k×n and the protoimage vectors Z * p ∈ R k×n where each row is a vector, the optimization can be refined as +γ std(D(G(Z p )) + δ std(M (Z p , Z 0 )) (S4) where γ and δ are hyperparameters, M (·, ·) is the pairwise cosine similarity as before, and std(·) is the standard deviation. We set λ = 0.2, γ = 1, and δ = 3.
We used the PGAN and WGAN-GP implementations from https://github.com/ facebookresearch/pytorch_GAN_zoo.git. The model weights for CelebA, CelebAHQ256, and CelebAHQ512 were taken from the same repository. Figure S1. Here we show the progression as we traverse the latent space. The image quality improves as we approach the protoimages marked in red. Note the similarity of the protoimages. We see the step after the protoimages shows a completely different identity or scene. Figure S2. We observe a similar traversal progression with larger resolution datasets such as CelebAHQ512 and CelebAHQ1024. The 1024x1024 dataset presents unique artifacts to the protoimages; however, the preceeding images still improve in realism.
The weights for CelebAHQ1024 and all LSUN datasets were ported from https://github.com/tkarras/ progressive_growing_of_gans.git. The weights were converted from Tensorflow to PyTorch. For BigGAN, we used the author's PyTorch implementation at https://github.com/ajbrock/ BigGAN-PyTorch.git. All networks and our method were capable of running on a single NVIDIA RTX 2070 graphics card.

S5. Method Variations
In Section 3.4 of the main paper, our method finds the latent vector of the protoimage for each starting sample. While this is effective, we alternatively find that the procedure can be simplified for applications to a large number of samples. Instead, we can find the protoimage latent vectors for a subset of 1000 images and calculate the mean latent vector. Then, we can apply the procedures in Section 3.2 or 3.4 to move the samples towards the mean latent vector. This results in a similar improvement in photo-realism while reducing the required computational load.
The optimization in Section 3.4 can be further controlled by the user by defining bounds on the value of σ. If the user wants to guarantee some level of change in the image without allowing the image to get too close to the protoimage, they can place an lower and upper bound on the value of σ. During the optimization, σ would simply be projected back into the set if it were to exceed the bounds. We find this variation to be a balance between full user control as in [29,30,33,9,32] and our automated method.

S6. Additional Figures
In Fig. S3, S4, S5 we show a set of results on the CelebA, LSUN Church, and LSUN Train dataset. We randomly generate 30 images and show the resulting output from our framework. The results show a balance of improving the realism while not allowing all the images to converge to the protoimages. As a result, not all of the images experience a large transformation. The framework yields better results for datasets with objects of consistent structure such as faces; however, it is still able to improve images of datasets with more variety as seen with the churches and trains. Figure S3. A set of 30 randomly generated images from a PGAN pretrained on CelebA with the corresponding output of our method. Figure S4. A set of 30 randomly generated images from a PGAN pretrained on LSUN Church with the corresponding output of our method. Figure S5. A set of 30 randomly generated images from a PGAN pretrained on LSUN Train with the corresponding output of our method.