Image Inpainting for Irregular Holes Using Partial Convolutions论文阅读笔记

这是一篇2018年发表在ECCV上的论文,作者团队是NVIDIA Corporation。
之前总结的两篇文章Globally and Locally Consistent Image Completion和Context Encoders: Feature Learning by Inpainting都用到了CNN进行语义的提取,然而这些方法没有区分完整的区域和被遮盖的区域(masked holes),导致了卷积计算的浪费以及对两部分区域的不敏感,通常会导致色差和模糊。本篇论文提出了Partial convolutions,卷积被部分遮盖,仅在有效的像素上起作用。同时提出了一种方法用于自动生成下一层的更新掩码,作为前向传递的一部分。

  • Partial Convolution Layer

x ′ = { W ⊤ ( X ⊙ M ) s u m ( 1 ) s u m ( M ) + b , if  s u m ( M ) > 0 0 , otherwise  x' = \left\{ \begin{array}{ll} \mathbf{W}^{\top}(\mathbf{X}\odot \mathbf{M})\frac{sum(\mathbf{1})}{sum(\mathbf{M})}+b, & \text{if } sum(\mathbf{M}) > 0 \\ 0, & \text{otherwise } \end{array} \right. x={W(XM)sum(M)sum(1)+b,0,if sum(M)>0otherwise 
其中 W W W是卷积核的权重, b b b是偏置, X X X是当前要被卷积的特征图, M M M是对应的二值掩码图(跟卷积核一样大小),1对应完好的区域,0对应损坏的区域。 1 \mathbf{1} 1指的是跟 M M M有相同形状且元素全是1的张量。由此可以看出,输出的值只依赖于未遮盖的区域的像素。用 s u m ( 1 ) s u m ( M ) \frac{sum(\mathbf{1})}{sum(\mathbf{M})} sum(M)sum(1)来调整缩放。
用这种方法卷积完一次后,我们要更新我们的mask,只要上一步的 M M M的区域中(例如3*3)有一个元素为1,就将该次卷积中该区域(该3*3区域) M M M的中心元素设为1,反之则为0。
m ′ = { 1 , if  s u m ( M ) > 0 0 , otherwise  m' = \left\{ \begin{array}{ll} 1, & \text{if } sum(M) > 0 \\ 0, & \text{otherwise } \end{array} \right. m={1,0,if sum(M)>0otherwise 

Partial Convolution as Padding. We use the partial convolution with appropriate masking at image boundaries in lieu of typical padding . This ensures that the inpainted content at the image border will not be affected by invalid values outside of the image – which can be interpreted as another hole.

作者选择不使用传统的填充方式,而是采用部分卷积并在图像边界使用适当的掩膜。通过这种做法,可以确保在图像边界进行修复或补全操作时,不会受到图像外部无效值(比如缺失区域或边界填充)的干扰。这样可以避免修复结果受到填充的影响,提高修复的准确性和质量。

Network Design. We design a UNet-like architecture [25] similar to the one used in [11], replacing all convolutional layers with partial convolutional layers and using nearest neighbor up-sampling in the decoding stage. The skip links will concatenate two feature maps and two masks respectively, acting as the feature and mask inputs for the next partial convolution layer. The last partial convolution layer’s input will contain the concatenation of the original input image with hole and original mask, making it possible for the model to copy non-hole pixels. Network details are found in the supplementary file.

网络结构:使用类似于UNet的网络结构,将其中所有的传统卷积换成部分卷积。
论文中的结果展示:
在这里插入图片描述
参考文献:

  1. Image Inpainting for Irregular Holes Using Partial Convolutions
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值