Image Inpainting Using Two-Stage Generative Inpainting Network with Contextual Attention
摘要
The Generative Inpainting Network (GIN) presents a novel and comprehensive approach to image inpainting, a process crucial in restoring missing content within images. The model comprises two key stages: a coarse network and a refinement network. The coarse network employs dilated convolutions to estimate missing content, guided by a reconstruction loss, while the refinement network incorporates a contextual attention layer. This layer, a key innovation, leverages related feature patches in distant spatial locations, enhancing inpainting by attending to relevant context. The contextual attention layer, a focal point in the model, explicitly attends to related feature patches, borrowing information from the surrounding context. This layer involves matching, attention, and reconstruction steps, utilizing convolution and softmax operations to determine the relevance of background patches. The spatial propagation layer maintains spatial coherence, enhancing the network’s ability to generate visually coherent and contextually consistent inpainted images.