Cultural relic document image character restoration method and system based on deep learning
Patent Information
- Application Number
- CN202611044508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-09
AI Technical Summary
[0007]本申请提供基于深度学习的文物文档图像文字修复方法及系统,解决现有技术中修复效果的稳定性与一致性难以保证的问题,同时适用于数字文化产品制作软件中的文物图像修复与数字文化资源重建场景
[0042]本发明在文物图像数字化处理及相关数字文化资源重建过程中,能够实现对文物文字信息的结构化修复与连续性重建,提高数字化保存与再现过程中的信息完整性与稳定性。针对纸张、竹简、木牍、金属铭文等文物载体在长期保存过程中产生的霉变、裂纹、腐蚀、剥落等退化缺陷,充分利用该类退化缺陷并非完全随机、而通常沿材料内部纤维方向、晶界结构或应力释放路径扩展并呈现方向一致性特征的材料特点,在不改变现有字形结构与语义推断主导逻辑的前提下,通过构建材料退化传播方向场数据,将材料内部主传播方向以可计算形式引入文字缺损处理流程。在材料退化主导的损伤模式下,当文字缺损扩展边界与材料内部主传播方向之间存在方向一致性统计特征时,本发明利用方向场对文字缺损边界重建过程施加物理合理性约束,使缺损区域的像素补全不仅满足字形语义合理性,同时符合材料传播规律,从而减少不符合材料演化趋势的过度补全与不合理延伸,提升修复结果在材料演化环境下的稳定性与一致性。进一步地,基于同一材料退化传播方向场数据执行退化传播趋势模拟处理,生成未来损坏风险分布数据,实现利用材料特性反向用于文字的修复和预测,使修复与预测统一于同一传播结构框架之中。
Smart Images

Figure CN122887733A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and digital cultural relic preservation, specifically to a method and system for restoring text in cultural relic documents based on deep learning. Background Technology
[0002] Cultural relics, such as paper, bamboo slips, wooden tablets, and metal inscriptions, typically carry textual information of historical and cultural value. Due to the influence of various natural factors during long-term preservation, including changes in temperature and humidity, biological erosion, oxidation, and stress, these materials undergo degradation phenomena such as mold, corrosion, cracking, and peeling. As the material structure gradually deteriorates, the strokes of the characters attached to their surface may become missing, broken, or blurred, or even partially detached. To achieve long-term preservation and research utilization of the information contained in these cultural relics, it is necessary to perform technical processing on the damaged text to restore its legibility and slow down further damage.
[0003] To address the issue of missing text in cultural relics, existing technologies typically analyze and reconstruct the text areas using image acquisition and digital processing. These solutions generally focus on the character's shape and structure, identifying remaining stroke features, extracting outline boundary information, and combining this with contextual semantic relationships to infer and complete the missing areas. During reconstruction, the technological approach often emphasizes the geometric shape and semantic features of the characters themselves, constraining the continuity of stroke forms and the overall consistency of the character shape to achieve pixel-level completion of the missing areas.
[0004] In some applications of software for creating digital cultural products or digital processing systems for digital cultural resources, the aforementioned image restoration technology is also used for the digital reconstruction of cultural relic images and the reproduction of cultural content, supporting the storage and display of cultural heritage information in the digital environment. Especially when using software for creating virtual reality (VR) scenes, generating high-precision digital cultural assets, creating 3D dynamic restorations, and post-production of digital publications, this type of image restoration technology often serves as a core front-end processing tool, outputting high-quality, editable image layers and texture maps of cultural relics to the software.
[0005] The inventors of this application have discovered the following technical problems with the aforementioned technology: When cultural relics such as paper, bamboo slips, wooden tablets, and metal inscriptions undergo degradation phenomena such as mold, corrosion, cracking, or peeling, the missing text often exhibits a spatial distribution characteristic that changes as the material damage morphology expands. In such damage scenarios dominated by material degradation, existing restoration technologies centered on text morphology and semantic structure may, in some areas, result in inconsistencies between the restoration outcome and the original damage morphology. This is especially true when the direction of the missing boundary extension is complex or when the damage continues to develop, making it difficult to guarantee the stability and consistency of the restoration effect. Furthermore, existing technologies typically address the existing missing state by completing the repair work, lacking effective technical solutions for situations where material damage may continue to develop. This makes it difficult to support the analysis and prediction of subsequent damage changes, and therefore, it cannot provide scientifically and physically based predictive data for animation engines such as dynamic aging and 3D evolution effects in digital cultural product creation software.
[0006] Therefore, in the context of cultural relic damage dominated by material degradation, how to improve the adaptability and stability of text restoration results in complex damage environments while maintaining the existing glyph structure and semantic inference logic, and how to technically address potential damage developments, has become a technical problem that needs to be solved. Summary of the Invention
[0007] This application provides a method and system for restoring text in cultural relic documents based on deep learning, which solves the problem that the stability and consistency of the restoration effect are difficult to guarantee in the existing technology. It is also applicable to the scenarios of cultural relic image restoration and digital cultural resource reconstruction in digital cultural product production software.
[0008] To achieve the above objectives, the embodiments of this application disclose the following technical solutions:
[0009] On the one hand, this solution discloses a deep learning-based method for restoring text in cultural relic documents, including the following steps:
[0010] Step S1: Obtain the image of the cultural relic document to be restored. Perform background texture analysis on the image of the cultural relic document. Background texture analysis is not simply to distinguish between foreground and background, but to identify the structural texture characteristics of the material of the cultural relic carrier. This provides an analysis scale and smoothing parameters that match the material type for subsequent structural tensor data calculation. Construct structural tensor data that reflects local structural features. Structural tensor data is used to express the directional energy distribution relationship in the neighborhood of pixels. It can statistically characterize the directional inertia formed by material degradation. Based on the structural tensor data, extract the main propagation direction data of material degradation and generate initial material degradation propagation direction field data covering the image area. The initial material degradation propagation direction field data is used to establish the physical structural constraint basis and avoid the restoration result from deviating from the internal structural law of the material.
[0011] Step S2: Determine whether a pixel has directional features based on the degree of difference between the feature values in the structural tensor data. Measure the intensity of local anisotropy by the difference in feature values to avoid misidentifying noise regions as valid directional regions. For pixels with directional features, retain their main direction data. For pixels without directional features, generate supplementary direction data through neighborhood direction interpolation. Perform completion processing on the initial material degradation propagation direction field data and further perform continuity enhancement processing to generate material degradation propagation direction field data covering the entire image region.
[0012] Step S3: Extract semantic feature data of text regions in the document image of the cultural relic to be restored through deep neural network, use deep neural network to perform high-dimensional semantic encoding on complex stroke structure to make up for the problem that the physical direction field cannot express the text form, and extract gradient direction data at the boundary of text loss. Perform direction consistency calculation on gradient direction data and material degradation propagation direction field data to generate anisotropic coherence index data. This index data is used to quantify the coupling strength between semantic form and material structure.
[0013] Step S4: Based on the anisotropic coherence index data, the weight ratio of semantic feature data and material degradation propagation direction field data in the feature fusion process is dynamically adjusted through an adaptive gating mechanism to generate fused feature data. The adaptive gating mechanism is used to achieve dynamic switching between semantic dominance and physical dominance in different regions, rather than fixed ratio superposition.
[0014] Step S5: The fused feature data is mapped to diffusion control data, and direction-restricted diffusion reconstruction processing is performed based on the material degradation propagation direction field data to complete the pixel incomplete areas of the text and output the repaired text image data. The direction-restricted diffusion reconstruction processing makes the pixel update preferentially expand along the material degradation propagation direction, thereby ensuring the physical consistency of the structural extension.
[0015] This claim introduces material degradation propagation direction field data and anisotropic coherence index data into the semantic repair process of a deep neural network, constructing a coupling bridge between physical and semantic structures. This avoids the problems of stroke distortion or incorrect extension direction caused by traditional deep learning methods relying solely on semantic inference while ignoring the constraints of the internal structure of the material. This technical approach is not simply a superposition of two types of features, but rather establishes a dynamic adjustment relationship through directional consistency calculation and adaptive gating mechanisms, forming a closed-loop collaborative mechanism, demonstrating clear technical motivation and structural necessity.
[0016] Furthermore, this application does not directly extract the direction from the image gradient, but instead constructs structural tensor data, transforms the local gradient distribution data into second-order structural matrix data, and performs weighted accumulation processing within the sliding window range to enhance the stability of the local structure.
[0017] The technical motivation behind this processing logic is that images of cultural relics are often accompanied by noise and degraded textures. If the main propagation direction is determined directly based on the instantaneous gradient direction, it is easily affected by local noise. By performing feature decomposition and filtering stable main direction data based on the degree of difference in eigenvalues, stable structural directions and random perturbation directions can be separated statistically.
[0018] From a technical necessity perspective, structural tensor data possesses the ability to express local anisotropic features, while simple edge detection or single-scale filtering cannot provide stable directional criteria. Therefore, this step constitutes a necessary prerequisite for constructing the material degradation propagation direction field data and provides reliable input for the direction continuity enhancement processing in step S2.
[0019] Furthermore, in order to avoid spatial breaks or isolated regions in the material degradation propagation direction field data, this application does not simply retain the initial direction data, but establishes direction adjacency relationships, performs direction smoothing processing on regions with drastic direction changes, and performs direction interpolation on regions without obvious main direction features.
[0020] The underlying principle of this design is that the degradation process of real materials is continuous and gradual, and does not undergo completely random jumps at microscales. If the orientation field lacks continuity, it will directly affect the reliability of subsequent orientation consistency calculations.
[0021] Therefore, by using continuity enhancement processing to form continuous material degradation propagation direction field data covering the entire image area, the physical constraints are made spatially stable, forming a synergistic relationship with the direction consistency calculation in step S3.
[0022] Furthermore, this application does not simply superimpose semantic feature data with material degradation propagation direction field data, but instead assesses the consistency between the boundary direction and the material propagation direction by locating the boundary of the missing text region and extracting the gradient direction sequence.
[0023] The technical motivation behind this logic lies in the fact that whether the morphology of text defects extends along the direction of material degradation directly reflects the degree to which the material structure dominates the defects. By generating original directional consistency score data and performing normalization processing to form anisotropic coherence index data, a calculable coupling strength index can be established.
[0024] This indicator provides a quantitative basis for the adaptive gating mechanism in step S4, so that the subsequent weight allocation has an objective reference rather than empirical adjustment, thereby avoiding being identified as arbitrary piecing together.
[0025] Furthermore, in the fusion stage, this application employs an adaptive gating mechanism instead of a fixed-weight fusion method. By constructing a weight adjustment module containing nonlinear activation units, the anisotropic coherence index data is transformed into physically constrained weight data and semantically guided weight data.
[0026] The underlying technology is that the degree to which the material structure dominates the form of missing characters varies by region. If a fixed weight ratio is used, it may cause semantic misleading in physically dominant areas or be overly constrained by physical limitations in semantically clear areas.
[0027] By dynamically adjusting the weight ratio, fused feature data is generated, enabling the fusion process to have regional adaptive capabilities and forming a causal closed loop with the coherence assessment in step S3.
[0028] Furthermore, in the reconstruction stage, this application employs directionally restricted diffusion reconstruction processing, rather than isotropic diffusion or simple convolutional padding.
[0029] The technical mechanism lies in the diffusion control data defining the directional bias relationship during pixel updates, ensuring that the update amplitude of a pixel along the material degradation propagation direction is higher than that along its normal direction. This design conforms to the extension law of material fibers or corrosion textures.
[0030] If a diffusion method without directional constraints is used, the filling result may result in lateral expansion or structural distortion. This step, together with the aforementioned direction field generation and weight fusion mechanism, forms a progressive relationship, realizing a complete chain from structural modeling to direction control.
[0031] Furthermore, setting a physical consistency verification step before executing step S5 is to prevent the fusion result from becoming unstable when there are errors in the material degradation propagation direction field data.
[0032] By applying directional perturbations to the material degradation propagation direction field data and comparing the differences in the fused feature data before and after the perturbation, the system's sensitivity to directional errors can be detected. If the difference exceeds a threshold, the gating mechanism parameter adjustment process is triggered.
[0033] The technical necessity of this step lies in the fact that material structure extraction may be affected by noise, and without a verification mechanism, the diffusion reconstruction process will amplify errors. By performing multiple rounds of perturbation verification, the fused feature response is stabilized, improving overall robustness.
[0034] Furthermore, in step S1, this application introduces background texture analysis and calls matching parameters to recalculate the structural tensor data based on the identified material category of the cultural relic carrier.
[0035] The technical motivation lies in the significant differences in texture scale among different materials; for example, the spatial frequency characteristics of paper fibers and metal corrosion textures differ. Using a uniform window size and smoothing parameters may lead to distortion in orientation extraction.
[0036] Therefore, by identifying material categories through multi-scale, multi-directional filter banks and calling corresponding parameters, the structural tensor data calculation is made material-adaptive, enhancing the physical rationality of step S1.
[0037] Furthermore, this application performs degradation propagation trend simulation processing based on the material degradation propagation direction field data, constructs a directional adjacency propagation network structure, and generates future damage risk distribution data.
[0038] The technical motivation behind this design lies in the fact that the direction of material degradation not only affects the current defect morphology but also determines its future expansion trend. Through multi-round directional propagation update calculations, the evolution process of the degradation path can be simulated.
[0039] This feature, together with step S5, extends the functionality of the method from static repair to dynamic prediction, demonstrating the profound value of material structure modeling.
[0040] On the other hand, this solution discloses a deep learning-based system for restoring text in cultural relics documents, including: a data acquisition module for acquiring images of cultural relics documents to be restored and constructing structural tensor data; a direction field generation module for generating continuous material degradation propagation direction field data; a coherence assessment module for generating anisotropic coherence index data; a feature fusion module for generating fused feature data based on the anisotropic coherence index data; a directional reconstruction module for performing direction-restricted diffusion reconstruction processing and outputting restored text image data; and a predictive analysis module for generating future damage risk distribution data and outputting risk identification information.
[0041] By modularizing the data acquisition module, orientation field generation module, coherence assessment module, feature fusion module, directional reconstruction module, and predictive analysis module, the method steps form a deployable closed-loop system in hardware or software architecture. Data flow between modules follows a logical sequence of "material structure modeling—semantic extraction—coupled assessment—adaptive fusion—directionally constrained reconstruction—trend prediction," avoiding functional isolation. This system structure is not a simple listing of functions, but rather revolves around the core hub of material degradation propagation orientation field data, enabling the orientation field to participate in both current repair and future prediction, thus demonstrating the technical unity and creative correlation effect of the overall architecture.
[0042] This invention enables structured restoration and continuous reconstruction of textual information in the digital processing of cultural relics images and the reconstruction of related digital cultural resources, improving the integrity and stability of information during digital preservation and reproduction. Addressing degradation defects such as mold, cracks, corrosion, and peeling that occur in cultural relics such as paper, bamboo slips, wooden tablets, and metal inscriptions during long-term preservation, this invention fully utilizes the material's characteristic that these degradation defects are not entirely random but typically extend along the internal fiber direction, grain boundary structure, or stress release path, exhibiting directional consistency. Without altering the existing character structure and semantic inference logic, it constructs a material degradation propagation direction field data, introducing the main propagation direction within the material into the text defect processing flow in a calculable form. Under the damage mode dominated by material degradation, when there is a statistically consistent directional characteristic between the text defect expansion boundary and the main propagation direction within the material, this invention uses the direction field to impose physical rationality constraints on the text defect boundary reconstruction process. This ensures that pixel completion of the defect area not only satisfies the semantic rationality of the character shape but also conforms to the material propagation law, thereby reducing excessive completion and unreasonable extensions that do not conform to the material evolution trend and improving the stability and consistency of the restoration results under the material evolution environment. Furthermore, based on the same material degradation propagation direction field data, degradation propagation trend simulation processing is performed to generate future damage risk distribution data, realizing the reverse application of material properties for text repair and prediction, so that repair and prediction are unified within the same propagation structure framework. Attached Figure Description
[0043] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;
[0044] Figure 2 This is a system structure diagram of an embodiment of the present invention;
[0045] Figure 3 This is a flowchart illustrating the generation process of the material degradation direction field according to an embodiment of the present invention.
[0046] Figure 4 This is a feature fusion and diffusion reconstruction diagram according to an embodiment of the present invention;
[0047] Figure 5 This is a schematic diagram of a risk prediction network according to an embodiment of the present invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In the following description, numerous specific details are set forth to provide a comprehensive understanding of the present invention. The present invention may be practiced without some or all of these specific details. In other instances, well-known processes have not been described in detail to avoid unnecessarily obscuring the present invention.
[0049] When used in conjunction with the terms "comprising," "method comprising," or similar language in this specification and appended claims, the singular forms "a," "some," and "the" include plural references unless the context clearly indicates otherwise. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0050] In this embodiment, "material degradation propagation direction field data" is defined as a set of direction vectors covering the entire image area of the artifact document to be restored. This set of direction vectors originates from the eigenvalue decomposition results of structural tensor data and is used to characterize the main propagation trend formed by the artifact carrier material during long-term mold growth, corrosion, or fiber breakage. It differs from conventional image gradient direction data in that this direction field has a physical structural meaning, reflecting the anisotropic characteristics of the material's internal microstructure, rather than simply the direction of grayscale changes.
[0051] In this embodiment, "structural tensor data" refers to the second-order structural matrix data constructed by performing horizontal and vertical gradient calculations on the image of the cultural relic to be restored, and then performing weighted accumulation processing within a sliding window to form a stable local structural representation. This data is used to extract material principal orientation information from noise.
[0052] "Anisotropic coherence index data" is defined as a normalized index obtained by calculating the directional consistency between the gradient direction data of the text defect boundary and the direction field data of material degradation propagation. It is used to quantify the degree to which the material structure dominates the text defect morphology.
[0053] The core innovation of this solution lies in introducing material degradation propagation direction field data into a deep neural network semantic inpainting framework. An anisotropic coherence index is used to construct a coupling bridge between semantics and physics. An adaptive gating mechanism is then employed to dynamically assign weights to the two types of features. Finally, structurally consistent pixel completion is achieved through directionally restricted diffusion reconstruction. This logic differs from image inpainting methods based solely on semantic generation, forming a closed-loop technical path of "material structure—semantic features—gated fusion—directionally restricted diffusion."
[0054] Example 1
[0055] A deep learning-based method for text restoration of cultural relic documents includes the following steps:
[0056] Step S1: Obtain the document image of the cultural relic to be restored, perform background texture analysis on the document image of the cultural relic to be restored, construct structural tensor data reflecting local structural features, and extract the main propagation direction data of material degradation based on the structural tensor data to generate the initial material degradation propagation direction field data covering the image area.
[0057] The construction of structural tensor data includes: performing gradient calculations on the image of the cultural relic to be restored in the horizontal and vertical directions to form local gradient distribution data; constructing second-order structural matrix data based on the local gradient distribution data, and performing weighted accumulation processing on the second-order structural matrix data within a preset sliding window range to generate structural tensor data; subsequently, performing feature decomposition processing on the structural tensor data to obtain eigenvalues and corresponding eigenvector data, selecting the eigenvector data with the largest eigenvalue as the local principal direction data, and filtering out stable principal direction data based on the degree of difference in eigenvalues to construct the initial material degradation propagation direction field data;
[0058] Background texture analysis also includes: performing convolution operations on the document image of the cultural relic to be restored using a multi-scale, multi-directional filter bank to obtain texture response data in different directions; extracting texture response distribution features based on the distribution characteristics of the texture response data; identifying the material category of the cultural relic carrier based on the texture response distribution features; and calling the corresponding structural analysis window size and smoothing parameters from a preset parameter library according to the identified material category. The parameter library stores structural analysis parameters and diffusion control parameters corresponding to different material categories. These parameters are obtained through experimental calibration, historical sample statistics, or model training, and can be called or dynamically adjusted according to the features of the input image. The structural tensor data is recalculated using matching parameters to adapt to the texture characteristics of different materials.
[0059] In this embodiment, the image of the cultural relic document to be restored is first acquired. Gradient calculations are performed on the image in both the horizontal and vertical directions to generate local gradient distribution data. Based on this gradient distribution data, a second-order structure matrix is constructed, and weighted accumulation processing is performed within a preset sliding window to enhance the stability of the local structure. A Gaussian weight distribution is preferably used for weighting.
[0060] Subsequently, eigenvalue decomposition was performed on the structure matrix data to obtain the eigenvectors and eigenvalues corresponding to the principal directions. Stable principal direction data were then selected by comparing the degree of difference in eigenvalues.
[0061] To accurately quantify the orientation quality of local textures and avoid false orientation extraction caused by background noise interference, a saliency evaluation index based on anisotropy measures needs to be introduced. By analyzing the characteristic distribution of the second-order structure matrix, a nonlinear mapping function reflecting the energy concentration is constructed, thus obtaining the equation for calculating directional saliency:
[0062] ;
[0063] in, This is used to quantify the directional credibility or significance of the local texture of a pixel in an image, and to participate as a weighting factor in the calculation of the original directional consistency score data. When the value approaches 1, it indicates that the point has extremely strong directionality, such as the deep and long fibers of bamboo and wood, and the algorithm will strictly enforce physical constraints. When it approaches 0, it indicates that the point is a flat area or a random noise area, and the algorithm will degenerate into ordinary semantic repair.
[0064] This represents the energy of the local structure along the principal gradient direction, i.e., the direction in which the change is most drastic. This refers to the energy of the local structure in the main diffusion direction, i.e., the direction of the most gradual change, i.e., the texture direction. In the actual processing flow, the system first processes the input image of the cultural relic document to be restored using a discrete difference operator. Perform numerical differentiation along the spatial dimension to obtain the result containing the horizontal component. With vertical component Local gradient vector Next, the processor performs an outer product operation on the gradient vector and its transpose to construct the original second-order tensor matrix reflecting the local energy distribution. To eliminate isolated noise and enhance the statistical stability of regional features, the system introduces a Gaussian kernel function with a preset window size to perform weighted convolution smoothing on the original second-order tensor matrix, thereby constructing a stable structure tensor. Subsequently, the system processed the structure tensor. Perform eigenvalue decomposition to decouple the first eigenvalue representing the direction of the most drastic local structural change. And a second characteristic value representing the local texture along the direction of fiber or crack extension. Through this physical modeling process, the difference ratio term on the left side of the formula... It can accurately map the anisotropic intensity of local areas: when the first feature value is significantly greater than the second feature value, the ratio approaches the maximum value, which physically indicates that the pixel is in a stripe, fiber or physical edge region with strong directionality, providing a key structural reliability criterion for subsequent accurate repair along the material degradation direction;
[0065] The energy compensation factor is a positive number used to ensure numerical stability. It provides numerical stability in flat areas of the image and suppresses random fluctuations under low signal-to-noise ratio conditions. The value is selected based on the image noise level or sensor characteristics.
[0066] The maximum texture response intensity represents the strongest response energy output by the multi-scale, multi-directional filter bank at a specific pixel, used to characterize the robustness of the original physical signal.
[0067] The material sensitivity adjustment coefficient is an exponential decay factor dynamically mapped based on the material properties of the carrier. It is selected from the parameter library or determined by the mapping function according to the material type or texture response characteristics. Its value directly determines the system's tolerance or cutoff threshold for weak directional signals.
[0068] In the above formula, firstly, the processor performs spatial gradient convolution on the acquired digitized image to construct a structure tensor, and then uses an eigenvalue decomposition algorithm to calculate the first eigenvalue in real time. With the second eigenvalue Simultaneously, the system invokes a multi-scale Gabor filter bank to perform rotational convolution operations on the entire image, and retrieves the maximum energy value at each pixel location from the multi-channel response data, then squares it to obtain the maximum texture response intensity. Energy compensation factor The system pre-sets static parameters in memory based on the dark current noise level of the photosensitive element. Most importantly, the system first identifies the material type of the artifact carrier (such as bamboo, silk, or paper) through a background texture analysis module. Then, based on this identification result, it retrieves and calls the matching material sensitivity adjustment coefficient from a pre-set material property index table. Finally, the central processing unit substitutes the aforementioned real-time acquired dynamic variables and preset parameters into the significance calculation equation to complete the directional significance index. The solution is then output to the subsequent gating reconstruction stage.
[0069] In the background texture analysis stage, a multi-scale, multi-directional filter bank is used to perform convolution operations on the document image of the cultural relic to be restored, obtaining texture response data in different directions. The material category of the cultural relic carrier is identified based on the texture response distribution, such as paper, bamboo / wood, or metal. According to the identification results, the corresponding structural analysis window size and smoothing parameters are retrieved from a preset parameter library. The preset parameter library stores the structural analysis window size and convolution smoothing parameters corresponding to different cultural relic carrier materials (such as paper, bamboo / wood, and metal). The parameter range is set according to the material fiber orientation characteristics and texture density, and can be statically preset in memory or generated statistically from historical samples. The structural analysis window size is selected according to the material category and texture granularity; for example, 5×5 pixels can be selected for paper, 7×7 pixels for bamboo / wood, and 3×3 pixels for metal. The smoothing parameter (Gaussian kernel standard deviation) is dynamically adjusted according to the texture contrast to ensure local structural stability, and the structural tensor data is recalculated to adapt to the texture characteristics of different materials.
[0070] Matching parameters are based on texture response distribution characteristics or saliency indicators. Based on the correspondence with material categories, the optimal window size and convolution smoothing parameters are selected from the preset parameter library.
[0071] Structural tensor data can stably represent local directional structures, and the main propagation direction of the material can be extracted through eigenvalue decomposition. By introducing background texture analysis and parameter matching mechanisms, the orientation field calculation is adapted to the material category, improving the accuracy of orientation extraction and avoiding misjudgment of orientation due to differences in texture between different materials.
[0072] Step S2: Determine whether a pixel has directional features based on the degree of difference between the feature values in the structural tensor data. For pixels with directional features, retain their main direction data. For pixels without directional features, generate supplementary direction data through neighborhood direction interpolation. Perform completion processing on the initial material degradation propagation direction field data and further perform continuity enhancement processing to generate material degradation propagation direction field data covering the entire image area.
[0073] The initial material degradation propagation direction field data undergoes continuity enhancement processing, including: establishing directional adjacency relationships based on the neighborhoods between pixels in the initial material degradation propagation direction field data; performing consistency judgment on the directional data within the neighborhoods, with the neighborhood range determined based on the sliding window range or spatial distance constraints; performing directional smoothing processing on regions with drastic directional changes, adjusting the directional data through neighborhood consistency constraints to create a continuous transition structure in space; and generating supplementary directional data by performing directional interpolation on regions without obvious main directional features, referencing surrounding directional pixels. Through the above processing, material degradation propagation direction field data covering the entire image region is formed.
[0074] The directional features of pixels are determined based on the degree of difference among the feature values in the structural tensor data. Pixels with directional features retain their main direction data; for pixels without directional features, supplementary direction data is generated through neighborhood direction interpolation.
[0075] Based on the initial material degradation propagation direction field data, pixel neighborhood directional adjacency relationships are established, and consistency judgment is performed on the directional data within the neighborhood. When a region with drastic directional changes is detected, directional smoothing processing is performed to create a continuous transition structure in the spatial direction data.
[0076] By using neighborhood interpolation and continuity enhancement, voids or breaks in the orientation field are avoided, ensuring that the orientation field data of material degradation propagation is continuously distributed throughout the entire image area, providing a stable physical constraint basis for subsequent consistency calculations and diffusion control.
[0077] Step S3: Extract semantic feature data of text regions in the document image of the cultural relic to be restored through a deep neural network, and extract gradient direction data at the boundary of text defects. Calculate the directional consistency between the gradient direction data and the material degradation propagation direction field data to generate anisotropic coherence index data.
[0078] The generation of anisotropic coherence index data includes: locating the boundary position of the text defect region and extracting the gradient direction sequence of the boundary pixels; retrieving the material propagation direction data corresponding to the spatial position of the boundary pixels in the material degradation propagation direction field data; evaluating the degree of direction consistency between the gradient direction sequence and the material propagation direction data to generate original direction consistency score data; and performing normalization processing on the original direction consistency score data to form anisotropic coherence index data, which is used to characterize the degree of dominance of the material structure on the text defect morphology.
[0079] Semantic feature data of text regions in the document image of the cultural relic to be restored are extracted using a deep neural network, and the boundary position of the missing text region is located. The gradient direction sequence of the boundary pixels is extracted.
[0080] Retrieve material propagation direction data corresponding to the spatial location of boundary pixels from the material degradation propagation direction field data. Evaluate the degree of directional consistency between the gradient direction sequence and the material propagation direction data.
[0081] Considering the potential local distortions at text boundaries, a single vector inner product cannot fully represent the physical dominance. This scheme introduces a spatial weighting operator to calculate the projected overlap between the gradient field of the defective boundary and the material propagation direction field within the integration region. Based on the manifold alignment relationship of local vectors, the original directional consistency score data can be calculated by constructing a directional consistency score function. In this embodiment, the directional consistency score function is calculated in the following form:
[0082] ;
[0083] in, The original directional consistency score data is a scalar value that quantifies the coupling degree between the morphology of text defects and the physical texture of materials. It is obtained by analyzing the local neighborhood set of the text defect boundary. All pixels within The result is obtained by weighted spatial integration. Specifically, the formula contains... The gradient magnitude at pixel p is extracted by the system by performing a first-order spatial derivative operation on the image. Here, it is used as a weighting factor to measure the salience of the edge, so as to ensure that obvious broken edges dominate the scoring. and These represent the normalized boundary gradient direction vector and the material propagation direction vector, respectively. The former is calculated by extracting the normal direction from the edge of the missing text region, while the latter is directly retrieved from the material degradation propagation direction field data generated in step S1, based on the spatial coordinates of the current pixel. The absolute value of the inner product between the two vectors is used to accurately quantify the cosine similarity or alignment between the text boundary direction and the material texture direction on the geometric manifold; the denominator is the sum of the gradient magnitudes of all pixels in the local neighborhood, and a very small normal value pre-set in the system memory is deliberately introduced. As a numerical stability protection term, it effectively prevents division-by-zero anomalies caused when a local region is completely flat and without edges. By performing the above integral calculation with local gradient magnitude as the weight through the central processing unit, the system can accurately calculate the original directional consistency score representing the physical dominance force, and output it as the basic data to the subsequent normalization processing and gating weight allocation module.
[0084] Normalization is performed on the original directional consistency score data to generate anisotropic coherence index data.
[0085] When the morphology of text defects aligns with the direction of material degradation, it indicates that the material structure plays a dominant role in the defect's formation. Lower consistency suggests the defect is more likely caused by external interference. This relationship can be quantified using anisotropic coherence index data, providing a basis for subsequent weight adjustments and enabling a coupled semantic and physical judgment.
[0086] Step S4: Based on the anisotropic coherence index data, the weight ratio of semantic feature data and material degradation propagation direction field data in the feature fusion process is dynamically adjusted through an adaptive gating mechanism to generate fused feature data.
[0087] The adaptive gating mechanism includes: constructing a weight adjustment module containing nonlinear activation units, taking anisotropic coherence index data as input signals, and calculating and outputting physical constraint weight data and semantic guidance weight data; performing element-level weighting processing on material degradation propagation direction field data and semantic feature data respectively to generate weighted physical feature data and weighted semantic feature data; concatenating the two types of weighted features in the channel dimension, and performing feature integration processing through a dimension reduction convolutional layer to form fused feature data for subsequent reconstruction steps.
[0088] A weight adjustment module containing nonlinear activation units is constructed. Anisotropic coherence index data is taken as input, and physical constraint weight data and semantic guidance weight data are calculated and output.
[0089] To achieve a smooth transition between physical constraints and semantic guidance and avoid artifacts at the fusion boundary, a gated mapping logic based on Boltzmann distribution characteristics needs to be constructed. The redistribution of feature energy is controlled by an anisotropic coherence index, and a gated weight mapping function is constructed based on the complementary constraint relationship between the index and weights:
[0090] ;
[0091] In this embodiment, the gating weight mapping formula is used to dynamically output physical constraint weight data. With semantically guided weight data This achieves a nonlinear adaptive balance between material evolution constraints and deep learning semantic inference during the feature fusion stage. Specifically, the input variables in this system of equations... The anisotropic coherence index data obtained after normalization in step S3 represents the input as an independent variable into the activation unit constructed based on the logistic regression principle; the parameters in the formula A pre-defined threshold offset is used to precisely define the coherence critical point at which physical features begin to dominate, while the parameter... This is the kurtosis adjustment coefficient, used to control the rate at which the weights smoothly transition from semantic guidance to physical constraints when crossing this critical point. These two hyperparameters... and All data are pre-calculated by the system on a validation set containing a massive amount of diverse degraded cultural relics. After offline training and grid search optimization, the data is stored in the processor's non-volatile memory and directly accessed. Adaptive adjustments or segmented selections are made based on different cultural relic types or degrees of degradation. Upon successful calculation... Subsequently, the system performs synchronous computation based on linear complementary logic. One important engineering parameter introduced here is the semantic preservation factor. This factor is an empirical weight constant pre-calibrated by the system based on the complexity of the characters and the topological complexity of the characters on the artifact to be restored. Its core function is to establish a defense mechanism to ensure that even under conditions of extremely high physical coherence... Even under extreme conditions approaching 1 full load, the system can still forcibly retain some of the underlying glyph semantic features, fundamentally preventing the pixel reconstruction of the missing areas from completely degenerating into pure background material texture. By executing the above mapping equation at high speed through the central processing unit, the system can output these two sets of weighted data with dynamic complementary relationships in real time and seamlessly connect them to the subsequent element-level weighting and channel splicing fusion process.
[0092] Element-wise weighting is applied to the material degradation propagation direction field data and semantic feature data to generate weighted physical feature data and weighted semantic feature data, respectively. The two types of weighted features are then concatenated along the channel dimension, and feature integration processing is performed through a dimensionality reduction convolutional layer to form fused feature data.
[0093] Principle and Effect: The adaptive gating mechanism enables the fusion process to have regional adaptability. When the material structure strongly dominates the defect morphology, the weight of physical constraints is increased; when the semantic information is more reliable, the weight of semantic guidance is increased. This mechanism avoids structural distortion caused by a single feature dominating the process and improves the rationality of the repair.
[0094] Step S5 involves mapping the fused feature data to diffusion control data and performing direction-restricted diffusion reconstruction processing based on the material degradation propagation direction field data to complete the pixel-filled text defect area and output the repaired text image data. The direction-restricted diffusion reconstruction processing includes: converting the fused feature data into diffusion control data, which defines the directional bias relationship when updating pixels within the defect area; during diffusion iteration, limiting the update amplitude of pixels along the material degradation propagation direction to be higher than the update amplitude in its normal direction, thereby forming a structural extension with directional consistency; performing continuous correction processing on the defect area boundary after each round of diffusion until the pixel completion result meets the preset stopping condition, generating the repaired text image data; before executing step S5, a physical consistency verification step is also included: applying directional perturbation within a preset amplitude range to the material degradation propagation direction field data to generate perturbation direction field numbers. The process involves: recalculating fused feature data based on perturbed directional field data and comparing the differences with fused feature data under undisturbed conditions; triggering a gating mechanism parameter adjustment process and recalculating the weight allocation ratio when the difference exceeds a preset threshold; performing multiple rounds of perturbed verification until the fused feature response stabilizes; performing degradation propagation trend simulation processing based on material degradation propagation directional field data, including: constructing a directional adjacency propagation network structure, where nodes represent pixels in the degradation region and edges represent directional relationships; performing multiple rounds of directional propagation update calculations based on the propagation network structure to generate pixel-level propagation intensity distribution data; identifying high-risk areas that may expand in the future based on the propagation intensity distribution data and generating future damage risk distribution data; associating and storing the future damage risk distribution data with the repaired text image data, and generating risk identification information based on the future damage risk distribution data to mark potential high-risk areas.
[0095] The fused feature data is mapped to diffusion control data, which defines the directional bias relationship when pixels are updated within the defective region.
[0096] To ensure that the pixel completion process strictly adheres to the physical texture of the material and prevents lateral overflow that could lead to blurred strokes, the fused features need to be mapped to an anisotropic diffusion tensor. By constructing a feature-guided diffusion kernel function, the diffusion process exhibits asymmetry in the field tangent and normal directions, thus yielding the direction-constrained diffusion control equation:
[0097] ;
[0098] In this embodiment, the direction-restricted diffusion equation is used to transform the fused feature data into a diffusion control tensor with spatial anisotropy during the diffusion iteration process. This drives the pixel values of the missing text areas to evolve and reconstruct along a specific physical trajectory. (The left side of the formula...) The rate of change of image pixel values with iteration step size t is represented by the divergence operator. With gradient operator A linear combination of these elements simulates the transmission process of image signals in a non-uniform medium; the core tensor... The construction of this is coupled with multi-dimensional physical constraints, among which The response intensity is extracted from the fusion feature data output in step S4 after channel energy modulus calculation, and is used to dynamically control the overall activation gain of the diffusion process; and These represent the tangent direction vector indexed in real time from the material degradation propagation direction field data and the orthogonal normal direction vector obtained through a 90-degree rotation transformation, respectively. The two are used to construct a direction-guiding basis through tensor product operations. and In the formula and It is the anisotropic diffusion coefficient preset in the system parameter dictionary. and The settings are based on material orientation consistency requirements or diffusion stability constraints, and are configured accordingly. The value is significantly greater than The system enforces a significantly higher diffusion rate along the tangent of the material texture than along the normal, thus guiding the completed character strokes to exhibit a strip-like extension consistent with the material fibers at the microscopic level. By having the central processing unit calculate this diffusion tensor and update the pixel distribution in real time during each iteration, the system can output physically reasonable and boundary-continuous repaired text image data.
[0099] During the diffusion iteration process, the update magnitude of pixels along the material degradation propagation direction is limited to be higher than that in the normal direction. After each round of diffusion, the boundary of the defect region is continuously corrected until a preset stopping condition is met.
[0100] The preset stopping conditions include at least one of the following: the pixel update magnitude is lower than the preset convergence threshold; the change in diffusion results over multiple consecutive rounds is less than the preset stability threshold; or the preset maximum number of iterations is reached.
[0101] Before diffusion is performed, physical consistency is checked, directional perturbation within a preset amplitude range is applied to the material degradation propagation direction field data, perturbation direction field data is generated, and fusion feature data is recalculated.
[0102] To quantify the robustness of the repair algorithm to physical disturbances, it is necessary to detect the manifold distance in the feature space before and after the perturbation. By calculating the normalized residuals between the perturbed and original feature vectors, and based on the degree of variation in the feature responses, a stability difference metric equation is constructed:
[0103] ;
[0104] In this embodiment, the stability difference metric equation is used to quantify the output response deviation of the repair system when subjected to physical disturbances, thereby determining the robustness of the fusion mechanism under complex texture interference and deciding whether to trigger the automatic backtracking and readjustment process of the gating parameters. The formula... This represents the final calculated stability difference score scalar, which is obtained by normalizing the square root of the feature manifold distance before and after the perturbation in the pixel space; where... It is the initial fused feature vector output in step S4 under the guidance of the original material degradation propagation direction field, and The system regenerates a perturbation fusion feature vector after applying a preset amplitude (the amplitude of the perturbation is selected within a preset angle range, which is determined based on the structural orientation stability or noise level, preferably ±1° to ±10°) to the orientation field. Both perturbations are obtained at a specific pixel position p by reading the depth channel value of the fused feature map. The numerator of the formula utilizes the Frobenius norm operator. The residuals of the two feature tensors are spatially accumulated pixel-by-pixel to capture the incremental perturbation of high-dimensional semantic features caused by minute directional shifts; the denominator is calculated by accumulating the energy magnitude of the original feature vectors and pre-setting a minimal regularization term in the system memory. To prevent numerical overflow, adaptive normalization of the difference intensity is implemented. The system executes this metric equation through the central processing unit, enabling real-time monitoring of the stability of the repair logic when scoring... When the preset stability threshold is exceeded, it is determined that there is a directional conflict between the current physical constraints and the semantic meaning of the glyphs, thereby forcibly activating the parameter correction mechanism of the gating module until the fused feature response reaches a convergent equilibrium state. The preset threshold is selected based on at least one of the following: material type, image resolution, and texture complexity.
[0105] In this embodiment, to ensure the repeatability and adaptability of the preset threshold, the system can select the threshold based on the following strategy:
[0106] Fixed value method: Preset threshold can be used Set within an empirical range, such as 0.01–0.1, to determine whether the deviation of the fusion feature response exceeds an acceptable stability range;
[0107] Adaptive approach: Based on the material type, texture characteristics, or image resolution of the cultural relic document to be restored, the average stability difference under the perturbation of fused features is statistically analyzed from the training samples, and a dynamic threshold is generated proportionally.
[0108] When calculated Greater than the selected preset threshold When this happens, the gating mechanism parameter adjustment process is triggered, and the weights of the fused features are reallocated, thereby ensuring the stability of the system output fused features under physical disturbances.
[0109] When the difference exceeds the threshold, the gating mechanism parameter adjustment process is triggered.
[0110] In addition, a directional adjacency propagation network structure is constructed to perform degradation propagation trend simulation processing, generate future damage risk distribution data, and associate and store it with the repaired text and image data.
[0111] Directionally restricted diffusion ensures pixel completion follows the material structure orientation, avoiding disordered lateral diffusion. Physical consistency verification enhances system robustness. Propagation trend simulation expands the application boundaries of the method, extending its functionality from repair to prediction.
[0112] Example 2
[0113] A deep learning-based system for the restoration of cultural relics documents, images, and text can be embedded as a core functional component into digital cultural product creation software. This allows users to perform high-quality restoration and layer editing of cultural relics assets during the development of digital audiovisual, virtual reality, or interactive multimedia products. The system includes:
[0114] The data acquisition module is used to acquire document images of the cultural relics to be restored and construct structural tensor data;
[0115] The orientation field generation module is used to generate continuous material degradation propagation orientation field data;
[0116] The coherence assessment module is used to generate anisotropic coherence index data;
[0117] The feature fusion module is used to generate fused feature data based on anisotropic coherence index data;
[0118] The directional reconstruction module is used to perform directionally restricted diffusion reconstruction processing and output the repaired text image data.
[0119] The predictive analysis module is used to generate data on the distribution of future damage risks and output risk identification information.
[0120] Example 3
[0121] Application Examples Based on Paper-based Cultural Relics
[0122] Paper materials typically contain fiber orientations, and degradation defects often extend or tear along these fiber directions. Therefore, when constructing the structural tensor data in step S1, a relatively small sliding window size is preferred to improve the response sensitivity to fine-scale changes in fiber orientation. In multi-scale, multi-directional filtering, it is preferable to enhance the weights of mid-to-high frequency texture responses to more accurately extract the main fiber propagation direction data.
[0123] In step S2, since the paper fiber distribution has a certain degree of discreteness but the overall direction is relatively clear, the direction field smoothing amplitude is set to a low level, and only the abrupt regions are subjected to slight continuity enhancement processing to avoid excessive smoothing that would cause the loss of fine fiber direction.
[0124] Steps S3 to S5 remain consistent with Example 1, adjusting the fusion ratio of semantic feature data and material degradation propagation direction field data using anisotropic coherence index data, and performing direction-restricted diffusion reconstruction processing. In the paper scenario, this method enables pixel completion of text defect boundaries to extend along the fiber direction, thereby improving the rationality and stability of the repair result at the material physical structure level.
[0125] Furthermore, in this embodiment, the repaired text and image data output by the directional reconstruction module can be directly exported as a high-definition lossless layer to the digital cultural product production software, so that digital artists can carry out the digital reproduction of ancient books, layered rendering of e-books, and design and production of digital publications within the software.
[0126] Example 4
[0127] Application Examples Based on Wooden Cultural Relics Carriers
[0128] Wood materials typically exhibit a distinct main grain direction, with degradation cracks often extending along the growth rings or longitudinal fibers, resulting in strong overall directional continuity. Therefore, when constructing the structural tensor data in step S1, the sliding window scale can be appropriately increased to enhance the statistical stability of long-scale continuous textures and improve the robustness of main direction extraction.
[0129] In step S2, since the main direction of the wood grain is continuous and changes slowly, the orientation field smoothing process can be performed over a large neighborhood to enhance orientation consistency and eliminate local noise interference. Meanwhile, neighborhood orientation interpolation is only enabled in areas of severe local corrosion, and the overall interpolation intensity is lower than in the paper scene.
[0130] The semantic feature extraction, anisotropic coherence index calculation, adaptive gating mechanism, and directionally restricted diffusion reconstruction process in steps S3 to S5 remain unchanged. In the case of wooden tablets, this method can make the reconstruction trend of the missing text area consistent with the main direction of the wood grain, thereby avoiding structural distortion caused by lateral diffusion and improving the overall consistency of the restoration results.
[0131] The reconstructed high-quality images will be used as high-fidelity texture materials in the creation of 3D ancient buildings and digital twin scenic spots by digital cultural product production software, effectively avoiding the impact of blurry or stretched text on the visual immersion of digital cultural products.
[0132] Example 5
[0133] Application Examples Based on Metal Carriers
[0134] Corrosion defects in metallic materials often extend along grain boundaries or stress release paths, with enhanced directional consistency in local areas, but overall variations may exist across different regions. Therefore, when constructing structural tensor data in step S1, the sliding window size is kept at a moderate scale to balance local grain boundary orientation identification with regional stability.
[0135] In step S2, the importance of the neighborhood orientation interpolation strategy increases because the etched region may exhibit directional fractures or localized multidirectional expansion. For pixel regions without obvious dominant directional features, supplementary orientation data is generated by performing orientation interpolation with reference to surrounding directional pixels to ensure continuous coverage of the material degradation propagation orientation field data within the etched region. Simultaneously, the orientation smoothing intensity is set to a medium level to prevent excessive smoothing of grain boundary details.
[0136] The processing flow of steps S3 to S5 is consistent with that of Example 1. By adjusting the fusion feature ratio through directional consistency calculation and adaptive gating mechanism, and performing directionally restricted diffusion reconstruction processing, the pixel completion process is made to proceed along the corrosion propagation trend, thereby improving the rationality of the metal inscription text restoration results at the physical propagation level and enhancing the stability of the prediction of future corrosion propagation trends.
[0137] Meanwhile, the future damage risk distribution data and risk identification information output by the predictive analysis module can be connected in real time to the special effects animation engine of digital cultural product production software to drive and guide the scientific and realistic simulation of material evolution and erosion effects of metal inscriptions in digital cultural heritage animations and dynamic documentary demonstrations.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them; although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation methods of the present invention or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of the present invention, and all such modifications should be covered within the scope of the technical solutions claimed in the present invention.
Claims
1. A method for image and text restoration of cultural relics documents based on deep learning, characterized in that, Includes the following steps: Step S1: Obtain the document image of the cultural relic to be restored, perform background texture analysis on the document image of the cultural relic to be restored, construct structural tensor data reflecting local structural features, and extract the main propagation direction data of material degradation based on the structural tensor data to generate the initial material degradation propagation direction field data covering the image area. Step S2: Determine whether a pixel has directional features based on the degree of difference between the feature values in the structural tensor data. For pixels with directional features, retain their main direction data. For pixels without directional features, generate supplementary direction data through neighborhood direction interpolation. Perform completion processing on the initial material degradation propagation direction field data and further perform continuity enhancement processing to generate material degradation propagation direction field data covering the entire image area. Step S3: Extract semantic feature data of text regions in the document image of the cultural relic to be restored through a deep neural network, and extract gradient direction data at the boundary of text defects. Calculate the directional consistency between the gradient direction data and the material degradation propagation direction field data to generate anisotropic coherence index data. Step S4: Based on the anisotropic coherence index data, the weight ratio of semantic feature data and material degradation propagation direction field data in the feature fusion process is dynamically adjusted through an adaptive gating mechanism to generate fused feature data. Step S5: Map the fused feature data to diffusion control data, and perform direction-restricted diffusion reconstruction processing based on the material degradation propagation direction field data to complete the pixel missing areas of the text and output the repaired text image data.
2. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, Step S1 involves constructing structural tensor data, which includes: performing gradient calculations on the image of the cultural relic to be restored in both the horizontal and vertical directions to form local gradient distribution data; constructing second-order structural matrix data based on the local gradient distribution data, and performing weighted accumulation processing on the second-order structural matrix data within a preset sliding window range to generate structural tensor data; subsequently, performing feature decomposition processing on the structural tensor data to obtain eigenvalues and corresponding eigenvector data, selecting the eigenvector data with the largest eigenvalue as the local principal direction data, and filtering out stable principal direction data based on the degree of difference in eigenvalues to construct the initial material degradation propagation direction field data.
3. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, Step S2 performs continuity enhancement processing on the initial material degradation propagation direction field data, including: establishing directional adjacency relationships based on the neighborhoods between pixels in the initial material degradation propagation direction field data, and performing consistency judgment on the directional data within the neighborhoods; performing directional smoothing processing on regions with drastic directional changes, adjusting the directional data through neighborhood consistency constraints, so that the directional data forms a continuous transition structure in space; for regions without obvious main directional features, performing directional interpolation to generate supplementary directional data by referring to surrounding directional pixels; and forming material degradation propagation direction field data covering the entire image area through the above processing.
4. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, Step S3, generating anisotropic coherence index data, includes: locating the boundary position of the text defect area and extracting the gradient direction sequence of the boundary pixels; retrieving the material propagation direction data corresponding to the spatial position of the boundary pixels in the material degradation propagation direction field data; evaluating the degree of direction consistency between the gradient direction sequence and the material propagation direction data to generate original direction consistency score data; and performing normalization processing on the original direction consistency score data to form anisotropic coherence index data.
5. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, The adaptive gating mechanism in step S4 includes: constructing a weight adjustment module containing nonlinear activation units, taking the anisotropic coherence index data as the input signal, and calculating and outputting physical constraint weight data and semantic guidance weight data; performing element-level weighting processing on the material degradation propagation direction field data and semantic feature data respectively to generate weighted physical feature data and weighted semantic feature data; concatenating the two types of weighted features in the channel dimension, and performing feature integration processing through a dimension reduction convolutional layer to form fused feature data.
6. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, Step S5, the direction-restricted diffusion reconstruction process, includes: converting the fused feature data into diffusion control data, which defines the directional bias relationship when updating pixels in the defective region; during the diffusion iteration process, restricting the update amplitude of pixels along the material degradation propagation direction to be higher than the update amplitude in its normal direction; and performing continuous correction processing on the boundary of the defective region after each round of diffusion until the pixel completion result meets the preset stopping condition, thereby generating the repaired text image data.
7. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, Before executing step S5, a physical consistency verification step is also included: applying directional perturbation within a preset amplitude range to the material degradation propagation direction field data to generate perturbed direction field data; recalculating the fused feature data based on the perturbed direction field data and comparing the difference with the fused feature data under the unperturbed condition; when the degree of difference exceeds a preset threshold, triggering the gating mechanism parameter adjustment process and recalculating the weight allocation ratio; and performing multiple rounds of perturbation verification until the fused feature response is stable.
8. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, The background texture analysis in step S1 also includes: performing convolution operations on the document image of the cultural relic to be restored using a multi-scale, multi-directional filter bank to obtain texture response data in different directions; extracting texture response distribution features based on the distribution features of the texture response data; identifying the material category of the cultural relic carrier based on the texture response distribution features; calling the corresponding structural analysis window size and smoothing parameters from the preset parameter library according to the identified material category; and recalculating the structural tensor data using the matching parameters.
9. The method for image and text restoration of cultural relics documents based on deep learning according to claim 1, characterized in that, The method also includes performing degradation propagation trend simulation processing based on material degradation propagation direction field data, including: constructing a directional adjacency propagation network structure, where nodes represent pixels in the degradation region and edges represent directional relationships; performing multi-round directional propagation update calculations based on the propagation network structure to generate pixel-level propagation intensity distribution data; identifying high-risk areas that may expand in the future based on the propagation intensity distribution data and generating future damage risk distribution data; associating and storing the future damage risk distribution data with the repaired text image data, and generating risk identification information based on the future damage risk distribution data to mark possible high-risk areas.
10. A deep learning-based system for restoring text in images of cultural relics documents, characterized in that: include: The data acquisition module is used to acquire document images of the cultural relics to be restored and construct structural tensor data; The orientation field generation module is used to generate continuous material degradation propagation orientation field data; The coherence assessment module is used to generate anisotropic coherence index data; The feature fusion module is used to generate fused feature data based on anisotropic coherence index data; The directional reconstruction module is used to perform directionally restricted diffusion reconstruction processing and output the repaired text image data. The predictive analysis module is used to generate data on the distribution of future damage risks and output risk identification information.