Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization(ICCV17)

1. Introduction

Perceptual Losses for Real-Time Style Transfer and Super-Resolution(ECCV16)

给定输入图像 x x x,经过一个网络得到 y y y,同时有一幅style image s s s,使用一个VGG19来计算loss,令 y y y的content与 x x x相似,同时令 y y y的style与 s s s相似

局限性在于训练得到一个网络,只能迁移style image s s s的风格,如果要换一幅style image,需要再训练一个网络

作者说IN是解决style transfer的一大利器,可能需要看一看文献[52,11]

作者对IN的作用提出了一种船新的解释,IN performs style normalization by normalizing feature statistics,而feature statistics被文献[16,30,33]证实包含了style信息

Given a content input and a style input, AdaIN simply adjusts the mean and variance of the content input to match those of the style input.
一句话总结AdaIN所做的事情

2. Related Work

之前的方法[19]采用histogram matching来做style transfer,不知道是不是和BeautyGAN中的一样,可以去看看

之前的工作研究了style loss如何设计,Gatys等人采用二阶统计量Gram matrix,其它的loss还有很多,见[30, 31, 54, 41, 33]

Note that all the above loss functions aim to match some feature statistics between the style image and the synthesized image.

3. Background

3.1. Batch Normalization

BN设计的目的是加速网络训练,但是[42]指出对于图像生成也有效,具体BN为图像生成带来了什么增益,可能要去读一读文献[42]

BN的计算方式

x: (N, C, H, W)
beta:(C,)
gamma:(C,)
mean_val = np.mean(x, axis=(0, 2, 3))	# C维向量
std_val = np.std(x, axis=(0, 2, 3))
result = gamma * (x - mean_val / std_val) + beta

文中指出了BN的一个缺点,训练时使用mini-batch的statistics,inference时使用popular statistics,这两个statistics之间必然存在着差异
Q:既然有缺点,那为什么大家还喜欢用?是因为没有比BN更好的Norm方式可用了,所以只能用BN了吗?

3.2. Instance Normalization

IN的计算方式

x: (N, C, H, W)
beta:(N, C)
gamma:(N, C)
mean_val = np.mean(x, axis=(2, 3))	# (N, C)
std_val = np.std(x, axis=(2, 3))
result = gamma * (x - mean_val / std_val) + beta

没有对N这个维度求平均,意味着保留了instance每个个体各自的statistics

因为IN与batch无关了,所以train和test时没有差别

3.3. Conditional Instance Normalization

CIN来自ICLR17

你可能感兴趣的:(读书笔记)