Abstract
SinGAN是一个无条件限制的生成模型,此模型可以用单个自然图像进行学习。
SinGAN包含一个完全卷积GAN的金字塔,可以用来生成风格多样的图片。
This is achieved by a pyramid of fully convolutional light-weight GANs, each is responsible for capturing the distribution of patches at a different scale.Once trained, SinGAN can produce diverse high quality image samples(of arbitrary dimensions), which semantically resemble the training image,yet contain new object configurations and structures1
Introduction
对构成单一图像的子图像块儿的 internal distribution进行建模早有应用,如去噪,去模糊,超分辨,去雾,图像修复
Method
Our goal is to learn an unconditional generative model that captures the internal statistics of a single training image x. This task is conceptually similar to the conventional GAN setting, except that here the training samples are patches of a single image,rather than whole image samples from a database.
如下图所示,为了生成更丰富的内容,我们的生成框架由许多层次化的patch-GANS构成,其中每一个都负责捕获图像 x x x的不同尺度的patch分布。
2.1Multi-scale architecture
该模型由金字塔生成器G
{
G
0
,
.
.
.
.
.
,
G
N
}
\{G_0,.....,G_N\}
{G0,.....,GN}组成,用图像金字塔 X:
{
x
0
,
.
.
.
.
.
,
x
N
}
\{x_0,.....,x_N\}
{x0,.....,xN}进行训练,其中
x
n
x_n
xn是x的降采样,采样因子
r
n
,
r
>
1
r^n,r>1
rn,r>1,每一个生成器
G
n
G_n
Gn都负责生成与图像patch
x
n
x_n
xn的
d
i
s
t
r
i
b
u
t
i
o
n
distribution
distribution对应的图像样本。Gn的目的是用来混淆对应的
D
n
D_n
Dn,
D
n
D_n
Dn的做用是区分生成的样本以及
x
n
x_n
xn。
The generation of an image sample starts at the coarsest scale and sequentially passes through all generators up to the finest scale, with noise injected at every scale. 每一层的生成器和判别器具有相同感受野。生成过程是自底向上的(上采样)。
1)最底层的生成过程:
该区域的感受野是整个图片的1/2,该层的GAN可以生成图像的总体布局和全局结构。
2)从最底层向上的每一层生成器都不断的向图片中增加前一层所没有的细节(也就是越往上,细节越丰富)。
也就是:
其中
z
n
z_n
zn为每一层的空间噪声,第二项为最邻近的下层图像的上采样版本
所有生成器具有相似的结构,如下图所示:
由上图可以得
G
n
G_n
Gn的具体表达式
2.2 Training
训练方法:分层次训练,从最粗糙的尺度训练到最精细的尺度(自下而上进行训练)。每训练好一个GAN,就将其保持固定。第
n
t
h
n_{th}
nth的训练损失可以表示为:
Adversarial Loss
使用WGAN-GP loss 作为Adv loss,其中最终的判别分数是patch 判别图上的平均分;
D
n
D_n
Dn的结构与Gn中的网络结构一样。
Reconstruction Loss
在这里专门指定噪声图z:
其中
z
∗
z^*
z∗是一个固定的噪声图(在训练期间一直保持固定)。
对于
n
<
N
n<N
n<N,有:
x
n
+
1
−
r
e
c
是
使
用
噪
声
图
后
的
第
n
个
尺
度
的
生
成
图
像
x_{n+1}^{-rec}是使用噪声图后的第n个尺度的生成图像
xn+1−rec是使用噪声图后的第n个尺度的生成图像
对于n=N,则有: