- Context Encoders与autoencoders很像,但是有区别
Autoencoders take an input image and try to reconstruct it after it passes through a low-dimensional “bottleneck” layer, with the aim of obtaining a compact feature representation of the scene. Unfortunately, this feature representation is likely to just compresses the image content without learning a semantically meaningful representation.
在autoencoders中,输入的图片通过encoder可以提取出特征,但是这种特征提取仅仅是对图像内容的一个压缩,缺乏对图像语义的理解。
本文使用了两种损失函数,reconstruction loss and adversarial loss,前者可以根据缺失区域的周围图像把握区域的整体结构,后者可以使生成器能够在生成图像时选择真实数据分布中的某种特定模式,从而生成更加逼真的图像。
Indeed, to the best of our knowledge, ours is the first parametric inpainting algorithm that is able to give reasonable results for semantic hole-filling (i.e. large missing regions).The context encoder can also be useful as a better visual feature for computing nearest neighbors in nonparametric inpainting methods.
这里的parametric inpainting和non-parametric inpainting,我的理解是parametric inpainting algorithm在训练过程中学习了图像的统计特征和结构,以便在预测缺失像素时能够生成合理和连贯的图像内容,使用了深度神经网络这个参数化模型;而non-parametric inpainting不依赖于预先定义的参数化模型,而是根据图像中已有的信息来进行图像修复,例如纹理合成。
网络图如下:
- Encoder:采用AlexNet的前五个卷积层和第五个池化层。
- Decoder:从官方源码中看出,decoder由生成器和判别器组成,类似于GAN,训练的时候是分别训练生成器和判别器的。
- channel-wise fully-connected layer,通道全连接层,即对每个通道单独进行全连接操作。好处是通道全连接层用于提取特征的操作,可以用于替代传统的全连接层,减少参数数量,并且由于对每个通道单独进行全连接操作,可以更好地保留卷积层提取的特征。
- 损失函数:Reconstruction loss and Adversarial loss。公式先不列了。
参考文献: