# Ancient Painting Inpainting with Regional Attention-Style Transfer and Global Context Perception
## 1 Introduction  
Ancient paintings, as a form of art that integrate architecture with color and form, are subject to damage in their local regions due to environmental influences, major natural disasters, and the risk of intentional destruction [1]. However, because of influences from the environment, significant calamities of nature, and the risk of deliberate damage, this measure trove of artistic legacy has become exceedingly delicate. Traditional ancient painting inpainting works [2] are mainly done by experienced experts using manual reproduction methods. This approach relies on the expertise of the restorer but is also inefficient. More importantly, there may be subjective misunderstanding of the contents of ancient paintings, leading to irreversible damage to them. Ancient painting inpainting has recently emerged as a fundamental research topic in computer vision [3]. Since the advent of deep learning [4], numerous studies in image processing and computer vision have leveraged its powerful capabilities for feature extraction and learning, achieving groundbreaking results. The integration of deep learning technology into the domain of image inpainting has addressed the limitations of traditional methods, which often fail to consider comprehensive image information. Among these advancements,generative adversarial networks (GANs [5]) stand out due to their distinctive adversarial approach and superior generative capabilities. They have been extensively applied across various image inpainting applications. GAN-based image inpainting technology [6], which combines a potent generative network with a discriminative network, has demonstrated significant advantages. The generative network is tasked with creating realistic image content, while the discriminative network assesses the authenticity of the output. This adversarial training significantly enhances the quality and precision of the details in the restored images. Because the U-Net [7] network's excellent feature fusion can learn different levels of information in an image, researchers have tried to apply it to image inpainting tasks and have achieved excellent inpainting results. In addition, [PERSON] et al. [8] used GAN for image refinement, combined with the use of the TranMSMrmer [9] module to restore refinement features for superior performance in image recovery tasks. [PERSON] et al. [10] proposed an antagonistic generation network based on universal multi-core filters to extract more relevant and discriminating features related to image tasks. [PERSON] and others [11] proposed an edge-guided ancient painting inpainting method using edge image guidance network training through self-attention to improve the attention to edge and detail features. Furthermore, [PERSON] et al. [12] demonstrated significant improvements in image quality using a lightweight image super-resolution approach with deep residual feature distillation, which is relevant to enhancing performance in image restoration tasks. Ancient painting inpainting requires a delicate balance between preserving the original artistic integrity and addressing the damages incurred over time. While considerable progress has been made in the field, existing GAN-based methods often struggle to effectively capture intricate details and maintain semantic coherence, especially in severely damaged or missing regions. To address these challenges, we propose a novel ancient painting inpainting network, RG-GAN, which introduces three key modules--RASTM (Regional Attention-Style Transfer Module), MFG (Multi-scale Fusion Generator), and GCPD (Global Context Perception Discriminator)--each designed to target specific limitations of prior inpainting methods. Firstly, RASTM improves the preservation of stylistic consistency by incorporating regional attention mechanisms, ensuring that transferred styles match the original artistic context more closely.