1. 程式人生 > >生成式對抗網路GAN研究進展(四)——Laplacian Pyramid of Adversarial Networks,LAPGAN

生成式對抗網路GAN研究進展(四)——Laplacian Pyramid of Adversarial Networks,LAPGAN

【前言】
    本文首先介紹生成式模型,然後著重梳理生成式模型(Generative Models)中生成對抗網路(Generative Adversarial Network)的研究與發展。作者按照GAN主幹論文、GAN應用性論文、GAN相關論文分類整理了45篇近兩年的論文,著重梳理了主幹論文之間的聯絡與區別,揭示生成式對抗網路的研究脈絡。
本文涉及的論文有:

  • Goodfellow Ian, Pouget-Abadie J, Mirza M, et al. Generative adversarial nets[C]//Advances in Neural Information Processing Systems. 2014: 2672-2680.
  • Mirza M, Osindero S. Conditional Generative Adversarial Nets[J]. Computer Science, 2014:2672-2680.
  • Denton E L, Chintala S, Fergus R. Deep Generative Image Models using a Laplacian Pyramid of Adversarial Networks[C]//Advances in neural information processing systems. 2015: 1486-1494.

4. 拉普拉斯金字塔生成式對抗網路,Laplacian Pyramid of Adversarial Networks

4.1 LAPGAN的思想

     生成式對抗網路GAN研究進展(二)——原始GAN 提出,與其他生成式模型相比,GAN這種競爭的方式不再要求一個假設的資料分佈,即不需要formulate p(x),而是使用一種分佈直接進行取樣sampling,從而真正達到理論上可以完全逼近真實資料,這也是GAN最大的優勢。然而,這種不需要預先建模的方法缺點是太過自由了,對於較大的圖片,較多的 pixel的情形,基於簡單 GAN 的方式就不太可控了。為了解決GAN太過自由這個問題,一個很自然的想法是給GAN加一些約束,於是便有了Conditional Generative Adversarial Nets(CGAN)【Mirza M, Osindero S. Conditional】

。通過引入條件變數y(conditional variable y),使用額外資訊y對模型增加條件,可以指導資料生成過程。如果條件變數y是類別標籤,可以看做CGAN 是把純無監督的 GAN 變成有監督的模型的一種改進。這個簡單直接的改進被證明非常有效,並廣泛用於後續的相關工作中[3,4]。[Mehdi Mirza et al.]
     另一方面,為了改進 GAN 太自由的問題,還有一個想法就是不要讓 GAN 一次完成全部任務,而是一次生成一部分,分多次生成一張完整的圖片。Sounds familiar?對啊,就是去年 DeepMind大火的一個工作 DRAW [1]的思想。DRAW 中指出,我們人類在完成一幅圖畫時,都不一定是一筆完成的,我們又為何要求機器能做到呢?所以 DRAW 用了一種 sequential VAE 的模型,讓機器一點點“寫”出了一個個數字。於是 Facebook 等人提出的 LAPGAN[2] 則是採用了這樣的思想,在 GAN 基礎上做出了改進。LAPGAN[2] 這個工作既有 project page,也有開原始碼,是非常值得重視的工作。在實現 sequential version 的方式上,LAPGAN[2] 這個工作採用的是一種幾十年前的 Laplacian Pyramid 的方式,也因此起名做 LAPGAN。
            這裡寫圖片描述
     這個方式主要的操作便是 downsample 和 upsample,而優勢是每次只考慮樣本和生成影象之間的殘差的學習效果,某種程度上和 Residual Network 的思想是一樣的。針對殘差的逼近和學習,相對更加容易。於是,在這個思想上,便有了如下 LAPGAN 的學習過程:
  這裡寫圖片描述
    這個圖中,當影象是較大 pixel 時,便需要進行 Laplacian Pyramid 過程,並且在每一個process step 時(每一個 Pyramid level),傳給 D 的只是針對殘差的 compare。另一方面,當pixel 足夠小的時候,也就是最右邊的 step,則不再需要進行 upsample 和 downsample 的過程,這時給 D 的 傳送則是未經處理的樣本和生成的影象了。Facebook 指出,這樣的 sequential方式減少了每一次 GAN 需要學習的內容,也就從而增大了 GAN 的學習能力。值得注意的是,LAPGAN 其實也是 LAPCGAN,都是 conditional 的。另外,每一步的 GAN 都是independently trained 的。與此同時,這篇論文還總結出了許多工程上的經驗,都在他們的project page中。

4.2 Deep Generative Image Models using a Laplacian Pyramid of Adversarial Networks

4.2.1 Abstract

LAPGAN
    A generative parametric model capable of producing high quality samples of natural images.
    一個生成式引數模型,能夠生產高質量的自然影象樣本
    使用一個帶有Laplacian pyramid框架的級聯卷積網路由粗糙到精細的迭代地去生成影象。
    At each level of the pyramid, a separate generative convent model is trained using the Generative Adversarial Nets (GAN) approach
    在金字塔的每一層級,使用GAN方法訓練一個獨立的生成時卷積網路模型。
    利用自然影象的多尺度結構,構件一系列生成式模型。每個生成式模型抓取Laplacian金字塔的一個特定尺度的影象結構。
    這一策略將原始問題轉變成一系列更加可控的步驟。
    Samples are drawn in a coarse-to-fine fashion, commencing with a low-frequency residual image.
    樣本通過一個由粗糙到精確的形式畫成,起始於一個低頻殘差影象。
    第二步,在下一層取樣帶通結構(band-pass structure),以取樣的殘差作為條件。
    Thus drawing samples is an efficient and straightforward procedure: taking random vectors as input and running forward through a cascade of deep convolutional networks (convnets) to produce an image.

4.2.2 Introduction

    生成式模型兩種主要的方法:
     Generative models falls into two main approaches:
Non-parametric :
Copy patches from training images to perform, for example, texture synthesis [3] or super-resolution,entire portions of an image can be in-painted, given a sufficiently large training dataset
Parametric
Early parametric models addressed the easier problem of texture synthesis making use of a steerable pyramid wavelet representation, similar to our use of a Laplacian pyramid.

4.2.3 拉普拉斯金字塔,Laplacian Pyramid

     We introduce our LAPGAN model which integrates a conditional form of GAN model into the framework of a Laplacian pyramid.
     The conditional generative adversarial net (CGAN) is an extension of the GAN where both networks G and D receive an additional vector of information l as input. This might contain, say, information about the class of the training example h. The loss function thus becomes.
這裡寫圖片描述
where pl(l) is, for example, the prior distribution over classes. This model allows the output of the generative model to be controlled by the conditioning variable l.
p(l)是資訊的分佈,例如類別的先驗分佈;
這個模型允許生成模型的輸出被條件變數l所控制。
在LAPGAN中,條件資訊是另一個CGAN生成的影象。
Laplacian Pyramid
     The Laplacian pyramid [1] is a linear invertible image representation consisting of a set of band-pass images, spaced an octave apart, plus a low-frequency residual.
     拉普拉斯金字塔是一個線性可逆影象表徵,它由一個帶通影象集合構成,構成了一個octave apart空間,加上一個低頻殘差。
     We first build a Gaussian pyramid G(I) = [I0; I1; : : : ; IK], where I0 = I and Ik is k repeated applications of d(:) to I
     我們構建一個高斯金字塔,I0是原始影象,Ik是第k次下采樣的影象。
              這裡寫圖片描述

4.2.4 Laplacian Generative Adversarial Networks (LAPGAN)

     LAPGAN結合了條件GAN(CGAN)拉普拉斯金字塔表徵。
生成器取樣過程(sampling):
這裡寫圖片描述
     Recurrence從IK+1開始(K是金字塔的層數,令Ik+1 = 0),然後給最後一層的生成模型GK輸入噪聲向量Zk,去生成一個殘差影象Ik這裡寫圖片描述 ,注意條件變數是k+1層影象的upsampling
取樣/生成過程:
這裡寫圖片描述
     We start with a noise sample z3 (right side) and use a generative model G3 to generate ~I3. This is upsampled (green arrow) and then used as the conditioning variable (orange arrow) l2 for the generative model at the next level, G2.
這裡寫圖片描述

訓練過程:

  1. 原始影象I 64 * 64,令I0 = I,下采樣生成I1;
  2. 對I1上取樣,得到I0的一個低通版本 l0
  3. 等概率地為判別模型D0選擇一個真實樣本或是生成樣本,為真實樣例計算高通 h0 = I0 – l0;低通影象l0(條件資訊)和噪聲z輸入生成模型G,輸出高通影象(殘差)h~ = G(z0,l0)。
    判別模型的輸入是低通影象l0(下、上取樣)條件資訊是:h 或 h~, 驅使生成模型學習realistic高頻結構(與低通影象l0相一致)

4.3 實驗

    We evaluate our approach using 3 different methods:

  • (i) computation of log-likelihood on a held out image set;
    This new approach uses a Gaussian Parzen window estimate to compute a probability at each scale of the Laplacian pyramid.
                這裡寫圖片描述
  • (ii) **drawing sample image**s from the model and
    類別條件LAPGAN,通過類別組織生成的影象。
    生成影象更銳利:歸功於引入了資料擴充。
    以類別標籤做條件,改進了生成影象的質量,具體表現在:生成影象的物體結構更清晰,物體邊界更顯著。
  • (iii) a human subject experiment that compares (a) our samples, (b) those of baseline methods and (c) real images.

Reference

[1] K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. DRAW: A recurrent neural network for image
generation. CoRR, abs/1502.04623, 2015.
[2] Denton E L, Chintala S, Fergus R. Deep Generative Image Models using a Laplacian Pyramid of Adversarial Networks[C]//Advances in neural information processing systems. 2015: 1486-1494.
[3] A. A. Efros and T. K. Leung. Texture synthesis by non-parametric sampling. In ICCV, volume 2, pages
1033–1038. IEEE, 1999.