《AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks》是CVPR 2018 文本生成图像的文章,是StackGAN++的后续工作。
Abstract
在本文中作者提出了一个 Attentional Generative Ad-
versarial Network(AttnGAN),一种attention-driven的多stage的细粒度文本到图像生成器。
并借助一个深层注意多模态相似模型(deep attentional multimodal similarity model)来训练该生成器。
它首次表明 the layered attentional GAN 能够自动选择单词级别的condition来生成图像的不同部分。
大体思路
先看下模型结构:
该模型由两部分组成
-
attentional generative network
该部分使用了注意力机制来生成图像中的子区域,并且在生成每个子区域时还考虑了文本中与该子区域最相关的词。如下图所示:
-
Deep Attentional Multimodal Similarity Model (DAMSM)
该部分用来计算生成的图像与文本的匹配程度。用来训练生成器。
Pipeline:
- 输入的文本通过一个Text Encoder 得到 sentence feature 和word features
- 用sentence feature 生成一个低分辨率的图像 I 0 I_0 I0
- 基于 I 0 I_0 I0 加入 word features 和setence feature 生成更高分辨率细粒度的图像
Attntional Generative Adversarial Network
下面将分别介绍之前提到的两个模块。
Attentional Generative Network
从Figure 2 中可以看出该attentional generative network共有m个生成器( G 0 G_0 G0, G 1 G_1 G1,…, G m − 1 G_{m-1} Gm−1)它们的输入分别是( h 0 h_0 h0, h 1 h_1 h1,…, h m − 1 h_{m-1} hm−1