1 Introduction
Generative models for images have enjoyed a resurgence in recent years, particularly with the availability of large datasets [20, 25]
and advent of deep neural networks
[15]. In particular, Generative Adversarial Networks (GANs) [8] and Variational AutoEncoders (VAE) [13] have shown a lot of promise in this regard. In this paper, we focus on GANbased approaches.A typical GAN framework consists of two components, a generator and a discriminator . The generator
is modelled so that it transforms a random vector
into an image , i.e. . usually arises from an easytosample distribution (e.g. uniform). is trained to generate images which are indistinguishable from a sampling of the true distribution, i.e , where is the true distribution of images. The discriminatortakes an image as input and outputs the probability that the image is from the true data distribution
. In practice, is trained to output a low probability when fed a “fake” (generated) image. and are trained adversarially to improve by competing with each other. A proper training regime ensures that at end of training, generates images which are essentially indistinguishable from real images, i.e. [8].In recent times, GANbased approaches have been used to generate impressively realistic housenumbers [4], faces, bedrooms [17] and a variety of other image categories [18, 21]. Usually, these image categories tend to have extremely complex underlying distributions. This complexity arises from two factors: (1) level of detail (e.g. color photos of objects have more detail than binary handwritten digit images) (2) diversity (e.g. inter and intracategory variability is larger for object categories compared to, say, house numbers). To be viable, generator needs to have sufficient capacity for tackling these complexityinducing factors. Typically, such capacity is attained by having deep networks for [2]. However, training highcapacity generators requires a large amount of training data. Therefore, existing GANbased approaches are not viable when the amount of training data is limited.
Contributions:

We propose DeLiGAN – a novel GANbased framework which is especially suited for smallyetdiverse data scenarios (Section 4).
The rest of the paper is organised as follows: We give an overview of the related work in Section 2, review GAN in Section 3 and then go on to describe our model DeLiGAN in Section 4. In Section 5, we discuss experimental results which showcase the capabilities of our model. Towards the end of the paper, we discuss these results and the implications of our design decisions in Section 6. We conclude with some pointers for future work in Section 7.
2 Related Work
Generative Adversarial Networks (GANs) have recently gained a lot of popularity due to the relative sharpness of samples generated by these models compared to other approaches. The originally proposed baseline approach [8] has been modified to incorporate deep convolutional networks without destabilizing the training scheme and achieving significant qualitative improvements in image quality [5, 17]. Further improvements were made by Salimans et al. [21] by incorporating algorithmic tricks such as minibatch discrimination which stabilize training and provide better image quality. We incorporate some of these tricks in our work as well.
Our central idea – utilizing a mixture model for latent space – has been suggested in various papers, but mostly in the context of variational inference. For example, Gershman et al. [7], Jordan et al. [11] and Jaakkola et al. [10] model the approximate posterior of the inferred latent distribution as a mixture model to represent more complicated distributions. More recently, Renzede et al. [19] and Kingma et al. [12] propose ‘normalizing flows’ to transform the latent probability density through a series of invertible mappings to construct a complex distribution. In the context of GANs, no such approaches exist, to the best of our knowledge.
Our approach can be viewed as an attempt to modify the latent space to obtain samples in the high probability regions in the latent space. The notion of latent space modification has been explored in some recent works. For example, Han et al. [9] propose to alternate between training the latent factors and the generator parameters. Arulkumaran et al. [1]
formulate an MCMC sampling process to sample from high probability regions of a learned latent space in variational or adversarial autoencoders.
3 Generative Adversarial Networks (GANs)
Although GANs were introduced in Section 1, we formally describe them below to establish continuity.
A typical GAN framework consists of two components, a generator and a discriminator . In practice, these two components are usually two neural networks. The generator is modelled so that it transforms a random vector into an image , i.e. . typically arises from an easytosample distribution, for e.g. where
denotes a uniform distribution.
is trained to generate images which are indistinguishable from a sampling of the true distribution. In other words, while training , we try to maximise , the probability that the generated samples belong to the data distribution.(1)  
(2) 
The above equations make explicit the fact that GANs assume a fixed, easy to sample, prior distribution and then maximize by training the generator network to produce samples from the data distribution.
The discriminator takes an image as input and outputs the probability that the image is from the true data distribution. Typically, is trained to output a low probability when fed a “fake” (generated) image. Thus,
is supposed to act as an expert, estimating the probability that the sample is from the true data distribution as opposed to the
’s output.and are trained adversarially to improve by competing with each other. This is achieved by alternating between the training phases of and . tries to ‘fool’ into thinking that its outputs are from the the true data distribution by maximizing its score . This is achieved by solving the following optimization problem in the generator phase of training:
(3) 
On the other hand, tries to minimize the score it assigns to generated samples by minimising and maximize the score it assigns to the real (training) data by maximising . Hence, the optimisation problem for can be formulated as follows:
(4) 
Hence the combined loss for the GAN can now be written as:
(5) 
In their work, Goodfellow et al. [8] show that Equation 5 gives us Jensen–Shannon (JS) divergence between the model’s distribution and data generating process. A proper training regime ensures that at the end of training, generates images which are essentially indistinguishable from real images, i.e. and JS divergence achieves its lowest value.
4 Our model  DeLiGAN
In GAN training, we essentially attempt to learn a mapping from a simple latent distribution to the complicated data distribution (Equation 2). This mapping requires a deep generative network which can disentangle the underlying factors of variation in the data distribution and enable diversity in generated samples [2]. In turn, this translates to the requirement of large amounts of data. Therefore, when data is limited yet originates from a diverse image modality, increasing the network depth becomes infeasible. Our solution to this conundrum is the following: Instead of increasing the model depth, we propose to increase the modelling power of the prior distribution. In particular, we propose a reparameterization of the latent space as a MixtureofGaussians model (see Figure 1).
(6) 
where represents the probability of the sample
in the normal distribution,
. For reasons which will be apparent shortly (Section 4.1), we assume uniform mixture weights, , i.e.(7) 
To obtain a sample from the above distribution, we randomly select one of the Gaussian components and employ the “reparameterization trick” introduced by Kingma et al. [13] to sample from the chosen Gaussian. We also assume that each Gaussian component has a diagonal covariance matrix. Suppose the th Gaussian is chosen. Let us denote the diagonal elements of the corresponding covariance matrix as where is the dimension of the latent space. For the “reparameterization trick”, we represent the sample from the chosen th Gaussian as a deterministic function of , and an auxiliary noise variable .
(8) 
Therefore, obtaining a latent space sample translates to sampling and calculating according to Equation 8. Substituting Equations 7, 8 in RHS of Equation 2, we get:
(9) 
Let us define and . Therefore, our new objective is to learn and (along with the GAN parameters) to maximise .
Next, we describe the procedure for learning and .
4.1 Learning and
For each Gaussian component, we first need to initialise its parameters. For , we sample from a simple prior – in our case, a uniform distribution . For , we assign a small, fixed nonzero initial value ( in our case). Normally, the number of samples we generate from each Gaussian relative to the other Gaussians during training gives us a measure of the ‘weight’ for that component. However, is not a trainable parameter in our model since we cannot obtain gradients for s. Therefore, as mentioned before, we consider all components to be equally important.
To generate data, we randomly choose one of the Gaussian components and sample a latent vector from the chosen Gaussian (Equation 8). is passed to to obtain the output data (image). The generated sample can now be used to train parameters of or using the standard GAN training procedure (Equation 5). In addition, and are also trained simultaneously along with ’s parameters, using gradients arising from
’s loss function.
However, we need to consider a subtle issue here involving . Since (Equation 9) has local maxima at the s, tries to decrease the s in an effort to obtain more samples from the high probability regions. As a result s can collapse to zero. Hence, we add a regularizer to the generator cost to prevent this from happening. The original formulation of loss function for (Equation 3) now becomes:
(10) 
Note that this procedure can be extended to generate a batch of images for minibatch training. Indeed, increasing the number of samples per Gaussian increases the accuracy of the gradients used to update and since they are averaged out over [3], thereby speeding up training.
5 Experiments
For our DeLiGAN framework, the choice of , the number of Gaussian components, is made empirically – more complicated data distributions require more Gaussians. Larger values of potentially help model with relatively increased diversity. However, increasing also increases memory requirements. Our experiments indicate that increasing beyond a point has little to no effect on the model capacity since the Gaussian components tend to ‘crowd’ and become redundant. We use a between and for our experiments.
To quantitatively characterize the diversity of generated samples, we also design a modified version of the “inceptionscore”, a measure which has been found to correlate well with human evaluation [21]. We describe this score next.
5.1 Modified Inception Score
Passing a generated image
through a trained classifier with an “inception” architecture
[22] results in a conditional label distribution . If is realistic enough, it should result in a “peaky” label distribution i.e. should have low entropy. We also want all categories to be covered uniformly among the generated samples, i.e. should have high entropy. These two requirements are unified into a single measure called “inceptionscore” as where stands for KLdivergence and expectation is taken over generated samples .Our modification: In its original formulation, “inceptionscore” assigns a higher score for models that result in a low entropy class conditional distribution . However, it is desirable to have diversity within image samples of a particular category. To characterize this diversity, we use a crossentropy style score where s are samples of the same class as as per the outputs of the trained inception model. We incorporate this crossentropy style term into the original “inceptionscore” formulation and define the modified “inceptionscore” (mIS) as a KLdivergence: . Essentially, mIS can be viewed as a proxy for measuring intraclass sample diversity along with the sample quality. In our experiments, we report mIS scores on a perclass basis and a combined mIS score averaged over all classes.
We analyze the performance of DeLiGAN models trained on toy data, handwritten digits [16], photo objects [14] and handdrawn object sketches [6] and compare with a regular GAN model. Specifically, we use a variant of DCGAN [17] with minibatch discrimination in the discriminator [21]. We also need to note here that DeLiGAN adds extra parameters over DCGAN. Therefore, we also compare DeLiGAN with baseline models containing an increased number of learnable parameters. We start by describing a series of experiments on toy data.
5.2 Toy Data
As a baseline GAN model for toy data, we set up a multilayer perceptron with one hidden layer as
and (see Figure 2). For the DeLiGAN model, we incorporate the mixture of Gaussian layer as shown in Figure 1. We also compare DeLiGAN with four other baseline models – (i) GAN++ (instead of mixture of Gaussian layer, we add a fully connected layer containing neurons between the input () and the generator) (ii) EnsembleGAN (An ensembleofgenerators setting for DeLiGAN. During training, we randomly choose one of the generators for training and update its parameters along with ) (iii) xGAN (We increase number of parameters in the generator network times by having times more neurons in the hidden layer) and (iv) MoEGAN (This is short for MixtureofExperts GAN. In this model, we just append a uniform discrete variable via adimensional onehot encoding
[4] to the random input ).For the first set of experiments, we design our generator network to output data samples originally belonging to a unimodal 2D Gaussian data (see Figure 3(g)). Figures 3 (a)(f) show samples generated by the respective GAN variants for this data. For the unimodal case, all models perform reasonably well in generating samples.
For the second set of experiments, we replace the unimodal distribution with a bimodal distribution comprising two Gaussians (Figure 3(n)). The results in this case show that DeLiGAN is able to clearly model the two separate distributions whereas the baseline GAN frameworks struggle to model the void in between (Figure 3(hm)). Although the other variants, containing more parameters, were able to model the two modes, they still struggle to model the local structure in the Gaussians properly. The generations produced by DeLiGAN look the most convincing. Although not obvious from the results, a recurring trend across all the baseline models was the relative difficulty in training due to instabilities. On the other hand, training DeLiGAN was much easier in practice. As we shall soon see, this phenomenon of suboptimal baseline models and better performance by DeLiGAN persists even for more complex data distributions (CIFAR10, sketches etc.)
Plane  Car  Bird  Cat  Deer  Dog  Frog  Horse  Ship  Truck  Overall  

GAN  
DeLiGAN  
MoEGAN  
GAN++ 
categories of CIFAR10 dataset. Larger scores are better. The entries represent score’s mean value and standard deviation for the category.
5.3 Mnist
The MNIST dataset contains images of handwritten digits from to [16]. We conduct experiments on a reduced training set of images to mimic the lowdata scenario. The images are sampled randomly from the dataset, keeping the total number of images per digit constant. For MNIST, the generator network has a fully connected layer followed by deconvolution layers while the discriminator network has convolutional layers followed by a minibatch discrimination layer (see Figure 2).
In Figure 4, we show typical samples generated by both models, arranged in a grid. For each model, the last column of digits (outlined in red), contains nearestneighbor images (from the training set) to the samples present in the last (th) column of the grid. For nearest neighborhood computation, we use distance between the images.
The samples produced by our model (Figure 4(b), right) are visibly crisper compared to baseline GAN (Figure 4(a), left). Also, some of the samples produced by the GAN model are almost identical to one other (shown as similarly colored boxes in Figure 4(a)) whereas our model produces more diverse samples. We also observe that some of the samples produced by the baseline GAN model are deformed and don’t resemble any digit. This artifact is much less common in our model. Additionally, in practice, the baseline GAN model frequently diverges during training given the small data regime and the deformation artifact mentioned above becomes predominant, eventually leading to homogeneous nondigit like samples. In contrast, our model remains stable during training and generates samples with better diversity.
5.4 Cifar 10
The CIFAR 10 dataset [14] contains color images across object classes. Once again, to mimic the diverseyetlimiteddata scenario, we compare the architectures on a reduced dataset of images. The images are drawn randomly from the entire dataset, keeping the number of images per category constant. For the experiments involving CIFAR dataset, we adopt the architecture proposed by Goodfellow et al. [8]. The generator has a fully connected layer followed by deconvolution layers with batch normalisation after each layer. The discriminator network has convolutional layers with dropout and weight normalisation, followed by a minibatch discrimination layer.
Figure 5 shows samples generated by our model and the baseline GAN model. As in the case of MNIST, some of the samples generated by the GAN, shown with similar colored bounding boxes, look nearly identical (Figure 5(a)). Again, we observe that our model produces visibly diverse looking samples and provides more stability. The modified “inceptionscore” values for the models (Table 1) attest to this observation as well. Note that there exist categories (‘cat’, ‘dog’) with somewhat better diversity scores for GAN. Since images belonging to these categories are similar, these kinds of images would be better represented in the data. As a result, GAN performs better for these categories, whereas DeLiGAN manages to capture even the other underrepresented categories. Table 1 also shows the modified inception scores for the GAN++ and MoEGAN models introduced in the toy experiments. We observe that the performance in this case is actually worse than the baseline GAN model, despite the increased number of parameters. Moreover, adding fully connected layers in the generator in GAN++ also leads to increased instability in training. We hypothesize that the added set of extra parameters worsens the performance given our limited data scenario. In fact, for baseline models such as EnsembleGAN and xGAN, the added set of parameters also makes computations prohibitively expensive.
Overall, the CIFAR dataset experiments demonstrate that our model can scale to more complicated real life datasets and still outperform the traditional GANs in low data scenarios.
5.5 Freehand Sketches
The TUBerlin dataset [6], contains handdrawn sketches evenly distributed among object categories, which amounts to images per category. This dataset represents a scenario where the amount of training data is actually limited, unlike previous experiments where the quantity of training data was artificially restricted. For sketches, our network contains convolutional layers in the discriminator with weight normalization and dropout followed by minibatch discrimination and deconvolutional layers, followed by a fully connected layer in the generator. To demonstrate the capability of our model, we perform two sets of experiments.
For the first set of experiments, we select sketch categories – apple, pear, tomato, candle. These categories have simple global contours, low sketch stroke density and are somewhat similar in appearance. During training, we augment the dataset using the flipped versions of the images. Once again, we compare the generated results of GAN and DeLiGAN. Figure 6 shows the samples generated by DeLiGAN and GAN respectively, trained on the similar looking categories (left side of the dotted line). The samples generated by both the models look visually appealing. Our guess is that since the object categories are very similar, the data distribution can be easily modelled as a continuous distribution in the latent space. Therefore, the latent space doesn’t need a multimodal representation in this case. This is also borne out by the mIS diversity scores in Table 2.
Apple  Tomato  Pear  Candle  Overall  

GAN  
DeLiGAN 
For the second set of experiments, we select diverse looking categories – apple, wine glass, candle, canoe, cup – and compare the generation results for both the models. The corresponding samples are shown in Figure 6 (on the right side of the dotted line). In this case, DeLiGAN samples are visibly better, less hazy, and arise from a more stable training procedure. The samples generated by DeLiGAN also exhibit larger diversity, visibly and according to mIS scores as well (Table 3).
6 Discussion
The experiments described above demonstrate the benefits of modelling the latent space as a mixture of learnable Gaussians instead of the conventional unit Gaussian/uniform distribution. One reason for our performance is derived from the fact that mixture models can approximate arbitrarily complex latent distributions, given a sufficiently large number of Gaussian components.
In practice, we also notice that our mixture model approach also helps increase the model stability and is especially useful for diverse, lowdata regimes where the latent distribution might not be continuous. Consider the following: The gradients on s push them in the latent space in a direction which increases the discriminator score, as per the gradient update (Equation 11). Thus, samples generated from the updated Gaussian components result in higher probability, .
(11) 
Hence, as training progresses, we find the s in particular, even if initialised in the lower probability regions, slowly drift towards the regions that lead to samples of high probability, . Hence, fewer points are sampled from the low probability regions. This is illustrated by (i) the locations of samples generated by our model in the toy experiments (Figure 3(d)) (ii) relatively small frequency of bad quality generations (that don’t resemble any digit) for the MNIST experiments (Figure 4). Our model successfully handles the low probability void between the two modes in the data distribution by emulating the void into its own latent distribution. As a result, no samples are produced in these regions. This can also be seen in the MNIST experiments – our model produces very few nondigit like samples compared to the baseline GAN (Figure 4).
Wineglass  Candle  Apple  Canoe  Cup  Overall  

GAN  
DeLiGAN 
In complicated multimodal settings, the data may be disproportionally distributed among the modes such that some of the modes contain relatively more data points. In this situation, the generator in baseline GAN tends to fit the latent distribution to the mode with maximum data as dictated by the JensenShannon Divergence [23]. This results in low diversity among the generated samples since a section of the data distribution is sometimes overlooked by the generator network. This effect is especially pronounced in low data regimes because the number of modes in the image space increase due to the nonavailability of data connecting some of the modes. As a result, the generator tries to fit to a small fraction of the already limited data. This is consistent with our experimental results wherein the diversity and quality of samples produced by baseline GANs deteriorate with decreasing amounts of training data (MNIST – Figure 4, CIFAR – Figure 5) or increasing diversity of the training data (Sketches – Figure 6).
Our design decision of having a trainable mixture model for latent space can be viewed as an algorithmic “plugin” that can be added to almost any GAN framework including recently proposed models [24, 21] to obtain better performance on diverse data. Finally, it is also important to note that our model is still constrained by the modelling capacity of the underlying GAN framework itself. Hence, as we employ better GAN frameworks on top of our mixture of Gaussians layer, we can expect the model to generate realistic, highquality samples.
7 Conclusions and Future Work
In this work, we have shown that reparameterizing the latent space in GANs as a mixture model can lead to a powerful generative model. Via experiments across a diverse set of modalities (digits, handdrawn object sketches and color photos of objects), we have observed that this seemingly simple modification helps stabilize the model and produce diverse samples even in low data scenarios. Currently, our mixture model setup incorporates some simplifying assumptions (diagonal covariance matrix for each component, equally weighted mixture components) which limit the ability of our model to approximate more complex distributions. These parameters can be incorporated into our learning scheme to better approximate the underlying latent distribution. The source code for training DeLiGAN models and computing modified inception score can be accessed at http://val.cds.iisc.ac.in/deligan/.
8 Acknowledgements
We would like to thank our anonymous reviewers for their suggestions, NVIDIA for their contribution of Tesla K40 GPU, Qualcomm India for their support to Ravi Kiran Sarvadevabhatla via the Qualcomm Innovation Fellowship and Google Research India for their travel grant support.
References
 [1] K. Arulkumaran, A. Creswell, and A. A. Bharath. Improving sampling from generative autoencoders with markov chains. arXiv preprint arXiv:1610.09296, 2016.
 [2] Y. Bengio, G. Mesnil, Y. Dauphin, and S. Rifai. Better mixing via deep representations. In ICML (1), volume 28 of JMLR Workshop and Conference Proceedings, pages 552–560, 2013.
 [3] Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
 [4] X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. arXiv preprint arXiv:1606.03657, 2016.
 [5] E. L. Denton, S. Chintala, R. Fergus, et al. Deep generative image models using a￼ laplacian pyramid of adversarial networks. In Advances in neural information processing systems, pages 1486–1494, 2015.
 [6] M. Eitz, J. Hays, and M. Alexa. How do humans sketch objects? ACM Transactions on Graphics (TOG), 31(4):44, 2012.
 [7] S. Gershman, M. Hoffman, and D. Blei. Nonparametric variational inference. arXiv preprint arXiv:1206.4665, 2012.
 [8] I. Goodfellow, J. PougetAbadie, M. Mirza, B. Xu, D. WardeFarley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2672–2680, 2014.
 [9] T. Han, Y. Lu, S.C. Zhu, and Y. N. Wu. Alternating backpropagation for generator network. arXiv preprint arXiv:1606.08571, 2016.
 [10] T. S. Jaakkola and M. I. Jordan. Improving the mean field approximation via the use of mixture distributions. In Learning in graphical models, pages 163–173. Springer, 1998.
 [11] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999.
 [12] D. P. Kingma, T. Salimans, and M. Welling. Improving variational inference with inverse autoregressive flow. arXiv preprint arXiv:1606.04934, 2016.
 [13] D. P. Kingma and M. Welling. Autoencoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
 [14] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009.
 [15] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012.

[16]
Y. Lecun and C. Cortes.
The MNIST database of handwritten digits.
 [17] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
 [18] S. Reed, Z. Akata, S. Mohan, S. Tenka, B. Schiele, and H. Lee. Learning what and where to draw. arXiv preprint arXiv:1610.02454, 2016.
 [19] D. J. Rezende and S. Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015.

[20]
O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang,
A. Karpathy, A. Khosla, M. Bernstein, et al.
Imagenet large scale visual recognition challenge.
International Journal of Computer Vision
, 115(3):211–252, 2015.  [21] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training GANs. arXiv preprint arXiv:1606.03498, 2016.

[22]
C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan,
V. Vanhoucke, and A. Rabinovich.
Going deeper with convolutions.
In
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition
, pages 1–9, 2015.  [23] L. Theis, A. v. d. Oord, and M. Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015.
 [24] J. Zhao, M. Mathieu, and Y. LeCun. Energybased generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.

[25]
B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva.
Learning deep features for scene recognition using places database.
In Advances in neural information processing systems, pages 487–495, 2014.
Comments
There are no comments yet.