NLMSA: Towards structure-aware image inpainting using nested linear and multi-scale attention
Abstract: Image inpainting technology aims to fill damaged regions reasonably based on known area information, generating semantically coherent inpainting results. The key to this task lies in effectively modeling long-range dependencies. However, existing Fourier transform-based methods are limited by fixed receptive fields, while dilated convolution methods sacrifice fine-grained details due to expanded receptive fields, making it difficult to achieve multi-scale global context modeling. Additionally, Transformer-based methods model long-range dependencies through simple module stacking, leading to increased computational costs. To address these challenges, this paper proposes a lightweight image inpainting framework called Structure-Guided Texture Generation, which achieves high-quality restoration through the collaborative work of a Structure Reconstruction Network (SRN) and a Texture Restoration Network (TRN). Specifically, in the SRN, a Multi-Scale Channel Attention Block (MSCAB) is designed based on edge-preserving smoothed images, enabling collaborative modeling of multi-scale features through a dynamic feature fusion mechanism to accurately reconstruct image structures. In the TRN, a novel Nested Linear Attention with Prior Information (NLAPI) mechanism is introduced, which incorporates structural prior information into the texture generation process through gated operations, achieving long-range dependency modeling under structural guidance. Experiments on the CelebA-HQ, FFHQ, and Paris StreetView datasets demonstrate that the proposed method can generate visually realistic inpainting results and outperforms comparative methods in both quantitative metrics and visual quality.