Image Inpainting with Edge-guided Learnable Bidirectional Attention Maps

Dongsheng Wang, Chaohao Xie, Shaohui Liu, Zhenxing Niu, Wangmeng Zuo
4/25/2021
cs.CV

Official code: wds1998/Edge-LBAM (25 stars, last commit 2021-07-24).

Abstract

For image inpainting, the convolutional neural networks (CNN) in previous methods often adopt standard convolutional operator, which treats valid pixels and holes indistinguishably. As a result, they are limited in handling irregular holes and tend to produce color-discrepant and blurry inpainting result. Partial convolution (PConv) copes with this issue by conducting masked convolution and feature re-normalization conditioned only on valid pixels, but the mask-updating is handcrafted and independent with image structural information. In this paper, we present an edge-guided learnable bidirectional attention map (Edge-LBAM) for improving image inpainting of irregular holes with several distinct merits. Instead of using a hard 0-1 mask, a learnable attention map module is introduced for learning feature re-normalization and mask-updating in an end-to-end manner. Learnable reverse attention maps are further proposed in the decoder for emphasizing on filling in unknown pixels instead of reconstructing all pixels. Motivated by that the filling-in order is crucial to inpainting results and largely depends on image structures in exemplar-based methods, we further suggest a multi-scale edge completion network to predict coherent edges. Our Edge-LBAM method contains dual procedures,including structure-aware mask-updating guided by predict edges and attention maps generated by masks for feature re-normalization.Extensive experiments show that our Edge-LBAM is effective in generating coherent image structures and preventing color discrepancy and blurriness, and performs favorably against the state-of-the-art methods in terms of qualitative metrics and visual quality.

View on arXivView PDF

Code Implementations(1)

wds1998/Edge-LBAMOfficial100%

Pytorch implementation of paper "Image Inpainting with Edge-guided Learnable Bidirectional Attention Maps"

255PythonMar 31, 20215 years ago

Similar Papers

Cite this paper

@article{wang2021image,
  title  = {Image Inpainting with Edge-guided Learnable Bidirectional Attention Maps},
  author = {Dongsheng Wang and Chaohao Xie and Shaohui Liu and Zhenxing Niu and Wangmeng Zuo},
  year   = {2021},
  eprint = {2104.12087},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.12087}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.12087.svg)](https://codeofpaper.com/paper/2104.12087)

Discussion