Elamur Research

Improved Techniques for Training GANs

Paper · 2016 · Tim Salimans, Ian Goodfellow, Wojciech Zaremba et al.

Summary

A generator can learn to make a convincing image and still fail at the job it was trained to do. If many different inputs lead to nearly the same output, the generator has found something that looks real without learning the variety of the data. Training a generative adversarial network, or GAN, can also get stuck in a cycle. The generator changes in response to the discriminator that judges its samples, and the discriminator changes in response to the generator. Each can improve against its current opponent while their joint behavior stays far from equilibrium. The authors develop practical ways to change the signals exchanged during training and test them on image generation and classification with scarce labels.

The most effective change depends on the task. For classification, the authors train the generator by feature matching. It tries to reproduce the average responses of an internal discriminator layer to real images, giving it a target beyond the discriminator’s latest verdict. For image generation, minibatch discrimination lets the discriminator compare examples within a group. It can then detect repetition that would be hard to spot from any individual image. The other changes act on different parts of training. Historical averaging penalizes movement away from earlier parameter values, one-sided label smoothing softens the target for real examples, and virtual batch normalization gives the generator a fixed reference batch.

On MNIST, CIFAR-10, and SVHN, the authors report state-of-the-art results for semisupervised classification. The best-looking MNIST digits came from the minibatch approach, which yielded a weaker classifier than feature matching. Mechanical Turk workers distinguished the generated digits from dataset images in 52.4% of judgments, close to the 50% expected from guessing. On CIFAR-10, workers made errors on 21.3% of judgments when shown a mix of real and generated images. At 128 × 128 resolution on ImageNet, the improved system generated recognizable details such as fur, eyes and noses. Their arrangement often failed to make an anatomically plausible animal.

The paper also introduces the Inception score, which uses an image classifier to assess whether individual samples contain recognizable objects and whether a collection of samples covers a variety of predicted categories. In the CIFAR-10 test, workers found it harder to identify generated images after the authors selected the highest-scoring samples. This gives the score a practical check against human judgments under the conditions of that experiment. The paper’s advances are empirical. The techniques make difficult training runs productive and give researchers another way to compare samples, while convergence and the relationship between realistic generation and accurate classification remain open questions.

Deep dive: Improved Techniques for Training GANs

Improved Techniques for Training GANs introduces ways to stabilize adversarial training and evaluates them on image generation and classification. · about 37 minutes to read

The problem and its context

Two learners change the task for each other

The original GAN framework turns learning to generate data into an interaction between two networks. Imagine a collection of real images and a generator that initially produces images by transforming random input. A discriminator sees images from both sources and learns to estimate which source produced each one. Its decisions provide feedback to the generator. As the generator changes its output, the examples the discriminator needs to recognize also change. The aim is to learn a generator that produces images distributed like those in the real collection. The framework comes from Generative Adversarial Nets.

This procedure makes the discriminator a source of information about features the generator should reproduce. Early in training, simple differences between the two sources may give the discriminator everything it needs. Once the generator reproduces some of those properties, distinctions that were previously irrelevant may start to matter. The training signal can therefore adapt to the generator’s current shortcomings. That adaptation also makes the optimization difficult. Each update can change the objective the other network effectively faces when it takes its next step.

The paper frames training as a game with a separate cost for each player. A Nash equilibrium is a pair of parameter settings at which each player minimizes its own cost with the other player’s parameters held fixed. Improving a cost against the current opponent is a much narrower condition. A discriminator update can make the generator’s cost worse, and a generator update can make the discriminator’s cost worse. A trace in which both players regularly find locally favorable moves can therefore continue without settling into a pair of mutually satisfactory settings.

The authors illustrate the problem with a game whose players control scalar variables. One tries to decrease their product by changing the first variable, and the other tries to increase the same product by changing the second. The paper describes gradient descent as orbiting the equilibrium in this example. The variables are simple enough that the location of the equilibrium can be written down, yet the direction that helps each player in the moment fails to bring the pair there. The example motivates the training changes. A GAN adds continuous, high-dimensional parameter vectors and non-convex costs, so the authors know of no feasible general equilibrium algorithm for the game they want to solve.

Collapse is a different failure visible in the generated samples. Several noise inputs can produce similar images, and a discriminator that judges images independently may give each of those images a similar direction for improvement. The generator can respond by sending even more inputs towards the same image. Once their outputs coincide, correcting the discriminator’s judgment of that image gives the generator a reason to move it. Each coinciding output can receive the same correction. The output may change over time while the generator continues to produce too little variety. A succession of changing images during training can therefore coexist with repetition among images drawn at any given point.

Earlier work supplied parts of the solution

The authors describe a field in which adversarial generation was already capable of producing excellent examples. Earlier research had improved sample quality and training stability, and the new paper retains some architectural choices from deep convolutional GANs, or DCGANs. One of those precedents was the successful use of batch normalization. The authors revisit it because a computation based on a batch can have different consequences for a network that judges images and one that draws them. Their architectural starting point is Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks.

Feature matching also has a precedent in work on maximum mean discrepancy. The paper describes an affinity with methods that train a generator by comparing statistics of real and generated data. Its own construction gets the statistics from a discriminator already learning to separate the two sources. The comparison changes as that discriminator learns. The role of a learned representation is central here because a difference between two image collections is helpful to the generator only to the extent that the selected statistics express it.

Other techniques have separate origins. Historical averaging takes loose inspiration from fictitious play, an approach used to find equilibria in other kinds of games. Label smoothing was already a classifier technique. It replaces hard targets with less extreme values. Earlier work discussed by the authors linked smoothing to reduced vulnerability to adversarial examples. The question in a GAN concerns how this intervention affects the generator as well as the classifier receiving the softened targets. The paper considers the consequences of changing the target on each side of the real-versus-generated distinction.

Semisupervised learning was also an existing application of deep generative learning and of GANs. In this setting, the supervised task is to assign a category to an image, but many training images arrive without category labels. A classifier can learn the mapping from the labeled examples. The research question is whether access to the larger image collection, together with a generator, helps it estimate that mapping more accurately. Earlier categorical adversarial work also supplied a point of comparison for the paper’s later use of classifier predictions to evaluate samples.

These precedents lead to two different tests of progress. One concerns whether a person looking at a generated image will take it for real. The other concerns whether an image classifier trained with limited labels will assign the right class on its test set. A visually convincing sample can be poor evidence about what a discriminator has learned for classification. A discriminator useful for classification can, in turn, supply training features to a generator whose images look visibly artificial. The paper studies both outcomes because they ask different things of the interaction between the networks. Its experiments are organized around those outcomes, with test-data likelihood outside the stated objective and category labels available where the setup uses them.

The method, step by step

Set up the generator and discriminator

The generator starts from a random vector. Its parameters determine what image that vector becomes. Drawing different vectors and applying the same network produces a distribution over images. The discriminator takes an image as input and assigns it a score for coming from the real data. The networks learn from different information. The discriminator knows the source of each training image it receives. The generator gets its feedback through computations performed by the discriminator.

x = G(z; θᴳ)

Here z is the random input vector, θᴳ denotes the generator parameters, G is the generator and x is the resulting image. The semicolon separates the input to the network from the parameters that determine its transformation. Repeated draws of z induce the generated image distribution, denoted below by p_G.

Jᴰ(θᴰ, θᴳ), Jᴳ(θᴰ, θᴳ)

The two expressions are the discriminator cost Jᴰ and the generator cost Jᴳ. The superscript D identifies the discriminator and G identifies the generator. Each cost can depend on both parameter vectors, θᴰ and θᴳ. At an equilibrium the discriminator parameters minimize Jᴰ with the generator fixed, and the generator parameters minimize Jᴳ with the discriminator fixed.

Jˣ = xy, Jʸ = −xy

In the orbit example, x and y are scalar choices controlled by their respective players, distinct from the image input denoted by x elsewhere. The cost Jˣ belongs to the player changing x, and Jʸ belongs to the player changing y. Juxtaposition denotes multiplication and − reverses the sign. The desired equilibrium is at x = y = 0. The gradient recommendations depend on the other player’s current choice, so the pair of updates can move around that point.

The training changes act at several locations in this setup. Feature matching changes the generator’s objective. Minibatch discrimination adds a source of information for the discriminator. Label smoothing changes a target presented to the discriminator, virtual batch normalization changes how the generator processes its inputs, and historical averaging adds a cost to parameter movement. The paper uses different combinations across experiments. The route below follows the feature-matching setup for semisupervised classification, where labeled images, unlabeled images and generated images each have a role.

Semi-supervised GAN training with feature matching

The steps in order.

Semi-supervised GAN training with feature matchingStep 1: Draw noise and produce generated images1. Draw noise and produce generated imagesStep 2: Collect labeled and unlabeled real images2. Collect labeled and unlabeled real imagesStep 3: Predict real categories and a generated category3. Predict real categories and a generated categoryStep 4: Train the classifier on labels and image sources4. Train the classifier on labels and image sourcesStep 5: Compare average internal features across sources5. Compare average internal features across sourcesStep 6: Update the generator to bring feature averages closer6. Update the generator to bring feature averages closer

Train the generator to match features

Under ordinary adversarial feedback, the generator tries to make the discriminator accept its outputs as real. Feature matching gives the generator a different target. The authors choose an intermediate discriminator layer and calculate the average of its activations on real images. They calculate the same average on generated images and update the generator to shrink the gap. An activation is a numerical response produced by a unit in a layer. Taken together, the activations form a vector describing how the layer responds to an image.

‖ E[x ∼ p_data] f(x) − E[z ∼ p_z] f(G(z)) ‖₂²

The function f returns the discriminator’s intermediate activations, x denotes a real image, and p_data is the real-data distribution. The random generator input is z, drawn from the noise distribution p_z. The expression G(z) is the generated image with the current generator parameters understood. Each E indicates an expectation, or a distributional average, over the draws identified in brackets. The difference inside the bars is a vector of gaps between corresponding average activations. The squared Euclidean norm ‖ · ‖₂² sums the squares of those gaps. The generator seeks to minimize this quantity.

For example, suppose a discriminator layer responds differently to two collections of images because a certain feature occurs more frequently in one collection. Matching the average gives the generator a reason to change how frequently its outputs elicit that feature. There is no need to assign each generated image a particular real image to copy. Both averages refer to populations, and generated examples can contribute to the average in different ways. This gives the generator a training signal defined by the collective behavior of its samples.

The discriminator still learns its own task. Updating the discriminator can change the layer responses and hence the statistics the generator is asked to match. The motivation is that a network separating real and generated images learns features relevant to the current gap between their distributions. The generator can then learn from those features without directly pursuing the discriminator’s final output. If both image distributions agree, their expected responses to the same layer agree. The reverse inference is unavailable from the feature means alone. Collections that differ elsewhere can give the same averages for the chosen activations. The existence of the desired fixed point therefore leaves open whether the updates will reach it.

Let the discriminator recognize repetition

Minibatch discrimination puts the comparison across images inside the discriminator. A minibatch is a group of examples processed together. With an independent judgment for each member, the discriminator may see an individually plausible image and have no indication that the generator has produced many nearly identical ones. The authors give later layers access to how close an image is to others in the group. Their implementation learns several ways to measure closeness, all based on an internal feature vector.

f(xᵢ) ∈ ℝᴬ, T ∈ ℝᴬˣᴮˣᶜ, Mᵢ = f(xᵢ)T ∈ ℝᴮˣᶜ

The image with index i is xᵢ. The function f maps it to an intermediate vector of length A. The tensor T is a learned array of weights with dimensions A, B and C. Multiplying along the shared A dimension gives Mᵢ, a matrix whose B rows each have C entries. The symbol ∈ indicates membership and ℝ indicates real-valued entries. The dimension markers in the superscripts describe the shapes of the vector, tensor and matrix. Each row of the matrix is a learned projection of the image features used for a separate comparison.

c_b(xᵢ, xⱼ) = exp(−‖Mᵢ,ᵦ − Mⱼ,ᵦ‖₁)

The expression c_b is the similarity for comparison row b between images xᵢ and xⱼ, whose indices are i and j. The row vectors at that position are Mᵢ,ᵦ and Mⱼ,ᵦ. The norm ‖ · ‖₁ adds the absolute coordinate differences. The function exp takes the exponential of the negative distance, so closer rows produce larger similarities. This transformation makes near neighbors contribute more strongly to the subsequent sum.

o(xᵢ)ᵦ = ∑ⱼ₌₁ⁿ c_b(xᵢ, xⱼ)

The component o(xᵢ)ᵦ summarizes the similarities of image xᵢ for row b. The symbol ∑ adds the terms indexed by j, from 1 through the batch size n. The displayed sum includes j = i, whose self-similarity contributes the same amount for every image. Differences between the outputs come from comparisons to the other images.

o(xᵢ) = [o(xᵢ)₁, o(xᵢ)₂, …, o(xᵢ)ᴮ] ∈ ℝᴮ

Here o(xᵢ) collects the similarity sums for image xᵢ across the B comparison rows. The numbered components indicate their order and the ellipsis stands for the intervening components. The vector has B real entries. Each sum can be large or small independently, so the discriminator receives more information than a single average distance would supply.

o(X) ∈ ℝⁿˣᴮ

The symbol X denotes the batch of images and o(X) stacks the vectors for those images. Its shape has n rows, one per example, and B columns, one per learned comparison. The discriminator appends each image’s vector to the individual features it already had for that image and passes the combined features to its next layer.

The comparisons operate separately within batches of generated images and batches of real images. An image’s score can thus reflect whether it is surrounded by similar examples from the same source. The final discriminator judgment is still made for each image, with the neighboring images supplying context. Because the comparison features enter the discriminator before its decision, the generator receives feedback through a decision that can depend on the relationships among its outputs. That gives the game a way to respond to groups of overly similar images before the generator reaches complete collapse.

Penalize drift from past parameters

Historical averaging adds a penalty separately to each player’s cost. To construct it, the training procedure keeps an average of the player’s earlier parameter vectors. A current setting far from that average incurs a larger cost. This gives the update a reference that changes with the trajectory of the network and incorporates information from earlier than the immediate opponent response.

‖ θ − (1/t) ∑ᵢ₌₁ᵗ θ[i] ‖²

Here θ is one player’s current parameter vector, and θ[i] is its value at the historical time indexed by i. The sum runs from 1 to t, the number of parameter values included. Multiplying by 1/t gives the historical mean. The squared norm measures the distance from that mean. The running average can be updated online, which avoids retaining the entire series of parameter vectors. The reference here is an average of parameters, as distinct from the averages of image features calculated by feature matching.

The paper tests the idea on small games. One of them changes the relation between a player’s choice and the objective on different sides of zero.

(f(x) − 1)(y − 1)

This is the value of the toy minimax game. The two players control x and y respectively, and their objectives oppose one another. The function f transforms x before the subtraction of 1. The factor involving y is y shifted by 1. The juxtaposed factors are multiplied.

f(x) = x for x < 0; f(x) = x² otherwise

The function f returns the input x when x is below 0 and its square when x is at or above 0. The squared branch gives the game a different shape across those regions. The paper uses this game to examine whether the historical penalty can change behavior when straightforward gradient updates keep circling.

Smooth the target for real images

A binary discriminator ordinarily learns from a positive target for a real image and a negative target for a generated image. Label smoothing gives one or both types a less extreme numerical target. The paper mentions .9 and .1 as examples of softened targets. It analyzes what happens to the optimal discriminator when these two targets can vary independently.

D(x) = [α p_data(x) + β p_G(x)] / [p_data(x) + p_G(x)]

The function D gives the discriminator output for image x at the optimum described in the paper. The target for a real example is α, and the target for a generated example is β. The values p_data(x) and p_G(x) are the respective real and generated densities at x. The numerator weights each source density by the target associated with its source, and the denominator is the combined density. Where both sources supply examples, the target seen by the optimal discriminator depends on their relative contributions.

Consider a region that contains many generated outputs and almost no real images. In that region the generated density dominates the expression, and a positive β lets the optimal discriminator give credit on the strength of those generated examples themselves. The authors argue that this takes away pressure for erroneous samples in such a region to move toward the data. Their version softens the real target to α and keeps β at 0. The distinction matters because changing the discriminator’s training targets also changes what the generator learns from the discriminator.

Normalize generator inputs against a fixed reference

Batch normalization uses statistics computed over a group of inputs when transforming activations. It can improve optimization, but it also creates dependencies between the outputs for different members of the group. For a generator, the image produced from a particular noise vector can depend on the other noise vectors drawn alongside it. The authors want the generator’s computation for a given input to have a consistent context across batches.

Virtual batch normalization chooses a reference batch at the start of training and keeps its membership fixed. The reference is normalized using its own statistics. A new example is normalized with statistics formed from the reference and that example itself. Accordingly, replacing other new examples in the ordinary minibatch leaves this example’s normalization context alone. The fixed membership concerns which inputs make up the reference. Their internal activations are computed by the network as it trains.

The procedure costs extra computation because it requires forward passes for both the reference and the batch being processed. The authors reserve it for the generator. The distinction from minibatch discrimination is functional. The discriminator can benefit from adapting a judgment to other images currently under inspection. The generator uses a fixed reference to avoid dependence on which other fresh inputs happen to accompany its own input.

Give the classifier a place for generated images

For semisupervised classification, the starting point is a network with one output score per real category. A score before normalization is called a logit. Softmax converts the logits into probabilities by exponentiating each score and dividing by the sum of the exponentiated scores. A larger logit gives its class a larger share of the total.

p(y = j | x) = exp(lⱼ) / ∑ₖ₌₁ᴷ exp(lₖ)

The image is x, its category is represented by the random variable y, and j identifies the category being scored. The symbol lⱼ denotes that category’s logit for x. The function exp is the exponential. The denominator sums the exponentials of the logits lₖ over the index k from 1 to the number K of real categories. The vertical bar means the probability is conditional on the input image. This is the ordinary classifier before the generated category is added.

The authors extend the same softmax to K + 1 outputs. The added category represents generated images of any content. A real image with a known label can teach the network its specific category. A real image without a known label can still teach the network to put probability somewhere among the real categories. A generated image supplies a target for the added category. In this way the training objective can use the provenance of an unlabeled real image even though its correct digit or object category is unavailable.

L = −E[(x,y) ∼ p_data(x,y)] log p(y | x)
    −E[x ∼ G] log p(y = K + 1 | x)

Here L is the classifier’s combined loss under the paper’s equal weighting of the real and generated sources. In the first expectation E, the pair (x,y) is drawn from the real joint distribution p_data(x,y). The label variable is y, and p(y | x) denotes the classifier’s probability for that label using the expanded set of outputs. In the second expectation, x ∼ G means that x comes from the generator. The generated category is indexed by K + 1. The function log is the logarithm. The minus signs turn lower probabilities for the corresponding targets into higher costs.

L = L_supervised + L_unsupervised

This decomposition writes the total classifier loss L as the sum of a category-label term L_supervised and a source-classification term L_unsupervised. An image can contribute evidence about its source independently of what is known about its category. The decomposition makes that information explicit.

L_supervised = −E[(x,y) ∼ p_data(x,y)] log p(y | x, y < K + 1)

The supervised loss L_supervised averages over real image and label pairs (x,y) from the joint distribution p_data(x,y). The expected negative log probability is computed using the classifier’s prediction p conditional on both the image x and membership in a real class. The condition y < K + 1 excludes the added category from the normalization for this term. In practice the category label required for this expectation comes from the labeled part of the training data.

L_unsupervised = −{ E[x ∼ p_data] log[1 − p(y = K + 1 | x)]
                   + E[x ∼ G] log p(y = K + 1 | x) }

The loss L_unsupervised uses real images x from p_data and generated images x from G. The classifier probability p(y = K + 1 | x) assigns the image to the generated category, and subtraction from 1 gives its total probability of belonging to the real categories. The expectations E average the corresponding logarithms over the two image sources. The outer negation makes the source term smaller when real images get more real-category probability and generated images get more generated-category probability. Category labels for the real images play no role in this term.

L_unsupervised = −{ E[x ∼ p_data] log D(x)
                   + E[z ∼ p_z] log[1 − D(G(z))] }

This is the same unsupervised loss expressed through the discriminator. The score D(x) is the classifier’s total probability that image x belongs to a real category. The first expectation averages its logarithm on real images. In the second expectation, z comes from the noise distribution p_z, G(z) is the resulting image, and 1 − D(G(z)) is its generated-category probability. The substitution connects the classifier’s source task to the ordinary adversarial game.

The authors show that the supervised and unsupervised objectives admit a common optimum in terms of the underlying distributions. The next two expressions describe how the same scaling function can be used for both sets of outputs.

exp(lⱼ(x)) = c(x) p(y = j, x) for every j < K + 1

Here lⱼ(x) is the real-class logit for image x and class index j. The term p(y = j, x) is the underlying joint distribution of real images and their category labels at that image and category. The function c(x) is a common, undetermined scale, and exp converts the logit to the corresponding unnormalized softmax weight. The condition on j covers the real categories.

exp(lₖ₊₁(x)) = c(x) p_G(x), with k = K

The logit lₖ₊₁(x) in this expression is the generated-category logit, with k set to the total number K of real categories. The term p_G(x) is the generator’s density at x, and c(x) is the same scale as in the real-category expression. The joint distributions and the generated density determine relative weights, which is why the shared scale can remain undetermined. Compatibility at the optimum still leaves the practical question of whether the classifier learns more from a finite training set.

The extra output can be represented without a separately varying generated logit. Subtracting the same image-dependent quantity from every logit multiplies every softmax weight by the same factor. This factor cancels upon normalization. The authors use that freedom to set the generated logit to zero.

lⱼ(x) ← lⱼ(x) − f(x) for every j

The quantity lⱼ(x) is the logit for output index j at input x. The arrow indicates a reassignment of logits and f(x) is the same shift for all outputs. It is a scalar function here, distinct from the intermediate feature representation used in feature matching. Choosing it to be the original generated logit fixes that output at 0.

Z(x) = ∑ₖ₌₁ᴷ exp(lₖ(x))

The quantity Z(x) sums the exponentiated logits of the real classes at image x. The index k runs from 1 to K, the number of real categories. Each lₖ(x) is the corresponding logit after the common shift. This sum represents the total unnormalized weight for the real categories.

D(x) = Z(x) / [Z(x) + 1]

The score D(x) is the probability that image x is real. Its numerator Z(x) is the total real-class weight. The denominator adds 1, the exponential of the fixed generated logit 0. The same real-class logits can thus serve both supervised prediction and the adversarial source task.

The authors expect the source task to help when generated examples give the classifier a meaningful distinction to learn. If the examples were trivial to identify as generated, the source objective could be satisfied without learning much about the structure of the real classes. In the successful semisupervised runs, the generator learns from feature matching using the classifier’s internal activations. During training, the classifier learns to assign real categories and to distinguish sources, and its evolving features also determine what the generator is asked to reproduce. The paper treats the value of this interaction as an empirical question.

Measure recognizability and variety together

The automatic evaluation starts with a pretrained Inception image classifier. Each image x gives a predicted category distribution p(y | x), where y now refers to an Inception category. An image that produces a confident prediction has low conditional entropy, meaning that the probability is concentrated on relatively few categories. Across a varied collection of images, the authors expect the average prediction to have high entropy, with substantial mass distributed across categories.

p(y) = E[z ∼ p_z] p(y | G(z))

The distribution p(y) is the marginal distribution of predicted categories across generated images. The expectation E averages over noise vectors z drawn from p_z, and G(z) turns each of those vectors into an image. The conditional distribution p(y | G(z)) is Inception’s prediction for that image. This is the paper’s integration over generator inputs expressed as an expectation. Its empirical counterpart averages the classifier predictions for the sampled images.

Inception score = exp(Eₓ KL(p(y | x) ‖ p(y)))

The expectation Eₓ averages over images x from the collection being evaluated. The function KL is Kullback–Leibler divergence, which measures how a conditional category distribution p(y | x) differs from the marginal p(y) across the collection. The double bar separates the two distributions in the divergence. The exponential exp puts the averaged quantity on the reported score scale. For a set of real images, the same calculation uses the predictions on those images to form the marginal.

This comparison favors confident predictions that differ from the distribution across the collection. If every image elicits essentially the same confident category, its prediction will be close to the marginal, and confidence alone will yield little divergence. When images elicit confident predictions spread over categories, the conditional predictions can each differ substantially from the broader marginal. The authors emphasize the need for a large pool of images because the marginal is meant to reflect diversity. Their assessment discussion specifies 50k samples as an appropriate scale, and they use human judgments to check whether the score tracks an aspect of visual quality that people also notice.

Experiments and results

MNIST with few labeled digits

MNIST allows the authors to examine labeling scarcity and visual realism within the same image collection. It contains 60,000 labeled digit images. For semisupervised training the authors retain labels for 20, 50, 100 or 200 examples, depending on the setting. Each labeled subset has equal representation from the digit classes, and the remaining training images enter without their labels. The authors average the classification results over 10 randomly selected labeled subsets. The classification measure is the number of test examples assigned to the wrong class in the permutation-invariant setting.

Both networks have 5 hidden layers. The discriminator receives Gaussian noise at the output of each layer. The setup also uses weight normalization, an existing intervention that changes the parameterization of the network, distinct from virtual batch normalization. The cited method is Weight normalization.

The authors report state-of-the-art semisupervised classification and identify feature matching as the stronger of the two generator-training approaches for this purpose. The labeled subsets are deliberately balanced, so the comparison addresses learning from small labeled samples with class coverage built into the sampling procedure. The result is an average across draws. That setup matters because, with very few labeled images, a single choice of examples could give an unrepresentative picture of how well training works.

The generated digits tell a different story. Images drawn from feature-matching training were visibly distinguishable from dataset images. Minibatch discrimination produced samples that researchers at the authors’ institution could find no reliable visual artifacts to distinguish. On Mechanical Turk, the proportion of correct real-versus-generated judgments was 52.4%, based on 2000 votes. Random guessing would give 50%. This makes the result a near-chance judgment outcome for that test, alongside the authors’ visual assessment of the samples. The classification result used a digit label as its target, while the human test used the source of the image. The better approach depended on which target was being scored.

CIFAR-10 classification and visual judgments

CIFAR-10 is a natural-image dataset with images of size 32 × 32. The discriminator uses a convolutional network with nine layers and applies dropout as well as weight normalization. The generator is a convolutional network with 4 layers. The architecture description uses batch normalization for the generator, and the sample-quality comparison distinguishes the full configuration using virtual batch normalization from a variant using ordinary batch normalization. The semisupervised metric is test classification error, averaged over 10 splits. The authors report state-of-the-art performance for that task.

For visual evaluation, the authors used an interface through which Mechanical Turk workers judged whether images were real or generated. On a mix containing 50% real and 50% generated images from the authors’ best CIFAR-10 generator, workers were correct on 78.7% of judgments. The corresponding human error rate reported by the paper is 21.3%. The authors themselves attained >95% accuracy on the distinction. Two groups could therefore draw very different performance estimates from the task. The authors discuss familiarity with the dataset and motivation as possible explanations for the workers’ lower accuracy.

They also tested the relationship between sample selection and human judgments. After filtering to retain only the top 1% of generated samples according to the Inception score, Mechanical Turk accuracy dropped to 71.4%. The direction of the change supports the authors’ use of the score as a guide to recognizability. In this comparison, a lower percentage means the workers found the real-versus-generated distinction harder.

Mechanical Turk real-versus-generated accuracy on CIFAR-10

Workers were less accurate after selection by Inception score.

Mechanical Turk real-versus-generated accuracy on CIFAR-10Unfiltered generated samples: 78.7Unfiltered generated samples78.7Generated samples selected by Inception score (this paper): 71.4Generated samples selected by Inceptionscore (this paper)71.4
The numbers
System or settingaccuracy %
Unfiltered generated samples78.7
Generated samples selected by Inception score (this paper)71.4

The star marks the setting in which the generator’s samples were harder for workers to distinguish. The chart compares two conditions of the human task. In the filtered condition, the score selects which outputs workers see, so the change gives evidence about selection from the generator’s output. The unfiltered condition describes the broader output stream used in the original test. The high-scoring slice can be especially convincing even if the same generator regularly produces easier examples.

The automatic evaluation also compares configurations directly. The authors calculate Inception scores using 50,000 images and include real CIFAR-10 images as a point of reference. The real images score highest. The full methods configuration uses the proposed techniques apart from feature matching and historical averaging. Switching its generator to ordinary batch normalization, removing label smoothing, removing training labels, and removing minibatch features give less favorable sample-quality outcomes. A further condition adds historical averaging to training without labels. These comparisons answer questions about which interventions contribute within that setup, alongside the human test of whether the score tracks perceived quality.

SVHN and ImageNet

The authors use an identical network architecture and experimental setup for both CIFAR-10 and SVHN. They report a semisupervised classification error comparison and include generated examples. The paper counts SVHN among the datasets on which its semisupervised results reach the state of the art. The sample figure supplies a visual counterpart to the error comparison. The reported human accuracy values come from the MNIST and CIFAR-10 tasks, while SVHN’s classification result addresses the performance of the learned classifier on its own dataset.

The ImageNet experiment changes both image resolution and the scope of the category distribution. The authors train on ILSVRC2012 images at 128 × 128 resolution across 1,000 categories. They describe the combination of resolution and number of categories as unprecedented to their knowledge. The number of categories matters to their argument because a generator prone to producing too little variety faces a collection with many visually distinct kinds of images. The implementation extensively modifies a publicly available TensorFlow DCGAN and uses multiple GPUs.

The DCGAN baseline learns some basic image statistics. It produces connected shapes and patches with relatively natural color and texture, without the authors seeing recognizable objects. Samples from training with the new techniques contain more legible animal details, including fur, eyes and noses. Those details frequently occupy spatial arrangements that would be strange for an actual animal. The comparison shows progress from texture and shape to recognizable parts and also makes the remaining problem of combining parts visible. It is a comparison of what appears in generated examples, with the evidence supplied by sample images and the authors’ descriptions.

The authors make code and hyper-parameters available through the improved_gan project. They describe the code as sufficient to reproduce most of the experiments. The paper’s evidence varies with the question under study. The classifier experiments evaluate prediction errors on held-out examples, the human experiments evaluate the recognizability of individual samples, and the ImageNet comparison shows what the trained generators can depict at the larger resolution.

What the ablations show

The strongest intervention depends on the outcome

The comparison between feature matching and minibatch discrimination is easiest to interpret on MNIST, where both the classification behavior and the visual difference are reported. The same adversarial setup can be judged by its ability to classify digits with sparse labels or by its ability to generate convincing digits. Feature matching gives the better classifier, even though the corresponding digits look artificial. Minibatch discrimination yields the near-chance human source judgments, even though semisupervised classification suffers by comparison.

This reversal provides evidence about the role of generated images in semisupervised training. A generator that produces attractive samples can be valuable for image synthesis. The discriminator in semisupervised training also has to learn a representation that separates the real categories. Improving the generated examples along dimensions important to a person inspecting them yields no direct estimate of the usefulness of the source task for learning those categories. The paper demonstrates a difference in the observed outcomes and leaves the mechanism of that difference open.

The authors also say minibatch discrimination produces attractive outputs quickly compared with feature matching. The CIFAR-10 figures place samples from both approaches side by side, allowing a visual comparison in a natural-image setting. That comparison supports the distinction between objectives used throughout the experiments. The classification experiments provide the basis for preferring feature matching for the semisupervised objective, and the visual tests provide the basis for preferring minibatch discrimination for the realistic-image objective.

Batch features, labels and normalization contribute differently

The CIFAR-10 ablations start from the image-generation configuration containing minibatch features, the label-based training setup, smoothing and virtual batch normalization. Feature matching and historical averaging are absent from that full configuration. This starting point is important because removing a component tests its contribution in the presence of the other choices. The scores also include a real-image reference, which places the generated conditions below the score obtained from natural images.

Removing minibatch features causes the largest loss among the component removals described by the authors, greater than the loss they attribute to removing the labels. The low scores occur in conditions that exhibit at least partial collapse. This fits the proposed role of the feature layer. The discriminator loses a direct measurement of repetition within the batch, and the resulting set of images fares worse on a metric that depends in part on the diversity of classifier predictions. The authors also report that adding historical averaging fails to prevent the problem in this setting. The two changes affect different parts of training. Historical averaging penalizes drift in the parameters, whereas the minibatch features make similarity among samples visible to the discriminator at the time of its decision.

The labels comparison concerns training labels, distinct from the Inception predictions used for evaluation. Removing training labels reduces sample quality. Adding historical averaging in the unlabeled setting allows the generator to recover some recognizable objects, while the unlabeled configuration without it produces worse samples. Comparing that pair of unlabeled runs gives the clearest indication in this series of what the historical penalty contributes. Comparing the run that both removes labels and adds averaging to the full configuration changes two things together. The series therefore supports a compensating role for historical averaging under the unlabeled condition.

The authors propose that labels encourage the discriminator to represent object identity in a way that aligns with what people look for in an image. A class-trained discriminator needs features that distinguish objects, and those features can affect how it evaluates generated examples. The ablation supports the practical contribution of training labels in this setup. The account of what changes inside the discriminator is an interpretation. The experiment changes the availability of labels and measures the consequences for samples, leaving the relative roles of particular internal features unresolved.

Removing label smoothing also produces a noticeable decrease in Inception score. This is evidence for the training choice as implemented in the image generator and discriminator. The separate optimal-discriminator analysis explains the asymmetry of the proposed targets. The ablation examines the effect of taking smoothing out, so the behavior of other choices of positive or negative targets remains a separate question.

Replacing virtual batch normalization with ordinary batch normalization causes a smaller decrease on CIFAR-10. Both settings retain normalization. Their comparison therefore bears on the choice between a fixed reference and ordinary batch statistics in the generator. The authors describe virtual batch normalization as more important for ImageNet, where the generation task operates at a larger resolution and spans more categories. The CIFAR-10 ablation provides the direct score comparison, while the relative importance on ImageNet is the authors’ assessment.

The auxiliary checks probe specific mechanisms

The historical-averaging toy games provide a more direct check of the movement of parameters than a set of images can. On the low-dimensional continuous games discussed in the paper, the historical penalty lets the training procedure reach equilibrium. Gradient descent on the same games produces extended orbits that fail to approach it. This comparison gives a concrete situation in which changing the cost by adding a historical term changes the trajectory. The image-generation experiments then supply a distinct observation about what the same technique can contribute to recognizable outputs when labels are removed.

The Inception score check has a different structure. The authors use the score to select examples and ask whether workers find the resulting images harder to recognize as generated. The decrease in worker accuracy supports the score as an aid to ranking visual outputs under this protocol. The real-image reference, the low scores observed in collapsed conditions and the examples shown for the ablations offer other ways to interpret the ranking. Together they connect the score to judgments about both individual recognizability and variety across samples. Each observation has a specific scope, and the paper also records conditions under which human judgments themselves change.

Limitations

Limits stated by the authors

The authors present the training interventions as heuristics. Feature matching has a fixed point at the desired distribution, and they explicitly leave reaching it in practice without a guarantee. Historical averaging helps in the toy games the paper discusses. The step to an equilibrium guarantee for high-dimensional GAN training remains open. A useful discriminator and a successful sample collection establish practical progress in a run even when the dynamics lack a formal explanation.

The paper also leaves a theoretical account of its semisupervised results for future work. The classifier and generator interact through the source objective and through the classifier’s changing feature representation. The compatibility of the supervised and unsupervised losses at an optimum is one property of the formulation. It leaves open which properties of the actual generator are helpful with a finite number of labeled examples, and why feature matching works so much better for classification in the tested setups. The proposed explanation about labels directing the discriminator toward features important to human observers is likewise left for further exploration.

Human judgment is sensitive to the conditions of the task. The authors observe that showing workers their mistakes makes them better at spotting generated images. The result depends on what workers can learn during the evaluation as well as on the images themselves. The authors also identify motivation and familiarity with CIFAR-10 as possible reasons their own performance differs from the workers’. These influences constrain how broadly to interpret any single human error rate.

The Inception score has an explicit intended use as a rough comparison among systems trained by an independent criterion. The authors warn that optimizing directly for it would produce adversarial examples, images that exploit a classifier’s responses. The images may earn the predicted confidence targeted by the objective while becoming less informative about visual realism. The warning is connected to earlier work on adversarial examples in Intriguing properties of neural networks.

The ImageNet examples expose a limitation in the generated content itself. The improved generator can produce recognizable animal parts, while the anatomy of the whole animal remains implausible. The result establishes recognizable features at the tested resolution. The arrangement of those features into coherent objects is a further capability that the samples show only imperfectly.

Limits visible in the experimental setup

The sample comparisons test specific configurations. In the CIFAR-10 ablations, the effect of removing a component depends on the other components that are still present. Replacing virtual with ordinary batch normalization answers a particular substitution question, for instance. It leaves the size of the effect under different generator objectives or architectures uncertain. The paper’s image-generation configuration also excludes feature matching and historical averaging, so the ablations give no basis for adding up all the techniques’ contributions as though they had been measured independently.

Human source judgments and Inception scores give partial views of image quality. The former depends on the workers and what they see. The latter depends on how a fixed classifier distributes category probability over an image collection. Variation that the classifier treats as irrelevant within a category may have little impact on the score. Conversely, confident predictions across different categories can support a high score even when people would find faults in particular images. The study provides an empirical check by filtering samples. The filtering experiment addresses the retained portion of the generator’s output, and performance on that portion leaves the broader output distribution to the unfiltered comparison.

The MNIST human result is tied to the sample of judgments and to the way the generated and real images were presented. A proportion close to guessing shows how difficult this particular discrimination task was for the workers. It leaves open how well observers could tell the images apart after receiving training or using a different interface. The same consideration applies to the stronger distinction achieved by the authors on CIFAR-10. It is evidence that an informed observer can be more successful in that setting, with the causes of the difference between annotator groups left unresolved.

The classification experiments test how access to additional unlabeled images helps on particular digit and natural-image datasets. On MNIST, balanced labeled subsets guarantee examples from each class. That design leaves open how the procedure behaves when some classes are poorly represented or absent from the labeled data. More generally, the reported test performance is evidence for the paper’s empirical choices. Agreement between the training objectives at their ideal solution cannot settle how sensitive the observed performance is to the data split, the classifier or the behavior of the generator.

The ImageNet comparison is informative about visible capabilities and their failures. A displayed animal part demonstrates that the generator can produce an example containing that part. Coverage across the full set of categories would require evidence about how often the generator produces their relevant visual features. An image gallery gives the reader a view of recognizable details and anatomical errors, while the breadth of coverage over the training distribution remains unquantified by that comparison.

What came after

Adversarial training across tasks

Later citing work pursued higher fidelity and considered other places to use generated images. One line of research made natural-image synthesis at large training scale its main goal. The point of contact is the earlier paper’s demonstration that the training setup can determine whether recognizable objects emerge at all. Its ImageNet comparison makes that concern tangible by showing the difference between plausible textures and plausible parts. Later work placed the scale of GAN training directly at the center of a study of image fidelity. Large Scale GAN Training for High Fidelity Natural Image Synthesis

In other work, the intended value of a generated image lies in what a classifier can learn from it. GAN-based medical image augmentation applies that idea to liver lesion classification. The connection is the use of a downstream classification objective to judge the contribution of generation. The role assigned to generated examples differs between the tasks. In the semisupervised GAN, they enter as an additional class and help construct a source prediction task. In the medical augmentation work, generating synthetic medical images is part of an augmentation strategy directed at classifier performance. GAN-based synthetic medical image augmentation for increased CNN performance in liver lesion classification

Another direction addresses learning from simulated and unsupervised images through adversarial training. The shared concern is how to draw a useful signal from images whose source differs from the target data or whose supervision is incomplete. In the earlier GAN paper, the discriminator organizes its training around the distinction between real and generated sources. The later work places simulated and unsupervised images at the center of the learning problem, extending the setting in which an adversarial distinction can matter. Learning from Simulated and Unsupervised Images through Adversarial Training

Cycle-consistent adversarial domain adaptation brings the distinction between sources into a domain adaptation problem. The original paper’s unlabeled examples belong to the real categories, and adversarial training supports a classifier for those categories. The later work treats adaptation across domains as the task and makes cycle consistency a part of its adversarial approach. It illustrates a different role for adversarial training in learning from distributions that a system has to relate to one another. CyCADA

Adversarial learning also appears in later work on neural dialogue generation. The connection is the idea of learning a signal for a generator through a task that distinguishes its outputs from another source of examples. With images, the paper can look for repetition, recognizable object parts and human source judgments. Moving to dialogue changes what the generated object is and what qualities would make it plausible in context. The citation links the adversarial framing across the two types of generation. Adversarial Learning for Neural Dialogue Generation

The search for ways to judge generated outputs

The evaluation problem also extends across output types. Work on measuring the gap between generated and human text using divergence frontiers makes comparison between populations of outputs its subject. The Inception score likewise uses statistics across a collection, with the average classifier prediction supplying the background against which each image’s prediction is compared. The two projects exemplify why judging samples entails asking something about the population as well as inspecting convincing members individually. The later work applies that broad question to text and frames the comparison through divergence frontiers. MAUVE

For text-to-image generation, the desired output is an image that faithfully depicts the content of an input text. One later evaluation approach addresses that goal through question answering. Recognizability matters to both evaluations, but it is used to ask different questions. Inception predictions let the earlier paper assess confidence and category variety. A question about the generated scene can assess whether it contains a particular element called for by the text. The later work makes this kind of faithfulness the object of evaluation. TIFA

Compositional text-to-image evaluation concentrates further on how elements occur together. The paper’s own ImageNet examples show why composition deserves attention. A generator can draw several recognizable parts and still combine them into a body with implausible anatomy. In a text-guided task the input can specify a particular composition, giving an evaluation benchmark a more explicit target for assessing the combination. Later citing work treats compositional performance as the organizing goal of its benchmark. T2I-CompBench++

These citations establish lines of contact through their stated tasks. The titles identify where the later studies placed their emphasis, while the citations alone leave the adoption of individual GAN techniques unresolved. What connects the work is a set of concrete experimental questions raised by the earlier results. A training procedure has to yield varied outputs, the usefulness of those outputs depends on the task, and a measure of progress has to specify what aspect of their quality it can detect.

 Fields, topics and concepts

Cite

Cite as Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford and Xi Chen. 2016. Improved Techniques for Training GANs. arXiv:1606.03498.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.1606.03498 · arXiv 1606.03498

@misc{salimans2016improved,
  title = {{Improved Techniques for Training GANs}},
  author = {Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford and Xi Chen},
  year = {2016},
  doi = {10.48550/arxiv.1606.03498},
  eprint = {1606.03498},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1606.03498}
}

References

26 references, from the paper's own bibliography.

  1. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, et al. Generative adversarial nets. In NIPS, 2014. OpenAlex ↗ · Scholar ↗
  2. Emily Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. arXiv preprint arXiv:1506.05751, 2015. our card
  3. Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. our card
  4. Ian J Goodfellow. On distinguishability criteria for estimating generative models. arXiv preprint arXiv:1412.6515, 2014. OpenAlex ↗ · Scholar ↗
  5. Daniel Jiwoong Im, Chris Dongjoo Kim, Hui Jiang, and Roland Memisevic. Generating images with recurrent adversarial networks. arXiv preprint arXiv:1602.05110, 2016. OpenAlex ↗ · Scholar ↗
  6. Donggeun Yoo, Namil Kim, Sunggyun Park, Anthony S Paek, and In So Kweon. Pixel-level domain transfer. arXiv preprint arXiv:1603.07442, 2016. our card
  7. Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. Measuring statistical dependence with hilbert-schmidt norms. In Algorithmic learning theory, pages 63–77. Springer, 2005. OpenAlex ↗ · Scholar ↗
  8. Kenji Fukumizu, Arthur Gretton, Xiaohai Sun, and Bernhard Schölkopf. Kernel measures of conditional dependence. In NIPS, volume 20, pages 489–496, 2007. OpenAlex ↗ · Scholar ↗
  9. Alex Smola, Arthur Gretton, Le Song, and Bernhard Schölkopf. A hilbert space embedding for distributions. In Algorithmic learning theory, pages 13–31. Springer, 2007. OpenAlex ↗ · Scholar ↗
  10. Yujia Li, Kevin Swersky, and Richard S. Zemel. Generative moment matching networks. CoRR, abs/1502.02761, 2015. OpenAlex ↗ · Scholar ↗
  11. Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. arXiv preprint arXiv:1505.03906, 2015. OpenAlex ↗ · Scholar ↗
  12. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. OpenAlex ↗ · Scholar ↗
  13. Ilya Sutskever, Rafal Jozefowicz, Karol Gregor, et al. Towards principled unsupervised learning. arXiv preprint arXiv:1511.06440, 2015. OpenAlex ↗ · Scholar ↗
  14. Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015. OpenAlex ↗ · Scholar ↗
  15. Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. 2016. MIT Press. OpenAlex ↗ · Scholar ↗
  16. George W Brown. Iterative solution of games by fictitious play. Activity analysis of production and allocation, 13(1):374–376, 1951. OpenAlex ↗ · Scholar ↗
  17. C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the Inception Architecture for Computer Vision. ArXiv e-prints, December 2015. OpenAlex ↗ · Scholar ↗
  18. David Warde-Farley and Ian Goodfellow. Adversarial perturbations of deep neural networks. In Tamir Hazan, George Papandreou, and Daniel Tarlow, editors, Perturbations, Optimization, and Statistics, chapter 11. 2016. Book in preparation for MIT Press. OpenAlex ↗ · Scholar ↗
  19. Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015. OpenAlex ↗ · Scholar ↗
  20. Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. arXiv preprint arXiv:1602.07868, 2016. our card
  21. Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Neural Information Processing Systems, 2014. OpenAlex ↗ · Scholar ↗
  22. Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing by virtual adversarial examples. arXiv preprint arXiv:1507.00677, 2015. OpenAlex ↗ · Scholar ↗
  23. Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. arXiv preprint arXiv:1602.05473, 2016. OpenAlex ↗ · Scholar ↗
  24. Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems, 2015. OpenAlex ↗ · Scholar ↗
  25. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, et al. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. our card
  26. Martín Abadi, Ashish Agarwal, Paul Barham, et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org. OpenAlex ↗ · Scholar ↗

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/salimans-2016-improved-techniques-training-gans/