Inpainting

less than 1 minute read

Loss

  • pixel loss
    • $\mathcal{L}=|I_{est}-I_{HR}|_2^2$
    • $I_{est}$估计图像,$I_{HR}$高清图像
  • perceptual loss
    • $\mathcal{L}=|\phi(I_{est})-\phi(I_{HR})|_2^2$
    • $\phi(*)$ VGG-19的第二和第五pooling层
  • texture matching loss
    • $\mathcal{L}=|G(\phi(I_{est}))-G(\phi(I_{HR}))|_2^2$
    • $G(F)=F·F^T$, 为Gram矩阵
  • Adversarial loss
    • G 最小化loss
      • $\mathcal{L}=-log(D(G(z)))$
    • D 最小化
      • $\mathcal{L}=-log(D(x))-log(1-D(G(z)))$
  • Content Loss 内容损失
  • Style loss 风格损失
    • $\mathcal{L}{Style}^{l}=\frac{1}{(2n_H^{l}n_W^{l}n_C^{l})^2}\sum{k}\sum_{k’}(Gram_{kk’}^{l}(S)-Gram_{kk’}^{l}(G))$
    • $l$为层数
    • $Gram$为$Gram$矩阵$G_{kk’}^{l}(S)=\sum_{i=1}^{n_H^{l}}\sum_{j=1}^{n_W^{l}}A_{i,j,k}^{l}(S)A_{i,j,k’}^{l}(S)$
      • $Gram$ $size=(n_c^l,n_c^l)$
    • $n_H^{l}$为第l层的H大小
    • $\mathcal{L}{style}(S, G)=\sum_l\lambda^l\mathcal{L}{style}^l(S,G)$
  • PAN^[Perceptual Adversarial Networks:TIP 2018]
    • 20221227135037
    • $\mathcal{l}_{percep}^{D,j}(x,y)=|D_j(y)-D_j(T(x))|$
    • $\mathcal{L}T=\sum{j=1}^F\lambda_j\mathcal{l}_{percep}^{D,j}$
  • GAN

  • $\underset{G}{\min}\ \underset{D}{\max}(D,G)=E_{x\sim p_{data}(x)}[logD(x)]+E_{z\sim p_{z}}[log(1-D(G(z)))]$
    • $D$ 判别网络 Discriminant
    • $G$ 生成网络
    • 寻找最优的判别网络可以区分生成的和真实的图片的区别
    • 寻找最优的生成网络,避免被判别网络判别

Paper

Categories:

Updated: