Partial Convolution
从文章的标题来看, partial convolution(局部卷积)是方法核心。实际上这个思想还是很直观的:
x ′ = { W T ( X ⊙ M ) s u m ( 1 ) s u m ( M ) + b , i f s u m ( M ) > 0 0 , o t h e r w i s e x'= \left\{ \begin{array}{ll} \bold{W}^T ( \bold{X}\odot\bold{M} )\frac{sum(\bold{1})}{sum(\bold{M})} +b,& if \ sum(\bold{M}) >0\\ 0, & otherwise \\ \end{array} \right. x′={
WT(X⊙M)sum(M)sum(1)+b,0,if sum(M)>0otherwise
在原来的卷积层的基础上,加入一个二进制的Mask M \bold{M} M,标准化之后作为该层的输出,通俗来讲就是“不想让你看的东西别看”。 M \bold{M} M的确定方式也是一个简单的One for all思路,如果对应的上一层的receptive field存在有效pixel,则归为1.
m ′ = { 1 i f s u m ( M ) > 0 0 , o t h e r w i s e m'= \left\{ \begin{array}{ll} 1& if \ sum(\bold{M}) >0\\ 0, & otherwise \\ \end{array} \right. m′={
10,if sum(M)>0otherwise
所以,这种局部卷积的方法就是通过“蒙住”无效区域,以减少噪声,从而使该方法对不规则区域的inpainting适用。
5 个损失函数
我之前没有看过inpainting的文章,也不是数学专业,所以当看到论文的Loss Functions这一节如获至宝。
Per Pixel Loss
L h o l e = 1 N I g t ∣ ∣ ( 1 − M ) ⊙ ( I o u t − I g t ) ∣ ∣ 1 \mathcal{L}_{hole} = \frac{1}{N_{\bold{I}_{gt}}}||(\bold{1}-\bold{M})\odot(\bold{I}_{out}-\bold{I}_{gt})||_1 Lhole=NIgt1∣∣(1−M)⊙(Iout−Igt)∣∣1
L v a l i d = 1 N I g t ∣ ∣ ( M ) ⊙ ( I o u t − I g t ) ∣ ∣ 1 \mathcal{L}_{valid} = \frac{1}{N_{\bold{I}_{gt}}}||(\bold{M})\odot(\bold{I}_{out}-\bold{I}_{gt})||_1