###### tags: `Paper`、`Research` # **[A Style-Based Generator Architecture for Generative Adversarial Networks](https://ieeexplore.ieee.org/document/8953766)** 本篇論文是 2019 年由 *Tero Karras, Samuli Laine, Timo Aila* 發表於 *CVPR* 的 paper。 **YouTube:** [A Style-Based Generator Architecture for Generative Adversarial Networks](https://www.youtube.com/watch?v=kSLJriaOumA&t=115s) ## Introduction 以往的 GAN 輸入到輸出的對應是不受到控制的,所以我們沒辦法預期怎樣的輸入會有怎樣的輸出,而在 StyleGAN,這個由 NVIDIA 提出的新架構,就是想要控制輸入的部分,希望生成圖像的更高保真度,增加輸出的多樣性,以及對頭髮顏色配飾等圖像特徵的更多控制。主要的 components 有: - Noise mapping network - Progressive growing - Adaptive instance normalization (實際介紹就不按論文的 Section 啦~) ## Mapping Network <center>  </center> 首先要介紹的是 mapping network 的部分,跟直接將 latent code 輸入到 network 的傳統GAN 不太一樣,這邊是先將原始的 latent space $\mathcal{Z}$ mapping 到另一個 latent space $\mathcal{W}$,這麼做的目的我們用下圖來解釋。 <center>  </center> 這邊是其中一個例子,左邊是原始的 training set 分布,中間是將 training set mapping 到 $\mathcal{Z}$ 後的結果,可以看到說,原始的 set 中並沒有左上角那種屬性,但因為透過 Gaussian distribution 轉換,為了填滿左上角的空缺,屬性會被扭曲,這樣可能造成生成的圖片,出現奇怪的樣子,例如女性長出鬍子等等,所以為了避免這種情況,作者多了將 $\mathcal{Z}$ mapping 到 $\mathcal{W}$ 這一步,希望出來的 latent space $\mathcal{W}$ 能更貼合 training set 的分布。 那這邊從 $\mathcal{Z}$ mapping 到 $\mathcal{W}$ 是透過一個 multilayer perceptron (MLP) 做到的,具體為什麼使用 MLP,作者在 Session 4.1 有提到, 是透過實驗做出的選擇,具體細節...有機會再補。<font color = "red">MLP 可以達到 classifier 的效果,因此可以將 latent code $z$ 進行分類。作者為了避免 $z$ 跟 data space 直接的連結,所以透過一個轉換到 $w$。</font> 下面稍微解釋一下 entangled。上面提到說 $\mathbf{z}$ 會有 entangled 的問題,但究竟什麼是 entangled?用下方的圖片來解釋,簡單來說就是若想調整右邊的其中一個屬性值時,必須調整 lantent vector 的值,但卻同時會影響到其他屬性。 <center>  </center> 下面這張圖則是這篇論文希望做到的,使每個 $w$ 值,都只對應到一個屬性,這樣在座照片編輯時可以針對單一屬性作調整,而不會去更動到其他屬性,然而這是理想化的結果。 <center>  </center> ## Progressive growing 這部分主要在講述,styleGAN 在生成圖片時,會是從解析度 4 $\times$ 4 的圖片開始,慢慢地以漸進增加解析度的方式,直到生成 1024 $\times$ 1024。從這些漸漸生成的圖片也可以看到哪些屬性是在較前面的 layer 會被影響的,哪些屬性是在較後面的 layer 影響的。那這部分主要是延續 <center>  </center> ## Adaptive Instance Normalization (AdaIN) - Step 1:Normalize convolution output with <font color="purple">**Instance Normalization**</font>. - Step 2:Apply <font color="blue">adaptive styles</font> **using the intermediate noise vector**. 首先第一個步驟,有別於常見以 batch normalize 做 normalization,styleGAN 這邊選擇以 instance normalize 來對 model 做 normalization,其中一個關鍵理由是,傳統的 batch normalization 是以 batch 為單位做 normalization,通常一個 batch 會涵蓋多張圖片,因此出來的圖片會有相似的 style,然而對於 styleGAN 這種 neural network 來說,這樣是不合理的,每張生成的圖片應該都有自己的 style,而不應該受其他圖片影響,故作者才採用 instance normalize 這種只針對單一圖片做 normalization 的方式。 <center>  </center> 接下來第二個步驟,在論文中,從 $w$ 獲得的值並不是直接輸入到 network 中,而是經過 Fully Connected 的轉換,取出 $\mathbf{y}_s$ 和 $\mathbf{y}_b$ 兩個值,這兩個值的目的分別是做 scale 和 bias,簡單來說就是對圖像的 style 做縮放和平移,達到 style 的轉換。 <center>  </center> 那最後整個公式就會長的像下面這樣: <center>  </center> ## Style Mixing 在這篇論文中還有一個非常值得注意的點,就是 Style Mixig,做法是隨機生成兩個 latent code (source A and B),並在 training 的過程中,將兩個 code 對調。 在 18 層的 network 中,論文將此分為 3 個區域,分別是 $4^2-8^2$ 的 coarse style、$16^2-32^2$ 的 middle style 和 $64^2-1024^2$ 的 fine。 可以看到在 coarse 的部分,姿勢、髮型、臉型受到來自 B 的影響更多,而在顏色部分則維持 A 的影響更多。到了 middle 的部分,B 的髮型、睜眼/閉眼這些較為細小的特徵被繼承下來,而 A 中的姿勢、臉型和眼鏡都保留了下來。最後 fine 的部分,B 主要帶來的是顏色和細微結構的變化。 <center>  </center> ## Stochastic Variation <center>  </center> 除了 <center>  </center> ---- ==<font color="Red">在沒弄懂之前,不能下結論</font>==
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up