Integrating Edge and Pencil Sketch Information for Enhanced Image Inpainting with Vision Transformers
摘要
Image inpainting is a specialized computer vision technique designed to restore damaged regions within an image. The advent of deep neural networks, particularly convolutional neural networks (CNNs), has significantly enhanced the capabilities of image inpainting, enabling the restoration of damaged images with unprecedented accuracy. However, despite these advancements, the limited receptive fields of CNNs can sometimes lead to suboptimal outcomes, as they fail to capture the broader context of the image. Recently, transformers have emerged as a promising solution to address the limitations of CNNs in image inpainting. By leveraging self-attention mechanisms, transformers can effectively model the global context of an image, learning long-range dependencies that enable them to capture complex scenes and large missing regions. This capability makes transformers particularly well-suited for achieving realistic image inpainting results, especially in cases where images have extensive damage or intricate details. In addition to transformers, other approaches have explored the integration of auxiliary information, such as edge or segmentation data, to augment the model’s understanding of structural details. By incorporating this additional information, image inpainting models can better capture the nuances of the original image, resulting in more accurate and visually coherent restored images. In this work, we propose a new architecture for image inpainting that combines auxiliary information with transformers to enhance the restoration process. By integrating edge and pencil sketch information, our model leverages the strengths of transformers to capture global context and long-range dependencies through self-attention mechanisms. This dual-guidance approach ensures more accurate and realistic restoration of both structural and textural elements, particularly in images with large missing regions and complex scenes. Our architecture consists of two stages. In the auxiliary information stage, edges and pencil sketch information are predicted from edge and sketch models respectively to restore the missing regions. In the inpainting stage, the inpainting model uses the restored edges and pencil sketch images to guide the restoration of the input image. Both the sketch and inpainting models utilize transformers with the patch self-attention strategy to reduce memory consumption and computational power compared to the global self-attention approach. Meanwhile, the edge model employs residual blocks with dilated convolutions to enhance its performance. Experimental results demonstrate the effectiveness of our approach, showing superior or competitive performance compared to existing methods, particularly in scenarios involving complex images and large missing areas.