U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization

论文题目:U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation(2019-7-25)

code:https://github.com/taki0112/UGATIT(tensorflow版本)/ https://github.com/znxlwm/UGATIT-pytorch(pytorch版本)

论文主要贡献:解决无监督的图像翻译问题,当两个域的图像的纹理和形状差别很大时,现有的一些经典模型(cyclegan、UNIT、MUNIT、DRIT等)效果不佳,这些算法适用于两个域的差别不大时,如photo2vangogh和photo2portriat,而cat2dog和selfie2anime(自拍到漫画)效果不好,本文通过引入attention module和AdaLIN(Adaptive Layer-Instance Normalization)能在几何形变很大的情况下仍然有好的效果,当然形变不大时效果也超过了现有的经典方法,是SOTA,同时本文的网络结构和超参数在所有实验的数据集上是不变的,而现有的经典方法则需要精细化调参;

本文实验数据集:总共5个数据集;详细信息参见论文;

horse2zebra and photo2vangogh:这两个数据集主要是cyclegan论文实验的数据集;

cat2dog and photo2portrait:这两个数据集主要是DRIT实验的数据集;

selfie2anime:本文额外的数据集,自拍到漫画人脸,其中漫画数据集从http://www.anime-planet.com/采集,然后利用程序https://github.com/nagadomi/lbpcascade animeface检测出漫画人脸,crop后通过超分辨率得到256*256的漫画数据,注意不是直接resize;而且只挑出女性人脸训练测试;

效果图:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第1张图片

可见确实该方法效果很不错,值得尝试;

网络结构:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第2张图片

该论文主要创新点是两处,一个是将attention机制引入生成器和判别器;另一个是在生成器的解码阶段采用自适应的ILN层(Adaptive ILN---adaptive instance-layer normalization);

具体的attention是通过网络的encode编码阶段得到特征图,例如C*H*W,然后通过对特征图的最大池化成C*1*1,经过全连接层输出一个节点的预测logits,然后将这个全连接层的参数(可以知道是C个w权重),和特征图相乘得到最大池化attention的特征图,同样对特征图均值池化然后同样的操作得到均值池化attention的特征图,将两个特征图concat得到C*2通道的H*W的特征图,然后将新的特征图经过1*1卷积将通道改变成C送入decode解码阶段,同时通过将特征图flaten经过全连接得到C通道的gama和beta,作为AdaILN的参数,其中解码器的残差网络部分用AdaILN,upsample上采样部分用ILN,ILN中的所有超参数是可学习的,同样的attention操作作用于判别器;具体的过程参见作者的源代码(下篇blog详细解读),比较容易理解;

从attention的权重获取可知该论文借鉴了CAM(Class Activition Map,一般还有Grad-CAM,主要用于画热力图,变相表示网络的attention)

补充:生成器的Encode采用IN,Decode的resnetAdaILN用的AdaILN,Decode的Upsample用的ILN,判别器用的SN;

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第3张图片

文章中说IN比LN更容易保持原图像的语义信息,但是风格转换不彻底;LN风格转换更彻底,但是语义信息保存不足,因此才有了自适应的ILN层,控制IN和LN的比例;

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第4张图片

从上图看出:photo2portait和photo2vagogh的数据集的rogh偏向于1,说明这两个数据集更偏向于IN;

同时生成器用Relu,判别器用LRelu,斜率0.2;

网络参数如下:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第5张图片

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第6张图片

实验结果:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第7张图片

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第8张图片

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第9张图片

主客观评价都很好,Excellent的效果;推荐精读论文;

补充说明:

将AdaILN换成其他Normalization的方式结果如下:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第10张图片

不加attention的结果:

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization_第11张图片

 

你可能感兴趣的:(图像翻译)