© 2026 The author. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).
OPEN ACCESS
Intelligent restoration of insect-damaged ancient manuscripts is still limited by insufficient detection accuracy and by semantic misalignment between modalities. This paper therefore proposes a hybrid restoration framework that combines You Only Look Once Version 8 nano (YOLOv8n) object detection with multimodal retrieval-augmented generation (RAG). For detection, the baseline YOLOv8n is improved in three ways: a Bilateral Transformer (BiFormer) attention mechanism is embedded to strengthen the features of small insect-eroded regions, a Bidirectional Feature Pyramid Network (BiFPN) is adopted for better multi-scale feature fusion, and training is supervised by a composite of Generalized Intersection over Union (GIoU) Loss, Focal Loss, and Dice Loss. The improved YOLOv8n-seg achieves a mean Average Precision (mAP)@0.5 of 74.2% and a recall of 82.8%. For inpainting, a generator–discriminator pipeline is built on U-Net and a generative adversarial network (GAN) and coupled with multimodal RAG. The RAG module dynamically retrieves historical conservation cases of ancient manuscripts as contextual priors for generation, so that the filled regions match the original calligraphic style and page layout. On a self-built dataset of insect-damaged manuscripts, the method reaches a Peak Signal-to-Noise Ratio (PSNR) of 33.5 dB and a Structural Similarity Index (SSIM) of 0.934. The framework offers a new and effective approach to cross-modal intelligent restoration of damaged ancient books with complex backgrounds.
YOLOv8n-seg, retrieval-augmented generation, ancient manuscript restoration, multimodal learning, U-Net, generative adversarial network
Ancient books are important carriers of Chinese civilization, and their preservation and restoration are of great cultural value. Because of their age, however, many ancient books suffer from insect damage, water stains and mildew, which seriously impair their readability and shorten their lifespan. Traditional restoration depends on manual experience, so it is inefficient and its quality is hard to guarantee. Deep learning has made remarkable progress in image inpainting in recent years [1-4], yet research on restoring Chinese ancient books remains scarce. Restoring insect-damaged regions still faces three challenges: (1) insect-damaged regions have complex shapes, and conventional detection models struggle to locate them precisely; (2) the loss of semantic information in damaged books causes restoration results to deviate from the original content; and (3) the restoration process lacks interpretability, which makes it difficult to meet the reversibility requirements of cultural heritage conservation. Object detection is a key step in restoring damaged ancient books, since it determines how accurately damaged regions such as wormholes and water stains are located. Conventional methods such as Faster Region-based Convolutional Neural Network (R-CNN) [5] perform well on natural images. In ancient book images, however, complex backgrounds easily interfere with detection, and the diverse shapes of insect damage lead to low accuracy on small targets, which in turn degrades the final restoration. Studies have shown that the You Only Look Once (YOLO) [6-8] object detection algorithm, trained on large amounts of annotated images, can learn the features of different types of damage and quickly identify and mark damaged locations. YOLO-based detection improves both speed and accuracy to some extent. Nevertheless, ancient book documents vary widely in font, paper texture and color, and in low-quality or blurred images the generalization of deep learning models may suffer, so that some insect-damaged regions are not accurately detected or restored. Previous work [9] has shown that combining deep learning with generative adversarial networks (GAN) can improve inpainting quality. Meanwhile, multimodal retrieval-augmented generation (RAG) technology [10, 11] fuses text, images and other modalities to generate semantically coherent inpainting content. When characters in an ancient book are missing or blurred, the system retrieves relevant content from a knowledge base and combines it with a GAN model to generate plausible supplementary content, assisting conservators in their work. Building on this research, this paper proposes an insect-damage detection and multimodal restoration system for ancient manuscripts based on a coupled You Only Look Once Version 8 nano (YOLOv8n)-RAG architecture. By integrating object detection with multimodal RAG, the method aims to locate insect-damaged regions precisely and to generate semantically coherent restored content, offering a new solution for the digital preservation of ancient books.
2.1 Acquisition of ancient book image data
To build the dataset for the inpainting experiments on character images from ancient books, we took both bibliographic value and sample diversity into account and selected valuable ancient book images from two authoritative sources, giving 500 representative samples in total (examples are shown in Figure 1). The first source is the character images of the Song-engraved, Yuan-repaired editions [12] held by the National Library of China. These editions combine the fine craftsmanship of Song Dynasty woodblock printing with the textual complexity that resulted from repeated repairs in the Yuan Dynasty. Their paper aging, variations in ink density and engraved typefaces all bear clear marks of their period, providing first-hand data on how early ancient books were engraved, circulated and damaged. The second source is the images of Yuan-engraved, Ming-repaired editions [13] from the website Guoxuemi. The website has digitized and collected a large number of Yuan Dynasty editions that were repaired successively in the Ming and Qing dynasties. Having undergone repairs over several generations, these samples show complex conditions such as differences in the typefaces of replacement blocks, uneven page wear, and later inscriptions interwoven with the original engraved text. They therefore provide a good test of how well the restoration model handles damage in editions that combine material from different periods.
Figure 1. Examples of ancient book image acquisition
2.2 Simulation of insect-damage
Insect damage in ancient books does not take the form of simple circular holes. Its shape depends on the direction of the paper fibers, ink penetration, humidity and the habits of the insects, producing jagged edges, varying sizes and uneven depths. Traditional simulation methods mostly rely on manual drawing in image-editing software or on rule-based noise generation, and their results lack realism and diversity. Deep generative models, in particular Stable Diffusion, have strong image synthesis capabilities learned from the latent distribution of massive image collections. However, using a general-purpose model directly to generate insect damage on ancient book pages often breaks character structures or distorts the style. To address this problem, this paper applies Low-Rank Adaptation (LoRA) to fine-tune Stable Diffusion in a lightweight manner. The main steps are as follows:
(1) The collected ancient book images are first preprocessed by grayscale conversion, denoising and contrast enhancement. A CNN is then used to extract features of the ancient books, including paper texture, character strokes and page layout.
(2) Training a LoRA model for the insect-damage style. The training data are real images of insect-damaged ancient books in which holes, edges and textures are annotated. The main training settings are as follows: the base model is SD1.5/SDXL; the trained layers are the UNet and attention layers; the rank is 8~32; the learning rate is 1e-4 ~ 5e-4; and the number of training steps is 1000~5000. Training uses a dual-input strategy of "text guidance + image condition". The text prompts contain keywords such as "ancient Chinese manuscript, worm-eaten, holes, frayed edges, yellowed paper" to strengthen semantic control. At the same time, the original intact page image serves as the ControlNet input condition, so that the generated results remain structurally consistent with the original. The canny or tile preprocessor of ControlNet preserves character contours well and prevents the simulated damage from eroding key strokes.
(3) Generation with Stable Diffusion. The text prompts contain keywords such as "ancient Chinese book page, worm-eaten holes, jagged edges, rice paper texture, yellowed, ink fading, vertical traditional Chinese characters, high detail, realistic texture". Main parameter settings: sampler: Euler A/DPM++ 2M Karras; steps: 20~30; Classifier-Free Guidance (CFG) Scale: 7~10; resolution: 1024 × 1536 (the aspect ratio of an ancient book page). During generation, an input character image from an ancient book is first passed through ControlNet to extract structural features, after which denoising is performed together with the trained LoRA model. Stable Diffusion builds up the insect-damage texture gradually in the latent space: the approximate positions and outlines of the wormholes form in the early steps, the torn-fiber appearance of the edges is refined in the middle steps, and local shadows and paper texture are enhanced in the later steps. The severity of the damage can be controlled through the number of steps and the denoising strength: a low strength produces slight signs of aging, whereas a high strength simulates severe erosion.
(4) LoRA is used to fine-tune the cross-attention layers of Stable Diffusion so that the model learns the mapping from "intact characters" to "insect-damaged characters". Examples of the simulated damage are shown in Figure 2.
Figure 2. Examples of insect-damage simulation effects
2.3 Annotation of insect-damaged regions
The images were annotated manually with the open-source tool Labelme. To ensure annotation quality, we formed a team of ancient book conservation experts and computer vision technicians. The conservators drew on their expertise to judge the type and severity of insect damage, while the technicians used their image-processing skills to refine the annotation boxes, ensuring consistent and accurate annotation. After several rounds of cross-checking, incorrect and ambiguous annotations were removed to give a reliable dataset for model training. The annotations of each image mainly record the location and category of insect-damage traces, with about 24 annotated features per image on average. These features cover the position, size and shape of the wormholes, together with other details that may matter for conservation. During annotation, rectangular bounding boxes were drawn around the wormholes with pixel-level coordinates to ensure precise localization, and the category label "insect-damage" was assigned. For special forms of damage, such as contiguous erosion or spreading insect tunnels, additional descriptive annotations were added to enrich the feature information. Finally, the annotations were exported as JSON files, COCO-format bounding boxes (bbox), and segmentation masks (polygons) for training.
2.4 Dataset expansion
To improve the training of the insect-damage detection model and to make the training data more diverse and comprehensive, we expanded the 500 insect-damaged ancient book images initially collected. Specifically, the insect-damaged regions in each image were cropped to obtain more small-size samples for training the deep learning model. Each image was first divided into several sub-regions according to the annotations of its insect-damaged regions. The size of each sub-region was set according to the distribution of the damage, so that every cropped region contained at least one insect-damage feature. In this way, the original 500 images were expanded to 2108 samples, examples of which are shown in Figure 3. Each cropped image can serve as an independent training sample, which enlarges the training set and improves the generalization ability of the model.
Figure 3. Dataset samples
2.5 Dataset augmentation
Image augmentation was applied to the dataset to improve generalization, alleviate overfitting and cope with the scarcity of data. Augmentation not only increases the number of damaged samples but also teaches the model to extract useful features from imperfect images with partly missing content, improving both restoration and recognition. The existing images were transformed by random rotation, salt-and-pepper noise, brightness adjustment and GridMask augmentation, which expanded the dataset to 9034 images. These were divided into training, test and validation sets in a ratio of 7:2:1. The expansion process is compared in Figure 4.
Figure 4. Data augmentation operations
3.1 Precise segmentation of ancient book insect-damaged regions
The YOLOv8 series offers several versions for different application requirements. Since the character images of ancient books are small in scale and require segmentation, the lightweight YOLOv8n-seg is the most suitable choice for this study. YOLOv8n [14] is a streamlined basic detector that keeps the number of parameters and computational cost as low as possible while maintaining relatively high accuracy. YOLOv8n-seg [15] inherits the efficiency of YOLOv8n and adds instance segmentation, so it can not only recognize characters and images in ancient books but also mark their contours accurately. Because insect-damage targets in ancient books are small and densely distributed, this paper improves the YOLOv8n-seg network accordingly. The overall improved architecture is shown in Figure 5. It consists of four parts: the Input layer, Backbone, Neck, and segmentation Head (Head).
Figure 5. Improved You Only Look Once Version 8 nano (YOLOv8n)-segmentation network structure
(1) Input end: accepts 640×640 pixel input and uses data augmentation techniques such as Mosaic augmentation and color jitter.
(2) Backbone: To strengthen both deep semantics and shallow details and to detect small insect-damaged regions accurately, we insert a BiFormer (Bi-Level Routing Attention, BRA) [16] attention layer after the 4th C2f module and before the SPPF module of the Backbone. This leaves the basic feature extraction of the first three layers untouched and strengthens global semantic focus only at the deepest layer, adding the fewest parameters and the least computation, which suits a nano-scale lightweight model.
(3) Neck (feature fusion layer): The original model fuses multi-scale features through a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN), which strengthens contextual representation and combines shallow and deep features to capture targets of different sizes. To suppress interference from background textures in ancient books (ink marks, paper grain) and focus on insect-damaged regions, the Neck is modified to screen multi-scale features: the original PAN+FPN structure is replaced by the Bidirectional Feature Pyramid Network (BiFPN) [17] bidirectional weighted feature fusion structure.
(4) Head: The head comprises a detection head and a segmentation head. The detection head is anchor-free. Binary Cross-Entropy (BCE) loss is used to measure the accuracy of the segmentation masks, and the Complete Intersection over Union (CIoU) loss is replaced by a composite loss of Generalized Intersection over Union (GIoU) Loss + Focal Loss + Dice loss to improve the localization of detection boxes. The segmentation head extends the YOLOv8 detection head with a decoupled structure that splits instance segmentation into two parallel branches: "prototype mask generation" (Proto branch) and "mask coefficient prediction" (Mask Coefficients branch). The final mask is calculated by Formula (1):
$Mask =\sigma\left(\sum_{i=1}^{32}\right. Coeff \left._i \times \operatorname{Proto}_i\right)$ (1)
The object detection model finally outputs three tensors:
(1) detection_matrix: with shape [N, 6] (where, N is the number of detections and each row contains [x, y, w, h, conf, class]).
(2) mask_protos: mask prototypes with shape [32, H, W], where, H, W denote the feature map size.
(3) mask_coefficients: coefficient matrix with shape [N, 32]. The final mask is generated by matrix multiplication, as given in Formula (2):
$\begin{aligned} & {Final\ Mask}_i= { Sigmoid }\left(\sum_{j=1}^{32} { mask\_coefficients }_{i, j}\right.\left.\times \text { mask_protos}_j\right)\end{aligned}$ (2)
3.2 Construction of the multimodal retrieval-augmented generation knowledge base
Although Large Language Models (LLMs) [18] perform well on many tasks involving semantic and contextual understanding, they have several drawbacks when applied to ancient book restoration, including outdated knowledge, insufficient domain expertise and hallucination. In addition, restoration samples are too scarce to meet the data requirements of training an LLM from scratch, so the model can hardly learn the necessary domain knowledge and its output is unstable. RAG is a technical framework that combines information retrieval with the generative capability of LLMs: it improves generation by retrieving relevant information from an external knowledge base. Its main advantages include up-to-date knowledge, domain adaptability, low implementation cost, interpretability and a knowledge base that can be updated dynamically. It addresses the problems above without retraining the model and thus provides more accurate, timely and reliable answers. The multimodal RAG module [19] retrieves historical restoration cases dynamically from a purpose-built knowledge graph of ancient book restoration. The graph contains nodes for ancient book entities, restoration techniques and restoration materials, and supports cross-page semantic reasoning through graph neural networks. During retrieval, the RAG module generates a query vector from the detection results, retrieves the most relevant historical restoration cases from the knowledge graph and uses them as contextual guidance for the restoration generation module. The knowledge graph is constructed as follows:
3.2.1 Multi-source data collection and preprocessing
(1) Node definition: ancient book entities (with attributes such as title, dynasty and damage type), restoration techniques (specific methods such as Tuobiao backing, paper mending and mildew removal), and restoration materials (characteristic parameters of different papers, adhesives, pigments, etc.).
(2) Preprocessing: PDF documents are converted into structured Markdown, special symbols are removed from the text, and the data are desensitized while the core restoration information is retained. For low-quality scans, layout and chart information is additionally extracted to build a supplementary image library, compensating for the unreliability of text-only retrieval.
(3) Multimodal data processing: Textual restoration records, images taken before and after restoration, and tables of material parameters are integrated. Images and tables are parsed by OCR to extract structured metadata, and the CLIP model is used to align visual and textual embeddings and link entities across modalities.
3.2.2 Structured construction of the knowledge graph
Authoritative corpora such as Siku Quanshu, restoration cases, paper-spectrum techniques and other multimodal resources are integrated to build a retrieval library covering both textual semantics and restoration knowledge, which supports the RAG module. The implementation is as follows:
(1) Five core entity types are defined, namely Book (ancient book), Author, Dynasty, RepairTech (restoration technique) and Material (restoration material), together with the attributes of each;
(2) Semantic relations are constructed, for example, AncientBook – adopts – Technique, Technique – uses – Material, AncientBook – belongs_to – Dynasty, which form a closed-loop knowledge network for subsequent relational reasoning;
(3) Graph neural networks learn hierarchical embeddings of the entities and complement the contextual association of vector recall, overcoming the isolated chunks and weak cross-document reasoning of conventional RAG.
(4) Relational modeling and reasoning: Graph neural networks build logical links at the paragraph and document levels and capture causal and correspondence relations among restoration techniques, materials and damage types across pages. This enables cross-page semantic reasoning and reconstructs the complete logic of historical restorations.
3.2.3 Retrieval-augmented generation system architecture
The architecture of the RAG system is shown in Figure 6.
Figure 6. Retrieval-augmented generation (RAG) system architecture
Design of the RAG retrieval process:
(1) Object detection input: Object detection is first performed on the ancient book to be restored to identify damaged regions and damage types and to produce the detection results;
(2) Query vector generation: A query vector is generated from the detection results and fed into the knowledge graph for retrieval;
(3) Case recall and filtering: The historical restoration cases that best match the current damage are retrieved from the knowledge graph as traceable structured context;
(4) Guided generation output: The retrieved case context is fed into the restoration generation module to guide the generation of restoration schemes that conform to established restoration practice for ancient books.
3.3 Dual-branch restoration based on U-Net and generative adversarial networks
Research on insect-damage detection and restoration of ancient books has recently moved toward technology fusion and interdisciplinary collaboration. GAN-based text and image inpainting [20] has shown considerable potential in ancient book restoration, especially in restoration accuracy and semantic consistency. Building on the multimodal RAG knowledge base, this paper designs a dual-branch restoration method based on U-Net [21] and GAN, in which texture and structure are coupled for inpainting. A hybrid attention module and a multi-scale residual module are added so that the generator captures detail and structural information more accurately and produces high-quality inpainting results.
The network structure is shown in Figure 7, with GAN as the basic framework. The damaged image retrieved by the multimodal RAG module is denoted Input image, and Edge denotes the edge map of the damaged image. The core of the network is the dual-branch U-Net, and the Convolutional Block Attention Module (CBAM) serves as the hybrid attention module. The discriminator has two branches, and Detected Edge refers to the grayscale edge map of the restored image.
Figure 7. Dual-branch restoration network structure based on U-Net and generative adversarial network (GAN)
The input image is obtained through the retrieval process of the multimodal RAG module: (1) Multimodal encoding: visual features and the semantic features of recognizable text are extracted simultaneously from the ancient book image to be restored, and a unified multimodal query vector is generated. (2) Knowledge base matching and retrieval: the query vector is used to find the most similar character glyphs, contextual semantics and applicable restoration schemes in the multimodal knowledge base, and the relevant reference information is retrieved. (3) Feature fusion input: the retrieved contextual information is fused with the original image features and fed into the U-Net generator. This provides semantic constraints for generation, keeps the restored characters consistent with the historical context and typeface of the book, and reduces the likelihood of wrong or missing characters.
U-Net uses an encoder-decoder architecture with skip connections and is adapted for ancient book restoration as follows:
(1) Encoder (downsampling): Successive groups of convolution and pooling operations extract hierarchical features of the page image, including character contours, textures and semantics, retaining information from local strokes up to the overall layout.
(2) Skip connection concatenation: The features of each downsampling layer are passed directly to the upsampling layer of the same scale, fusing shallow details with deep semantics. This avoids the loss of detail in conventional upsampling and keeps stroke edges sharp.
(3) Decoder (upsampling): Upsampling gradually restores the image size; the decoder combines these features with those from the skip connections and outputs the restored content of the missing regions. For lightweight deployment, the model can be compressed to 3 MB and run on embedded ancient book scanners.
The generator produces a complete restoration from the damaged input image, aiming to make the generated content as close as possible to the style of genuine ancient books. The discriminator judges whether its input is an original, undamaged page or a result produced by the generator, and feeds a "real/fake" decision back to the generator. The multi-scale discriminator also checks the restoration in terms of stroke continuity, ink distribution and overall layout. Through alternating training over many iterations, the generator learns the texture, ink color and style of real ancient books, so that its results look closer to genuine pages and appear more natural and realistic.
Two steps are added in post-processing: multi-scale feature fusion and dynamic sharpening adjustment. Multi-scale feature fusion combines low-resolution results (global structure) with high-resolution results (local detail) through pyramid fusion, balancing overall structure and local detail. Dynamic sharpening applies a nonlinear energy adjustment to the restored regions, improving the consistency of ink color between the restored regions and the original page and avoiding stylistic breaks.
4.1 Precise segmentation experiment of ancient book insect-damaged regions
The experiments were run on 64-bit Windows 10 with an NVIDIA RTX 3090 GPU (24 GB memory), an Intel Core i9-10900K CPU and 64 GB RAM, using Python 3.8, PyTorch 1.10.1 and CUDA 11.3. During training, the input size was 640 × 640 pixels, the batch size 16, the optimizer AdamW, the initial learning rate 0.001 and the number of epochs 200. The model was evaluated by Precision, Recall, Mean Average Precision @0.5 (mAP@0.5) and Mean Average Precision @0.5:0.95 (mAP@0.5:0.95). Figure 8 shows how the main losses and performance metrics on the training and validation sets changed over the training epochs.
To verify the effectiveness of the designed YOLOv8n-seg network for detecting insect damage in ancient books, an ablation experiment was carried out on the dataset constructed in this paper, with the results listed in Table 1. Group 1 is the original YOLOv8n-seg model. Group 2 adds the BiFormer attention mechanism to the Backbone of the original network. Group 3 builds on Group 2 by applying multi-scale feature screening to the Neck and replacing the original PAN+FPN structure with the BiFPN bidirectional weighted feature fusion structure. Group 4, the final optimized model, builds on Group 3 by replacing the CIoU loss with a composite of GIoU Loss + Focal Loss + Dice loss. Table 1 shows that the mAP for insect-damage detection rises steadily as the model is optimized. Group 4 reaches a mAP of 74.2%, 7.8% higher than the original model. These improvements strengthen the detection of small targets and robustness to background noise, and make the model focus more on hard samples during training, which together improve detection performance.
Table 1. Ablation experiment results
|
Group |
Original YOLOv8n-Seg |
BiFormer |
BiFPN |
GFD Loss |
P% |
R% |
mAP@0.5% |
|
1 |
√ |
|
|
|
70.2 |
72.4 |
66.4 |
|
2 |
√ |
√ |
|
|
72.8 |
74.9 |
68.8 |
|
3 |
√ |
√ |
√ |
|
74.9 |
78.7 |
70.1 |
|
4 |
√ |
√ |
√ |
√ |
76.9 |
82.8 |
74.2 |
Note: Yolov8n-seg: You Only Look Once version 8 nano – segmentation; BiFormer: Vision Transformer with Bi-Level Routing Attention; BiFPN: Bidirectional Feature Pyramid Network; GFD: Generalized Intersection over Union + Focal + Dice composite loss; mAP: mean Average Precision.
4.2 Ancient book insect-damage restoration simulation experiment and result analysis
4.2.1 Experimental parameter settings
The insect-damage dataset constructed in Section 2 was used, from which 400 images were randomly selected for training and 100 for testing. The training parameters were: Adam optimizer ($\beta_1=0.5,\ \beta_2=0.999$), initial learning rate 0.0001, batch size 8, and 200 iterations.
4.2.2 Evaluation metrics
Two image quality metrics commonly used for GAN-based text and image inpainting are Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM), which measure the similarity between the generated and target images from different perspectives.
PSNR is a metric based on pixel-level differences and is mainly used to evaluate image reconstruction and inpainting algorithms. It is calculated as:
$P S N R=10 \cdot \log _{10}\left(\frac{M A X^2}{M S E}\right)$ (3)
where, MAX is the maximum possible pixel value and MSE is the mean squared error between the reconstructed and reference images. A larger PSNR indicates a smaller difference between the two images and thus better image quality.
SSIM evaluates the perceptual similarity of images, with particular attention to brightness, contrast and structural information. It is defined as:
$SSIM(x, y)=\frac{\left(2 \mu_x \mu_y+C_1\right)\left(2 \sigma_{x y}+C_2\right)}{\left(\mu_x^2+\mu_y^2+C_1\right)\left(\sigma_x^2+\sigma_y^2+C_2\right)}$ (4)
where, $\mu_x$ and $\mu_y$ are the average brightness of the two image patches respectively; $\sigma_x^2$ and $\sigma_y^2$ are the contrast (variance) of the two images respectively; $\sigma_{x y}$ is the covariance of the two images, measuring their structural similarity; C1 and C2 are constants used to avoid zero denominators.
4.2.3 Comparative experiments
To compare how different methods perform in restoring insect-damaged ancient books, the traditional interpolation method, Context Encoder [22], Pix2Pix [23] and the proposed U-Net+GAN method were evaluated, with the results given in Table 2. The traditional interpolation method interpolates only from local information in low-resolution images; it preserves the basic image structure but performs poorly in PSNR (23.4 dB) and SSIM (0.689). Context Encoder introduces deep feature extraction, raising PSNR to 27.8 dB and SSIM to 0.802 and markedly improving reconstruction quality. Pix2Pix further uses GAN to improve detail generation, raising PSNR and SSIM to 30.8 dB and 0.897, respectively. The proposed U-Net+GAN method combines the multi-scale feature fusion of U-Net with the stable training of GAN and achieves the best PSNR (33.5 dB) and SSIM (0.934). This shows that the method recovers high-quality details more effectively and produces restorations closer to real high-resolution images.
Table 2. Comparison experiment results of different methods
|
Method |
PSNR (dB) |
SSIM |
|
Traditional interpolation |
23.4 |
0.689 |
|
Context Encoder |
27.8 |
0.802 |
|
Pix2Pix |
30.8 |
0.897 |
|
U-Net+GAN |
33.5 |
0.934 |
Note: PSNR: Peak Signal-to-Noise Ratio; SSIM: Structural Similarity Index; GAN: generative adversarial network.
This paper proposes an insect-damage detection and multimodal restoration method for ancient manuscripts based on a coupled YOLOv8n-RAG architecture. By integrating object detection with multimodal RAG, the method locates insect-damaged regions precisely and generates semantically coherent restored content. Experiments show that it outperforms traditional methods in both detection accuracy and restoration quality, offering a new solution for cross-modal restoration of complex damaged ancient books. Future work will proceed in several directions. First, the dataset will be expanded in scale and diversity to cover more types of ancient documents and forms of insect damage, improving the generalization of the model. Second, multimodal fusion will be explored further by incorporating non-visible-light data such as infrared and hyperspectral imaging, so as to better detect concealed insect damage. Third, the physical plausibility of the restoration algorithm will be improved by introducing prior knowledge such as paper fiber direction and ink penetration, so that restoration results better match the material properties of ancient books. Fourth, the system will be extended with new functional modules, for example 3D reconstruction for virtual restoration of the three-dimensional structure of ancient books. Finally, lightweight deployment on mobile terminals and edge devices will be studied to provide portable tools for cultural relic surveys and on-site restoration, contributing to the preservation of ancient books and the transmission of cultural heritage.
[1] Ma, X., Bai, M., Wang, Y., Xu, R., Li, S., Wei, H. (2026). Image restoration of sediment particles in turbid environments based on a multi-scale fusion algorithm. Journal of Soils and Sediments, 26(5): 145. https://doi.org/10.1007/s11368-026-04330-9
[2] G, B.S., Vankdoth, K. (2026). A review on AI-augmented dual-phase denoising using sliced ridgelet transform and deep learning for medical and industrial image restoration. Transactions of the Indian National Academy of Engineering, 11(2): 183-198. https://doi.org/10.1007/s41403-026-00574-6
[3] Qadir, M.S., Bartani, A., Mohammed, M.A., Daneshfar, F. (2026). Semi-supervised sand-dust image enhancement via attention-driven multi-scale feature fusion network. Digital Signal Processing, 177: 106093. https://doi.org/10.1016/j.dsp.2026.106093
[4] Karthik, U., Nair, B.J.B., Rani, N.S., Ravi, V., Alahmadi, T.J. (2026). A hybrid spatial blur detection and restoration algorithm for smartphone captured document images. Scientific Reports, 16(1): 12648. https://doi.org/10.1038/s41598-026-38494-8
[5] Chaudhuri, A. (2024). Smart traffic management of vehicles using faster R-CNN based deep learning method. Scientific Reports, 14(1): 10357. https://doi.org/10.1038/s41598-024-60596-4
[6] Reddy, S.S., Janarthanan, M., Khan, I.U., Amrutha, K. (2026). A deep learning framework for real-time pothole detection from combined drone imagery and custom dataset using enhanced YOLOv8 and custom feature extraction. Mathematics, 14(5): 898. https://doi.org/10.3390/math14050898
[7] Antanita, Y.P., Ardana, A., Alfin, K., Pratama, Y., Purnamasari, R., Saleh, K. (2026). Utilizing YOLOv8 for waste detection on waste bank application. Journal of Physics: Conference Series, 3188: 012014. https://doi.org/10.1088/1742-6596/3188/1/012014
[8] Li, X., Chu, Y., Chan, T., Lo, W. L., Fu, H. (2026). YOLO-ERCD: An upgraded YOLO framework for efficient road crack detection. Sensors, 26(2): 564. https://doi.org/10.3390/s26020564
[9] Zhao, S., Liu, Z., Yang, X. (2026). Spa-IHANet: Sparse self-attention transformer combined with improved hybrid attention mechanisms network for image inpainting. Computers & Graphics, 137: 104608. https://doi.org/10.1016/j.cag.2026.104608
[10] Kunekar, P., Mankar, S., Cholke, P., Kulkarni, A., Nooji, P., Gadhave, R. (2026). MedIntelliCare: Neurodynamic-inspired AI for medical decision support by integrating retrieval-augmented generation with multimodal cognitive processing. Cognitive Neurodynamics, 20(1): 61. https://doi.org/10.1007/s11571-026-10429-z
[11] Roll, D.S., Kurt, Z., Li, Y., Woo, W.L. (2025). Augmenting orbital debris identification with neo4j-enabled graph-based retrieval-augmented generation for multimodal large language models. Sensors, 25(11): 3352. https://doi.org/10.3390/s25113352
[12] National Library of China. Song-Printed and Yuan-Repaired Edition of an Ancient Book. Available at: http://read.nlc.cn/allSearch/searchDetail?searchType=&showType=1&indexName=data_892&fid=412004000701.
[13] Guoxuemi. Yuan-Printed and Ming-Repaired Edition of an Ancient Book. Available at: https://www.guoxuemi.com/gjzx/669377tazb/.
[14] Fan, Z., Chen, B., Wang, Z., et al. (2025). Defects recognition in on-site GPR images of mountain tunnel linings based on YOLOv8N model. Case Studies in Construction Materials, 23: e05196. https://doi.org/10.1016/j.cscm.2025.e05196
[15] Wu, W., He, Z., Li, J., et al. (2024). Instance segmentation of tea garden roads based on an improved YOLOv8n-seg model. Agriculture, 14(7): 1163. https://doi.org/10.3390/agriculture14071163
[16] Dong, C., Zhao, X. (2024). Bi-DAUnet: Leveraging BiFormer in a unet-like architecture for building damage assessment. Journal of Physics: Conference Series, 2833: 012015. https://doi.org/10.1088/1742-6596/2833/1/012015
[17] Yu, C., Shin, Y. (2023). SAR ship detection based on improved YOLOv5 and BiFPN. ICT Express, 10(1): 28-33. https://doi.org/10.1016/j.icte.2023.03.009
[18] Lee, M.J., Zhang, R. (2026). LLM-driven generative agents for simulating occupant feedback in built environments. Journal of Computing in Civil Engineering, 40(4): 04026045. https://doi.org/10.1061/jccee5.cpeng-7365
[19] Bedi, P., Thukral, A., Dhiman, S. (2025). XLR-KGDD: Leveraging LLM and RAG for knowledge graph-based explainable disease diagnosis using multimodal clinical information. Knowledge and Information Systems, 67(9): 7451-7471. https://doi.org/10.1007/s10115-025-02465-8
[20] Singh, G., Durbha, S.S., Budakoti, S., R, S.C. (2026). Reconstruction of missing radiosonde observations for Indian region using conditional GAN framework. Journal of Atmospheric and Solar-Terrestrial Physics, 284: 106840. https://doi.org/10.1016/j.jastp.2026.106840
[21] Altamirano, L., Rene, H., Guerra, O.E., Vargas, J.T., Pintor, A., Carolina, D. (2026). Semantic segmentation of sugarcane crops in UAV orthoimages using U-Net. Journal of the Indian Society of Remote Sensing, 54(7): 2835-2847. https://doi.org/10.1007/s12524-026-02455-5
[22] Yu, W., Li, C., Hu, X., Zhu, W., Cambria, E., Jiang, D. (2024). Dialogue emotion model based on local–global context encoder and commonsense knowledge fusion attention. International Journal of Machine Learning and Cybernetics, 15(7): 2811-2825. https://doi.org/10.1007/s13042-023-02066-3
[23] Kudomi, N., Mitamura, K., Maeda, Y., et al. (2025). Resolution and quality enhancement of SPECT cerebral blood flow images using Pix2pix deep learning. Annals of Nuclear Medicine, 40(3): 319-326. https://doi.org/10.1007/s12149-025-02129-1