The variational infomax autoencoder

05/25/2019 ∙ by Vincenzo Crescimanna, et al. ∙ University of Stirling 0

We propose the Variational InfoMax AutoEncoder (VIMAE), a method to train a generative model, maximizing the variational lower bound of the mutual information between the visible data and the hidden representation, maintaining bounded the capacity of the network. In the paper we investigate the capacity role in a neural network and deduce that a small capacity network tends to learn a more robust and disentangled representation than an high capacity one. Such observations are confirmed by the computational experiments.



There are no comments yet.


page 7

page 8

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Finding a model able to identify the underlying casual factors (hidden representation

) of the visible data is a key problem in machine learning research. In literature it is possible to distinguish many ways to learn such representation

(dinh2016density, ; hinton2006fast, ; maddison2017filtering, ; radford2015unsupervised, ), but recently two family models become dominant: Variational AutoEncoder (VAE) (kingma2013auto, ; rezende2014stochastic, ) and Generative Adversarial Network (GAN) (goodfellow2014generative, ). Although the two families follow different approaches, they share the same principles: assuming there exists a representation , for any observation distributed according to

, find the probability

approximating the original one according to a specific metric; in particular, VAE minimizes a lower bound of the Kullback-Leibler divergence,

, whereas GAN minimizes the Jensen-Shannon divergence, . But, since in both cases the objective function does not depend on the learned representation, , it is not guaranteed that these methods will learn a useful representation for the generative model.

In particular, VAE, a method which is defined to learn a good representation, in the specific case where the decoder is particularly powerful, tends to ignore the encoded variable , i.e. it does not learn a useful representation. Common suggestions to overcome the poor representation issue are: bound the encoding capacity (chen2016variational, ; higgins2017beta, ), or maximize the mutual information between the visible and hidden representation (alemi2017fixing, ); indeed, a useful representation is the one containing the salient properties of the visible data.

Starting from such observations, in this manuscript we propose a method that maximizes a variational lower bound of the mutual information between the visible and hidden representation while maintaining a bound on the entropy of the encoded data. The derived model is a variational autoencoder having the same form as the Wasserstein AutoEncoder (WAE) (tolstikhin2017wasserstein, ), an autoencoder minimizing the optimal transport between the visible and generated data. Thanks to the information description we are able to highlight the role of the network capacity: the amount of information that can be stored by the representation. In particular, we observe that in order to learn a good representation it is not necessary to minimize the encoding mutual information channel as suggested in (higgins2017beta, ), but it is sufficient to bound the capacity of the network, i.e. the entropy of the hidden term. The obtained results lead us to argue that an unsupervised network should optimize a capacity-constrained InfoMax measure, a principle slightly different from the Information Bottleneck (tishby2000information, ).

The work is divided as follows: in the second section we describe briefly the VAE and its variants, in the third and fourth sections we describe the variational infomax (VIMAE) method and the related work. We conclude the paper with experimental results and the conclusions.

2 Background

The aim of this section is to describe VAE, understand its principal issues and describe the two most relevant approaches to overcome such issues.

2.1 Notation and preliminary definitions

We use calligraphic letters (i.e. ) for sets, capital letters (i.e.

) for random variables, and lower case letters (i.e.

) for their samples. With abuse of notation we denote both the probability and the corresponding density with the lower case letters (i.e. ).


Given two random distributions and , the -divergence


is an (intuitive) measure of the distance between the distributions and . In the case , is called Kullback-Leibler (KL) divergence.

Mutual Information

Given two random variables and

, with joint distribution

and marginals and , the mutual information

is a measure of the reduction of uncertainty in due to the knowledge of

2.2 Variational autoencoder

From now on let us assume that the unknown distribution of the data coincides with the empirical one , and that the distribution of the latent representation is known. In this context the VAE is a model solving the following optimization problem: find the generative model , specified by the parameters of the associated neural network, maximizing the ELBO objective


a lower bound of the unfeasible-to-compute marginal likelihood . The ELBO objective is optimized by a regularized autoencoder, with encoder and decoder parameterizing, respectively, the inference and generative distributions, and , with regularizer defined by the rate term , measuring the excess number of bits required to encode samples from the encoder using the optimal code designed for .

2.3 Uninformative representation issue

As underlined in the introduction, the main issue of VAE is that it learns an uninformative representation and a -independent generative model . Such issues are intrinsic in the ELBO objective (2), that reaches the optimum when , (zhao2017infovae, ). The rate term, which can be rewritten as


is a penalty on the encoding capacity, and reaches the optimum when , with , i.e. when does not encode any information about the input .

We now describe the two most relevant models that try to overcome the uninformative representation issue.


In (zhao2017infovae, ) the InfoVAE family of models was proposed, a generalization of the VAE model optimizing the objective


with and two real hyper-parameters.

The main advantage of this definition is that it is possible to consider separately the two components of the rate term. In particular, in (zhao2017infovae, ) it was observed that by eliminating the information penalty (), the generative performance of the model improves and the representation is more informative.


In (higgins2017beta, ), starting from the observation that the optimal case is rare, but most of the learned features by VAE are uninformative, an opposite approach is proposed: put a high penalty to the rate term. The -VAE family is a particular case of InfoVAE where . This idea, that at first sight looks counter-intuitive, is based on the observation that by the additive property of the KL-divergence


pushing the penalty associated with the rate is equivalent to penalizing the informativeness of most features, leaving few features containing the relevant information. A similar conclusion was derived in (chen2016variational, ) where starting from a bits-back coding argument it is highlighted that minimizing the encoding capacity bounds the variational extra term added by the variational approximation in (2), , measuring the extra-code length for using a non-precise inference .

We conclude this section observing that although InfoVAE and VAE approaches are antithetic, in both the cases the hyper-parameter associated to the KL divergence term is bigger then .

3 The Model

3.1 The Variational InfoMax (VIMAE)

Assuming known the distribution associated to the two random variables and the InfoMax objective is defined as: find the joint distribution maximizing the mutual information .

Since the definition via KL divergence is computationally intractable, it is necessary to re-write the mutual information as


where is the entropy of and is a measure of the information contained by the random variable, and is the conditional entropy, a measure of the information lost by about . Since the entropy is constant. Then in order to maximize the mutual information it is sufficient to minimize the conditional entropy.

Excluding some special cases (bell1997independent, ), minimizing the conditional entropy is unfeasible. Thus it is necessary to consider a variational lower bound of the original objective. In the same fashion as done in (agakov2004algorithm, ), we see that by the non-negativity of the KL divergence, for any the conditional entropy is bounded by the reconstruction accuracy term , indeed:


Then the associated variational objective to maximize is given by:


In order to proceed to a numerical optimization of , and optimize the variational conditional entropy minimizing the reconstruction loss of the associated autoencoder, as done in VAE, it is necessary to remove the condition , and consider the following relaxed form


where is an hyper-parameter associated to the generic -divergence , penalizing all the far from . In this way the objective (9) is optimized by a variational autoencoder model with regularizer defined by .

From now on let us assume, . In this case the regularizer is approximated via the Maximum Mean Discrepancy (MMD)(zhao2017infovae, ) defined as


where is the Reproducing Kernel Hilbert Space associated to a positive definite kernel .

Encoding channel

In VAE we observed that an uninformative representation was caused by the non-informativeness of the encoding map . Since from equation (9) it is not clear how behaves, we consider an equivalent representation, (zhao2017infovae, ):


From (11) we see that the infomax objective (9) can be read as a composition of three sub-objectives: find a generative model resembling the visible representation (first term); maximize the encoded mutual information (fourth term); and learn an inferred distribution close to the generative model . Then the optimum is obtained by such that is maximal, confirming the validity of the approximation made above.

3.2 Channel capacity

The divergence term in (9) can be rewritten as


where is the cumulative distribution associated to , i.e. . Thanks to the relationship in (12) we see that minimizing the KL divergence is equivalent to maximizing a constrained entropy of the latent variable. In this way it is possible to interpret as a constraint for the shape of distribution and its entropy, since the entropy in (12) is lower then zero and it is equal to zero only when .

This observation, although simple, is theoretically relevant: it allows us to interpret the divergence penalty as a bound of the network capacity ; i.e. a bound of the information that can be stored by the variable, and then consequently it suggests to see the variational InfoMax as an approximation of the following objective:


By the constrained infomax objective (13

), and by the disentangled representation learned by

-VAE, we deduce that the ability to learn the relevant factors of the visible data is associated to the constraint in the capacity of the channel. Intuitively, since a small capacity network can contain only a small amount of information, the network has to transfer only the relevant features. In order to test this assumption in the experiments (see below) we trained the model assuming

is logistically distributed with unity variance. We choose such a distribution for two reasons: it has less entropy than a Gaussian distribution and because it is a common assumption in natural science to suppose that the hidden factors of the visible data are logistically distributed

(hyvarinen2009natural, ).

4 Related work

Autoencoder literature

Autoencoder models are one of the most used family of neural networks to extract features in an unsupervised way (bengio2013representation, ), and their relationship with Information Theory is well-established from the first unregularized autoencoders (baldi1989neural, ). The classical unregularized autoencoders, minimizing the reconstruction loss , are maximizing an unbounded information, i.e. they are looking for a solution in the space . A solution in this wide space is good only to reconstruction performance because contains all the possible information that can be stored in the space , but from this representation it is impossible to sample, because the prior is unknown; and moreover such a representation, in general, is not robust to input noise (vincent2008extracting, ).

Many regularized models have been proposed, but the most well known is VAE, that minimizes the expected code length of communicating . As we observed in the previous sections, it is not guaranteed that this method finds a useful representation, and in the second section we illustrated two principal ways to improve VAE.

The objective (9) was derived independently in (tolstikhin2017wasserstein, ) and (zhao2017infovae, ). The derivation in (tolstikhin2017wasserstein, ) is of particular relevance because it allows us to describe an informative model as the one minimizing the transport cost between the original and generated data.

Finally, we underline that in case we wish to consider a Jensen-Shannon divergence in (9) it is necessary to consider an adversarial network model, discriminating the true samples from the fake sampled by (goodfellow2014generative, ). In the latter case the obtained model is equivalent to the Adversarial AutoEncoder (makhzani2015adversarial, ). We conclude by remarking that in all the cases cited above the Infomax objective was never maximized using a prior different from a Gaussian.

Information theoretic literature

Information theory is strongly related with neural networks, and not only with autoencoders. Originally the InfoMax objective was applied to a self-organized system with a single hidden layer, (bell1997independent, ; linsker1989application, )

where the bound in the capacity was given by the numbers of hidden neurons. Recently the (naive) InfoMax has given way to a new information-theoretic principle: the Information-Bottleneck (IB)

(tishby2000information, )

. The idea of this principle is that a feed-forward neural network trained for task

tends to learn a minimally sufficient representation of the data, maximizing the following objective:


Although it was shown that in the general case this principle does not hold true (michael2018on, ), the principle was used as a regularization technique with success both in unsupervised (higgins2017beta, ) and supervised (alemi2016deep, ) settings. We observe that the VIM (9) and IB (14) differ only in the constraint term, respectively the capacity and the encoding information, and coincide in the case of a deterministic encoder.

5 Experiments

Here we empirically evaluate the Variational InfoMax model. The section is divided in two parts: in the first part we compare the ability of VAE, -VAE and VIMAE to infer the representation, , observing that the latter two models are able to learn a posterior fitting well .

In the second part we compare the quality of the learned representation by the different models, in particular paying attention on the differences between a small entropy, logistically distributed representation, and a Gaussian distributed one. In order to evaluate the representation we compare the models in the following tasks: generation, reconstruction and semi-supervised learning; where the last two tasks will be performed both with corrupted and clean input data in order to evaluate the robustness of the learned features.

Since we approximate the KL divergence, , with the MMD distance, the regularizer in the autoencoder has the following form:


with and . We used the inverse multi-quadratics kernel , with . We choose this kernel because it is characterized by heavy tails and then it is suitable to measure the distance of a leptokurtic distribution as the logistic distribution that we used as prior .

5.1 The shape of Z

The experiments in this subsection are performed with an autoencoder trained with the MNIST data-set, a collection of 70k monocromatic handwritten digits, where both the inference and generative distributions are modelled by 3-layer deep neural nets with 256 hidden units in each layer and .







Figure 1: 2-d learned representation,

In figure 1 are plotted the 2d learned representations by the different methods and we observe that VAE is not able to learn an hidden representation fitting the prior . This phenomenon is consistent with the -VAE hypothesis and attests how the theoretically null rate issue, , is rare and it happens only in case of really powerful autoregressive generative models like PixelRNN (oord2016pixel, ) and PixelCNN++ (salimans2017pixelcnn++, ). This example is particularly useful to understand the necessity to penalize the capacity term, as done in -VAE and VIMAE. These models are able to learn a representation fitting fairly well to .

5.2 The role of capacity

In this subsection all the experiments are performed with the same autoencoder models used in (tolstikhin2017wasserstein, ), an architecture similar to the DCGAN (radford2015unsupervised, )

with batch normalization

(ioffe2015batch, ). We consider two data-sets: MNIST, a standard benchmark with ground-truth labels, to evaluate the quality of the learned representation and CelebA (liu2015deep, ), consisting of roughly of 203k center cropped faces of resolution, in order to compare the generative quality of the pictures. After considering many parameters for and , we choose, in accordance to what is suggested in (tolstikhin2017wasserstein, ), for MNIST and for CelebA experiments.

accuracy (%)
VAE 80.4 77.8 70.6 72.6 52
-VAE 92.7 86.6 82.2 91.7 84.3
VIMAE-n 93.6 92.5 86.6 92.1 86.2
VIMAE-l 93.1 92.6 88.4 92.3 87.1
Table 1: Semi-supervised classification, MNIST

Semi-supervised Learning

We define a good representation as one containing the relevant properties of the visible data. In order to evaluate such quality, following the approach proposed in (rifai2011higher, ), we evaluate the accuracy of an SVM directly trained on the learned features of the data. Proceeding as made in (zhao2017infovae, ), we train the M1+TSVM (kingma2014semi, ) and use the semi-supervised performance over 1000 samples as an approximate metric to verify the relevance and the quality of the learned representation. In order to evaluate the robustness of the learned features, we performed the same algorithm on the representation associated to a corrupted data. In particular we consider two types of noise corruption: Gaussian and mask. In the Gaussian case, we add to each MNIST pixel a value sampled from with ; in the masking case a fraction

of the elements is forced to be 0 according to a Bernoulli distribution

. Higher classification performance suggests that the learned representation contains the relevant information and, in case of corrupted input data, that it is robust.

From the classification scores listed in table 1

, it is clear that VAE, differently from the other methods, is not able to learn a relevant representation and is not robust to noise. Particularly relevant are the last two rows, where the two VIMAEs are compared, VIMAE-n and VIMAE-l with normal and logistic priors, respectively. The normal distribution, having larger entropy than the logistic distribution, is able to store more information, and the associated representation has the best classification score with clean data; but such information is not completely relevant and the representation is not as robust as the one learned by VIMAE-l. Such phenomenon is particularly clear in the highly corrupted data case,

, where it is necessary to individuate and to extract the relevant lineaments of the visible data.

Generation and reconstruction
















Figure 2: Test reconstruction (top), test reconstruction from corrupted data (middle), and random generated samples (bottom) of the different methods for the MNIST dataset, .

The models that we are considering are defined as generative models: given a sample , they should be able to generate a new data similar to the original one. In figure 2 are plotted the reconstruction and the generated samples, obtained from the different models, and we observe that, although all the models are able to reconstruct (all of them are autoencoders), VAE and VAE do not generate good samples. Such behaviour is not surprising, and it is correlated with the inability to learn a prior fitting ; indeed, in the generative case the representation is sampled from and not from as in the reconstruction case.

In order to emphasize the ability of VIMAE to learn the relevant properties, in the second row of figure 2 we plotted the reconstruction when we fed the model with fifty percent masked digits. Such an experiment is particularly useful to see that VIMAE does not reconstruct the corrupted data, but the associated clean one. Indeed, the VIMAE reconstruction is the one minimizing the transport between the (corrupted) input and one of the (clean) training set.

[width=]rec_origA.png [width=]gen_origA2.png


[width=]rec_logA.png [width=]gen_logA.png

Figure 3: Test reconstruction (top) and random generated samples (bottom) of the two VIMAE models with the CelebA dataset, .

The experiments with MNIST underlined that the VIMAE models outperform the others. For this reason we decided to compare the two variants of VIMAE when trained with a more challenging data-set: CelebA (liu2015deep, ). From figure 3 we observe that the differences between the two models, VIMAE-n and VIMAE-l, both in the reconstruction and generation are minimal. The small difference in generative performance is confirmed also by the Frechet Inception Distance (heusel2017gans, ) in table 2, where according to what was seen in table 1, we notice that the Gaussian prior variant, VIMAE-n, containing more information in the representation, has slightly better generative performance than the logistic prior variant, VIMAE-l.

Method FID
VAE 82
VIMAE-l 56
VIMAE-n 55
Table 2: FID scores for generated samples on CelebA (smaller is better)

6 Conclusion

Trying to solve the issue of the uninformativeness of the learned representation in VAE, we proposed a variational method that learns a generative model by maximizing the mutual information between the visible and hidden representations. In particular, the method maximizes a capacity-constrained InfoMax, where the constraint is given by the choice of the prior distribution . We described the role of information capacity in the major variational autoencoder models and we deduce that by reducing the capacity a network tends to learn more robust and relevant features. The deduction was confirmed by computational experiments.

Future work will include the generalization of the capacity-constrained InfoMax to autoregressive models and to a supervised setting.