文章提出了StarGAN v2,這是一種可以同時解決生成圖像多樣性和多域擴展性的單一框架。相比於了baselines,它取得了明顯的提升。文章對StarGAN 取得的視覺質量、多樣性以及可擴展性都進行了驗證。
paper: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9157662
code: https://github.com/clovaai/stargan-v2
cite: @inproceedings{DBLP:conf/cvpr/ChoiUYH20, author = {Yunjey Choi and Youngjung Uh and Jaejun Yoo and Jung{-}Woo Ha}, title = {StarGAN v2: Diverse Image Synthesis for Multiple Domains}, booktitle = , pages = {8185–8194}, publisher = , year = {2020} }
全文共計5245字,預計閱讀時間14分鐘。
關注公眾號,後臺回復『StarGAN2』,即可獲取論文電子資源。
domain :a set of images that can be grouped as a visually distinctive category
style: each image has a unique appearance, which we call style
例如,我們可以用性別作為不同的域,則風格就是妝容、鬍子和髮型等(圖1的上部分)。
An ideal image-to-image translation method :should be able to synthesize images considering the diverse styles in each domain.
現有的方法:只考慮的兩個域之間的映射,當域數量增加的時候,他們不具備擴展性。
StarGAN [6]:one of the earliest models, which learns the mappings between all available domains using a single generator。
生成器將域標籤作為附加的輸入,學習圖像到對應域的轉換。然而,StarGAN仍然學習每個域的確定性映射,該映射沒有捕獲數據分布的多模式本質。
StarGAN v2: a scalable approach that can generate diverse images across multiple domains.
基於StarGAN,並用我們提出的域特定風格代碼取代掉了StarGAN的域標籤,這個域特定風格代碼可以表示特定域的不同風格。為此,我們引入了兩個模塊,一個映射網絡(mapping network),一個風格編碼器(style encoder)。
mapping network :learns to transform random Gaussian noise into a style code
學習如何將隨機高斯噪聲轉換為風格編碼
style encoder: the encoder learns to extract the style code from a given reference image.
而編碼器則學習從給定的參考圖像中提取風格編碼。
在多個域的情況下,這兩個模塊都擁有多個輸出分支,每一個都為特定域提供了風格編碼。最終,使用這些風格編碼,生成器就可以成功地學習在多個域下合成風格圖像。
我們用X 和Y來分別表示圖像和域的集合,給定x屬於X 和任意域y屬於Y,我們的目標是訓練一個單一的生成器G ,使它能夠根據x針對每一個域y生成多樣化的圖像。我們在每個域學習到的風格空間中生成域特定的風格向量,並且訓練G來表達這個風格向量。圖2 闡釋了我們框架的概述, 其中包含了如下的四個模塊。
生成器G(x,s)需要輸入圖像x和特定風格編碼s,s由映射網絡F或者風格編碼器E提供。我們使用adaptive instance normalization(AdaIN)來注入s到G中。s被設計為表示特定域y的風格,從而消除了向G提供y的必要性,並允許G合成所有域的圖像。
Mapping network (Figure 2b)給定一個潛在編碼z和一個域y,映射網絡F生成風格編碼s=Fy(z)s=Fy(z),其中Fy(⋅)Fy(⋅) 表示F對應於域y的輸出。F由帶有多個輸出分支的MLP組成,用來為所有可用域提供風格編碼。F 通過隨機採樣潛在向量z和域y來提供多樣化風格編碼。我們的多任務架構允許F高效地學習所有域的風格表達。
Style encoder(Figure 2c)給定圖像x和它對應的域y,編碼器E提取風格編碼s=Ey(x)s=Ey(x). 其中Ey(⋅)Ey(⋅)表示編碼器特定域域y的輸出。和F類似,風格編碼器E也受益於多任務學習設置。
E可以使用不同參考圖片生成多樣化風格編碼。這允許G合成反映參考圖像x的風格s的輸出圖像。
判別器D是一個多任務判別器,由多個輸出分支組成。每個分支DyDy 學習一個二進位分類決定輸入圖像x是否是它對應域y的真實圖像,或者是由G產生的假圖像G(x,s)
給定一張圖像x和它對應的原始域y。
Adversarial objective對抗目標:我們隨機採樣潛在編碼z和目標域y,並且生成目標風格編碼 ~s=F~y(z)s~=Fy~(z). 編碼器G 將圖像x和~ss~ 作為輸入,並通過對抗損失學習生成輸出圖像G(x,~s)G(x,s~)
Style reconstruction.風格重建:為了增強生成器 來在生成圖像G(x,~s)G(x,s~)的時候,使用風格編碼~ss~, 我們採用風格重建損失:在測試時,我們學習的編碼器E允許G變換輸入圖像,以反映參考圖像的風格。
Style diversification.風格多樣化:為了進一步增強生成器G來產生多樣化圖像,我們用多樣性敏感損失來調整G。其中目標風格編碼~s1s~1 和~s2s~2由F根據兩個隨機潛在編碼z1z1和z2z2產生。最大化正則項會迫使G探索圖像空間並發現有意義的風格特徵,以生成各種圖像。我們刪除了分母部分,並設計了一個新的方程來進行穩定的訓練,但要保持直覺。
Preserving source characteristics.保留原始特徵:
為了保證生成的圖像適當地保留輸入圖像x域無關特徵(例如,姿勢),我們採用了循環一致性損失:其中,^s=Ey(x)s^=Ey(x) 是輸入圖像x的估計風格編碼,y是x的原始域。通過鼓勵生成器G 重新構造帶有估計風格編碼^ss^的輸入圖像x, G學習在改變風格的同時保留x的原始特徵。
Full objective.我們還以與上述目標相同的方式訓練模型,在生成風格編碼時使用參考圖像而不是潛在向量。我們在附錄中提供了訓練詳細信息。
在訓練階段,所有實驗均使用看不見的圖像進行 baselines:
MUNIT [13]
DRIT [22]
MSGAN[27]
StarGAN [6]
All the baselines are trained using the implementations provided by the authors.
datasets:
評估策略:
Frechét inception distance (FID) [11]
learned perceptual image patch similarity (LPIPS) [38].
We evaluate individual components that are added to our baseline StarGAN using CelebA-HQ.
FID 表示真實和生成圖像的分布之間的距離,越小越好,LPIPS表示生成圖像的多樣性,越大越好
3.1. Analysis of individual一個輸入圖像在不同配置情況下的相應生成圖像如圖3所示。baseline 配置(A)就相當於是StarGAN。如圖3a所示,StarGAN程序只通過在輸入圖像上進行了妝容的局部改變。配置(F)對應著我們提出的方法 StarGAN v2
圖4展示了StarGAN v2 可以合成參照包括髮型、妝容和鬍鬚在內的反應多樣化風格的圖像,同時,還沒有破壞原有的特徵。
學習了妝容、髮型、鬍鬚等風格,保留了姿勢和身份。
In this section, we evaluate StarGAN v2 on diverse image synthesis from two perspectives: latent-guided synthesis and reference-guided synthesis.
潛在引導合成
圖5提供了質量的比較。For both CelebA-HQ and AFHQ, our method achieves FIDs of 13.8 and 16.3, respectively, which are more than two times improvement over the previous leading method.
Reference-guided synthesis.參考引導合成Here, MUNIT and DRIT suffer from mode-collapse in AFHQ, which results in lower LPIPS and higher FID than other methods.
Human evaluation.For each comparison, we randomly generate 100 questions, and each question is answered by 10 workers. We also ask each worker a few simple questions to detect unworthy workers. The number of total valid workers is 76.
These results show that StarGAN v2 better extracts and renders the styles onto the input image than the other baselines.
We discuss several reasons why StarGAN v2 can successfully synthesize images of diverse styles over multiple domains.
our style code is separately generated per domain by the multi-head mapping network and style encoder.
our style space is produced by learned transformations
our modules benefit from fully exploiting training data from multiple domains
To show that our model generalizes over the unseen images, we test a few samples from FFHQ [18] with our model trained on CelebA-HQ (Figure 7). Here, StarGAN v2 successfully captures styles of references and renders these styles correctly to the source images.
我們提出來 StarGAN v2,解決了兩個image-to-image轉化的主要挑戰,轉換一個域的單張圖像到目標域的多張不同風格的圖像,以及支持多目標域。 實驗結果表明,我們的模型可以跨多個域中生成豐富的風格圖像,並且超過了此前的領先方法 [13, 22, 27]。 我們還發布了一個新的動物臉集(AFHQ)數據集,用來在大規模域內域間變化設置中評估各種方法。