[Paper Review] Deep Generative Model for Image Inpainting with Local Binary Pattern Learning and Spatial Attention
This paper proposes a two-stage deep generative model for image inpainting that first predicts local binary pattern (LBP) features of the missing region using a U-Net-based LBP learning network, then uses these features to guide a spatially attentive image inpainting network. The novel spatial attention mechanism models dependencies not only between known and generated regions but also within the generated region itself, significantly reducing artifacts and improving structural consistency, outperforming state-of-the-art methods on CelebA-HQ, Places, and Paris StreetView datasets.
Deep learning (DL) has demonstrated its powerful capabilities in the field of image inpainting. The DL-based image inpainting approaches can produce visually plausible results, but often generate various unpleasant artifacts, especially in the boundary and highly textured regions. To tackle this challenge, in this work, we propose a new end-to-end, two-stage (coarse-to-fine) generative model through combining a local binary pattern (LBP) learning network with an actual inpainting network. Specifically, the first LBP learning network using U-Net architecture is designed to accurately predict the structural information of the missing region, which subsequently guides the second image inpainting network for better filling the missing pixels. Furthermore, an improved spatial attention mechanism is integrated in the image inpainting network, by considering the consistency not only between the known region with the generated one, but also within the generated region itself. Extensive experiments on public datasets including CelebA-HQ, Places and Paris StreetView demonstrate that our model generates better inpainting results than the state-of-the-art competing algorithms, both quantitatively and qualitatively. The source code and trained models will be made available at https://github.com/HighwayWu/ImageInpainting.
Motivation & Objective
- To address the persistent issue of artifacts and structural inconsistencies in deep learning-based image inpainting, especially in textured and boundary regions.
- To improve global and local consistency in inpainted regions by leveraging structural priors from LBP features.
- To enhance feature representation in the generated region by modeling internal dependencies through a novel spatial attention mechanism.
- To stabilize training and improve feature fidelity using a multi-level loss function across multiple network layers.
- To achieve state-of-the-art performance in both qualitative and quantitative evaluations on public benchmarks.
Proposed method
- A two-stage framework is employed: first, a U-Net-based LBP learning network predicts the LBP feature map of the missing region using the known context.
- The predicted LBP feature is used as a structural prior to guide the subsequent image inpainting network in generating semantically plausible and structurally coherent content.
- A novel spatial attention mechanism is integrated into the inpainting network, modeling cross-region dependencies (known vs. generated) and intra-region dependencies (within the generated region) to improve consistency.
- The attention mechanism operates on a 32×32 feature resolution with T=2 patches per token, balancing efficiency and performance.
- A multi-level loss function is applied across multiple encoder-decoder layers to optimize feature fidelity and improve training stability.
- Generative adversarial networks (GANs) are jointly trained with the above components to enhance realism and perceptual quality.
Experimental results
Research questions
- RQ1Can LBP features serve as an effective, parameter-free structural prior to guide image inpainting and reduce artifacts?
- RQ2Does modeling internal dependencies within the generated region improve structural consistency compared to existing attention mechanisms?
- RQ3How does the proposed two-stage, coarse-to-fine framework compare to end-to-end GAN-based methods in terms of visual quality and quantitative metrics?
- RQ4To what extent does the multi-level loss improve feature reconstruction and final inpainting performance?
- RQ5Can the proposed model generalize across diverse image domains such as faces, natural scenes, and street views?
Key findings
- The proposed model achieves a PSNR gain of approximately 0.11 dB over the baseline without multi-level loss on the Places dataset with centering masks.
- On the Places dataset, the model achieves a PSNR of 24.31 and SSIM of 0.845 when using the multi-level loss, outperforming the version without it (PSNR: 24.20, SSIM: 0.844).
- Qualitative results on CelebA-HQ, Places, and Paris StreetView show reduced boundary artifacts and improved texture coherence compared to state-of-the-art methods.
- The ablation study confirms that the proposed spatial attention mechanism, which models internal dependencies, significantly improves local consistency and reduces hallucination.
- The integration of LBP as a structural prior leads to more accurate structural reconstruction, especially in complex regions like faces and textures.
- The model demonstrates strong generalization across diverse datasets, including face images, natural scenes, and urban street views, with visually plausible and semantically consistent results.
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.