美文网首页
最新的GAN方法——PGGAN揭秘

最新的GAN方法——PGGAN揭秘

作者: Feather轻飞 | 来源:发表于2018-04-25 18:00 被阅读0次

    论文链接

    https://arxiv.org/pdf/1710.10196.pdf

    主页链接

    思想一:

    grow both the generator and discriminator progressively: 

    starting from a low resolution, we add new layers that model increasingly fine details as training progresses. This both speeds the training up and greatly stabilizes it, allowing us to produce images of unprecedented quality, e.g., CELEBA images at 1024

    思想二:

    a simple way to increase the variation in generated images, and achieve a record inception score of 8.80 in unsupervised CIFAR10.

    思想三:

    several implementation details that are important for discouraging unhealthy competition between the generator and discriminator.

    思想四:

    we suggest a new metric for evaluating GAN results, both in terms of image

    quality and variation.

    简介 生成方法有三种

    第一种, Autoregressive, 优点是生成的图片sharp,缺点是因为是对像素的条件分布做估计,所以没有Latent representation, 适用性比较低 (Odena et. al 2017)

    第二种, VAE, 好处是简单快速,缺点是生成图片质量低 

    第三种 , GAN 好处是生成图片sharp,但是有时候low resolution, 缺点是训练不稳定,Limited variation

    GAN的介绍

    生成器和鉴别器。其中遇到几个问题

    第一, 训练分布和生成分布的距离估计。有时候会出现gradients point to more or less random direction的问题。 这一般出现在 两个分布没有substantial overlap的时候。比如说,生成分布和训练分布区别非常大。 现在研究的有用W距离和least square之类的。这篇文章用improved W距离但是也比较一下Least square

    第二, 如果要生成高分辨率的图像会比较难。因为高分辨率的意味着生成图像和训练图像会相对容易区别。这样converge就难了。 所以这样就放大了梯度问题。本文用的方法是他的网络是动态变化的。网络是在生长grow的,先从简单的低分辨率图像开始,然后加入新的层来引入高分辨率的细节。这样加速了训练。

    这部分让我想到,好未来AI实验室老板的最高引用的那篇文章,也是在区分General的一些全局特征和局部特征(不同分辨率)然后分阶段用不同大小的patch去feed。 可能也有点像inception net里面的思想(用3*3 , 5*5 等不同大小的卷积, 相当于不同的感受野吧)

    但是这里不是用不同大小的卷积核,来把局部(小)和比较全局(大)的感受野实现,而是直接对于不同的分辨率/感受野的需求产生不同的网络结构。整个网络都是动态进化的。

    第三,GAN不要求最后的生成模型represent全部的训练数据。(The GAN formulation does not explicitly require the entire training data distribution to be represented by the resulting generative model.)

    tradeoff between image quality and variation . But challenged.

    Preserved variation的程度用什么来评估?

    有 Inception score, multi-scale structural similarity (MS-SSIM), birthday paradox, and explicit tests for the number of discrete modes discovered. 

    (Section 3)我们鼓励variation的方法

    Section 5是我们提出的一个评估quality和variation的新的metrics

    Section 4 是网络的改进。 我们观察到 mode collapses traditionally plaguing GANs 一般都发生的很快,在几十个minibatch时候就发生了。 一般来说鉴别器开始overshoot, 然后产生梯度过大的问题,然后就产生了不健康的D和G的竞争。这时候signal magnitudes escalate in both networks 。 文章提出的是一种类似early stopping for generator. Stop

     from participating in such escalation.

    第二部分 

    start with low-resolution

    progressively increase the resolution by adding layers

    incremental nature 使得训练首先发现了图像分布的large - scale 结构

    然后慢慢把注意力转变到increasingly finer scale detail

    注意: 我们把D和G网络是作为相互的镜像, 而且同时生长 (grow in synchrony)

    所有的层在两个网络里面都是可以train的。 当新的层被添加,We fade them in smoothly, 我们平滑的把它们fade进去。这样可以避免sudden shocks to already well-trained ,smaller resolution layers

    这样做有几个好处。

    第一,一开始的时候产生的小的低分辨率的图更加稳定。因为有更少的class info和更少的店啊。慢慢的增加分辨率的时候,我们相当于相比较以前的方法在问一个更简单的问题。

    第二, 训练时间减少。

    灵感来源这里省略了。但是文章里面的可以看一下。在第二部分最后一段。

    第三部分 用minibatch标准差来increase variation

    1)以前的work

    GAN 有一个只capture到训练数据中的变化的一个子集的倾向。Salimans建议用 minibatch discrimination来解决这个问题。 minibatch这个题目又让我想到 组归一化,批归一化之类的。之前出过一个比较焦点的结果。从Batchnorm衍生到Minibatch。之后一篇generalized DL方法文章里面会讨论。

    Minibatch discrimination不仅仅比较单个图片的 feature stats, 还会比较minibatch之间的。

    这样的话就会鼓励生成和训练的Minibatch表现出来相似的stats。这里是在鉴别器后面使用一个minibatch 层。这个和我之前说的batchnorm和组归一化是不是有点像。batchnorm也是一层啊。在以前的work立面是把minibatch里的每一个example产生separate set of statistics,然后concat到layer output上。

    (This is implemented by adding a minibatch layer towards the end of the discriminator, where the layer learns a large tensor that projects the input activation to an array of statistics.) A separate set of statistics is produced for each example in a minibatch and it is concatenated to the layer’s output, so that the discriminator can use the statistics internally. 

    2)我们的work

    我们简化上面的方法,并且也improve variation。我们的方法没有 learnable parameters 也没有新的 hyperparameters. 

    首先计算minibatch里每个feature在每个空间位置的标准差

    算这些值在所有feature和空间位置上的平均值。得到一个single value

    然后复制,concat到minibatch上的所有feature和空间位置上.得到一个额外的feature map

    This layer could be inserted anywhere in the discriminator, but we have found it best to insert it towards the end (see Appendix A.1 for details). We experimented with a richer set of statistics, but were not able to improve the variation further. In parallel work, Lin et al. (2017) provide theoretical insights about the benefits of showing multiple images to the discriminator.


    第四部分

    之前说的好像不多。我想到的batchnorm 和 组归一化是在这个第四部分被讨论的。作者反对被引用了两万次的batchnorm , 觉得对GAN没有什么用。“我们并未认为这是GAN的一个问题,因此认为GAN的实际需求是限制信号幅度和竞争。我们使用不同的由两种成分组成的方法,两种成分都不包括可学习的参数。"

    4.1平等的学习速度

    这篇文章不用careful weight initialization, 而是用 N(0,1) 再 scale at runtime。

    准确地说,我们设置wi = wi / c,其中wi是权重,c是He的初始化器的每层归一化常数(He et al。,2015)。动态地执行此操作而不是在初始化过程中进行的好处有点与RMSProp(Tieleman&Hinton,2012)和Adam(Kingma&Ba,2015)等常用自适应随机梯度下降方法中的尺度不变性有关。

    这些方法通过其估计的标准偏差对梯度更新进行归一化,从而使更新独立于参数的比例。 因此,如果某些参数的动态范围比其他参数大,则需要较长时间进行调整。 这是现代初始值设定程序引起的场景,因此学习速率可能同时过大和过小。 我们的方法确保动态范围以及学习速度对所有权重都是相同的。 van Laarhoven(2017)独立使用了类似的推理。

    4.2 鉴别器中的像素特征向量归一化

    PIXELWISE FEATURE VECTOR NORMALIZATION IN GENERATOR

    为了避免由于竞争导致发生器和鉴别器中的幅度失控的场景,我们将每个像素中的特征矢量归一化为每个卷积层之后的生成器中的单位长度。

    我们使用“局部响应归一化”(Krizhevsky et al。,2012)的一个变体来做到这一点,配置为N是特征映射的数量,ax,y和bx,y是像素中的原始和归一化特征向量(x ,y)。

    我们感到惊讶的是,这种强有力的约束似乎不会以任何方式伤害发生器,实际上对于大多数数据集来说,它并不会改变结果,但它可以在需要时非常有效地防止信号幅度的升级。

    To disallow the scenario where the magnitudes in the generator and discriminator spiral out of control as a result of competition, we normalize the feature vector in each pixel to unit length in the generator after each convolutional layer.

    5用于评估GAN结果的多尺度统计相似度

    为了比较一个GAN与另一个GAN的结果,需要调查大量的图像,这些图像可能是单调乏味,困难和主观的。因此,需要依靠自动化方法来计算大型图像集合中的某些指示性度量。

    我们注意到现有的诸如MS-SSIM(Odena等,2017)的方法可靠地发现大规模模式崩溃但不能对较小的影响作出反应,例如颜色或纹理变化的损失,并且它们也不直接评估图像质量与训练集相似。

    ( We noticed that existing methods such as MS-SSIM (Odena et al., 2017) find large-scale mode collapses reliably but fail to react to smaller effects such as loss of variation in colors or textures, and they also do not directly assess image quality in terms of similarity to the training set.)

    我们建立在这样的直觉上:一个成功的生成器将生成局部图像结构与所有尺度上的训练集相似的样本。我们建议通过考虑拉普拉斯金字塔中局部图像块分布之间的多尺度统计相似性来研究这一点(Burt&Adelson,1987)生成的和目标图像的表示,从16×16像素的低通分辨率开始。

    (We build on the intuition that a successful generator will produce samples whose local image structure is similar to the training set over all scales. We propose to study this by considering the multiscale statistical similarity between distributions of local image patches drawn from Laplacian pyramid (Burt & Adelson, 1987) representations of generated and target images, starting at a low-pass resolution of 16 × 16 pixels.

    按照标准惯例,金字塔逐渐加倍,直到达到全分辨率,每个连续的水平将差异编码为上一个水平的上采样版本。

    单拉普拉斯金字塔等级对应于特定的空间频带。我们随机抽取16384个图像,并从拉普拉斯金字塔的每个级别提取128个描述符,这是一个有效计算的随机化。使用512个投影(Rabin et al。,2011)对近似距离进行近似。

    As per standard practice, the pyramid progressively doubles until the full resolution is reached, each successive level encoding the difference to an up-sampled version of the previous level.

    A single Laplacian pyramid level corresponds to a specific spatial frequency band. We randomly sample 16384 images and extract 128 descriptors from each level in the Laplacian pyramid, an efficiently computable randomized approximation to earthmovers distance, using 512 projections (Rabin et al., 2011).

    直观地,小的Wasserstein距离表明贴片的分布是相似的,这意味着训练图像和生成器样本在该空间分辨率下的外观和变化两者看起来相似。特别是,从最低分辨率的16×16图像中提取的补丁组之间的距离表示大尺寸图像结构中的相似性,而最细级补丁编码关于像素级属性的信息,例如边缘锐度和噪声。

    Intuitively a small Wasserstein distance indicates that the distribution of the patches is similar, meaning that the training images and generator samples appear similar in both appearance and variation at this spatial resolution. In particular, the distance between the patch sets extracted from the lowest resolution 16 × 16 images indicate similarity in large-scale image structures, while the finest-level patches encode information about pixel-level attributes such as sharpness of edges and noise.

    相关文章

      网友评论

          本文标题:最新的GAN方法——PGGAN揭秘

          本文链接:https://www.haomeiwen.com/subject/yudylftx.html