Intelligent incomplete ancient literature restoration system based on lightweight deep learning network
Through the intelligent restoration system based on lightweight deep learning network, the problems of high cost, low efficiency, high computing resource requirements and poor adaptability in ancient document restoration technology are solved, efficient and accurate restoration of ancient documents is achieved, and the scope of application is expanded. Suitable for resource-constrained environments and diverse ancient document styles.
Patent Information
- Application Number
- CN202410792078.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing ancient document restoration technologies suffer from the problems of high cost, low efficiency, high computing resource requirements, poor adaptability, and insufficient restoration accuracy, especially in resource-constrained environments and when dealing with diverse ancient document styles.
An intelligent restoration system based on a lightweight deep learning network is adopted, including a data preprocessing module, a lightweight deep learning model module and a restoration result visualization module. Image quality is optimized through data preprocessing, and technologies such as depth separable convolution and knowledge distillation are used to reduce Compute resource requirements, combine multi-task learning and transfer learning to improve model adaptability, and provide a user-friendly interactive interface.
It has significantly improved the efficiency and accuracy of ancient document restoration, reduced economic costs, made large-scale ancient document protection possible, and expanded the scope of technical application so that non-professionals can also perform restoration, reducing reliance on professional equipment. Improved detail richness and adaptability of repair results.
Smart Images

Figure CN118691508A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of book restoration, and specifically is an intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network. Background Art
[0002] At present, the restoration and protection technology of ancient documents mainly relies on two directions: one is the traditional manual restoration method, and the other is the automated restoration method based on computer technology. Traditional manual restoration relies on the skills and experience of restoration experts. Although it can achieve a high restoration quality, the process is time-consuming, costly, and easily affected by the subjective judgment of experts. On the other hand, automated restoration methods based on computer technology, such as digital image processing, computer vision technology, and machine learning methods, have improved the efficiency of restoration, but most efficient models require a lot of computing resources, which limits their application in resource-constrained environments. In addition, these automated methods often require a large amount of labeled data for training, which limits their ability to handle diverse ancient document styles.
[0003] Problems and shortcomings of existing technologies:
[0004] 1. High cost and low efficiency: Manual repair methods are costly and inefficient, and are not suitable for rapid repair of large-scale documents.
[0005] 2. High computing resource requirements: Existing automated repair methods, especially those based on deep learning, require high computing resources and are not suitable for mobile devices or low-end and mid-range servers.
[0006] 3. Poor adaptability: For ancient documents of different types or styles, existing automated methods require a large amount of customized training data, which limits their possibility of wide application.
[0007] 4. Restoration accuracy: Automated methods still face certain challenges in restoring the details and colors of ancient documents, especially when the data volume is small or the data is severely damaged.
[0008] To this end, technicians in this field have proposed an intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network. Summary of the invention
[0009] In order to solve the above technical problems, the present invention provides an intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network, aiming to solve the problems of high cost and low efficiency of traditional methods and high demand for computing resources and poor adaptability of existing automated methods.
[0010] An intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network, including:
[0011] The data preprocessing module performs preliminary processing on the input incomplete ancient document images and enhances the key features in the images;
[0012] A lightweight deep learning model module that uses LDLM to learn and restore the features of incomplete document images and predict the content of the missing parts;
[0013] The restoration result visualization module is used to display the restored image to the user and enable interaction with the restoration process.
[0014] Preferably, the data preprocessing module further comprises the following steps:
[0015] S101, image acquisition and import: used to collect and import the ancient document images to be processed;
[0016] S102, image preprocessing: optimizing image quality through preprocessing;
[0017] S103, feature enhancement: used to enhance key features in the image.
[0018] Preferably, the image preprocessing specifically includes the following steps:
[0019] S102a, denoising: reducing image noise and removing background noise in the image by using Gaussian smoothing filter image denoising technology;
[0020] S102b, contrast enhancement: Adaptive histogram equalization is used to enhance the image contrast so that the text and the background are clearly distinguished, which is expressed as:
[0021]
[0022] Among them, CDF min is the minimum non-zero value of the cumulative distribution function CDF, and Its p(r j ) is the gray value r in the image j The probability distribution function of
[0023] S102c, Binarization: Adopt adaptive threshold technology to convert the image into a binary image, apply Sauvola algorithm, for each pixel, the threshold is calculated based on the average value and standard deviation of the pixel value of its local neighborhood, assuming that the coordinates of the current pixel point are (x, y), the neighborhood of the point is r×r, g(x, y) is the gray value of the point, then the local adaptive threshold T is calculated as follows:
[0024]
[0025] Where R is the dynamic range of the standard deviation, m(x,y) and s(x,y) are the grayscale mean and standard deviation variance in the r×r neighborhood respectively:
[0026]
[0027]
[0028] S102d, correction and cropping: use Hough transform technology to detect and correct image tilt, correct image rotation and deflection, and crop irrelevant edge parts in the image.
[0029] Preferably, the feature enhancement includes edge enhancement and morphological processing, wherein the edge enhancement strengthens the edges of text and patterns in the image by using an edge detection algorithm; the morphological processing applies morphological dilation and erosion operations to optimize the structure of text and symbols, improve the text structure, and fill small gaps caused by damage.
[0030] Preferably, the lightweight deep learning model module selects a lightweight architecture based on a convolutional neural network as its basis, adopts deep separable convolution to reduce the amount of calculation and the number of parameters, and increases the width of the network, i.e. the number of channels, for compensation, while performing network pruning, weight quantization and knowledge distillation.
[0031] Preferably, before training the lightweight deep learning model, all training data are passed through a data preprocessing module. During training, a multi-task learning strategy is adopted, and pixel-level loss and content loss are combined as the loss function of the model. The training samples are enhanced by rotation, scaling, and cropping, and the model is quickly adapted to new restoration tasks through transfer learning. At the same time, an early stopping strategy is used to prevent overfitting.
[0032] Model compression technology is also used to further reduce the model size and deploy it on specific hardware for acceleration.
[0033] Preferably, the restoration result visualization module adopts a visual interface design, and its user interface includes buttons, prompt information and progress indicators; it also includes setting an image display area for displaying the original image and the restored image, which are displayed side by side or superimposed; setting interactive functions to provide interactive methods such as zooming, dragging to view details, and adjusting contrast and brightness.
[0034] Preferably, HTML, CSS and JavaScript are used to build a Web interface, Ajax is used to communicate with the server to upload images and display results, and an image processing library is introduced to perform real-time processing before image display. At the same time, a data visualization library is used to enhance interactivity and visual effects, and a result evaluation and feedback function is set.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1. This invention significantly improves the efficiency of ancient document restoration through a lightweight deep learning model and an automated restoration process, reduces reliance on manual intervention, and reduces the economic cost of ancient document restoration, making large-scale ancient document protection projects feasible and economical.
[0037] 2. The system of the present invention can run on resource-constrained devices, such as smart phones and tablet computers, so that the ancient document restoration technology is no longer limited to professional laboratories or institutions, but can be used by a wider user group; through the user-friendly interactive interface, non-professionals can also easily perform ancient document restoration work, further expanding the scope of application of the technology.
[0038] 3. The present invention utilizes modular design, knowledge distillation and transfer learning technology. The lightweight model can achieve restoration quality close to that of a large model while maintaining high efficiency. The system can automatically identify and specifically repair various damages in ancient documents, such as missing text, blurred images, etc., ensuring the accuracy of the restoration results and the richness of details.
[0039] 4. The present invention uses a fine-tuning method with a small amount of annotated data, and the system can quickly adapt to ancient documents of different styles and types, solving the limitations of existing technologies in dealing with diverse ancient document styles. It is not only limited to ancient documents, but can also be extended to the restoration of other historical and cultural heritages such as murals and stone tablets.
[0040] 5. The present invention helps to preserve historical memory and promote cultural communication by improving the efficiency and quality of restoration of ancient documents and other cultural heritages. Its low-cost and efficient ancient document restoration technology has important economic significance for museums, libraries, and cultural heritage protection institutions, and can reduce the financial burden of protecting historical heritage, while promoting the development of related cultural tourism and education industries. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a block diagram of the incomplete ancient document intelligent restoration system based on lightweight deep learning of the present invention. DETAILED DESCRIPTION
[0042] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0043] As attached Figure 1 As shown:
[0044] Embodiment 1: The present invention provides an intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network, comprising:
[0045] The data preprocessing module performs preliminary processing on the input incomplete ancient document image to enhance the key features in the image. The data preprocessing module includes the following steps:
[0046] S101, image acquisition and import: used to collect and import the images of ancient documents to be processed, and perform high-resolution scanning or photography of incomplete ancient documents through scanners, digital cameras and other equipment to ensure that the clarity and integrity of the images are as high as possible;
[0047] S102, image preprocessing: optimizing image quality and reducing restoration difficulty through preprocessing; specifically including the following steps:
[0048] S102a, denoising: reduce image noise through Gaussian smoothing filtering, median filtering and other image denoising techniques, and remove background noise in the image, such as dust, stains, etc.;
[0049] S102b, contrast enhancement: histogram equalization and adaptive histogram equalization are used to improve the image contrast so that the text and the background are clearly distinguished, which is expressed as:
[0050]
[0051] Among them, CDF min is the minimum non-zero value of the cumulative distribution function CDF, and Its p(r j ) is the gray value r in the image j The probability distribution function of
[0052] S102c, Binarization: Convert the image to black and white to facilitate subsequent feature extraction and analysis. Adaptive threshold technology, such as OTSU algorithm or local adaptive threshold algorithm, is used to convert the image into a binary image. Sauvola algorithm is applied. For each pixel, the threshold is calculated based on the average and standard deviation of the pixel values in its local neighborhood. Assuming that the coordinates of the current pixel point are (x, y), the neighborhood of the point is r×r, and g(x, y) is the gray value of the point, the local adaptive threshold T is calculated as follows:
[0053]
[0054] Where R is the dynamic range of the standard deviation, m(x,y) and s(x,y) are the grayscale mean and standard deviation variance in the r×r neighborhood respectively:
[0055]
[0056]
[0057] S102d, correction and cropping: Use Hough transform technology to detect and correct image tilt, manually or automatically identify and crop the effective area, and remove unnecessary background; thereby correcting the rotational skew of the image and cropping irrelevant edge parts of the image.
[0058] S103, Feature Enhancement: It is used to enhance key features in the image, such as text edges, lines, etc., so that the restoration model can better understand and process the image. It includes edge enhancement and morphological processing. Edge enhancement uses edge detection algorithms to strengthen the edges of text and patterns in the image; morphological processing uses morphological dilation and erosion operations to optimize the structure of text and symbols, improve text structure, and fill small gaps caused by damage.
[0059] Through the above data preprocessing steps, the quality of the input image can be effectively improved, the difficulty of subsequent lightweight deep learning model processing can be reduced, and the accuracy and reliability of the restoration effect can be improved. The preprocessing module is an indispensable part of the entire system and lays a solid foundation for the restoration work.
[0060] The lightweight deep learning model module uses LDLM learning to restore the features of incomplete document images and predict the content of missing parts; it selects a lightweight architecture based on convolutional neural networks as the basis, and uses deep separable convolution to reduce the amount of calculation and the number of parameters while maintaining efficient feature extraction capabilities; through experiments, the balance point of minimizing model size and maximizing performance is determined, using fewer layers and smaller convolution kernel sizes, and increasing the width of the network, that is, the number of channels, to compensate, while performing network pruning, weight quantization, and knowledge distillation.
[0061] Its network pruning is an effective means to reduce the size of deep learning models. It removes unimportant weights and neurons through pruning technology, reduces model complexity, and maintains model performance as much as possible.
[0062] Its weight quantization is to quantize the floating-point weights of the model into integers with lower bit width (such as 8 bits), which can significantly reduce the model size and speed up the inference process with almost no loss of accuracy;
[0063] Knowledge distillation is the process of transferring the knowledge of a large, high-performance teacher model to a lightweight student model. By training the student model to imitate the behavior of the teacher model, the performance of the lightweight model can be improved.
[0064] Before training, this lightweight deep learning model makes all training data pass through the data preprocessing module. During training, a multi-task learning strategy is adopted, combining pixel-level loss and content loss as the loss function of the model, which helps the model to restore the image while maintaining the content consistency and style authenticity of the image; data enhancement is performed on training samples through rotation, scaling, and cropping to increase the robustness and generalization ability of the model; and transfer learning is used to quickly adapt to new restoration tasks to further improve training efficiency and model performance; at the same time, an early stopping strategy is used to prevent overfitting. When the training process is nearing the end, a more detailed learning rate adjustment and fine-tuning strategy is adopted to accurately tune the model performance; model compression technology is also used to further reduce the model size, improve loading and execution speed, and make the model more suitable for deployment in resource-constrained environments, such as mobile devices or embedded systems; and it is deployed on specific hardware for acceleration, such as GPU, TPU or dedicated AI accelerators, to optimize the model to make full use of hardware characteristics and further improve the reasoning speed.
[0065] Through the above design and strategy, the lightweight deep learning model LDLM can effectively restore incomplete ancient document images while reducing computing resource consumption, providing strong technical support for the protection and research of ancient documents.
[0066] The restoration result visualization module is used to display the restored image to the user in an intuitive and easy-to-understand way, and can interact with the restoration process. The user interface is simple and intuitive, ensuring that users can easily upload images, start the restoration process, and view the restoration results, including buttons, prompts, and progress indicators; it also includes setting up an image display area for displaying the original image and the restored image, which are displayed side by side or superimposed; the side-by-side display is to display the original image and the restored image side by side, which is convenient for users to compare directly; the superimposed display is to superimpose the original image and the restored image on the same screen, allowing users to adjust the transparency through tools such as sliders, view detailed comparisons, set interactive functions, and provide interactive methods such as zooming, dragging to view details, and adjusting contrast and brightness, so that users can review the restoration effect more carefully.
[0067] Use HTML, CSS, and JavaScript to build a web interface, use Ajax to communicate with the server to upload images and display results, and front-end frameworks such as React or Vue can speed up the development process and improve application performance and responsiveness. Introduce an image processing library for real-time processing before image display, such as resizing and format conversion. At the same time, use graphics and data visualization libraries such as D3.js and Three.js to enhance interactivity and visual effects, such as dynamically updating progress bars and image effect adjustment sliders.
[0068] At the same time, the automatically calculated restoration quality score, such as SSIM (structural similarity index) or PSNR (peak signal-to-noise ratio), is displayed next to the restoration result to provide users with preliminary quantitative indicators of the restoration effect; and interface elements or functions are provided to enable users to give scores or written feedback on the restoration results, which is used to improve future models.
[0069] It also includes designing a system to support asynchronous processing of image restoration tasks, ensuring that the UI remains responsive while the backend handles complex calculations; to speed up display, some resources can be preloaded and commonly used data can be cached; and ensuring that the visualization interface maintains a good user experience on different devices (such as desktops, tablets, and mobile phones).
[0070] Through the restoration result visualization module designed above, from user interface, function implementation to performance optimization, it aims to realize a user-friendly and interactive system, so that users can easily use the system and effectively evaluate and utilize the restoration results.
[0071] Embodiment 2: This embodiment is basically the same as the previous embodiment, except that after S103 feature enhancement, S104 data enhancement is further provided, and more training samples are generated by rotating, scaling, cropping and other operations on the preprocessed images, thereby increasing the diversity of training data through image transformation and improving the generalization ability of the model.
[0072] As can be seen from the above, the purpose of the present invention is to provide a solution that is both efficient and low-cost for intelligently restoring incomplete ancient documents, and to achieve automated restoration of ancient documents by adopting lightweight deep learning technology. This not only greatly reduces the difficulty and cost of ancient document restoration, but also speeds up the restoration process, making the protection of ancient documents more efficient and popular. In addition, the present invention is also intended to expand the scope of application of this technology, including but not limited to ancient documents, and can also be used for the restoration of other historical and cultural heritage such as murals and stone tablets, thereby having important social value and economic significance for protecting and inheriting human historical and cultural heritage.
[0073] Additionally, in order to provide a concise description of exemplary embodiments, all features of an actual embodiment may not be described (ie, those features that are not relevant to the best mode presently contemplated for carrying out the invention or those that are not relevant to implementing the invention).
[0074] It will be appreciated that in the development of any actual implementation, as in any engineering or design project, numerous implementation-specific decisions may be made. Such a development effort may be complex and time-consuming, but will be a routine task of design, fabrication, and production for those of ordinary skill having the benefit of this disclosure without undue experimentation.
[0075] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network, characterized in that: include: The data preprocessing module performs preliminary processing on the input incomplete ancient document images and enhances the key features in the images; A lightweight deep learning model module that uses LDLM to learn and restore the features of incomplete document images and predict the content of the missing parts; The restoration result visualization module is used to display the restored image to the user and enable interaction with the restoration process.
2. The intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network as claimed in claim 1, characterized in that: The data preprocessing module also includes the following steps: S101, image acquisition and import: used to collect and import the ancient document images to be processed; S102, image preprocessing: optimizing image quality through preprocessing; S103, feature enhancement: used to enhance key features in the image.
3. The intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network as claimed in claim 2, characterized in that: The image preprocessing specifically comprises the following steps: S102a, denoising: reducing image noise and removing background noise in the image by using Gaussian smoothing filter image denoising technology; S102b, contrast enhancement: Adaptive histogram equalization is used to enhance the image contrast so that the text and the background are clearly distinguished, which is expressed as: Among them, CDF min is the minimum non-zero value of the cumulative distribution function CDF, and Its p(r j ) is the gray value r in the image j The probability distribution function of S102c, Binarization: Adopt adaptive threshold technology to convert the image into a binary image, apply Sauvola algorithm, for each pixel, the threshold is calculated based on the average value and standard deviation of the pixel value of its local neighborhood, assuming that the coordinates of the current pixel point are (x, y), the neighborhood of the point is r×r, g(x, y) is the gray value of the point, then the local adaptive threshold T is calculated as follows: Where R is the dynamic range of the standard deviation, m(x,y) and s(x,y) are the grayscale mean and standard deviation variance in the r×r neighborhood respectively: S102d, correction and cropping: use Hough transform technology to detect and correct image tilt, correct image rotation and deflection, and crop irrelevant edge parts in the image.
4. The incomplete ancient document intelligent restoration system based on a lightweight deep learning network as claimed in claim 2, characterized in that: The feature enhancement includes edge enhancement and morphological processing. The edge enhancement strengthens the edges of text and patterns in the image by using an edge detection algorithm; the morphological processing applies morphological dilation and erosion operations to optimize the structure of text and symbols, improve the text structure, and fill in small gaps caused by damage.
5. The incomplete ancient document intelligent restoration system based on a lightweight deep learning network as claimed in claim 1, characterized in that: The lightweight deep learning model module selects a lightweight architecture based on a convolutional neural network as its basis, adopts deep separable convolution to reduce the amount of calculation and the number of parameters, and increases the width of the network, i.e. the number of channels, for compensation, while performing network pruning, weight quantization and knowledge distillation.
6. The incomplete ancient document intelligent restoration system based on a lightweight deep learning network as claimed in claim 5, characterized in that: Before training the lightweight deep learning model, all training data are passed through the data preprocessing module. During training, a multi-task learning strategy is adopted, combining pixel-level loss and content loss as the model's loss function. The training samples are enhanced by rotation, scaling, and cropping. Transfer learning is used to quickly adapt to new restoration tasks, and an early stopping strategy is used to prevent overfitting. Model compression technology is also used to further reduce the model size and deploy it on specific hardware for acceleration.
7. The intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network as claimed in claim 1, characterized in that: The restoration result visualization module adopts a visual interface design, and its user interface includes buttons, prompt information and progress indicators; it also includes setting an image display area for displaying the original image and the restored image, which are displayed side by side or superimposed; setting interactive functions to provide interactive methods such as zooming, dragging to view details, and adjusting contrast and brightness.
8. The intelligent restoration system for incomplete ancient documents based on a lightweight deep learning network as claimed in claim 7, characterized in that: Use HTML, CSS, and JavaScript to build a web interface, use Ajax to communicate with the server to upload images and display results, and introduce an image processing library for real-time processing before image display. Use a data visualization library to enhance interactivity and visual effects, and set up result evaluation and feedback functions.
