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

在这里插入图片描述

损失函数

由6部分组成,太复杂了。
L t o t a l = L v a l i d + 6 L h o l e + 0.05 L p e r c e p t u a l + 120 ( L s t y l e o u t + L s t y l e c o m p ) + 0.1 L t v \mathcal{L}_{total} = \mathcal{L}_{valid} +6\mathcal{L}_{hole} +0.05\mathcal{L}_{perceptual} +120(\mathcal{L}_{styleout} +\mathcal{L}_{stylecomp})+0.1\mathcal{L}_{tv} Ltotal=Lvalid+6Lhole+0.05Lperceptual+120(Lstyleout+Lstylecomp)+0.1Ltv

pixel loss

两部分组成,分别是空洞部分和非空洞部分。
L hole  = 1 N I g t ∥ ( 1 − M ) ⊙ ( I o u t − I g t ) ∥ 1 \mathcal{L}_{\text {hole }}=\frac{1}{N_{\mathbf{I}_{g t}}}\left\|(1-M) \odot\left(\mathbf{I}_{o u t}-\mathbf{I}_{g t}\right)\right\|_{1} Lhole =NIgt1(1M)(IoutIgt)1
L valid  = 1 N I g t ∥ M ⊙ ( I out  − I g t ) ∥ 1 \mathcal{L}_{\text {valid }}=\frac{1}{N_{\mathbf{I}_{g t}}}\left\|M \odot\left(\mathbf{I}_{\text {out }}-\mathbf{I}_{g t}\right)\right\|_{1} Lvalid =NIgt1M(Iout Igt)1

perceptual loss

L perceptual  = ∑ p = 0 P − 1 ∥ Ψ p I o u t − Ψ p I g t ∥ 1 N Ψ p I g t + ∑ p = 0 P − 1 ∥ Ψ p I comp  − Ψ p I g t ∥ 1 N Ψ p I g t \mathcal{L}_{\text {perceptual }}=\sum_{p=0}^{P-1} \frac{\left\|\Psi_{p}^{\mathbf{I}_{o u t}}-\Psi_{p}^{\mathbf{I}_{g t}}\right\|_{1}}{N_{\Psi_{p}} \mathbf{I}_{g t}}+\sum_{p=0}^{P-1} \frac{\left\|\Psi_{p}^{\mathbf{I}_{\text {comp }}}-\Psi_{p}^{\mathbf{I}_{g t}}\right\|_{1}}{N_{\Psi_{p}} \mathbf{I}_{g t}} Lperceptual =p=0P1NΨpIgt ΨpIoutΨpIgt 1+p=0P1NΨpIgt ΨpIcomp ΨpIgt 1

style loss

comp表示用真值填充非空洞部分,输出填充空洞部分,style loss要分别计算comp和out的损失值。
L style  out  = ∑ p = 0 P − 1 1 C p C p ∥ K p ( ( Ψ p I o u t ) ⊤ ( Ψ p I o u t ) − ( Ψ p I g t ) ⊤ ( Ψ p I g t ) ) ∥ 1 L s t y l e c o m p = ∑ p = 0 P − 1 1 C p C p ∥ K p ( ( Ψ p I c o m p ) ⊤ ( Ψ p I c o m p ) − ( Ψ p I g t ) ⊤ ( Ψ p I g t ) ) ∥ 1 \begin{aligned} &\mathcal{L}_{\text {style }_{\text {out }}}=\sum_{p=0}^{P-1} \frac{1}{C_{p} C_{p}}\left\|K_{p}\left(\left(\Psi_{p}^{\mathbf{I}_{o u t}}\right)^{\boldsymbol{\top}}\left(\Psi_{p}^{\mathbf{I}_{o u t}}\right)-\left(\Psi_{p}^{\mathbf{I}_{g t}}\right)^{\boldsymbol{\top}}\left(\Psi_{p}^{\mathbf{I}_{g t}}\right)\right)\right\|_{1}\\ &\mathcal{L}_{s t y l e_{c o m p}}=\sum_{p=0}^{P-1} \frac{1}{C_{p} C_{p}}\left\|K_{p}\left(\left(\Psi_{p}^{\mathbf{I}_{c o m p}}\right)^{\boldsymbol{\top}}\left(\Psi_{p}^{\mathbf{I}_{c o m p}}\right)-\left(\Psi_{p}^{\mathbf{I}_{g t}}\right)^{\boldsymbol{\top}}\left(\Psi_{p}^{\mathbf{I}_{g t}}\right)\right)\right\|_{1} \end{aligned} Lstyle out =p=0P1CpCp1 Kp((ΨpIout)(ΨpIout)(ΨpIgt)(ΨpIgt)) 1Lstylecomp=p=0P1CpCp1 Kp((ΨpIcomp)(ΨpIcomp)(ΨpIgt)(ΨpIgt)) 1

total variation —— tv

为R上的平滑惩罚,其中R为空洞区域1像素膨胀的区域。
L t v = ∑ ( i , j ) ∈ R , ( i , j + 1 ) ∈ R ∥ I comp  i , j + 1 − I comp  i , j ∥ 1 N I comp  + ∑ ( i , j ) ∈ R , ( i + 1 , j ) ∈ R ∥ I comp  i + 1 , j − I comp  i , j ∥ 1 N I comp  \mathcal{L}_{t v}=\sum_{(i, j) \in R,(i, j+1) \in R} \frac{\left\|\mathbf{I}_{\text {comp }}^{i, j+1}-\mathbf{I}_{\text {comp }}^{i, j}\right\|_{1}}{N_{\mathbf{I}_{\text {comp }}}}+\sum_{(i, j) \in R,(i+1, j) \in R} \frac{\left\|\mathbf{I}_{\text {comp }}^{i+1, j}-\mathbf{I}_{\text {comp }}^{i, j}\right\|_{1}}{N_{\mathbf{I}_{\text {comp }}}} Ltv=(i,j)R,(i,j+1)RNIcomp  Icomp i,j+1Icomp i,j 1+(i,j)R,(i+1,j)RNIcomp  Icomp i+1,jIcomp i,j 1

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值