CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis

text2image相比单一的图像生成任务来说,其目标不仅是生成与目标分布一致的图像,而且还要使得生成的图像符合输入描述,也就是说相比单纯的图像生成任务来说,text2image是一个可以通过输入控制输出的任务。本文建立在大家已经对这个领域有了充分了解的基础上介绍最近一篇基于GAN的生成方法CPGAN,这篇论文采用全阶段解析的方式生成符合文本描述的图像,其基本架构如下:

CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第1张图片

其中的全阶段解析包含三个方面:

1.   Memory-Attended Text Encoder 

 在文本编码阶段采用记忆结构去挖掘训练样本中词与各种不同视觉上下文之间的对应关系,使用该记忆模块的原因是:(1)a word in the vocabulary may have multiple  visual context information  (2)a word may correspond to more than one relevant  images in training data; 使用该模块后,(1) extract precises emantic features from the most salient region of relevant images for each word; (2)  capture full semantic correspondence between a word to its various visual contexts

该模块的具体做法是:给定一幅图像,使用预训练的yolov3和 Bottom-Up and Top-Down Attention model 和加权的计算方式提取与词对应的visual feature; 

CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第2张图片CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第3张图片

在训练text-encoder阶段,首先对描述中的所有词训练词向量E,然后将memory向量通过非线性映射与该词向量结合获取目标词向量w,s

CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第4张图片

 

2.  object-aware image encoder

该模块将生成的图像编码到语义级别,具体做法是采用yolov3提取object feature,与此同时,将图像分成8*8的网格,提取各个网格feature,两种feature分别通过矩阵,转换到与text embedding一致的shape,使用与attnGAN中同样的DAMSM 方式计算图像与文本 non-match loss

3.  Fine-grained Conditional Discriminator

该模块解决的问题是(1). only the global compatibility between the text and the image are considered   (2). the local correlations between a word in the text and a sub-region of the image are not explored

受patchGAN启发,作者将图像分成N*N的patch,每个patch提取的视觉特征v通过文本编码进行加权,得到该patch的文本上下文表示,该表示与视觉特征v和sentence特征连接共同判定图像的真伪。

CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第5张图片

结果:

这篇文章在coco上的结果是很令人惊艳的,首先贴下图,其中IS提升到52.73

CPGAN: Full-Spectrum Content-Parsing Generative Adversarial Networks for Text-to-Image Synthesis_第6张图片

再看下生成的图像

 可以看到的是生成的object例如羊、人等相比之前算法在形态上更加逼真,但是对跨度范围大的object其效果还有待改善,或许基于layout的方法与该方法结合能改善这一问题。

你可能感兴趣的:(text2image,计算机视觉,图像识别)