[Paper Review] Image Inpainting with Learnable Bidirectional Attention Maps
This paper proposes Learnable Bidirectional Attention Maps (LBAM), a novel attention mechanism that jointly learns feature re-normalization and mask-updating in an end-to-end manner for image inpainting. By introducing learnable forward and reverse attention maps, LBAM enables the U-Net decoder to focus exclusively on hole-filling, significantly improving visual quality, sharpness, and structural coherence over state-of-the-art methods on Paris StreetView and Places datasets.
Most convolutional network (CNN)-based inpainting methods adopt standard convolution to indistinguishably treat valid pixels and holes, making them limited in handling irregular holes and more likely to generate inpainting results with color discrepancy and blurriness. Partial convolution has been suggested to address this issue, but it adopts handcrafted feature re-normalization, and only considers forward mask-updating. In this paper, we present a learnable attention map module for learning feature renormalization and mask-updating in an end-to-end manner, which is effective in adapting to irregular holes and propagation of convolution layers. Furthermore, learnable reverse attention maps are introduced to allow the decoder of U-Net to concentrate on filling in irregular holes instead of reconstructing both holes and known regions, resulting in our learnable bidirectional attention maps. Qualitative and quantitative experiments show that our method performs favorably against state-of-the-arts in generating sharper, more coherent and visually plausible inpainting results. The source code and pre-trained models will be available.
Motivation & Objective
- To address the limitations of standard and partial convolution in handling irregular holes and reducing color discrepancy and blurriness in image inpainting.
- To overcome the reliance on handcrafted mask-updating and fixed normalization in partial convolution (PConv) by learning these processes end-to-end.
- To improve decoder efficiency and focus by introducing reverse attention maps that suppress reconstruction of known regions.
- To enable effective training with adversarial loss by stabilizing feature learning and mask propagation.
Proposed method
- Proposes a learnable attention map module that replaces PConv's hard 0-1 mask and handcrafted normalization with a differentiable, end-to-end learned re-normalization mechanism.
- Introduces forward attention maps for encoder-level feature re-normalization and mask-updating, adapting to irregular hole shapes during feature propagation.
- Introduces reverse attention maps in the decoder to suppress feature learning on known regions, forcing the network to focus only on inpainting holes.
- Employs a U-Net architecture with both forward and reverse attention maps, enabling bidirectional attention learning across encoder and decoder.
- Uses Sigmoid or LeakyReLU as activation functions in the attention map network, with ablation studies to validate optimal choices.
- Integrates adversarial loss to enhance perceptual quality, made feasible by the stable training enabled by learnable attention.
Experimental results
Research questions
- RQ1Can end-to-end learned attention maps outperform handcrafted mask-updating and normalization in partial convolution for image inpainting?
- RQ2Does introducing reverse attention maps in the decoder improve focus on hole-filling and reduce reconstruction of known regions?
- RQ3Can the proposed learnable bidirectional attention mechanism support effective training with adversarial loss for better perceptual quality?
- RQ4How does the model perform on irregular holes compared to state-of-the-art methods in terms of structural coherence and texture realism?
Key findings
- The full LBAM model achieves a PSNR of 28.73 and SSIM of 0.889 on the (0.4, 0.5] hole size range of the Paris StreetView dataset, outperforming PConv and other SOTA methods.
- User study shows LBAM is selected as the most visually plausible result in 63.2% of cases, significantly outperforming PConv (15.2%) and other baselines.
- Ablation studies confirm that the combination of learnable attention, reverse attention, and proper activation functions (e.g., ReLU) is essential for optimal performance.
- The model with adversarial loss (Ours(w/o L_adv)) achieves higher PSNR and SSIM but lower visual quality, indicating that adversarial loss improves perceptual realism despite slightly worse metrics.
- Visualization shows that LBAM effectively reduces artifacts and blurriness, especially in the decoder, where reverse attention maps suppress known-region reconstruction.
- Mask-updating visualization confirms that encoder masks shrink over layers, while decoder masks shrink the known region, demonstrating effective bidirectional adaptation.
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.