Intelligent restoration method and device for damaged stone inscriptions
Patent Information
- Application Number
- CN202610354976.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-23
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-03-23
AI Technical Summary
这一过程不仅耗时费力、效率低下,且对专家的知识储备与经验依赖度高,难以满足大规模石刻文物数字化保护与研究的迫切需求
Smart Images

Figure CN122336763B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of inscription restoration technology, and in particular to an intelligent method and device for restoring damaged stone inscriptions. Background Technology
[0002] Stone inscriptions, as the most representative and enduring physical remains of ancient written information, are widely found on steles, epitaphs, cliff carvings, and other carriers. They not only carry multi-dimensional historical information about ancient politics, economy, culture, and language, but also serve as indispensable basic data for archaeological, paleographic, historical, and calligraphic art research. However, due to natural weathering, human damage, and historical changes, many stone inscriptions suffer from problems such as blurred characters, incomplete strokes, and surface damage, seriously affecting their interpretation and research utilization.
[0003] Currently, the restoration, completion, and identification of stone inscriptions mainly rely on manual collation, experience comparison, and visual interpretation by experts in the field. This process is not only time-consuming, labor-intensive, and inefficient, but also highly dependent on the experts' knowledge and experience, making it difficult to meet the urgent needs of large-scale digital preservation and research of stone inscriptions.
[0004] Although existing research has attempted to introduce artificial intelligence technology into the field of ancient script processing, and has made some progress in text generation, single-character completion, fragment matching, and character shape recognition based on materials such as paper and bamboo slips, these methods have not yielded ideal results when dealing with stone inscriptions. Therefore, there is an urgent need for a restoration method that can fully utilize the multimodal information of stone inscriptions to achieve high-fidelity and highly adaptive restoration of complex and damaged stone inscriptions. Summary of the Invention
[0005] Based on this, the purpose of the present invention is to provide an intelligent method and device for repairing damaged stone inscriptions.
[0006] A method for intelligent restoration of damaged stone inscriptions, firstly, involves constructing an ancient character database based on images of intact inscriptions, which includes the following steps:
[0007] S10. Based on the intact inscription image, extract the complete single-character dataset and the stone dataset; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; S20. Based on the complete single-character dataset, establish a general character shape constraint rule topology graph; S30. Learn the writing style of each character in the complete single-character dataset, and generate stylized single-character images under the guidance of the general character constraint rule topology graph; S40. Based on the stone texture and physical property characteristics of the stone dataset, combine them with the stylized single-character image to generate an ancient character image with the texture of stone. S50. Input a standard character set, and construct an ancient character database corresponding to the standard character set, based on the ancient character images with the texture of stone inscriptions. Then, based on the criteria of structural consistency, outline similarity, skeleton correspondence and style similarity, the similarity between the input damaged stone inscription and the glyph samples in the ancient script stele script database is calculated, and the weighted similarity of the above four criteria is calculated. The k glyphs are output from high to low according to the weighted similarity of the above four criteria, and are recorded as Top-k candidate characters. The similarity between the input damaged stone inscription and the Top-k candidate characters is calculated based on the context of the inscription, the relationship between adjacent characters, and the common usage rules of characters. The weighted similarity of the above three criteria is calculated, and the Top-k candidate characters are reordered from high to low according to the weighted similarity of the above three criteria before the repaired text is output.
[0008] The intelligent restoration method for damaged stone inscriptions described in this invention, based on intact inscription images, performs general character shape constraint rule learning, text style learning, and target stone stele material modeling and rendering to generate a batch of ancient character stele character libraries that can provide reference for the restoration of damaged stone inscriptions. The ancient character stele character library generation model only requires a small number of high-quality stele samples for training, thus solving the pain point that existing ancient character restoration techniques cannot be adapted to the restoration of damaged stone inscriptions.
[0009] Further, step S20 includes: S21. Extract the outline nodes of the character based on the complete single-character dataset; S22. Based on the complete single-character dataset, extract the skeleton key point nodes of the character shape; S23. Based on the complete single-character dataset, extract the component nodes of the character shape; S24. Construct a general glyph constraint rule topology graph based on the contour nodes, the skeleton key point nodes, and the component nodes.
[0010] Further, step S30 includes: S31. Extract the writing style features of each character in the complete single-character dataset; S32. Extract the structural features of the characters based on the topology of the general character shape constraint rules; S33. Based on the writing style characteristics and the structural characteristics of the character shapes, obtain stylized character shape fusion features; S34. Decode the stylized glyph fusion features to generate stylized single-character images.
[0011] Furthermore, the construction of the ancient script stele character database is optimized through the following training method: Collect real ancient character images (y) from a small number of existing high-quality stone inscription samples as a reference set; input the reference set, and generate single ancient character images with stone texture through steps S10, S20, S30 and S40; then input the standard character set corresponding to the reference set, and generate the corresponding ancient character stele character library as a verification set through step S50. Randomly select a glyph image (x) from the standard character set, and then filter out the predicted ancient character image with the highest similarity from the validation set. ; Compare the actual ancient character images (y) of the reference set with the predicted ancient character images of the validation set. Compare the results and calculate the total loss function L; Based on the total loss function L, optimize the process of generating stylized single-character images in step S30.
[0012] A method for constructing an ancient script stele character database includes the following steps: S10. Based on the intact inscription image, extract the complete single-character dataset and the stone dataset; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; S20. Based on the complete single-character dataset, establish a general character shape constraint rule topology graph; S30. Learn the writing style of each character in the complete single-character dataset, and generate stylized single-character images under the guidance of the general character constraint rule topology graph; S40. Based on the stone texture and physical property characteristics of the stone dataset, combine them with the stylized single-character image to generate an ancient character image with the texture of stone. S50. Input a standard character set, and construct an ancient character database corresponding to the standard character set, based on the ancient character images with the texture of stone inscriptions.
[0013] Further, step S20 includes: S21. Extract the outline nodes of the character based on the complete single-character dataset; S22. Based on the complete single-character dataset, extract the skeleton key point nodes of the character shape; S23. Based on the complete single-character dataset, extract the component nodes of the character shape; S24. Construct a general glyph constraint rule topology graph based on the contour nodes, the skeleton key point nodes, and the component nodes.
[0014] Further, step S30 includes: S31. Extract the writing style features of each character in the complete single-character dataset; S32. Extract the structural features of the characters based on the topology of the general character shape constraint rules; S33. Based on the writing style characteristics and the structural characteristics of the character shapes, obtain stylized character shape fusion features; S34. Decode the stylized glyph fusion features to generate stylized single-character images.
[0015] Furthermore, the method for constructing the ancient script stele character database is optimized through the following training method: Collect real ancient character images (y) from a small number of existing high-quality stone inscription samples as a reference set; input the reference set, and generate single ancient character images with stone texture through steps S10, S20, S30 and S40; then input the standard character set corresponding to the reference set, and generate the corresponding ancient character stele character library as a verification set through step S50. Randomly select a glyph image (x) from the standard character set, and then filter out the predicted ancient character image with the highest similarity from the validation set. ; Compare the actual ancient character images (y) of the reference set with the predicted ancient character images of the validation set. Compare the results and calculate the total loss function L; Based on the total loss function L, optimize the process of generating stylized single-character images in step S30.
[0016] A smart device for repairing damaged stone inscriptions includes: an ancient character stele character library generator and a damaged character repairer; The ancient script stele character library generator learns from intact stele images, batches generate ancient script single character images with the texture of stone inscriptions, and constructs an ancient script stele character library. The damaged character restorer uses the ancient script stele character library as a reference to perform character shape matching and context matching on the input damaged stone carving characters, and outputs the restored text.
[0017] An ancient script stele character database generator includes: The data processing module is used to extract a complete single-character dataset and a stone dataset based on the intact inscription image; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; The general character shape constraint learning module is used to establish a general character shape constraint rule topology graph based on the complete single character dataset; The writing style learning module is used to learn the writing style of each glyph in the complete single-character dataset and generate stylized single-character images under the guidance of the general glyph constraint rule topology graph; The stone inscription material learning module is used to generate ancient character images with stone texture and physical property characteristics based on the stone texture and physical property characteristics of the stone dataset and combined with the stylized single character images. The ancient script stele character library generation module is used to input a standard character set and construct an ancient script stele character library corresponding to the standard character set, based on the ancient script single character images with the texture of stone inscriptions.
[0018] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0019] Figure 1 The present invention provides an execution flowchart for an intelligent restoration method for damaged stone inscriptions; Figure 2 A schematic diagram of the module for the ancient script stele character library generator provided by the present invention; Figure 3 The execution flowchart of the method for constructing the ancient script stele character database provided by the present invention; Figure 4 The execution flowchart of step S10 provided by the present invention; Figure 5 The execution flowchart of step S20 provided by the present invention; Figure 6 The execution flowchart of step S30 provided by the present invention; Figure 7 Flowchart of the optimized training method for constructing the ancient script inscription database provided by this invention Detailed Implementation The applicant researched and analyzed existing methods for restoring ancient Chinese characters using artificial intelligence. The findings revealed that the unsatisfactory results in restoring damaged stone inscriptions stemmed from the fact that these methods rely heavily on ancient book samples of the same style. The models learn the two-dimensional outlines and stroke information of characters written in ink on flat paper or bamboo slips before being implemented. However, stone inscriptions, made of stone, are influenced by complex factors such as the stone's texture and natural erosion, resulting in significant morphological differences compared to ancient characters written in ink on paper or bamboo slips. Furthermore, high-quality, complete stone inscription samples of the same style are scarce, making it impossible to provide a large number of suitable models for restoration. Consequently, the methods are not effective in restoring damaged stone inscriptions.
[0020] Based on this, the present invention provides an intelligent method for restoring damaged stone inscriptions. Please refer to... Figure 1 and Figure 3 First, based on intact inscription images, an ancient script inscription database is constructed. This includes: using character localization combined with threshold segmentation based on intact inscription images, collecting text information and stone texture background information to obtain complete single-character datasets and stone texture datasets; then, based on the complete single-character datasets, performing general character shape constraint learning and writing style feature learning sequentially to generate stylized single-character images corresponding to the writing style; and then, based on the stone texture dataset, performing stone carving material modeling, combining the stylized single-character images with the stone carving material modeling to generate ancient script single-character images with a stone texture texture; finally, using the ancient script single-character images with a stone texture texture as a benchmark, batch generating corresponding ancient script single-character images for a given general character list to construct the ancient script inscription database. Then, using the ancient script inscription database as a reference, inputting damaged stone carving characters for character shape matching and context matching, and outputting restoration results for researchers' reference.
[0021] The following is a detailed explanation.
[0022] (I) Constructing a database of ancient inscriptions This invention constructs an ancient script stele script database using an ancient script stele script database generator. Please refer to [link / reference]. Figure 2 and Figure 3 The ancient script stele character library generator provided by the present invention includes: a data processing module 10, a general character shape constraint learning module 20, a writing style learning module 30, a stele material learning module 40, and an ancient script stele character library generation module 50.
[0023] The data processing module 10 is used to perform step S10: extracting complete single-character datasets and stone datasets based on the intact inscription image.
[0024] In this embodiment, the intact inscription image can be selected from one or more of the following: ordinary digital photographs, traditional rubbings, flatbed scans, and two-dimensional images obtained by converting three-dimensional scan data.
[0025] The complete single-character dataset includes all single-character images in the intact inscription images; the stone dataset includes the stone texture and physical property features of the stone tablet in the intact inscription images.
[0026] Please refer to Figure 4 Step S10 includes: S11. Divide the text area into the intact inscription image.
[0027] Specifically, by combining the traditional MSER algorithm and the YOLOv8 algorithm, a deep learning object detection algorithm can be used to select the text region in the intact inscription image, thereby narrowing the processing range and improving the processing speed.
[0028] S12. Perform binarization processing on the text region to obtain a binarized image.
[0029] Specifically, the text region is binarized using the Ostu global thresholding method or the Sauvola adaptive algorithm to obtain a clear binarized image.
[0030] S13. Extract text information and stone texture background information from the binarized image.
[0031] Specifically, GrabCut or U-Net is used to perform semantic segmentation on the binarized image, separating the complete single characters and the stone texture background in the binarized image, thereby extracting the text information and the stone texture background information respectively.
[0032] S14. Extract the complete single-character dataset based on the text information.
[0033] Specifically, the `connectedComponentsWithStats` function of OpenCV is used to extract single-character images from the text information, while filtering out noise blocks that are too small or too large. If the single-character images span multiple pages or are damaged, SIFT / FREAK feature matching can be used to stitch multiple images together. Finally, all the obtained single-character images are standardized, uniformly scaled to a fixed size, centered using affine transformation, and padded with zero values or mirrored edges to avoid boundary effects and obtain a complete single-character dataset.
[0034] S15. Extract the stone data set based on the stone texture background information.
[0035] Specifically, the contrast, correlation, energy, and homogeneity of the stone tablet background in the stone texture background information are calculated using the Gray-Level Co-occurrence Matrix (GLCM) to describe the roughness and regularity of the stone tablet's surface texture. The color features of the stone tablet are obtained by calculating the Lab histogram of the stone texture background information in a specific color space. The physical roughness and graininess of the stone tablet surface are obtained by analyzing the image gradient magnitude. Weathering features are obtained by identifying and quantifying the morphology, distribution density, and contrast of typical weathering traces in the background. Finally, the stone texture features and physical property features of the stone tablet are combined and stored as a stone dataset.
[0036] Furthermore, before performing step S10 to extract the complete single-character dataset and stone dataset, the intact inscription image needs to be preprocessed. Specifically, firstly, a bilateral filtering method is used to filter and clean the intact inscription image to remove noise or uneven lighting. Then, the main axis is detected by Hough linear transform, and the intact inscription image is aligned in direction.
[0037] The general glyph constraint learning module 20 is used to perform step S20: establish a general glyph constraint rule topology graph based on the complete single-character dataset.
[0038] In this step, by extracting the outline features, skeleton layout features, and component layout features of the characters in the complete single-character dataset, the inherent structural rules shared by all Chinese characters are extracted, thereby guiding the model on how to generate a correct Chinese character.
[0039] Please refer to Figure 5 Step S20 includes: S21. Extract the outline nodes of the character based on the complete single-character dataset.
[0040] Specifically, the contour extraction algorithm is used to analyze each character shape in the complete single-character dataset to obtain a continuous point sequence of the outer contour and internal holes of each character shape, thereby obtaining multiple sets of feature points describing the specific contour geometry, and defining a set of feature points describing the specific contour geometry as a contour node.
[0041] S22. Based on the complete single-character dataset, extract the skeleton key point nodes of the character shape.
[0042] Specifically, the thinning algorithm is used to analyze each character shape in the complete single-character dataset to obtain the single-pixel width skeleton of each character shape's strokes, and the endpoints and bifurcation points in the single-pixel width skeleton are obtained and defined as skeleton key point nodes.
[0043] S23. Based on the complete single-character dataset, extract the component nodes of the character shape.
[0044] Specifically, the character shapes in the complete single-character dataset are analyzed by the Chinese character component segmentation algorithm. Each character shape is decomposed into basic components (such as radicals), and each basic component is defined as a component node. At the same time, the bounding rectangle, center coordinates and pixel area of each component node are calculated as its additional attributes.
[0045] S24. Construct a general glyph constraint rule topology graph based on the contour nodes, the skeleton key point nodes, and the component nodes.
[0046] Specifically, the contour nodes, skeleton key point nodes and component nodes extracted in steps S21, S22 and S23 are defined as a node set V, and each node in the node set V is accompanied by its corresponding geometric and structural attributes.
[0047] Define the spatial constraints and logical relationships between any two related nodes in the node set V as the edge set V, which includes: Spatial relationship edges: Calculate the spatial relative relationships between different nodes. For example, define spatial orientation relationships such as "left-right," "top-bottom," and "semi-enclosed" between two component nodes; calculate the overlap and relative distance between the area enclosed by the outline node and the area where the component node is located. The spatial relationship edges are used to encode the layout structure of glyph components.
[0048] Topological connecting edges: Connecting edges are established between key nodes of the skeleton based on the continuity of the skeleton, forming a topological network of the stroke skeleton. These topological connecting edges are used to accurately describe the direction of the strokes themselves and the connections and intersections between strokes.
[0049] Construction relationship edges: Establish "belongs to" or "contains" relationship edges between component nodes and their contained skeleton key point nodes or contour feature points. These construction relationship edges are used to establish hierarchical associations from components to skeletons or from components to contours.
[0050] By using the contour nodes, skeleton key point nodes, and component nodes as basic construction units, and utilizing the spatial relationship edges, topological connection edges, and compositional relationship edges to establish a multi-level, multi-dimensional network of connections between them, the general glyph constraint rule topology graph is finally formed. This abstractly encodes the general construction rules that Chinese characters must follow in terms of outline integrity, skeleton connectivity, and component combination. These rules are used to guide and constrain the output of the model during character generation, ensuring that the generated characters are structurally correct and conform to the norms of Chinese character writing.
[0051] The writing style learning module 30 is used to perform step S30: learn the writing style of each character in the complete single-character dataset, and generate stylized single-character images under the guidance of the general character constraint rule topology graph.
[0052] Specifically, this step establishes a glyph style transfer architecture based on generative adversarial networks. This style transfer architecture takes glyph images of a specified stele style from the complete single-character dataset and the topology graph of the general glyph constraint rules as input, learns the writing style of the specified stele style from the complete single-character dataset, and transfers it to the general glyph structure.
[0053] Please refer to Figure 6Step S30 includes: S31. Extract the writing style features of each character in the complete single-character dataset.
[0054] Specifically, a style encoder is established through a deep convolutional neural network to encode the character images of the specified stele style in the complete single-character dataset, and to extract the writing style features of the specified stele style, including visual attributes such as brushstroke shape, stroke thickness variation, and the strength and angle of the carving.
[0055] S32. Extract the structural features of the characters based on the topology of the general character shape constraint rules.
[0056] Specifically, a normalized glyph skeleton and contour binary map are derived from the topology map of the general glyph constraint rules through a convolutional neural network, and encoded as the structural features of the glyph.
[0057] S33. Based on the writing style features and the structural features of the character shapes, obtain stylized character shape fusion features.
[0058] Specifically, by using Adaptive Instance Normalization (AdaIN), the channel mean and variance implied by the writing style features are calculated, and the structural features of the glyphs are normalized and rescaled using the channel mean and variance to generate the fused stylized glyph fusion features, thereby transferring the writing style of each glyph in the complete single-character dataset to the general glyph structure.
[0059] S34. Decode the stylized glyph fusion features to generate stylized single-character images.
[0060] Specifically, the stylized glyph fusion features are progressively upsampled from a low-resolution, high-dimensional feature space through a series of deconvolution layers, and finally mapped to the image pixel space to generate a stylized single-character image.
[0061] The stone inscription material learning module 40 is used to perform step S40: based on the stone texture and physical property characteristics of the stone dataset, it is combined with the stylized single character image to generate an ancient character image with the texture of stone.
[0062] Specifically, this step, based on an existing material-aware generation model, uses a cross-attention mechanism to input the stylized single-character image into the model, guiding the generation process to strictly maintain the character structure. Then, the material-aware generation model extracts the stone texture and physical properties of the target stele from the stone dataset, generating a stone texture map, height map, and normal map that match the size of the stylized single-character image. Subsequently, using texture mapping techniques in computer graphics or lightweight neural rendering methods, the stone texture map, height map, and normal map are synthesized with the stylized single-character image, overlaying the stylized single-character image with the physical texture of a real stele, including stone texture, engraving depth, surface roughness, graininess, and natural weathering marks, visually simulating the effect of stone carving, and finally rendering an ancient single-character image with the texture of stone inscriptions.
[0063] The ancient script stele character library generation module 50 is used to perform step S50: input a standard character set, and construct an ancient script stele character library corresponding to the standard character set based on the ancient script single character image with the texture of stone script.
[0064] Specifically, this step takes each Chinese character in a standard character set, such as the GB18030 character set, as the target and the ancient character images with the texture of stone as the benchmark. Through parallel computing, it automatically and continuously performs text style transfer and stone tablet material rendering to generate a set of single character images that cover the standard character set, have a unified text style and texture of stone, and stores them as an ancient character tablet character library.
[0065] To further improve the quality of the set of single-character images with a unified writing style and stone texture generated by the ancient inscription character database generator, it is necessary to further train and optimize the ancient inscription character database generator.
[0066] Specifically, please refer to Figure 7 The training method is as follows: Collect real ancient character images (y) from a small number of existing high-quality stone inscription samples as a reference set; input the reference set, and generate single ancient character images with the texture of stone text through steps S10, S20, S30 and S40; then input the standard character set corresponding to the reference set, and generate the corresponding ancient character stele character library as a verification set through step S50.
[0067] Step R1: Randomly select a glyph image (x) from the standard character set, and use a finder to filter out the predicted ancient character image with the highest similarity in the validation set. .
[0068] Step R2: Compare the real ancient character images (y) of the reference set with the predicted ancient character images of the validation set. The comparisons are made, and the total loss function L is calculated using a calculator.
[0069] Specifically, the total loss function is:
[0070] In the formula, Indicates conditions against loss; Indicates pixel-level loss; Indicates category loss; This indicates a loss of consistency. , and These are the weight coefficients for pixel-level loss, category loss, and consistency loss, respectively.
[0071] The conditional resistance loss and the pixel-level loss Predicted ancient text images used for constraint generation It closely resembles the image of a real ancient character (y) in terms of outline, stroke position, and overall shape. Its expression is:
[0072]
[0073] In the formula, This represents the pixel value of the i-th pixel in a real image of ancient characters. This represents the predicted pixel value of the i-th pixel in the ancient character image, where N is the total number of pixels in the image.
[0074] The category of loss The expression used to constrain the generated results to maintain a specified target style is:
[0075] The consistency loss To ensure consistency in feature representation between the input glyph and the generated glyph, its expression is:
[0076] Step R3: Based on the total loss function L, optimize the process of generating stylized single-word images in step S30 using the Adam optimizer.
[0077] Specifically, the core step in generating the predicted ancient character image (y) is stylized single-character image generation. This core step uses Adaptive Instance Normalization (AdaIN) to calculate the channel mean and variance implied by the text style features. The channel mean and variance are then used to normalize and rescale the structural features of the character shapes, generating a fused stylized character shape feature. Finally, the stylized character shape fusion feature is decoded to generate a stylized single-character image. The Adam optimizer optimizes the calculated channel mean and variance implied by the text style features based on the total loss function L, making the generated stylized single-character image closer to the real ancient character image. In this step, the parameters of the Adam optimizer are β1=0.5, β2=0.999, and the batch size is 16.
[0078] (II) Restoration of damaged stone inscriptions The restoration of damaged stone inscriptions is accomplished using a damaged inscription restoration tool, which uses the ancient inscription character database generated by the ancient inscription character database generator as a reference database. The steps are as follows: The similarity between the input damaged stone inscription and the glyph samples in the ancient script database is calculated based on the criteria of structural consistency, outline similarity, skeleton correspondence, and stylistic similarity. The weighted similarity of the above four criteria is calculated, and k glyphs are output from high to low according to the weighted similarity of the above four criteria, which are denoted as Top-k candidate characters.
[0079] In this embodiment, the weights of structural consistency, contour similarity, skeleton correspondence, and style similarity are 0.2, 0.2, 0.3, and 0.3, respectively.
[0080] The similarity between the input damaged stone inscription and the Top-k candidate characters is calculated based on the context of the inscription, the relationship between adjacent characters, and the common usage rules of characters. The weighted similarity of the above three criteria is calculated, and the Top-k candidate characters are reordered from high to low according to the weighted similarity of the above three criteria before the repaired text is output.
[0081] In this embodiment, the weights of the inscription context, the relationship between adjacent characters, and the common usage patterns are 0.4, 0.3, and 0.3, respectively.
[0082] The intelligent restoration method for damaged stone inscriptions of this invention extracts single-character images from intact inscription images as a complete single-character dataset, and the stone texture and physical property features of the stone tablet in the intact inscription image as a stone material dataset. Then, it sequentially performs general character shape constraint rule learning, writing style learning, and target stone tablet material modeling and rendering to batch generate an ancient character database that can provide a reference for the restoration of damaged stone inscriptions. Based on the ancient character database, character shape matching and context matching are performed to restore the damaged stone inscriptions. This invention constructs an ancient character database specifically for stone inscriptions, making it more suitable for the restoration of damaged stone inscriptions, and only requires a small number of high-quality inscription samples for training, thus solving the pain point that existing ancient character restoration technologies cannot adapt to the restoration of damaged stone inscriptions.
[0083] Based on the same inventive concept described above, this invention also provides an electronic device, which can be a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). The device includes one or more processors and a memory, wherein the processor executes a program to implement the aforementioned intelligent restoration method for damaged stone inscriptions; and the memory stores a computer program executable by the processor.
[0084] Based on the same inventive concept, the present invention also provides a computer-readable storage medium corresponding to the aforementioned embodiments of the intelligent restoration method for damaged stone inscriptions. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps described in any of the above embodiments.
[0085] This invention can take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0086] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and the present invention also intends to include these modifications and variations.
Claims
1. A method for intelligent restoration of damaged stone inscriptions, characterized in that, First, based on the well-preserved images of the inscriptions, a database of ancient Chinese characters for the inscriptions is constructed, which includes the following steps: S10. Based on the intact inscription image, extract the complete single-character dataset and the stone dataset; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; S20. Based on the complete single-character dataset, establish a general character shape constraint rule topology graph; specifically, step S20 includes: S21. Extract the outline nodes of the character based on the complete single-character dataset; S22. Based on the complete single-character dataset, extract the skeleton key point nodes of the character shape; S23. Based on the complete single-character dataset, extract the component nodes of the character shape; S24. Construct a general glyph constraint rule topology graph based on the contour nodes, the skeleton key point nodes, and the component nodes; S30. Learn the writing style of each glyph in the complete single-character dataset, and generate stylized single-character images under the guidance of the general glyph constraint rule topology graph; specifically, step S30 includes: S31. Extract the writing style features of each character in the complete single-character dataset; S32. Extract the structural features of the characters based on the topology of the general character shape constraint rules; S33. Based on the writing style characteristics and the structural characteristics of the character shapes, obtain stylized character shape fusion features; S34. Decode the stylized glyph fusion features to generate stylized single-character images; S40. Based on the stone texture and physical property characteristics of the stone dataset, combine them with the stylized single-character image to generate an ancient character image with the texture of stone. S50. Input a standard character set, and construct an ancient character database corresponding to the standard character set, based on the ancient character images with the texture of stone inscriptions. Then, based on the criteria of structural consistency, outline similarity, skeleton correspondence and style similarity, the similarity between the input damaged stone inscription and the glyph samples in the ancient script stele script database is calculated, and the weighted similarity of the above four criteria is calculated. The k glyphs are output from high to low according to the weighted similarity of the above four criteria, and are recorded as Top-k candidate characters. The similarity between the input damaged stone inscription and the Top-k candidate characters is calculated based on the context of the inscription, the relationship between adjacent characters, and the common usage rules of characters. The weighted similarity of the above three criteria is calculated, and the Top-k candidate characters are reordered from high to low according to the weighted similarity of the above three criteria before the repaired text is output.
2. The intelligent restoration method for damaged stone inscriptions according to claim 1, characterized in that, The ancient script inscription database was optimized through the following training method: A set of real ancient characters y is collected from a small number of existing high-quality stone inscription samples as a reference set; the reference set is input, and the ancient characters with the texture of stone are generated through steps S10, S20, S30 and S40; then the standard character set corresponding to the reference set is input, and the corresponding ancient characters stele character library is generated through step S50 as a verification set. Randomly select a glyph image x from the standard character set, and filter out the predicted ancient character image with the highest similarity from the validation set. ; Compare the real ancient character images y in the reference set with the predicted ancient character images in the validation set. Compare the results and calculate the total loss function L; Based on the total loss function L, optimize the process of generating stylized single-character images in step S30.
3. A method for constructing an ancient script stele character database, characterized in that, Including the following steps: S10. Based on the intact inscription image, extract the complete single-character dataset and the stone dataset; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; S20. Based on the complete single-character dataset, establish a general character shape constraint rule topology graph; specifically, step S20 includes: S21. Extract the outline nodes of the character based on the complete single-character dataset; S22. Based on the complete single-character dataset, extract the skeleton key point nodes of the character shape; S23. Based on the complete single-character dataset, extract the component nodes of the character shape; S24. Construct a general glyph constraint rule topology graph based on the contour nodes, the skeleton key point nodes, and the component nodes; S30. Learn the writing style of each glyph in the complete single-character dataset, and generate stylized single-character images under the guidance of the general glyph constraint rule topology graph; specifically, step S30 includes: S31. Extract the writing style features of each character in the complete single-character dataset; S32. Extract the structural features of the characters based on the topology of the general character shape constraint rules; S33. Based on the writing style characteristics and the structural characteristics of the character shapes, obtain stylized character shape fusion features; S34. Decode the stylized glyph fusion features to generate stylized single-character images; S40. Based on the stone texture and physical property characteristics of the stone dataset, combine them with the stylized single-character image to generate an ancient character image with the texture of stone. S50. Input a standard character set, and construct an ancient character database corresponding to the standard character set, based on the ancient character images with the texture of stone inscriptions.
4. The method for constructing an ancient script stele script database according to claim 3, characterized in that, Optimization was achieved through the following training methods: A set of real ancient characters y is collected from a small number of existing high-quality stone inscription samples as a reference set; the reference set is input, and the ancient characters with the texture of stone are generated through steps S10, S20, S30 and S40; then the standard character set corresponding to the reference set is input, and the corresponding ancient characters stele character library is generated through step S50 as a verification set. Randomly select a glyph image x from the standard character set, and filter out the predicted ancient character image with the highest similarity from the validation set. ; Compare the real ancient character images y in the reference set with the predicted ancient character images in the validation set. Compare the results and calculate the total loss function L; Based on the total loss function L, optimize the process of generating stylized single-character images in step S30.
5. A generator for generating ancient script stele text databases, characterized in that, include: The data processing module is used to extract a complete single-character dataset and a stone dataset based on the intact inscription image; wherein, the single-character dataset includes all single-character images in the intact inscription image, and the stone dataset includes the stone texture and physical property features of the stone in the intact inscription image; The general character shape constraint learning module is used to extract the outline nodes, skeleton key point nodes and component nodes of the character shape according to the complete single character dataset, and establish a general character shape constraint rule topology graph accordingly. The writing style learning module is used to extract the writing style features of each character in the complete single-character dataset, and extract the structural features of the characters according to the topology map of the general character constraint rules; then, it obtains the stylized character fusion features based on these features; finally, it decodes the data to generate stylized single-character images. The stone inscription material learning module is used to generate ancient character images with stone texture and physical property characteristics based on the stone texture and physical property characteristics of the stone dataset and combined with the stylized single character images. The ancient script stele character library generation module is used to input a standard character set and construct an ancient script stele character library corresponding to the standard character set, based on the ancient script single character images with the texture of stone inscriptions.
6. An intelligent restoration device for damaged stone inscriptions, characterized in that, include: The ancient script stele character database generator and damaged character restorer as described in claim 5; The ancient script stele character library generator learns from intact stele images, batches generate ancient script single character images with the texture of stone inscriptions, and constructs an ancient script stele character library. The damaged character restorer uses the ancient script stele character library as a reference to perform character shape matching and context matching on the input damaged stone carving characters, and outputs the restored text.
Citation Information
Patent Citations
Inscription restoration method based on contour feature description of Chinese character image
CN105069766A
Ancient character defect font reconstruction method and device based on graph structure and deep learning
CN120997847A