InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets
InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets
Abstract
摘要
This paper describes InfoGAN, an information-theoretic extension to the Generative Adversarial Network that is able to learn disentangled representations in a completely unsupervised manner. InfoGAN is a generative adversarial network that also maximizes the mutual information between a small subset of the latent variables and the observation. We derive a lower bound of the mutual information objective that can be optimized efficiently. Specifically, InfoGAN successfully disentangles writing styles from digit shapes on the MNIST dataset, pose from lighting of 3D rendered images, and background digits from the central digit on the SVHN dataset. It also discovers visual concepts that include hair styles, presence/absence of eyeglasses, and emotions on the CelebA face dataset. Experiments show that InfoGAN learns interpretable representations that are competitive with representations learned by existing supervised methods. For an up-to-date version of this paper, please see https://arxiv.org/abs/1606.03657.
本文介绍 InfoGAN,这是生成对抗网络(Generative Adversarial Network)的一种信息论扩展,能够在完全无监督的条件下学习解耦表示(disentangled representation)。InfoGAN 本身仍是生成对抗网络,同时最大化潜变量中一个较小子集与观测之间的互信息。我们为互信息目标导出一个可以高效优化的下界。具体而言,InfoGAN 能在 MNIST 上把书写风格与数字外形分开,在三维渲染图像上把姿态与光照分开,并在 SVHN 上把背景数字与中心数字分开。它还在 CelebA 人脸数据上发现了发型、是否佩戴眼镜以及情绪等视觉概念。实验表明,InfoGAN 学到的可解释表示,可以和现有有监督方法学到的表示相竞争。本文的更新版本见 https://arxiv.org/abs/1606.03657。
30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain.
第 30 届神经信息处理系统大会(NIPS 2016),西班牙巴塞罗那。
1 Introduction
1 引言
Unsupervised learning can be described as the general problem of extracting value from unlabelled data which exists in vast quantities. A popular framework for unsupervised learning is that of representation learning [1, 2], whose goal is to use unlabelled data to learn a representation that exposes important semantic features as easily decodable factors. A method that can learn such representations is likely to exist [2], and to be useful for many downstream tasks which include classification, regression, visualization, and policy learning in reinforcement learning.
无监督学习可以概括成这样一个一般问题:从大量存在的无标注数据中提取出有用的东西。其中一种常见框架是表示学习(representation learning)[1, 2],目标是利用无标注数据学到一种表示,把重要的语义特征暴露成容易解码的因子。能够学到这类表示的方法很可能是存在的 [2],并且会对许多下游任务有用,包括分类、回归、可视化,以及强化学习中的策略学习。
While unsupervised learning is ill-posed because the relevant downstream tasks are unknown at training time, a disentangled representation, one which explicitly represents the salient attributes of a data instance, should be helpful for the relevant but unknown tasks. For example, for a dataset of faces, a useful disentangled representation may allocate a separate set of dimensions for each of the following attributes: facial expression, eye color, hairstyle, presence or absence of eyeglasses, and the identity of the corresponding person. A disentangled representation can be useful for natural tasks that require knowledge of the salient attributes of the data, which include tasks like face recognition and object recognition. It is not the case for unnatural supervised tasks, where the goal could be, for example, to determine whether the number of red pixels in an image is even or odd. Thus, to be useful, an unsupervised learning algorithm must in effect correctly guess the likely set of downstream classification tasks without being directly exposed to them.
无监督学习之所以是不适定的,是因为相关的下游任务在训练时并不知道;不过,一种解耦表示——也就是把数据实例的显著属性显式表示出来的表示——应当有助于那些相关但未知的任务。例如,对人脸数据集而言,一种有用的解耦表示可能会为下列每一种属性分别分配一组维度:面部表情、眼睛颜色、发型、是否佩戴眼镜,以及对应的人的身份。对需要了解数据显著属性的自然任务来说,解耦表示会有用,这类任务包括人脸识别和物体识别。对不自然的监督任务则未必如此,例如目标可能只是判断一幅图像里红色像素的个数是奇数还是偶数。因此,要想真正有用,无监督学习算法实际上必须在并未直接接触这些任务的情况下,正确猜出下游分类任务可能是哪些。
A significant fraction of unsupervised learning research is driven by generative modelling. It is motivated by the belief that the ability to synthesize, or “create” the observed data entails some form of understanding, and it is hoped that a good generative model will automatically learn a disentangled representation, even though it is easy to construct perfect generative models with arbitrarily bad representations. The most prominent generative models are the variational autoencoder (VAE) [3] and the generative adversarial network (GAN) [4].
相当一部分无监督学习研究是由生成建模推动的。其动机是相信:能够合成、或者说“创造”出所观测到的数据,就意味着某种形式的理解;人们也希望一个好的生成模型会自动学到解耦表示,尽管构造表示任意糟糕、却仍完美的生成模型并不困难。最突出的生成模型是变分自编码器(VAE)[3] 和生成对抗网络(GAN)[4]。
In this paper, we present a simple modification to the generative adversarial network objective that encourages it to learn interpretable and meaningful representations. We do so by maximizing the mutual information between a fixed small subset of the GAN’s noise variables and the observations, which turns out to be relatively straightforward. Despite its simplicity, we found our method to be surprisingly effective: it was able to discover highly semantic and meaningful hidden representations on a number of image datasets: digits (MNIST), faces (CelebA), and house numbers (SVHN). The quality of our unsupervised disentangled representation matches previous works that made use of supervised label information [5–9]. These results suggest that generative modelling augmented with a mutual information cost could be a fruitful approach for learning disentangled representations.
在本文中,我们对生成对抗网络的目标做一个简单修改,以促使它学习可解释、有意义的表示。做法是最大化 GAN 噪声变量中一个固定的较小子集与观测之间的互信息,而这件事相对直接。尽管方法简单,我们发现它出奇地有效:它能在多个图像数据集上发现高度语义、有意义的隐表示,包括数字(MNIST)、人脸(CelebA)和门牌号(SVHN)。我们这种无监督解耦表示的质量,可以和以往使用监督标签信息的工作相比 [5–9]。这些结果说明,在生成建模中加入互信息代价,可能是学习解耦表示的一条有收获的路。
In the remainder of the paper, we begin with a review of the related work, noting the supervision that is required by previous methods that learn disentangled representations. Then we review GANs, which is the basis of InfoGAN. We describe how maximizing mutual information results in interpretable representations and derive a simple and efficient algorithm for doing so. Finally, in the experiments section, we first compare InfoGAN with prior approaches on relatively clean datasets and then show that InfoGAN can learn interpretable representations on complex datasets where no previous unsupervised approach is known to learn representations of comparable quality.
在本文余下部分,我们先回顾相关工作,并指出以往学习解耦表示的方法需要怎样的监督。随后回顾作为 InfoGAN 基础的 GAN。我们说明最大化互信息如何带来可解释表示,并导出一个简单而高效的算法来实现这一点。最后,在实验部分,我们先在相对干净的数据集上把 InfoGAN 与先前方法比较,再表明 InfoGAN 也能在更复杂的数据集上学到可解释表示,而此前并没有已知的无监督方法能在这些数据上学到质量相当的表示。
2 Related Work
2 相关工作
There exists a large body of work on unsupervised representation learning. Early methods were based on stacked (often denoising) autoencoders or restricted Boltzmann machines [10–13].
无监督表示学习已有大量工作。早期方法基于堆叠的(常常是去噪)自编码器,或受限玻尔兹曼机 [10–13]。
Another intriguing line of work consists of the ladder network [14], which has achieved spectacular results on a semi-supervised variant of the MNIST dataset. More recently, a model based on the VAE has achieved even better semi-supervised results on MNIST [15]. GANs [4] have been used by Radford et al. [16] to learn an image representation that supports basic linear algebra on code space. Lake et al. [17] have been able to learn representations using probabilistic inference over Bayesian programs, which achieved convincing one-shot learning results on the OMNI dataset.
另一条有意思的线索是阶梯网络(ladder network)[14],它在 MNIST 的一个半监督变体上取得了非常出色的结果。更近一些,一种基于 VAE 的模型在 MNIST 半监督设定上取得了更好的结果 [15]。Radford 等人 [16] 用 GAN [4] 学到一种图像表示,并支持在编码空间上做基本的线性代数运算。Lake 等人 [17] 通过对贝叶斯程序做概率推断来学习表示,并在 OMNI 数据集上取得了有说服力的一次性学习结果。
In addition, prior research attempted to learn disentangled representations using supervised data. One class of such methods trains a subset of the representation to match the supplied label using supervised learning: bilinear models [18] separate style and content; multi-view perceptron [19] separate face identity and view point; and Yang et al. [20] developed a recurrent variant that generates a sequence of latent factor transformations. Similarly, VAEs [5] and Adversarial Autoencoders [9] were shown to learn representations in which class label is separated from other variations.
此外,先前研究也曾尝试用有监督数据来学习解耦表示。有一类方法用监督学习,把表示中的一个子集训练成与给定标签对齐:双线性模型 [18] 分离风格与内容;多视角感知机 [19] 分离人脸身份与视角;Yang 等人 [20] 还发展了一种循环变体,生成一串潜因子变换。类似地,VAE [5] 和对抗自编码器(Adversarial Autoencoders)[9] 也被表明可以学到把类别标签与其他变化分开的表示。
Recently several weakly supervised methods were developed to remove the need of explicitly labeling variations. disBM [21] is a higher-order Boltzmann machine which learns a disentangled representation by “clamping” a part of the hidden units for a pair of data points that are known to match in all but one factors of variation. DC-IGN [7] extends this “clamping” idea to VAE and successfully learns graphics codes that can represent pose and light in 3D rendered images. This line of work yields impressive results, but they rely on a supervised grouping of the data that is generally not available. Whitney et al. [8] proposed to alleviate the grouping requirement by learning from consecutive frames of images and use temporal continuity as supervisory signal.
近来又出现了若干弱监督方法,以去掉显式标注各种变化的需要。disBM [21] 是一种高阶玻尔兹曼机,它对已知除某一个变化因子外都相匹配的一对数据点,“钳制”(clamping)一部分隐单元,从而学习解耦表示。DC-IGN [7] 把这种“钳制”想法扩展到 VAE,并成功学到能表示三维渲染图像中姿态与光照的图形编码。这条路线的结果令人印象深刻,但它们依赖于对数据的有监督分组,而这样的分组通常并不可得。Whitney 等人 [8] 提出从连续图像帧中学习,用时间连续性作为监督信号,以减轻对分组的依赖。
Unlike the cited prior works that strive to recover disentangled representations, InfoGAN requires no supervision of any kind. To the best of our knowledge, the only other unsupervised method that learns disentangled representations is hossRBM [13], a higher-order extension of the spike-and-slab restricted Boltzmann machine that can disentangle emotion from identity on the Toronto Face Dataset [22]. However, hossRBM can only disentangle discrete latent factors, and its computation cost grows exponentially in the number of factors. InfoGAN can disentangle both discrete and continuous latent factors, scale to complicated datasets, and typically requires no more training time than regular GANs.
与上述致力于恢复解耦表示的先前工作不同,InfoGAN 不需要任何形式的监督。据我们所知,另一种能学习解耦表示的无监督方法只有 hossRBM [13],它是尖峰-板条受限玻尔兹曼机(spike-and-slab restricted Boltzmann machine)的高阶扩展,能在 Toronto Face Dataset [22] 上把情绪与身份分开。不过,hossRBM 只能解耦离散潜因子,而且计算代价随因子数目指数增长。InfoGAN 既能解耦离散潜因子,也能解耦连续潜因子,可以扩展到更复杂的数据集,并且通常并不比普通 GAN 需要更多训练时间。
3 Background: Generative Adversarial Networks
3 背景:生成对抗网络
Goodfellow et al. [4] introduced the Generative Adversarial Networks (GAN), a framework for training deep generative models using a minimax game. The goal is to learn a generator distribution that matches the real data distribution . Instead of trying to explicitly assign probability to every in the data distribution, GAN learns a generator network that generates samples from the generator distribution by transforming a noise variable into a sample . This generator is trained by playing against an adversarial discriminator network that aims to distinguish between samples from the true data distribution and the generator's distribution . So for a given generator, the optimal discriminator is . More formally, the minimax game is given by the following expression:
Goodfellow 等人 [4] 提出了生成对抗网络(GAN),这是一个用极小极大博弈来训练深度生成模型的框架。目标是学习一个与真实数据分布 相匹配的生成器分布 。GAN 并不试图为数据分布中的每一个 显式赋概率,而是学习一个生成器网络 ,把噪声变量 变换成样本 ,从而从生成器分布 中产生样本。这个生成器通过对抗判别器网络 来训练, 的目标是区分来自真实数据分布 的样本和来自生成器分布 的样本。因此,对给定的生成器,最优判别器是 。更形式地,这一极小极大博弈由下面的表达式给出:
4 Mutual Information for Inducing Latent Codes
4 用互信息诱导潜编码
The GAN formulation uses a simple factored continuous input noise vector , while imposing no restrictions on the manner in which the generator may use this noise. As a result, it is possible that the noise will be used by the generator in a highly entangled way, causing the individual dimensions of to not correspond to semantic features of the data.
GAN 的表述使用一个简单的、因子化的连续输入噪声向量 ,同时并不限制生成器使用这些噪声的方式。因此,生成器有可能以高度纠缠的方式使用噪声,使得 的各个维度并不对应于数据的语义特征。
However, many domains naturally decompose into a set of semantically meaningful factors of variation. For instance, when generating images from the MNIST dataset, it would be ideal if the model automatically chose to allocate a discrete random variable to represent the numerical identity of the digit (0-9), and chose to have two additional continuous variables that represent the digit's angle and thickness of the digit's stroke. It would be useful if we could recover these concepts without any supervision, by simply specifying that an MNIST digit is generated by an 1-of-10 variable and two continuous variables.
不过,许多领域本身就可以分解成一组有语义意义的变化因子。例如,在从 MNIST 生成图像时,理想情况是模型自动选择用一个离散随机变量来表示数字的数值身份(0–9),再用两个额外的连续变量来表示数字的角度和笔画粗细。如果只需指定“一个 MNIST 数字由一个十选一变量和两个连续变量生成”,就能在没有任何监督的情况下恢复这些概念,那将会很有用。
In this paper, rather than using a single unstructured noise vector, we propose to decompose the input noise vector into two parts: (i) , which is treated as source of incompressible noise; (ii) , which we will call the latent code and will target the salient structured semantic features of the data distribution.
在本文中,我们不再使用单一的无结构噪声向量,而是把输入噪声向量分成两部分:(i),作为不可压缩噪声的来源;(ii),我们称之为潜编码(latent code),用来对准数据分布中那些显著的、有结构的语义特征。
Mathematically, we denote the set of structured latent variables by . In its simplest form, we may assume a factored distribution, given by . For ease of notation, we will use latent codes to denote the concatenation of all latent variables .
在数学上,我们把这组有结构的潜变量记为 。最简单的情形下,可以假定一个因子化分布:。为书写方便,我们将用潜编码 表示所有潜变量 的拼接。
We now propose a method for discovering these latent factors in an unsupervised way: we provide the generator network with both the incompressible noise and the latent code , so the form of the generator becomes . However, in standard GAN, the generator is free to ignore the additional latent code by finding a solution satisfying . To cope with the problem of trivial codes, we propose an information-theoretic regularization: there should be high mutual information between latent codes and generator distribution . Thus should be high.
接下来我们提出一种无监督发现这些潜因子的方法:同时把不可压缩噪声 和潜编码 提供给生成器网络,于是生成器的形式变成 。然而在标准 GAN 中,生成器完全可以忽略额外的潜编码 ,只要找到满足 的解即可。为应对这种平凡编码问题,我们提出一种信息论正则:潜编码 与生成器分布 之间应当有高互信息。因此 应当较高。
In information theory, mutual information between and , , measures the “amount of information” learned from knowledge of random variable about the other random variable . The mutual information can be expressed as the difference of two entropy terms:
在信息论中, 与 之间的互信息 衡量的是:在知道随机变量 之后,关于另一个随机变量 所了解到的“信息量”。互信息可以写成两个熵项之差:
This definition has an intuitive interpretation: is the reduction of uncertainty in when is observed. If and are independent, then , because knowing one variable reveals nothing about the other; by contrast, if and are related by a deterministic, invertible function, then maximal mutual information is attained. This interpretation makes it easy to formulate a cost: given any , we want to have a small entropy. In other words, the information in the latent code should not be lost in the generation process. Similar mutual information inspired objectives have been considered before in the context of clustering [23–25]. Therefore, we propose to solve the following information-regularized minimax game:
这一定义有一个直观解释: 是在观测到 时, 的不确定性减少了多少。如果 与 相互独立,则 ,因为知道其中一个变量对另一个毫无揭示;相反,如果 与 由一个确定且可逆的函数相联系,则达到最大互信息。这一解释使代价函数很容易写出:对任意 ,我们希望 具有较小的熵。换句话说,潜编码 中的信息不应当在生成过程中丢失。类似的、受互信息启发的目标,先前已在聚类的语境中被考虑过 [23–25]。因此,我们提出求解下面这个带互信息正则的极小极大博弈:
5 Variational Mutual Information Maximization
5 变分互信息最大化
In practice, the mutual information term is hard to maximize directly as it requires access to the posterior . Fortunately we can obtain a lower bound of it by defining an auxiliary distribution to approximate :
在实践中,互信息项 很难直接最大化,因为它需要用到后验 。幸运的是,我们可以定义一个辅助分布 来逼近 ,从而得到它的一个下界:
This technique of lower bounding mutual information is known as Variational Information Maximization [26]. We note that the entropy of latent codes can be optimized as well since it has a simple analytical form for common distributions. However, in this paper we opt for simplicity by fixing the latent code distribution and we will treat as a constant. So far we have bypassed the problem of having to compute the posterior explicitly via this lower bound but we still need to be able to sample from the posterior in the inner expectation. Next we state a simple lemma, with its proof deferred to Appendix 1, that removes the need to sample from the posterior.
这种为互信息构造下界的技术被称为变分信息最大化(Variational Information Maximization)[26]。我们注意到,潜编码的熵 也可以被优化,因为它对常见分布有简单的解析形式。不过,本文为简单起见固定潜编码的分布,并把 当作常数。到目前为止,我们借助这一下界避开了显式计算后验 的问题,但内层期望中仍需要能够从后验中采样。接下来我们陈述一条简单引理,其证明留到附录 1,它可以去掉从后验采样的需要。
Lemma 5.1 For random variables , and function under suitable regularity conditions: .
引理 5.1 对随机变量 、 和函数 ,在适当的正则条件下:。
By using Lemma 5.1, we can define a variational lower bound, , of the mutual information, :
借助引理 5.1,我们可以为互信息 定义一个变分下界 :
We note that is easy to approximate with Monte Carlo simulation. In particular, can be maximized w.r.t. directly and w.r.t. via the reparametrization trick. Hence can be added to GAN's objectives with no change to GAN's training procedure and we call the resulting algorithm Information Maximizing Generative Adversarial Networks (InfoGAN).
我们注意到, 很容易用蒙特卡洛模拟来逼近。具体来说, 可以对 直接最大化,并借助重参数化技巧对 最大化。因此,可以把 加到 GAN 的目标上,而不必改变 GAN 的训练程序;我们把由此得到的算法称为信息最大化生成对抗网络(Information Maximizing Generative Adversarial Networks,InfoGAN)。
Eq (4) shows that the lower bound becomes tight as the auxiliary distribution approaches the true posterior distribution: . In addition, we know that when the variational lower bound attains its maximum for discrete latent codes, the bound becomes tight and the maximal mutual information is achieved. In Appendix, we note how InfoGAN can be connected to the Wake-Sleep algorithm [27] to provide an alternative interpretation.
式 (4) 表明,当辅助分布 逼近真正的后验分布时,下界会变紧:。此外,我们知道,对离散潜编码而言,当变分下界达到其最大值 时,下界变紧,并且达到最大互信息。在附录中,我们还说明了如何把 InfoGAN 与 Wake-Sleep 算法 [27] 联系起来,以给出另一种解释。
Hence, InfoGAN is defined as the following minimax game with a variational regularization of mutual information and a hyperparameter :
因此,InfoGAN 被定义为下面这个带有互信息变分正则以及超参数 的极小极大博弈:
6 Implementation
6 实现
In practice, we parametrize the auxiliary distribution as a neural network. In most experiments, and share all convolutional layers and there is one final fully connected layer to output parameters for the conditional distribution , which means InfoGAN only adds a negligible computation cost to GAN. We have also observed that always converges faster than normal GAN objectives and hence InfoGAN essentially comes for free with GAN.
在实践中,我们把辅助分布 参数化成一个神经网络。在大多数实验里, 与 共享全部卷积层,只在最后用一层全连接输出条件分布 的参数,这意味着 InfoGAN 只给 GAN 增加了可以忽略的计算开销。我们还观察到, 总是比普通的 GAN 目标收敛得更快,因此 InfoGAN 基本上是随 GAN 一起“白送”的。
For categorical latent code , we use the natural choice of softmax nonlinearity to represent . For continuous latent code , there are more options depending on what is the true posterior . In our experiments, we have found that simply treating as a factored Gaussian is sufficient.
对类别型潜编码 ,我们采用自然的选择,用 softmax 非线性来表示 。对连续潜编码 ,选项更多,取决于真正的后验 是什么。在我们的实验中,发现只需把 当作因子高斯就足够了。
Since GAN is known to be difficult to train, we design our experiments based on existing techniques introduced by DC-GAN [16], which are enough to stabilize InfoGAN training and we did not have to introduce new trick. Detailed experimental setup is described in Appendix. Even though InfoGAN introduces an extra hyperparameter , it's easy to tune and simply setting to is sufficient for discrete latent codes. When the latent code contains continuous variables, a smaller is typically used to ensure that , which now involves differential entropy, is on the same scale as GAN objectives.
由于 GAN 素以难训练著称,我们的实验设计基于 DC-GAN [16] 引入的已有技术,它们已足以稳定 InfoGAN 的训练,我们不必再引入新的技巧。详细实验设置见附录。尽管 InfoGAN 多引入了一个超参数 ,它很容易调节:对离散潜编码,直接设为 就足够。当潜编码包含连续变量时,通常使用更小的 ,以确保此时涉及微分熵的 与 GAN 目标处于同一量级。
7 Experiments
7 实验
The first goal of our experiments is to investigate if mutual information can be maximized efficiently. The second goal is to evaluate if InfoGAN can learn disentangled and interpretable representations by making use of the generator to vary only one latent factor at a time in order to assess if varying such factor results in only one type of semantic variation in generated images. DC-IGN [7] also uses this method to evaluate their learned representations on 3D image datasets, on which we also apply InfoGAN to establish direct comparison.
我们实验的第一个目标,是考察互信息能否被高效最大化。第二个目标,是评估 InfoGAN 能否学习解耦且可解释的表示:做法是利用生成器每次只改变一个潜因子,看这种改变是否只带来生成图像中一种类型的语义变化。DC-IGN [7] 也用这种方法在三维图像数据集上评估所学表示;我们同样在这些数据上应用 InfoGAN,以便直接比较。
7.1 Mutual Information Maximization
7.1 互信息最大化
To evaluate whether the mutual information between latent codes and generated images can be maximized efficiently with proposed method, we train InfoGAN on MNIST dataset with a uniform categorical distribution on latent codes . In Fig 1, the lower bound is quickly maximized to , which means the bound (4) is tight and maximal mutual information is achieved.
为评估用所提出的方法能否高效最大化潜编码 与生成图像 之间的互信息,我们在 MNIST 上训练 InfoGAN,并对潜编码使用均匀的类别分布 。在图 1 中,下界 被迅速最大化到 ,这意味着下界 (4) 已经变紧,并且达到了最大互信息。
图 1:下界 随训练迭代的变化
As a baseline, we also train a regular GAN with an auxiliary distribution when the generator is not explicitly encouraged to maximize the mutual information with the latent codes. Since we use expressive neural network to parametrize , we can assume that reasonably approximates the true posterior and hence there is little mutual information between latent codes and generated images in regular GAN. We note that with a different neural network architecture, there might be a higher mutual information between latent codes and generated images even though we have not observed such case in our experiments. This comparison is meant to demonstrate that in a regular GAN, there is no guarantee that the generator will make use of the latent codes.
作为基线,我们还训练了一个带辅助分布 的普通 GAN,但并不显式鼓励生成器最大化它与潜编码之间的互信息。由于我们用表达能力较强的神经网络来参数化 ,可以假定 对真正的后验 有合理的逼近,因此在普通 GAN 中,潜编码与生成图像之间几乎没有互信息。我们注意到,若换用不同的神经网络架构,潜编码与生成图像之间的互信息可能会更高,尽管我们在实验中并未观察到这种情况。这一比较是为了说明:在普通 GAN 中,并不能保证生成器会用到这些潜编码。
7.2 Disentangled Representation
7.2 解耦表示
To disentangle digit shape from styles on MNIST, we choose to model the latent codes with one categorical code, , which can model discontinuous variation in data, and two continuous codes that can capture variations that are continuous in nature: .
为在 MNIST 上把数字外形与风格分开,我们选择用一个类别型编码 来刻画数据中的不连续变化,再用两个连续编码来捕捉本质上连续的变化:。
In Figure 2, we show that the discrete code captures drastic change in shape. Changing categorical code switches between digits most of the time. In fact even if we just train InfoGAN without any label, can be used as a classifier that achieves error rate in classifying MNIST digits by matching each category in to a digit type. In the second row of Figure 2a, we can observe a digit 7 is classified as a 9.
在图 2 中,我们表明离散编码 抓住了外形上的剧烈变化。改变类别型编码 ,大多数时候会在不同数字之间切换。事实上,即便完全不使用标签来训练 InfoGAN,也可以把 当作分类器使用:把 中的每个类别与一种数字类型对齐后,在 MNIST 数字分类上可以达到 的错误率。在图 2(a) 的第二行,可以看到一个数字 7 被分成了 9。
Continuous codes , capture continuous variations in style: models rotation of digits and controls the width. What is remarkable is that in both cases, the generator does not simply stretch or rotate the digits but instead adjust other details like thickness or stroke style to make sure the resulting images are natural looking. As a test to check whether the latent representation learned by InfoGAN is generalizable, we manipulated the latent codes in an exaggerated way: instead of plotting latent codes from to , we plot it from to covering a wide region that the network was never trained on and we still get meaningful generalization.
连续编码 、 抓住了风格上的连续变化: 刻画数字的旋转, 控制宽度。值得注意的是,在这两种情形下,生成器并不是简单地拉伸或旋转数字,而会同时调整粗细或笔画风格等细节,以使结果看起来仍然自然。为检验 InfoGAN 学到的潜表示是否可泛化,我们以夸张的方式操纵潜编码:不是把潜编码从 画到 ,而是从 画到 ,覆盖网络从未在其上训练过的更宽区域,仍然得到了有意义的泛化。
Figure 2: Manipulating latent codes on MNIST: In all figures of latent code manipulation, we will use the convention that in each one latent code varies from left to right while the other latent codes and noise are fixed. The different rows correspond to different random samples of fixed latent codes and noise. For instance, in (a), one column contains five samples from the same category in , and a row shows the generated images for 10 possible categories in with other noise fixed. In (a), each category in largely corresponds to one digit type; in (b), varying on a GAN trained without information regularization results in non-interpretable variations; in (c), a small value of denotes left leaning digit whereas a high value corresponds to right leaning digit; in (d), smoothly controls the width. We reorder (a) for visualization purpose, as the categorical code is inherently unordered.
图 2:在 MNIST 上操纵潜编码。在所有潜编码操纵图中,我们约定:每一张图里只有一个潜编码从左到右变化,其余潜编码和噪声保持固定。不同行对应固定潜编码与噪声的不同随机样本。例如在 (a) 中,同一列包含来自 同一类别的五个样本,而一行则在其他噪声固定时展示 全部 10 个可能类别的生成图像。在 (a) 中, 的每个类别大体对应一种数字类型;在 (b) 中,对未经信息正则训练的 GAN 改变 ,得到的是不可解释的变化;在 (c) 中, 取较小值表示数字向左倾斜,取较大值则向右倾斜;在 (d) 中, 平滑地控制宽度。由于类别型编码本身没有顺序,我们对 (a) 做了重排以便可视化。
Next we evaluate InfoGAN on two datasets of 3D images: faces [28] and chairs [29], on which DC-IGN was shown to learn highly interpretable graphics codes.
接下来,我们在两个三维图像数据集上评估 InfoGAN:人脸 [28] 和椅子 [29]。此前已表明,DC-IGN 能在这些数据上学到高度可解释的图形编码。
On the faces dataset, DC-IGN learns to represent latent factors as azimuth (pose), elevation, and lighting as continuous latent variables by using supervision. Using the same dataset, we demonstrate that InfoGAN learns a disentangled representation that recover azimuth (pose), elevation, and lighting on the same dataset. In this experiment, we choose to model the latent codes with five continuous codes, with .
在人脸数据集上,DC-IGN 借助监督,把潜因子表示为方位角(姿态)、仰角和光照这些连续潜变量。使用同一数据集,我们表明 InfoGAN 也能学到解耦表示,并在同一数据上恢复方位角(姿态)、仰角和光照。在这一实验中,我们选择用五个连续编码来建模潜编码:,其中 。
Since DC-IGN requires supervision, it was previously not possible to learn a latent code for a variation that's unlabeled and hence salient latent factors of variation cannot be discovered automatically from data. By contrast, InfoGAN is able to discover such variation on its own: for instance, in Figure 3d a latent code that smoothly changes a face from wide to narrow is learned even though this variation was neither explicitly generated or labeled in prior work.
由于 DC-IGN 需要监督,先前无法为未经标注的变化学习潜编码,因此显著的潜在变化因子也不能从数据中自动发现。相比之下,InfoGAN 能够自己发现这类变化:例如在图 3(d) 中,它学到了一个能把人脸从宽平滑变到窄的潜编码,尽管这种变化在先前工作中既没有被显式生成,也没有被标注。
Figure 3: Manipulating latent codes on 3D Faces: We show the effect of the learned continuous latent factors on the outputs as their values vary from to . In (a), we show that a continuous latent code consistently captures the azimuth of the face across different shapes; in (b), the continuous code captures elevation; in (c), the continuous code captures the orientation of lighting; and in (d), the continuous code learns to interpolate between wide and narrow faces while preserving other visual features. For each factor, we present the representation that most resembles prior results [7] out of 5 random runs to provide direct comparison.
图 3:在三维人脸上操纵潜编码。我们展示所学连续潜因子取值从 变到 时对输出的影响。在 (a) 中,一个连续潜编码在不同形状上都一致地抓住了人脸的方位角;在 (b) 中,连续编码抓住了仰角;在 (c) 中,连续编码抓住了光照方向;在 (d) 中,连续编码学会在宽脸与窄脸之间插值,同时保持其他视觉特征。对每个因子,我们从 5 次随机运行中展示与先前结果 [7] 最相近的那次表示,以便直接比较。
On the chairs dataset, DC-IGN can learn a continuous code that represents rotation. InfoGAN again is able to learn the same concept as a continuous code (Figure 4a) and we show in addition that InfoGAN is also able to continuously interpolate between similar chair types of different widths using a single continuous code (Figure 4b). In this experiment, we choose to model the latent factors with four categorical codes, and one continuous code .
在椅子数据集上,DC-IGN 可以学到一个表示旋转的连续编码。InfoGAN 同样能把这一概念学成连续编码(图 4(a));此外我们还表明,InfoGAN 也能用单个连续编码,在宽度不同、类型相近的椅子之间做连续插值(图 4(b))。在这一实验中,我们选择用四个类别型编码 和一个连续编码 来建模潜因子。
Figure 4: Manipulating latent codes on 3D Chairs: In (a), the continuous code captures the pose of the chair while preserving its shape, although the learned pose mapping varies across different types; in (b), the continuous code can alternatively learn to capture the widths of different chair types, and smoothly interpolate between them. For each factor, we present the representation that most resembles prior results [7] out of 5 random runs to provide direct comparison.
图 4:在三维椅子上操纵潜编码。在 (a) 中,连续编码抓住了椅子的姿态并保持其形状,尽管所学的姿态映射在不同椅型之间会有变化;在 (b) 中,连续编码也可以转而抓住不同椅型的宽度,并在它们之间平滑插值。对每个因子,我们从 5 次随机运行中展示与先前结果 [7] 最相近的那次表示,以便直接比较。
Next we evaluate InfoGAN on the Street View House Number (SVHN) dataset, which is significantly more challenging to learn an interpretable representation because it is noisy, containing images of variable-resolution and distracting digits, and it does not have multiple variations of the same object. In this experiment, we make use of four 10-dimensional categorical variables and two uniform continuous variables as latent codes. We show two of the learned latent factors in Figure 5.
接下来,我们在街景门牌号(Street View House Number,SVHN)数据集上评估 InfoGAN。要在这上面学到可解释表示明显更难,因为它噪声大,包含分辨率不一、还有干扰数字的图像,并且同一物体并没有多种变化。在这一实验中,我们使用四个 10 维类别型变量和两个均匀连续变量作为潜编码。图 5 展示了其中两个学到的潜因子。
Figure 5: Manipulating latent codes on SVHN: In (a), we show that one of the continuous codes captures variation in lighting even though in the dataset each digit is only present with one lighting condition; In (b), one of the categorical codes is shown to control the context of central digit: for example in the 2nd column, a digit 9 is (partially) present on the right whereas in 3rd column, a digit 0 is present, which indicates that InfoGAN has learned to separate central digit from its context.
图 5:在 SVHN 上操纵潜编码。在 (a) 中,我们表明其中一个连续编码抓住了光照变化,尽管在数据集里每个数字只以一种光照条件出现;在 (b) 中,其中一个类别型编码被表明可以控制中心数字的上下文:例如第 2 列右侧(部分)出现数字 9,而第 3 列出现数字 0,这说明 InfoGAN 已经学会把中心数字与其上下文分开。
Finally we show in Figure 6 that InfoGAN is able to learn many visual concepts on another challenging dataset: CelebA [30], which includes 200,000 celebrity images with large pose variations and background clutter. In this dataset, we model the latent variation as 10 uniform categorical variables, each of dimension 10. Surprisingly, even in this complicated dataset, InfoGAN can recover azimuth as in 3D images even though in this dataset no single face appears in multiple pose positions. Moreover InfoGAN can disentangle other highly semantic variations like presence or absence of glasses, hairstyles and emotion, demonstrating a level of visual understanding is acquired.
最后,我们在图 6 中表明,InfoGAN 也能在另一个更具挑战性的数据集 CelebA [30] 上学习多种视觉概念。该数据集包含 20 万张姿态变化大、背景杂乱的名人图像。在这一数据集上,我们把潜在变化建模为 10 个均匀的类别型变量,每个变量为 10 维。令人惊讶的是,即便在如此复杂的数据上,InfoGAN 仍能像在三维图像中那样恢复方位角,尽管这里没有一张脸以多种姿态出现。此外,InfoGAN 还能解耦其他高度语义的变化,例如是否佩戴眼镜、发型以及情绪,表明它获得了一定程度的视觉理解。
Figure 6: Manipulating latent codes on CelebA: (a) shows that a categorical code can capture the azimuth of face by discretizing this variation of continuous nature; in (b) a subset of the categorical code is devoted to signal the presence of glasses; (c) shows variation in hair style, roughly ordered from less hair to more hair; (d) shows change in emotion, roughly ordered from stern to happy.
图 6:在 CelebA 上操纵潜编码。(a) 表明一个类别型编码可以通过把这种本质上连续的变化离散化,来抓住人脸的方位角;在 (b) 中,类别型编码的一个子集被用来指示是否有眼镜;(c) 展示发型变化,大致按头发从少到多排列;(d) 展示情绪变化,大致按从严肃到高兴排列。
8 Conclusion
8 结论
This paper introduces a representation learning algorithm called Information Maximizing Generative Adversarial Networks (InfoGAN). In contrast to previous approaches, which require supervision, InfoGAN is completely unsupervised and learns interpretable and disentangled representations on challenging datasets. In addition, InfoGAN adds only negligible computation cost on top of GAN and is easy to train. The core idea of using mutual information to induce representation can be applied to other methods like VAE [3], which is a promising area of future work. Other possible extensions to this work include: learning hierarchical latent representations, improving semi-supervised learning with better codes [31], and using InfoGAN as a high-dimensional data discovery tool.
本文介绍一种称为信息最大化生成对抗网络(InfoGAN)的表示学习算法。与以往需要监督的方法不同,InfoGAN 是完全无监督的,并能在有挑战性的数据集上学习可解释、解耦的表示。此外,InfoGAN 在 GAN 之上只增加可以忽略的计算开销,并且易于训练。用互信息来诱导表示这一核心想法,也可以应用到 VAE [3] 等方法上,这是一个有前景的未来工作方向。本文的其他可能扩展包括:学习分层潜表示、用更好的编码改进半监督学习 [31],以及把 InfoGAN 用作高维数据的发现工具。
Acknowledgements
致谢
We thank the anonymous reviewers. This research was funded in part by ONR through a PECASE award. Xi Chen was also supported by a Berkeley AI Research lab Fellowship. Yan Duan was also supported by a Berkeley AI Research lab Fellowship and a Huawei Fellowship. Rein Houthooft was supported by a Ph.D. Fellowship of the Research Foundation - Flanders (FWO).
我们感谢匿名审稿人。本研究部分由 ONR 通过一项 PECASE 奖资助。Xi Chen 还受到 Berkeley AI Research lab Fellowship 的支持。Yan Duan 还受到 Berkeley AI Research lab Fellowship 以及一项 Huawei Fellowship 的支持。Rein Houthooft 受到 Research Foundation - Flanders(FWO)博士奖学金的支持。
References
参考文献
[1] Y. Bengio, “Learning deep architectures for ai,” Foundations and trends in Machine Learning, 2009.
[2] Y. Bengio, A. Courville, and P. Vincent, “Representation learning: A review and new perspectives,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 35, no. 8, 2013.
[3] D. P. Kingma and M. Welling, “Auto-encoding variational bayes,” ArXiv preprint arXiv:1312.6114, 2013.
[4] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in NIPS, 2014, pp. 2672–2680.
[5] D. P. Kingma, S. Mohamed, D. J. Rezende, and M. Welling, “Semi-supervised learning with deep generative models,” in NIPS, 2014, pp. 3581–3589.
[6] B. Cheung, J. A. Livezey, A. K. Bansal, and B. A. Olshausen, “Discovering hidden factors of variation in deep networks,” ArXiv preprint arXiv:1412.6583, 2014.
[7] T. D. Kulkarni, W. F. Whitney, P. Kohli, and J. Tenenbaum, “Deep convolutional inverse graphics network,” in NIPS, 2015, pp. 2530–2538.
[8] W. F. Whitney, M. Chang, T. Kulkarni, and J. B. Tenenbaum, “Understanding visual concepts with continuation learning,” ArXiv preprint arXiv:1602.06822, 2016.
[9] A. Makhzani, J. Shlens, N. Jaitly, and I. Goodfellow, “Adversarial autoencoders,” ArXiv preprint arXiv:1511.05644, 2015.
[10] G. E. Hinton, S. Osindero, and Y.-W. Teh, “A fast learning algorithm for deep belief nets,” Neural Comput., vol. 18, no. 7, pp. 1527–1554, 2006.
[11] G. E. Hinton and R. R. Salakhutdinov, “Reducing the dimensionality of data with neural networks,” Science, vol. 313, no. 5786, pp. 504–507, 2006.
[12] P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol, “Extracting and composing robust features with denoising autoencoders,” in ICLR, 2008, pp. 1096–1103.
[13] G. Desjardins, A. Courville, and Y. Bengio, “Disentangling factors of variation via generative entangling,” ArXiv preprint arXiv:1210.5474, 2012.
[14] A. Rasmus, M. Berglund, M. Honkala, H. Valpola, and T. Raiko, “Semi-supervised learning with ladder networks,” in NIPS, 2015, pp. 3532–3540.
[15] L. Maaløe, C. K. Sønderby, S. K. Sønderby, and O. Winther, “Improving semi-supervised learning with auxiliary deep generative models,” in ICML, 2016.
[16] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” ArXiv preprint arXiv:1511.06434, 2015.
[17] B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum, “Human-level concept learning through probabilistic program induction,” Science, vol. 350, no. 6266, pp. 1332–1338, 2015.
[18] J. B. Tenenbaum and W. T. Freeman, “Separating style and content with bilinear models,” Neural computation, vol. 12, no. 6, pp. 1247–1283, 2000.
[19] Z. Zhu, P. Luo, X. Wang, and X. Tang, “Multi-view perceptron: A deep model for learning face identity and view representations,” in NIPS, 2014, pp. 217–225.
[20] J. Yang, S. E. Reed, M.-H. Yang, and H. Lee, “Weakly-supervised disentangling with recurrent transformations for 3d view synthesis,” in NIPS, 2015, pp. 1099–1107.
[21] S. Reed, K. Sohn, Y. Zhang, and H. Lee, “Learning to disentangle factors of variation with manifold interaction,” in ICML, 2014, pp. 1431–1439.
[22] J. Susskind, A. Anderson, and G. E. Hinton, “The Toronto face dataset,” Tech. Rep., 2010.
[23] J. S. Bridle, A. J. Heading, and D. J. MacKay, “Unsupervised classifiers, mutual information and ’phantom targets’,” in NIPS, 1992.
[24] D. Barber and F. V. Agakov, “Kernelized infomax clustering,” in NIPS, 2005, pp. 17–24.
[25] A. Krause, P. Perona, and R. G. Gomes, “Discriminative clustering by regularized information maximization,” in NIPS, 2010, pp. 775–783.
[26] D. Barber and F. V. Agakov, “The IM algorithm: A variational approach to information maximization,” in NIPS, 2003.
[27] G. E. Hinton, P. Dayan, B. J. Frey, and R. M. Neal, “The" wake-sleep" algorithm for unsupervised neural networks,” Science, vol. 268, no. 5214, pp. 1158–1161, 1995.
[28] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, and T. Vetter, “A 3d face model for pose and illumination invariant face recognition,” in AVSS, 2009, pp. 296–301.
[29] M. Aubry, D. Maturana, A. Efros, B. Russell, and J. Sivic, “Seeing 3D chairs: Exemplar part-based 2D-3D alignment using a large dataset of CAD models,” in CVPR, 2014, pp. 3762–3769.
[30] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in ICCV, 2015.
[31] J. T. Springenberg, “Unsupervised and semi-supervised learning with categorical generative adversarial networks,” ArXiv preprint arXiv:1511.06390, 2015.





