[Paper Review] Image Inpainting with Edge-guided Learnable Bidirectional Attention Maps
This paper proposes Edge-LBAM, a novel image inpainting framework that uses learnable bidirectional attention maps guided by predicted edges to improve structural coherence and reduce blurriness in irregular hole inpainting. By replacing hard 0-1 masks with end-to-end trainable attention maps and integrating edge-aware mask-updating, Edge-LBAM achieves state-of-the-art performance in both quantitative metrics and visual quality on benchmark datasets.
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.
Motivation & Objective
- To address the limitations of standard and partial convolution in handling irregular holes, which often lead to color discrepancies and blurry results.
- To improve mask-updating and feature re-normalization by replacing fixed 0-1 masks with learnable attention maps trained end-to-end.
- To enhance inpainting performance by making the filling-in process structure-aware using predicted edges.
- To develop a bidirectional attention mechanism—forward and reverse attention maps—for better feature propagation and reconstruction.
- To achieve more coherent and realistic image completion by integrating multi-scale edge prediction with attention-based feature refinement.
Proposed method
- Introduces a learnable forward attention map (LFAM) that replaces the hard 0-1 mask in partial convolution with a soft, trainable attention map for dynamic feature re-normalization and mask-updating.
- Proposes a learnable reverse attention map (LRAM) in the decoder to emphasize missing regions during reconstruction, improving training stability and generation quality.
- Employs a multi-scale edge completion network (MCENet) to predict coherent edges from the input, which guide structure-aware mask-updating in the encoder.
- Introduces Edge-LFAM and Edge-LRAM, which use predicted edge maps to constrain mask-updating and attention distribution, ensuring filling-in follows structural contours.
- Uses a dual-path architecture with encoder-decoder design, where attention maps are learned end-to-end and integrated with edge supervision for improved feature learning.
- Applies adaptive activation functions $g_A(\cdot)$ and $g_M(\cdot)$ in attention modules, which outperform standard Sigmoid and ReLU in ablation studies.
Experimental results
Research questions
- RQ1Can learnable attention maps replace hard 0-1 masks in partial convolution to improve feature re-normalization and mask-updating for irregular hole inpainting?
- RQ2How does edge-guided mask-updating affect the coherence of generated image structures and reduction of blurriness?
- RQ3Can bidirectional attention mechanisms (forward and reverse) improve feature propagation and reconstruction in image inpainting?
- RQ4Does integrating multi-scale edge prediction with attention maps lead to more structure-aware and realistic inpainting results?
- RQ5How do different activation functions in the attention modules affect the final inpainting performance?
Key findings
- Edge-LBAM achieves state-of-the-art performance on the Paris StreetView and Places2 datasets, outperforming methods like PConv, DeepFillv2, and EdgeConnect in both PSNR and SSIM metrics.
- The ablation study confirms that the proposed $g_A(\cdot)$ and $g_M(\cdot)$ activation functions significantly outperform Sigmoid, ReLU, and their combinations in feature re-normalization and mask-updating.
- Visualization shows that Edge-LBAM’s mask-updating is structure-aware: holes shrink along predicted edge directions, enabling coherent structural completion.
- The reverse attention map (LRAM) effectively focuses the decoder on filling in unknown regions, with higher attention values on holes than on known regions.
- Edge-LBAM reduces color discrepancy and blurriness by learning attention maps that adapt to spatial context and structural cues.
- The method demonstrates robustness across diverse irregular hole shapes and complex textures, as validated by qualitative comparisons and quantitative metrics.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.