On Stabilizing Generative Adversarial Training with Noise
Simon Jenni, Paolo Favaro

TL;DR
This paper introduces a novel filtering-based method to stabilize GAN training by extending the support of data distributions, enabling more reliable convergence and improved performance across various datasets.
Contribution
The authors propose using filtered versions of real and generated data distributions to address support limitations, enhancing GAN stability and compatibility with existing models.
Findings
Training becomes more stable with the filtering approach.
The method improves performance on multiple datasets.
It can be integrated into various GAN architectures.
Abstract
We present a novel method and analysis to train generative adversarial networks (GAN) in a stable manner. As shown in recent analysis, training is often undermined by the probability distribution of the data being zero on neighborhoods of the data space. We notice that the distributions of real and generated data should match even when they undergo the same filtering. Therefore, to address the limited support problem we propose to train GANs by using different filtered versions of the real and generated data distributions. In this way, filtering does not prevent the exact matching of the data distribution, while helping training by extending the support of both distributions. As filtering we consider adding samples from an arbitrary distribution to the data, which corresponds to a convolution of the data distribution with the arbitrary one. We also propose to learn the generation of…
|
|
| Experiment | CIFAR-10 | STL-10 | ||
|---|---|---|---|---|
| FID | IS | FID | IS | |
| Standard GAN | ||||
| (a) Noise only: | ||||
| (b) Noise only: learned | ||||
| (c) Noise only: , | ||||
| (d) Clean + noise: | ||||
| (e) Clean + noise: with learnt | ||||
| (f) DFGAN | ||||
| (g) DFGAN | ||||
| (h) DFGAN | ||||
| (i) DFGAN alt. mini-batch | ||||
| Exp. | LR | BN in | Opt. | ActFn | ||
|---|---|---|---|---|---|---|
| a) | FALSE | ADAM | (l)ReLU | 1 | 50K | |
| b) | TRUE | ADAM | tanh | 1 | 50K | |
| c) | TRUE | ADAM | (l)ReLU | 1 | 50K | |
| d) | TRUE | SGD | (l)ReLU | 1 | 50K | |
| e) | TRUE | ADAM | (l)ReLU | 5 | 50K | |
| f) | TRUE | ADAM | (l)ReLU | 1 | 5K |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
MethodsConvolution · Dogecoin Customer Service Number +1-833-534-1729
Generative Adversarial Training by Blurring the Data Distribution Support
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
Generative Adversarial Training via Multi-Smoothness Support Matching
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
A Principled Generative Adversarial Training via Multiple Data Distribution Filterings
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
A Principled Generative Adversarial Training via Data Distribution Filterings
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
Stable Generative Adversarial Training via Data Distribution Filtering
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
A Stable Generative Adversarial Training via Data Distribution Filtering
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
On Stabilizing Generative Adversarial Training with Noise
Simon Jenni Paolo Favaro
University of Bern
{simon.jenni,paolo.favaro}@inf.unibe.ch
Abstract
We present a novel method and analysis to train generative adversarial networks (GAN) in a stable manner. As shown in recent analysis, training is often undermined by the probability distribution of the data being zero on neighborhoods of the data space. We notice that the distributions of real and generated data should match even when they undergo the same filtering. Therefore, to address the limited support problem we propose to train GANs by using different filtered versions of the real and generated data distributions. In this way, filtering does not prevent the exact matching of the data distribution, while helping training by extending the support of both distributions. As filtering we consider adding samples from an arbitrary distribution to the data, which corresponds to a convolution of the data distribution with the arbitrary one. We also propose to learn the generation of these samples so as to challenge the discriminator in the adversarial training. We show that our approach results in a stable and well-behaved training of even the original minimax GAN formulation. Moreover, our technique can be incorporated in most modern GAN formulations and leads to a consistent improvement on several common datasets.
1 Introduction
Since the seminal work of [6], generative adversarial networks (GAN) have been widely used and analyzed due to the quality of the samples that they produce, in particular when applied to the space of natural images. Unfortunately, GANs still prove difficult to train. In fact, a vanilla implementation does not converge to a high-quality sample generator and heuristics used to improve the generator often exhibit an unstable behavior. This has led to a substantial work to better understand GANs (see, for instance, [23, 19, 1]). In particular, [1] points out how the unstable training of GANs is due to the (limited and low-dimensional) support of the data and model distributions.
In the original GAN formulation, the generator is trained against a discriminator in a minimax optimization problem. The discriminator learns to distinguish real from fake samples, while the generator learns to generate fake samples that can fool the discriminator. When the support of the data and model distributions is disjoint, the generator stops improving as soon as the discriminator achieves perfect classification, because this prevents the propagation of useful information to the generator through gradient descent (see Fig. 1(a)).
The recent work by [1] proposes to extend the support of the distributions by adding noise to both generated and real images before they are fed as input to the discriminator. This procedure results in a smoothing of both data and model probability distributions, which indeed increases their support extent (see Fig. 1(b)). For simplicity, let us assume that the probability density function of the data is well defined and let us denote it with . Then, samples , obtained by adding noise to the data samples , are also instances of the probability density function , where denotes the convolution operator. The support of is the Minkowski sum of the supports of and and thus larger than the support of . Similarly, adding noise to the samples from the generator probability density leads to the smoothed probability density . Adding noise is a quite well-known technique that has been used in maximum likelihood methods, but is considered undesirable as it yields approximate generative models that produce low-quality blurry samples. Indeed, most formulations with additive noise boil down to finding the model distribution that best solves . However, this usually results in a low quality estimate because has lost the high frequency content of . An immediate solution is to use a form of noise annealing, where the noise variance is initially high and is then reduced gradually during the iterations so that the original distributions, rather than the smooth ones, are eventually matched. This results in an improved training, but as the noise variance approaches zero, the optimization problem converges to the original formulation and the algorithm may be subject to the usual unstable behavior.
In this work, we design a novel adversarial training procedure that is stable and yields accurate results. We show that under some general assumptions it is possible to modify both the data and generated probability densities with additional noise without affecting the optimality conditions of the original noise-free formulation. As an alternative to the original formulation, with and ,
[TABLE]
where denotes the discriminator, we propose to train a generative model by solving instead the following optimization
[TABLE]
where we introduced a set of probability density functions. If we solve the innermost optimization problem in Problem (2), then we obtain the optimal discriminator
[TABLE]
where we have defined as the probability density of , where . If we substitute this in the problem above and simplify we have
[TABLE]
where JSD is the Jensen-Shannon divergence. We show that, under suitable assumptions, the optimal solution of Problem (4) is unique and . Moreover, since enjoys a larger support than , the optimization via iterative methods based on gradient descent is more likely to achieve the global minimum, regardless of the support of . Thus, our formulation enjoys the following properties:
- It defines a fitting of probability densities that is not affected by their support;
- It guarantees the exact matching of the data probability density function;
- It can be easily applied to other GAN formulations. A simplified scheme of the proposed approach is shown in Fig. 2.
In the next sections we introduce our analysis in detail and then devise a computationally feasible approximation of the problem formulation (2). Our method is evaluated quantitatively on CIFAR-10 [12], STL-10 [5], and CelebA [15], and qualitatively on ImageNet [20] and LSUN bedrooms [24].
2 Related Work
The inherent instability of GAN training was first addressed through a set of techniques and heuristics [22] and careful architectural design choices and hyper-parameter tuning [18]. [22] proposes the use of one-sided label smoothing and the injection of Gaussian noise into the layers of the discriminator. A theoretical analysis of the unstable training and the vanishing gradients phenomena was introduced by Arjovsky et al. [1]. They argue that the main source of instability stems from the fact that the real and the generated distributions have disjoint supports or lie on low-dimensional manifolds. In the case of an optimal discriminator this will result in zero gradients that then stop the training of the generator. More importantly, they also provide a way to avoid such difficulties by introducing noise and considering “softer” metrics such as the Wasserstein distance. [23] makes similar observations and also proposed the use of “instance noise” which is gradually reduced during training as a way to overcome these issues. Another recent work stabilizes GAN training in a similar way by transforming examples before feeding them to the discriminator [21]. The amount of transformation is then gradually reduced during training. They only transform the real examples, in contrast to [23], [1] and our work. [2] builds on the work of [1] and introduces the Wasserstein GAN (WGAN). The WGAN optimizes an integral probability metric that is the dual to the Wasserstein distance. This formulation requires the discriminator to be Lipschitz-continuous, which is realized through weight-clipping. [7] presents a better way to enforce the Lipschitz constraint via a gradient penalty over interpolations between real and generated data (WGAN-GP). [19] introduces a stabilizing regularizer based on a gradient norm penalty similar to that by [7]. Its formulation however is in terms of f-divergences and is derived via an analytic approximation of adversarial training with additive Gaussian noise on the datapoints. Another recent GAN regularization technique that bounds the Lipschitz constant of the discriminator is the spectral normalization introduced by [17]. This method demonstrates state-of-the-art in terms of robustness in adversarial training. Several alternative loss functions and GAN models have been proposed over the years, claiming superior stability and sample quality over the original GAN (e.g., [16], [25], [3], [2], [25], [11]). Adversarial noise generation has previously been used in the context of classification to improve the robustness against adversarial perturbations [13].
3 Matching Filtered Distributions
We are interested in finding a formulation that yields as optimal generator a sampler of the data probability density function (pdf) , which we assume is well defined. The main difficulty in dealing with is that it may be zero on some neighborhood in the data space. An iterative optimization of Problem (1) based on gradient descent may yield a degenerate solution, i.e., such that the model pdf only partially overlaps with (a scenario called mode collapse). It has been noticed that adding samples of an arbitrary distribution to both real and fake data samples during training helps reduce this issue. In fact, adding samples corresponds to blurring the original pdfs and , an operation that is known to increase their support and thus their likelihood to overlap. This increased overlap means that iterative methods can exploit useful gradient directions at more locations and are then more likely to converge to the global solution. By building on this observation, we propose to solve instead Problem (2) and look for a way to increase the support of the data pdf without losing the optimality conditions of the original formulation of Problem (1).
Our result below proves that this is the case for some choices of the additive noise. We consider images of pixels and with values in a compact domain , since image intensities are bounded from above and below. Then, also the support of the pdf is bounded and contained in . This implies that is also .
Theorem 1**.**
Let us choose such that Problem (4) can be written as
[TABLE]
where is a non-degenerate probability density function in . Let us also assume that the domain of is restricted to (and thus ). Then, the global optimum of Problem (5) is , .
Proof.
The global minimum of the Jensens-Shannon divergence is achieved if and only if
[TABLE]
Let . Then, we have and . By substituting in eq. (6) we obtain . Since and are in , we can take the Fourier transform of both sides, and obtain
[TABLE]
If for some , then there exists such that , and thus . This means that
[TABLE]
or, equivalently,
[TABLE]
Notice that
[TABLE]
unless for any such that , with . Since is not degenerate, then eq. (11) holds, and eq. (8) cannot be true, which leads to for all , and we can conclude that , . ∎
3.1 Formulation
Based on the above theorem we consider two cases:
Gaussian noise with a fixed/learned standard deviation : ; 2. 2.
Learned noise from a noise generator network with parameters :
In both configurations we can learn the parameter(s) . We do so by minimizing the cost function after the maximization with respect to the discriminator. The minimization encourages large noise since this would make more similar to regardless of and . This would not be very useful to gradient descent. Therefore, to limit the noise magnitude we introduce as a regularization term the noise variance or the Euclidean norm of the noise output image , and multiply it by a positive scalar , which we tune.
The proposed formulations can then be written in a unified way as:
[TABLE]
3.2 Implementation
Implementing our algorithm only requires a few minor modifications of the standard GAN framework. We perform the update for the noise-generator and the discriminator in the same iteration. Mini-batches for the discriminator are formed by collecting all the fake and real samples in two separate batches, i.e., is the batch with real examples and the fake examples batch. The complete procedure is outlined in Algorithm 1. The noise-generator architecture is typically the same as the generator, but with a reduced number of convolutional filters. Since the inputs to the discriminator are doubled when compared to the standard GAN framework, the DFGAN framework can be to times slower. Similar and more severe performance drops are present in existing variants (e.g., WGAN-GP). Note that by constructing the batches as the training time is instead comparable to the standard framework, but it is much more stable and yields an accurate generator. For a comparison of the runtimes, see Fig. 4.
3.3 Batch-Normalization and Mode Collapse
The current best practice is to apply batch normalization to the discriminator separately on the real and fake mini-batches [4]. Indeed, this showed much better results when compared to feeding mini-batches with a 50/50 mix of real and fake examples in our experiments. The reason for this is that batch normalization implicitly takes into account the distribution of examples in each mini-batch. To see this, consider the example in Fig. 3. In the case of no separate normalization of fake and real batches we can observe mode-collapse. The modes covered by the generator are indistinguishable for the discriminator, which observes each example independently. There is no signal to the generator that leads to better mode coverage in this case. Since the first two moments of the fake and real batch distribution are clearly not matching, a separate normalization will help the discriminator distinguish between real and fake examples and therefore encourage better mode coverage by the generator.
Using batch normalization in this way turns out to be crucial for our method as well. Indeed, when no batch normalization is used in the discriminator, the generator will often tend to produce noisy examples. This is difficult to detect by the discriminator, since it judges each example independently. To mitigate this issue we apply separate normalization of the noisy real and fake examples before feeding them to the discriminator. We use this technique for models without batch normalization (e.g. SNGAN).
4 Experiments
We compare and evaluate our model using two common GAN metrics: the Inception score IS [22] and the Fréchet Inception distance FID [8]. Throughout this section we use 10K generated and real samples to compute IS and FID. In order to get a measure of the stability of the training we report the mean and standard deviation of the last five checkpoints for both metrics (obtained in the last 10% of training). More reconstructions, experiments and details are provided in the supplementary material.
4.1 Ablations
To verify our model we perform ablation experiments on two common image datasets: CIFAR-10 [12] and STL-10 [5]. For CIFAR-10 we train on the 50K RGB training images and for STL-10 we resize the 100K training images to . The network architectures resemble the DCGAN architectures of [18] and are detailed in Table 1. All the models are trained for 100K generator iterations using a mini-batch size of 64. We use the ADAM optimizer [10] with a learning rate of and . Results on the following ablations are reported in Table 2:
(a)-(c) Only noisy samples:
In this set of experiments we only feed noisy examples to the discriminator. In experiment (a) we add Gaussian noise and in (b) we add learned noise. In both cases the noise level is not annealed. While this leads to stable training, the resulting samples are of poor quality which is reflected by high FID and low IS. The generator will tend to also produce noisy samples since there is no incentive to remove the noise. Annealing the added noise during training as proposed by [1] and [23] leads to an improvement over the standard GAN. This is demonstrated in experiment (c). The added Gaussian noise is linearly annealed during the 100K iterations in this case;
(d)-(i) Both noisy and clean samples:
The second set of experiments consists of variants of our proposed model. Experiments (d) and (e) use a simple Gaussian noise model; in (e) the standard deviation of the noise is learned. We observe a drastic improvement in the quality of the generated examples even with this simple modification. The other experiments show results of our full model with a separate noise-generator network. We vary the weight of the norm of the noise in experiments (f)-(h). Ablation (i) uses the alternative mini-batch construction with faster runtime as described in Section 3.2;
Application to Different GAN Models. We investigate the possibility of applying our proposed training method to several standard GAN models. The network architectures are the same as proposed in the original works with only the necessary adjustments to the given image-resolutions of the datasets (i.e., truncation of the network architectures). The only exception is SVM-GAN, where we use the architecture in Table 1. Note that for the GAN with minimax loss (MMGAN) and WGAN-GP we use the architecture of DCGAN. Hyper-parameters are kept at their default values for each model. The models are evaluated on two common GAN benchmarks: CIFAR-10 [12] and CelebA [15]. The image resolution is for CIFAR-10 and for CelebA. All models are trained for 100K generator iterations. For the alternative objective function of LSGAN and SVM-GAN we set the loss of the noise generator to be the negative of the discriminator loss, as is the case in our standard model. The results are shown in Table 3. We can observe that applying our training method improves performance in most cases and even enables the training with the original saturation-prone minimax GAN objective, which is very unstable otherwise. Note also that applying our method to SNGAN [17] (the current state-of-the-art) leads to an improvement on both datasets. We also evaluated SNGAN with and without our method on images of STL-10 (same as in Table 2) where our method boosts the performance from an FID of to . We show random CelebA reconstructions from models trained with and without our approach in Fig. 5.
Robustness to Hyperparameters. We test the robustness of DFGANs with respect to various hyperparamters by training on CIFAR-10 with the settings listed in Table 4. The network is the same as specified in Table 1. The noise penalty term is set to . We compare to a model without our training method (Standard), a model with the gradient penalty regularization proposed by [19] (GAN+GP) and a model with spectral normalization (SNGAN). To the best of our knowledge, these methods are the current state-of-the-art in terms of GAN stabilization. Fig. 7 shows that our method is stable and accurate across all settings.
Robustness to Network Architectures. To test the robustness of DFGANs against non-optimal network architectures we modified the networks in Table 1 by doubling the number of layers in both generator and discriminator. This leads to significantly worse performance in terms of FID in all cases: 46 to 135 (Standard), 33 to 111 (SNGAN), 28 to 36 (GAN+GP), and 27 to 60 (DFGAN). However, SNGAN+DF leads to good results with a FID of 27.6.
4.2 Qualitative Results
We trained DFGANs on images from two large-scale datasets: ImageNet [20] and LSUN bedrooms [24]. The network architecture is similar to the one in Table 1 with one additional layer in both networks. We trained the models for 100K iterations on LSUN and 300K iterations on ImageNet. Random samples of the models are shown in Fig. 6. In Fig. 8 we show some examples of the noise that is produced by the noise generator at different stages during training. These examples resemble the image patterns that typically appear when the generator diverges.
5 Conclusions
We have introduced a novel method to stabilize generative adversarial training that results in accurate generative models. Our method is rather general and can be applied to other GAN formulations with an average improvement in generated sample quality and variety, and training stability. Since GAN training aims at matching probability density distributions, we add random samples to both generated and real data to extend the support of the densities and thus facilitate their matching through gradient descent. We demonstrate the proposed training method on several common datasets of real images.
Acknowledgements. This work was supported by the Swiss National Science Foundation (SNSF) grant number 200021_169622. We also wish to thank Abdelhak Lemkhenter for discussions and for help with the proof of Theorem 1.
1 Influence on the Generator Gradient Norm
We compare the norm of the generator gradient with and without DF for a GAN trained with the original minimax objective and a GAN trained with the alternative generator objective in Figure 1. The models were trained on CIFAR-10. We can observe the vanishing gradient phenomenon in Figure 1(a) when no distribution filtering is applied. With our proposed method the gradient norms are stable. In the case of the alternative loss in Figure 1(b) we can observe that the gradient norms are orders of magnitude higher when no distribution filtering is applied. This results in highly unstable weight updates due to the overconfident discriminator.
2 Experiments on synthetic data
We performed experiments with a standard GAN and a DFGAN using Gaussian noise on synthetic 2-D data. The generator and discriminator architectures are both MLPs consisting of three fully-connected layers with a hidden-layer size of 512. We use ReLU activations and batch-normalization ([9]) in all but the first discriminator layer and the output layers. The Adam optimzer ([10]) was used with a learning rate of and we trained for 20K iterations. The results are shown in Figure 2. We can observe how the matching of both clean and filtered distribution leads to a better fit in the case of DFGAN.
3 Implementation Details
Noise Generator. The noise-generator architecture in all our experiments is equivalent to the generator architecture with the number of filters reduced by a factor of eight. The output of the noise-generator has a tanh activation scaled by a factor of two to allow more noise if necessary. We also experimented with a linear activation but didn’t find a significant difference in performance.
GAN+GP. For the comparisons to the GAN regularizer proposed by [19] we used the same settings as used in their work in experiments with DCGAN.
SNGAN+DF. We used the standard GAN loss (same as DCGAN) in all our experiments with models using spectral normalization. When combining SNGAN with DF we batch-normalized the noisy inputs to the discriminator.
4 Qualitative Results for Experiments
We provide qualitative results for some of the ablation experiments in Figure 3 and for the robustness experiments in Figure 4. As we can see in Figure 4, none of the tested settings led to degenerate solutions in the case of DFGAN while the other methods would show failure cases in some settings.
5 Application to Progressive GAN
To test our method on a state-of-the-art GAN we applied our training method to the progressive GAN model. We used the DCGAN loss, trained for a total of 6M images and did not use label conditioning. We used fixed Gaussian noise for the distribution filtering. On CIFAR-10 progressiveGAN without DF achieved a FID of 29.4. Adding DF improved the performance to 26.8. Note that the original WGAN-GP loss in the same setup only achieved a FID of 29.8.
We also trained progressive-GAN+DF on higher resolution images of LSUN bedrooms. See Figure 5 for results.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. ar Xiv preprint ar Xiv:1701.04862 , 2017.
- 2[2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning , pages 214–223, 2017.
- 3[3] David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. ar Xiv preprint ar Xiv:1703.10717 , 2017.
- 4[4] Soumith Chintala, Emily Denton, Martin Arjovsky, and Michael Mathieu. How to train a gan? tips and tricks to make gans work. https://github.com/soumith/ganhacks , 2016.
- 5[5] Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics , pages 215–223, 2011.
- 6[6] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems , pages 2672–2680, 2014.
- 7[7] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems , pages 5769–5779, 2017.
- 8[8] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Günter Klambauer, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a nash equilibrium. ar Xiv preprint ar Xiv:1706.08500 , 2017.
