SAIN:structure-aware image inpainting for large missing areas
摘要
Image inpainting is crucial for restoring missing or corrupted regions in images, with diverse applications in computer vision and digital content creation. Existing deep learning-based methods, however, often struggle with large or irregular missing regions due to limited contextual cues, leading to structural inconsistencies and semantic misalignment. To address these challenges, we propose Structure-Aware Image Inpainting (SAIN), a novel two-stage framework that integrates multi-scale structural priors and a mask-aware gated attention mechanism to guide the inpainting process. A structured encoder-decoder architecture is designed to extract multi-scale structural features of the complete edge maps generated by the edge generation network. These features from decoder-side reconstructions, rich in semantic and geometric information, are adaptively injected as structural priors into the content inpainting network, helping the model to balance fine detail restoration with global shape consistency. Both stages of SAIN are enhanced with a mask-aware gated attention module that explicitly encodes the geometry of missing regions and applies gated attention. This mechanism enables the network to focus on reliable contextual features while suppressing misleading signals near hole boundaries caused by corruption. This combination allows for the effective handling of large missing regions, ensuring robust inpainting while maintaining spatial and semantic coherence, even under complex mask conditions. We evaluate SAIN on multiple datasets and conduct extensive experiments, demonstrating its superior performance in inpainting complex structures. The proposed method significantly enhances geometric consistency, semantic fidelity, and robustness across a variety of degradation scenarios.