天天看点

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

【2019 arxiv】

Karras, Tero, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. “Analyzing and improving the image quality of stylegan.” arXiv preprint arXiv:1912.04958 (2019).

任务:无条件图像生成

问题:对StyleGAN中出现的小气泡的失真现象进行分析

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

本文对StyleGAN模型进行了全面的分析,对原来出现的小气泡状的失真现象进行了分析,并提出了改进后的StyleGAN_v2

本文首先对原来的网络进行进行了改进,将原来在特征图上进行了modulation和normalization改在了在网络权重中进行modulation和demodulation,同时对损失函数采用不同的使用频率,并增加了Path Length的正则化,同时不再使用progress growing的策略,而是在G中使用skip结构,在D中使用residual结构,所有尺度同时训练,最后还提出了对64-1024尺度的特征图通道数翻倍的更大的网络。

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

作者在StyleGAN的基础上一共提出了五项改进,同时作者发现Perceptual Path Length的结果与人的感觉更相符

Weight domodulation

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

(a)是StyleGAN的模型

(b)是StyleGAN中间的详细细节

©是对StyleGAN进行了改进

①将noise(B)和bias(b)移到每个block之外(在normalization之后)

②norm和modulation的操作只需要对方差进行,不需要对均值进行

③在输入层的bias、noise和norm可以移除

(d)对©中的Instance Normalization进行了改进

©中的modulation是对于特征图进行的,作者提出可以改为对模型参数进行约束

Modulation:

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

Demodulation:

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

在具体实现时使用group convolution操作

Lazy regularization

当模型有main loss和regularization loss时,对于regularization loss的计算频率可以更少(例如每更新16个main loss后使用一次regularization loss),在不影响模型效率的同时可以减少计算量和内存使用

Path length regularization

为了使得隐向量空间到图像的映射更加连续,约束每个方向的路径长度都变小

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

其中w为z在经过8个FC后的隐状态向量,y=g(w)为生成图像

a为||y_w^Ty||_2的指数平滑均值

计算时实际使用下式计算

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

不使用Progressive growing方法

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

(a)为StyleGAN中使用的方法,(b)为skip-connection方法,©为residual方法

通过实验发现在生成器中使用skip方法,在判别器中使用residual方法的效果更好

Large Network

作者同时实验发现在训练的不同阶段,不同尺度的图像对最终生成图像的影响不同,但是在改进后的StyleGAN中发现,512尺度的图像的影响度比1024尺度的大,因此认为可能是网络容量不够导致的

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

为此提出了将64-1024尺度阶段中所有特征图的通道数翻倍

数据集

FFHQ(1024 * 1024)

LSUN Car(512 * 384)

LSUN Cat(256 * 256)

LSUN Church(256 * 256)

LSUN Horse(256 * 256)

评价指标

①FID

②Perceptual Path Length(PPL)

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

其中w=f(z)表示经过FC后的在隐状态的向量,然后对两个w之间进行插值,计算每隔一小步后生成的两张图像,在所有中间特征层的特征距离的均值,再对所有区间进行求和,作为这两个w对之间的距离,再采样100000个z对进行计算

③Precision&Recall

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

ϕ ϕ ϕ为一个图像的特征, Φ g Φ_g Φg​ 表示生成图像组成的特征集合, Φ r Φ_r Φr​ 表示真实图像组成的特征集合

f判断某一图像特征是否在某一集合特征中任意特征的最k邻近集之中

实验

①将生成图像或真实图像返回到W空间,然后再重新生成图像,并计算前后两张图像之间的距离(使用LPIPS距离)

其中,返回到W空间时,通过反向传播方法同时求出最优的W空间向量和输入噪声n

损失函数如下:

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

后一项是为了约束噪声符合正态分布

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

重建图像及最优化噪声

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

重建前后图像的LPIPS距离

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

重建图像的对比

②生成图像

【论文阅读】Analyzing and Improving the Image Quality of StyleGAN

继续阅读