A method and system for structuring and analyzing Chinese character text based on a shape-root topology relationship diagram
Patent Information
- Application Number
- CN202610917437.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]因此,本发明提供了一种基于形根拓扑关系图的汉字文本结构化解析方法及系统,解决现有汉字识别与结构分析技术中,难以从汉字图像自动提取形根、识别形根间空间拓扑关系、并对复杂汉字结构进行递归拆解问题
[0016]本发明有益效果为:本发明通过采集汉字文本图像并执行标准化处理,利用深度神经网络提取形根边界特征并生成统一边界响应图;基于连通域分析与结构一致性评分提取形根节点及其空间关系,构建形根关系图;对形根关系图进行全局结构能量计算与结构类型判别,通过递归拆分与最优切分函数逐层分解为最小形根单元,输出标准化的结构化形根关系图。本发明实现了从汉字图像到结构化形根拓扑关系的端到端解析,有效提升了汉字结构分析的准确性与鲁棒性,可广泛应用于汉字字形检索、书法风格分析、汉字教学辅助等领域,本发明与表意AI理论中的形根解析器形成完整技术闭环,可为汉字字形检索、书法风格分析、汉字教学辅助等应用提供结构化形根数据支撑。
Smart Images

Figure CN122990724A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Chinese character information processing and image recognition technology, and in particular to a method and system for structured parsing of Chinese character text based on root topology graphs. Background Technology
[0002] Traditional optical character recognition (OCR) technologies primarily target whole-character matching, mapping Chinese character images to preset character categories using template matching or deep learning classifiers. However, these methods suffer significant accuracy drops when dealing with non-standard fonts such as handwriting, artistic fonts, and rubbings from stone inscriptions due to factors like stroke deformation, ligatures, and incompleteness. On the other hand, existing Chinese character structure analysis methods often focus on stroke-level extraction and organization, obtaining stroke sequences through techniques like skeletonization and stroke tracking. These methods require high image quality, and the stroke extraction process is susceptible to noise interference, leading to broken or fused strokes that affect subsequent structural analysis. Furthermore, the granularity of stroke-level analysis is too fine, failing to directly reflect the combination relationships and spatial layout between the radicals of Chinese characters, thus unable to meet the needs of advanced applications such as Chinese character shape retrieval, calligraphy style analysis, and Chinese character teaching aids. In recent years, deep learning-based image segmentation technology has made significant progress in object detection and semantic segmentation. However, when directly applied to the segmentation of Chinese character radicals, the following shortcomings still exist: First, Chinese character radicals are diverse and varied in form, making it difficult for a single segmentation model to cover all radical variants; second, the segmentation results only remain at the pixel level, lacking explicit modeling of the spatial topological relationships between radicals, thus failing to form structured analytical results. Therefore, there is an urgent need for a method that can automatically extract radicals from Chinese character images, identify the spatial relationships between radicals, and construct a structured radical topological relationship graph to fill the gap in deep analysis of Chinese character structure in existing technologies. This invention, based on the "Morpho-Root" theory proposed in Chapter 5 of this book, regards Chinese character radicals as structured cognitive primitives and achieves automatic conversion from Chinese character images to radical topological relationship graphs through image analysis technology, providing a new technical path for Chinese character structure analysis. Summary of the Invention
[0003] In view of the aforementioned existing problems, the present invention is proposed.
[0004] Therefore, this invention provides a method and system for structured parsing of Chinese characters based on root topology graphs, which solves the problem in existing Chinese character recognition and structural analysis technologies that it is difficult to automatically extract roots from Chinese character images, identify spatial topological relationships between roots, and recursively decompose complex Chinese character structures.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for structured parsing of Chinese character text based on a root-based topological relationship diagram, comprising, The Chinese text image is acquired, standardized and converted into an input tensor. The input tensor is then fed into an encoder-decoder structure to generate a boundary probability map and a boundary gradient map, which are then fused into a unified boundary response map. Construct neighborhood windows for each pixel and calculate response concentration; build an adaptive threshold and further generate a binary map; based on the binary map, use BFS to construct initial connected components and construct a structure consistency scoring function. and output the set of connected components; Map each connected component to a graph node, define candidate edges, and construct a relation vector for each candidate edge; construct a geometric root relation graph based on the connected component nodes, valid edges, and edge weights. Perform global structural energy calculation on the root graph, calculate the structural discrimination function, filter out candidate edges, enumerate the set of effective partitioning schemes, and split the root graph into multiple subgraphs.
[0006] As a preferred embodiment of the Chinese character text structure parsing method based on root topology graphs described in this invention, the steps of acquiring the Chinese character text image, performing standardization and converting it into an input tensor refer to acquiring the Chinese character text image and converting it into a grayscale image. For grayscale images Calculate the center of brightness ; Calculate pixel distribution dispersion based on brightness center. ; Normalization is performed on each pixel to obtain a normalized pixel image. ; Normalized pixel image Add a grayscale channel and convert it into an input tensor. .
[0007] As a preferred embodiment of the Chinese character text structured parsing method based on root topology graphs described in this invention, the step of inputting the input tensor into the encoder-decoder structure, generating boundary probability graphs and boundary gradient graphs, and fusing them into a unified boundary response graph refers to inputting the input tensor... Preliminary processing yields initial features Subsequently, progressive convolution and max pooling are used to expand channels and downsample spatially, ultimately yielding bottleneck features. ; Bottleneck characteristics The input to the decoder is progressively upsampled and convolutionally processed to restore the spatial resolution, and then fused with the features from the corresponding coding layers to obtain the final output features. ; Based on the final features of the decoder Construct boundary probability maps respectively With boundary gradient map ; Based on boundary probability graph With boundary gradient map Constructing a unified boundary response diagram :
[0008] in, , These are probability weighting coefficients. To prevent extremely small constants with a denominator of 0.
[0009] As a preferred embodiment of the Chinese character text structured parsing method based on root topology graph described in this invention, wherein: constructing a neighborhood window for each pixel and calculating the response concentration, constructing an adaptive threshold, and further generating a binary graph refer to any pixel... Build neighborhood window ; Calculate the mean local response based on the neighborhood window. ; Further calculation of local response energy ; Based on local response mean and local response energy Calculate response concentration ; Based on local response mean and response concentration Constructing an adaptive threshold ; According to the boundary response diagram and adaptive threshold Generate binary image .
[0010] As a preferred embodiment of the Chinese character text structure parsing method based on root topology graphs described in this invention, the method involves: constructing an initial connected component using BFS based on a binary graph, and then constructing a structure consistency scoring function. The output set of connected components refers to the initial connected components constructed using BFS based on the binary graph. After completing the initial connected component partitioning, a boundary response graph-based approach is introduced. Consistency constraints, for any connected component Define its response energy Compared with average response :
[0011] in, Indicates the number of pixels in the connected components; Construct a structural consistency scoring function ; The final output is a set of connected components. And each connected component It includes structural features.
[0012] As a preferred embodiment of the Chinese character text structured parsing method based on root topology graphs described in this invention, wherein: mapping each connected component to a graph node, defining candidate edges, and constructing a relation vector for each candidate edge refers to mapping each connected component to a graph node. Mapped to graph nodes and define node attribute vectors ; For any node pair A deterministic candidate selection rule is adopted to construct a joint distance function. ; Based on joint distance function Construction scale normalized distance At the same time, define the response consistency function. ; Based on scale-normalized distance and response consistency function Define candidate edges, for each candidate edge Construct relation vectors .
[0013] As a preferred embodiment of the Chinese character text structure parsing method based on the root topology graph described in this invention, wherein: the construction of the root relationship graph based on connected component nodes, valid edges, and edge weights refers to defining 12 types of spatial relationship sets. The probability of the relationship is calculated as follows: ; Based on the probability of the relationship... Determine the final relationship category ; According to relation category Define weight function ; According to the weighting function Define the final edge weight ; Construct a geometric root relation graph based on connected component nodes, valid edges, and edge weights. .
[0014] As a preferred embodiment of the Chinese character text structured parsing method based on root topology graphs described in this invention, the step of performing global structural energy calculation on the root graph and calculating the structure discrimination function refers to performing global structural energy calculation on the root graph G and defining the overall structural energy of the current graph. ; Calculate the strength of vertical structures Horizontal structural strength Enclosing structural strength ; Based on vertical structural strength Horizontal structural strength Enclosing structural strength Calculate the structure discriminant function .
[0015] As a preferred embodiment of the Chinese character text structured parsing method based on the root topology graph described in this invention, the step of selecting candidate edges and enumerating the set of effective segmentation schemes to split the root graph into multiple subgraphs refers to selecting a structure discrimination function. The structure type corresponding to the component with the largest value is used as the sole output. The three features of the structure discriminant function correspond to the top-bottom structure, left-right structure, and enclosing structure, respectively. according to The difference lies in the edge set. Candidate edges that conform to the structural orientation are selected from the data. ; Based on candidate edges Enumerate the set of valid partitioning schemes ; For each Calculate the evaluation function ; Select the optimal segmentation According to the optimal segmentation , the root relationship diagram The graph is recursively split into multiple subgraphs, and the final root analysis result dataset is output. Secondly, this invention provides a Chinese character text structure parsing system based on a root topology graph, comprising: The image input interface module is used to receive bitmaps of Chinese text, perform grayscale and standardization preprocessing on the image, and transmit the standardized input tensor to the next module. The root boundary detection module is connected to the image input interface module. It has a built-in deep neural network model to extract the root boundary features in Chinese character images, generate boundary probability maps and boundary gradient maps, and fuse them into a unified boundary response map. The root connected component extraction module, connected to the root boundary detection module, is used to perform binarization processing on the unified boundary response map based on an adaptive threshold, and extract the root connected components and associated structured features. The spatial relationship identification module is used to determine the spatial relationship type between the roots and assign weights based on the centroid coordinates and bounding box parameters of the root connected domains. The root relationship graph construction module is used to construct a root relationship graph based on root nodes and their spatial relationships, where the node set represents the root and the edge set represents the spatial relationship and weight between the root nodes. The recursive decomposition control module is used to recursively decompose the root relationship diagram. Through structural energy calculation, structural type determination and optimal cutting function, it decomposes the smallest root unit layer by layer. The output interface module is used to output a standardized structured root relationship diagram.
[0016] The beneficial effects of this invention are as follows: This invention acquires Chinese character text images and performs standardization processing; it then uses a deep neural network to extract root boundary features and generate a unified boundary response map; based on connected component analysis and structural consistency scoring, it extracts root nodes and their spatial relationships, constructing a root relationship map; it performs global structural energy calculation and structural type discrimination on the root relationship map, and decomposes it layer by layer into the smallest root units through recursive splitting and optimal segmentation functions, outputting a standardized structured root relationship map. This invention achieves end-to-end parsing from Chinese character images to structured root topological relationships, effectively improving the accuracy and robustness of Chinese character structure analysis. It can be widely applied in fields such as Chinese character shape retrieval, calligraphy style analysis, and Chinese character teaching assistance. This invention forms a complete technical closed loop with the root parser in ideographic AI theory, providing structured root data support for applications such as Chinese character shape retrieval, calligraphy style analysis, and Chinese character teaching assistance. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a Chinese character text structure parsing method based on a root topology graph, as shown in Example 1.
[0019] Figure 2 This is a structural diagram of a Chinese character text structured parsing system based on a root topology graph, as shown in Example 1. Detailed Implementation
[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0023] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for structured parsing of Chinese character text based on a root topology graph, including the following steps: S1. Obtain the Chinese text image, perform standardization and convert it into an input tensor; input the input tensor into the encoder and decoder, construct the boundary probability map and boundary gradient map, and further construct the unified boundary response map; Obtain Chinese character text images and convert them to grayscale images. For grayscale images Calculate the center of brightness :
[0024] in, Indicates the image height and width; Represents pixels The grayscale value at that location; Then calculate the pixel distribution dispersion based on the brightness center. :
[0025] Normalization is performed on each pixel to obtain a normalized pixel image. :
[0026] Normalized pixel image Add a grayscale channel and convert it into an input tensor. ; Input tensor Preliminary processing yields initial features Subsequently, progressive convolution and max pooling are used to expand channels and downsample spatially, ultimately yielding bottleneck features. :
[0027]
[0028] , ,
[0029]
[0030] in, Represents the ReLU activation function. This represents a 3×3 convolution operation, and BN represents batch normalization. Indicates will The sample was obtained by performing a 2×2 max pooling operation. Bottleneck characteristics The input to the decoder is progressively upsampled and convolutionally processed to restore the spatial resolution, and then fused with the features from the corresponding coding layers to obtain the final output features. : ; , ; , ; , ; Here, UpSample represents a 2×2 upsampling operation, implemented using a transposed convolution operation. This indicates feature concatenation, where Φ(·) is the ReLU activation function and BN is batch normalization. Based on the final features of the decoder Construct boundary probability maps respectively With boundary gradient map : ; ; in, Represents a 1×1 convolution mapping. This represents the Sigmoid function, used to compress the output to the range [0,1], indicating the probability of the boundary existing; This represents the Tanh activation function, used to preserve information about positive and negative gradient changes; boundary probability plot. A probability distribution representing the existence of pixel-level boundaries, used to characterize the spatial location of the root of Chinese characters; boundary gradient map. The intensity and direction information representing local structural changes are used to characterize the connection relationships of strokes and the features of structural abrupt changes; Based on boundary probability graph With boundary gradient map Constructing a unified boundary response diagram :
[0031] Among them, the probability weight coefficient is preferably selected as follows: , This ensures that semantic boundaries dominate the overall judgment while preserving the compensatory effect of gradients on weak boundaries. Boundary gradient map The maximum value in; To prevent extremely small constants with a denominator of 0; S2. Construct neighborhood windows for each pixel and calculate response concentration, build an adaptive threshold, and further generate a binary map; based on the binary map, use BFS to construct initial connected components and construct a structure consistency scoring function. and output the set of connected components; For any pixel Build neighborhood window The side length of the neighborhood window is:
[0032] in, Indicates the image height. Indicates the image width. Indicates the size of the local statistics window; Calculate the mean local response based on the neighborhood window. :
[0033] in, This indicates the number of pixels in the neighborhood window. This is the "position variable" used when traversing all pixels within a local window Ω centered at a certain pixel; Further calculation of local response energy :
[0034] Based on local response mean and local response energy Calculate response concentration :
[0035] in, To prevent the stability constant from having a denominator of zero; Based on local response mean and response concentration Constructing an adaptive threshold :
[0036] in, Indicates the response enhancement coefficient. This represents the concentration adjustment coefficient; the preferred value is [value missing]. , It can balance fine strokes and noise suppression; According to the boundary response diagram and adaptive threshold Generate binary image :
[0037] in, =1 indicates the boundary foreground. =0 indicates the background area; Based on the binary graph, the initial connected components are constructed using BFS; specifically, the label graph is first defined. and initialized to This indicates that all pixels initially do not belong to any connected component, and the current connected component number is set. Initialize an empty queue Then, the entire binary image is scanned pixel by pixel. For any pixel... If satisfied and If , then it is taken as the seed point of the current connected component, and let At the same time, add the point to the queue. This queue drives the BFS region expansion; During the BFS expansion process, the current pixel is retrieved from the queue. And define its 8-neighborhood:
[0038] For any neighboring pixels If both conditions are met and Then add it to the current connected component and assign a value. and joined the team This process iterates until the queue is empty, thus completing the first iteration. The complete growth of each connected component ensures that each connected component corresponds to a maximal connected subgraph. After completing the initial connected component partitioning, a boundary response graph-based approach is introduced. Consistency constraints, for any connected component Define its response energy Compared with average response :
[0039] in, Indicates the number of pixels in the connected components; Further construct the structural consistency scoring function :
[0040] in, Used to normalize the energy scale of different connected domains For the weighting coefficient, the preferred value is... To avoid large-area background noise being falsely amplified due to cumulative effect; when The connected component is determined to be an invalid region and removed, where the threshold is... A value of 0.25 is preferred, which allows weak strokes to be preserved while effectively suppressing isolated noise. The final output is a set of connected components. :
[0041] And each connected component Attached structured features:
[0042] in, This is a pixel mask, where a pixel is marked as 1 if it belongs to the connected component, and 0 otherwise. It is a circumscribed rectangle, specifically... , , , ,and ; This represents the area, specifically the number of pixels in the Mask with a value of 1. and These represent the boundary response energy and the average response intensity, respectively.
[0043] S3, connect each connected component Mapped to graph nodes Define candidate edges, for each candidate edge Construct relation vectors Construct a geometric root relation graph based on connected component nodes, valid edges, and edge weights. ; Each connected component Mapped to graph nodes and define node attribute vectors :
[0044] in, The coordinates of the centroid of the connected domain:
[0045]
[0046] The width and height of the bounding rectangle are represented by the Box property; The average boundary response intensity, , Represents connected components The pixel area, that is, the total number of pixels in the connected component; For response density, ; It is a stability constant used to avoid numerical instability in small connected regions; For any node pair A deterministic candidate selection rule is adopted to construct a joint distance function. :
[0047] Based on joint distance function Construction scale normalized distance :
[0048] in, This represents the maximum "combined size span" of two connected domains in space. Simultaneously define the response consistency function. :
[0049] Finally, the distance is normalized according to the scale. and response consistency function Define candidate edges:
[0050] Among them, spatial distance threshold Response consistency threshold A dual-threshold screening mechanism is constructed from two dimensions: spatial structure constraints and boundary response consistency constraints. The spatial reachability of the control root. By controlling the semantic response consistency of the radical, the noise connection rate can be significantly reduced while ensuring the structural integrity of Chinese characters. For each candidate edge Construct relation vectors :
[0051] wherein, , ; the scale-normalized overlap rate , , the overlapping width of two Boxes in the x direction = , the overlapping height of two Boxes in the y direction ; the normalized direction overlap rate , , is the difference between the abscissas of the center points of the two nodes, is the difference between the ordinates of the center points of the two nodes; c represents that if the Boxes of the two nodes have an inclusion relationship, the value is 1, otherwise it is 0; a set of 12 types of spatial relationships is defined , and the calculated relationship probability is :
[0052] wherein, the spatial relationships include a left-right structure, a top-bottom structure, an enclosing structure, a top-left structure, a top-right structure, a bottom-left structure, a bottom-right structure, a nested structure, a triangular structure, an intersecting structure, an overlapping structure, and a deformed structure; is the weight vector of the k-th type of relationship, which is obtained by constructing a training set (the relationship feature vectors of connected domains and the manually labeled spatial relationship categories), and performing gradient descent optimization under the constraint of the Softmax maximum likelihood loss function to obtain the final parameters, so that each type of spatial relationship forms a stable discriminant direction vector in the feature space; is the node pair relationship feature vector, is the spatial relationship category index; according to the relationship probability the final relationship category is determined :
[0053] For example, taking the Chinese character "Xi" as an example, the connected domain set of "Xi" , respectively correspond to the upper point, the middle point and the lower point of the three-dot water radical on the left, is the upper left-falling stroke and the like of the component "Xi"; for the node pair the calculation result is obtained as , , then ; according to the relationship category a weight function is defined :
[0054] wherein, This includes top-left structure, top-right structure, bottom-left structure, bottom-right structure, triangular structure, overlapping structure, and deformed structure; According to the weighting function Define the final edge weight :
[0055] Among them, the distance attenuation coefficient It is used to moderately exponentially attenuate the influence of spatial distance in the topological relationship modeling of Chinese character roots, so that the structural relationship of medium distance is preserved while the unstructured connection of long distance is effectively suppressed, thereby achieving the optimal balance between structural integrity and noise suppression. Construct a geometric root relation graph based on connected component nodes, valid edges, and edge weights. :
[0056] in, Represents graph nodes; The set of edges that satisfy the candidate conditions; Let it be the set of edge weights; S4. Perform global structural energy calculation on the root graph and calculate the structural discrimination function; select candidate edges and enumerate the set of effective partitioning schemes to split the root graph into multiple subgraphs; First, the global structural energy of the root graph G is calculated, and the overall structural energy of the current graph is defined. :
[0057] in, Indicates the number of edges; Calculate the strength of vertical structures Horizontal structural strength Enclosing structural strength :
[0058]
[0059]
[0060] in, , The global image width. H is the global image height; Indicates when node and The function takes a value of 1 when the ordinates are different, and 0 otherwise. Similarly; calculation The process is as follows: traverse each node in the subgraph, count the number of times it is surrounded by other nodes, divide by the total number of nodes to get the surrounded ratio of the node, and then take the average of the surrounded ratios of all nodes to get the surrounding structure strength of the entire subgraph. Based on vertical structural strength Horizontal structural strength Enclosing structural strength Calculate the structure discriminant function :
[0061] The preferred value for the weighting coefficient is... , , This ensures the integrity of components and enables better structural segmentation of components; the three features of the structural discrimination function correspond to the top-bottom structure, left-right structure, and enclosing structure, respectively. The structure type corresponding to the component with the largest value is selected as the unique output. :
[0062] according to The difference lies in the edge set. Candidate edges that conform to the structural orientation are selected from the data. If Type(G) is a top-bottom structure, then the horizontal cutting direction takes effect, retaining only those edges connecting nodes of different vertical levels as candidates. If Type(G) is a left-right structure, then the vertical cutting direction takes effect, retaining only edges connecting nodes at different horizontal levels as candidates. If Type(G) = enclosing structure, then the inner / outer separation direction takes effect: only edges with an inclusion relation indicator function value of 1 are retained as candidates, i.e. ; Based on candidate edges Enumerate the set of valid partitioning schemes Specifically, in obtaining the candidate edge set corresponding to the determined structure type... Then, all edges in the set are sorted in ascending order of edge weight, and incrementally increasing subsets of edges are generated as candidate splitting schemes. (in That is, first construct a partition that contains only the minimum edge weight. Subsequently, the smaller side weights were gradually introduced to form until all candidate edges are included. For each candidate segmentation scheme In the original graph G, temporarily delete the edges contained therein, and check the number of connected components in the remaining graph: if the graph splits into at least two disconnected subgraphs after deletion, then accept the splitting scheme. It was determined to be a valid segment and added to the candidate segment set. If the graph remains globally connected after deletion, it is considered an invalid partition and discarded directly. For each Calculate the evaluation function :
[0063] in, This indicates the proportion of the weight of the cutting edge; the larger the value, the more important the edge is. This indicates the balance of the number of nodes in the subgraph; the closer it is to 1, the more balanced it is. The larger the normalized distance between the centroids of the subgraphs, the more obvious the spatial separation; the optimal weight for segmentation evaluation is... This ensures that weak connections are cut off first during segmentation, maintains component symmetry, and makes the segmentation results highly consistent with human natural segmentation habits of Chinese character components; Select the optimal segmentation :
[0064] Based on optimal segmentation , the root relationship diagram Recursively split into multiple subgraphs; first, from the current graph Remove directly from the middle The remaining graph is obtained by including all the edges. Then in the remaining diagrams Run a breadth-first search algorithm to traverse all nodes and mark reachability relationships, dividing the graph into several maximal connected subgraphs. :
[0065] Update the recursion depth counter to and with each subgraph As new input, re-evaluate from the structural discriminant function The calculation begins, and the entire recursive process of "type determination - candidate segmentation - optimal segmentation - graph splitting" is repeated until the recursion terminates. The recursion termination condition is: the recursion depth reaches 6 levels or the total pixel area of all connected components within the current node is less than 15 pixels (connected components with an area lower than this cannot physically accommodate two independent stroke structures, and forcibly continuing to split will only produce meaningless noise fragments) or the root node is in the root knowledge base (preset standard root knowledge base). , which is marked as indivisible in the National Standard Chinese Character Component Specification and High-Frequency Root Dictionary; Output the final root analysis result dataset :
[0066] in, This represents the final set of root units, where each element represents a minimum root node that cannot be further divided or terminates the recursion. This represents the set of parent-child structural relationships, used to represent the hierarchical topological relationships formed during the recursive splitting process. , representing the root It is further broken down into during the recursive process. ; The set of structural attribute features for each root node The geometric centroid coordinates of the root are represented. This represents the pixel area corresponding to the shape root; The width and height are the dimensions of the circumscribed rectangle; Recursive depth numbering; The root type is labeled and determined by the matching results of the root knowledge base (e.g., "wood", "hand", "water").
[0067] This embodiment also provides a Chinese character text structure parsing system based on root topology graphs, including: The image input interface module is used to receive bitmaps of Chinese text, perform grayscale and standardization preprocessing on the image, and transmit the standardized input tensor to the next module. The root boundary detection module is connected to the image input interface module. It has a built-in deep neural network model to extract the root boundary features in Chinese character images, generate boundary probability maps and boundary gradient maps, and fuse them into a unified boundary response map. The root connected component extraction module, connected to the root boundary detection module, is used to perform binarization processing on the unified boundary response map based on an adaptive threshold, and extract the root connected components and associated structured features. The spatial relationship identification module is used to determine the spatial relationship type between the roots and assign weights based on the centroid coordinates and bounding box parameters of the root connected domains. The root relationship graph construction module is used to construct a root relationship graph based on root nodes and their spatial relationships, where the node set represents the root and the edge set represents the spatial relationship and weight between the root nodes. The recursive decomposition control module is used to recursively decompose the root relationship diagram. Through structural energy calculation, structural type determination and optimal cutting function, it decomposes the smallest root unit layer by layer. The output interface module is used to output a standardized structured root relationship diagram.
[0068] In summary, this invention acquires Chinese character text images and performs standardization processing. It then utilizes a deep neural network to extract root boundary features and generate a unified boundary response map. Based on connected component analysis and structural consistency scoring, it extracts root nodes and their spatial relationships, constructing a root relationship graph. The graph undergoes global structural energy calculation and structural type discrimination, and is decomposed layer by layer into the smallest root units through recursive splitting and optimal segmentation functions, outputting a standardized structured root relationship graph. This invention achieves end-to-end parsing from Chinese character images to structured root topological relationships, effectively improving the accuracy and robustness of Chinese character structure analysis. It can be widely applied in fields such as Chinese character shape retrieval, calligraphy style analysis, and Chinese character teaching assistance. This invention forms a complete technical closed loop with the root parser in ideographic AI theory, providing structured root data support for applications such as Chinese character shape retrieval, calligraphy style analysis, and Chinese character teaching assistance.
[0069] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for structured parsing of Chinese character text based on root topology graphs, characterized in that, include: The Chinese text image is acquired, standardized and converted into an input tensor. The input tensor is then fed into an encoder-decoder structure to generate a boundary probability map and a boundary gradient map, which are then fused into a unified boundary response map. Construct neighborhood windows for each pixel and calculate response concentration. Develop an adaptive threshold and generate a binary map. Based on the binary map, use BFS to construct initial connected components and then construct a structure consistency scoring function. and output the set of connected components; Map each connected component to a graph node, define candidate edges, construct a relation vector for each candidate edge, and build a geometric root relation graph based on the connected component nodes, valid edges, and edge weights. Perform global structural energy calculation on the root graph, calculate the structural discrimination function, select candidate edges, enumerate the set of effective partitioning schemes, and split the root graph into multiple subgraphs.
2. The method for structured parsing of Chinese character text based on root topology graphs as described in claim 1, characterized in that: The process involves acquiring Chinese character text images, standardizing them, converting them into input tensors, and then converting them into grayscale images. For grayscale images Calculate the center of brightness ; Calculate pixel distribution dispersion based on brightness center. ; Normalization is performed on each pixel to obtain a normalized pixel image. ; Normalized pixel image Add a grayscale channel and convert it into an input tensor. .
3. The method for structured parsing of Chinese character text based on root topology graphs as described in claim 2, characterized in that: The process of inputting the input tensor into the encoder and decoder to construct boundary probability maps and boundary gradient maps, and further constructing a unified boundary response map, refers to inputting the tensor into the encoder and decoder. Preliminary processing yields initial features Subsequently, progressive convolution and max pooling are used to expand channels and downsample spatially, ultimately yielding bottleneck features. ; Bottleneck characteristics The input to the decoder is progressively upsampled and convolutionally processed to restore the spatial resolution, and then fused with the features from the corresponding coding layers to obtain the final output features. ; Based on the final features of the decoder Construct boundary probability maps respectively With boundary gradient map ; Based on boundary probability graph With boundary gradient map Constructing a unified boundary response diagram : ; in, , These are probability weighting coefficients. To prevent extremely small constants with a denominator of 0.
4. The method for structured parsing of Chinese characters based on root topology graphs as described in claim 3, characterized in that: The process involves constructing a neighborhood window for each pixel, calculating the response concentration, building an adaptive threshold, and further generating a binary image for any pixel. Build neighborhood window ; Calculate the mean local response based on the neighborhood window. ; Further calculation of local response energy ; Based on local response mean and local response energy Calculate response concentration ; Based on local response mean and response concentration Constructing an adaptive threshold ; According to the boundary response diagram and adaptive threshold Generate binary image .
5. The method for structured parsing of Chinese character text based on root topology graphs as described in claim 4, characterized in that: The initial connected components are constructed using BFS based on the binary graph, and a structural consistency scoring function is then constructed. The output set of connected components refers to the initial connected components constructed using BFS based on the binary graph. After completing the initial connected component partitioning, a boundary response graph-based approach is introduced. Consistency constraints, for any connected component Define its response energy Compared with average response : ; in, Indicates the number of pixels in the connected components; Construct a structural consistency scoring function ; The final output is a set of connected components. And each connected component It includes structural features.
6. The method for structured parsing of Chinese character text based on root topology graphs as described in claim 5, characterized in that: The process of mapping each connected component to a graph node, defining candidate edges, and constructing a relation vector for each candidate edge refers to mapping each connected component... Mapped to graph nodes and define node attribute vectors ; For any node pair A deterministic candidate selection rule is adopted to construct a joint distance function. ; Based on joint distance function Construction scale normalized distance At the same time, define the response consistency function. ; Based on scale-normalized distance and response consistency function Define candidate edges, for each candidate edge Construct relation vectors .
7. The method for structured parsing of Chinese characters based on root topology graphs as described in claim 6, characterized in that: The construction of a geometric root relation graph based on connected component nodes, valid edges, and edge weights refers to the definition of 12 types of spatial relation sets. The probability of the relationship is calculated as follows: ; Based on the probability of the relationship... Determine the final relationship category ; According to relation category Define weight function ; According to the weighting function Define the final edge weight ; Construct a geometric root relation graph based on connected component nodes, valid edges, and edge weights. .
8. The method for structured parsing of Chinese characters based on root topology graphs as described in claim 7, characterized in that: The calculation of global structural energy of the root graph and the calculation of the structural discrimination function refer to the calculation of global structural energy of the root graph G, defining the overall structural energy of the current graph. ; Calculate the strength of vertical structures Horizontal structural strength Enclosing structural strength ; Based on vertical structural strength Horizontal structural strength Enclosing structural strength Calculate the structure discriminant function .
9. The method for structured parsing of Chinese character text based on root topology graphs as described in claim 8, characterized in that: The process of selecting candidate edges and enumerating the set of valid partitioning schemes to split the root graph into multiple subgraphs refers to the selection of a structure discrimination function. The structure type corresponding to the component with the largest value is used as the sole output. ; according to The difference lies in the edge set. Candidate edges that conform to the structural orientation are selected from the data. ; Based on candidate edges Enumerate the set of valid partitioning schemes ; For each Calculate the evaluation function ; Select the optimal segmentation According to the optimal segmentation , the root relationship diagram The graph is recursively split into multiple subgraphs, and the final root analysis result dataset is output. .
10. A Chinese character text structured parsing system based on a root topology graph, based on the Chinese character text structured parsing method based on a root topology graph as described in any one of claims 1 to 9, characterized in that, include: The image input interface module is used to receive bitmaps of Chinese text, perform grayscale and standardization preprocessing on the image, and transmit the standardized input tensor to the next module. The root boundary detection module is connected to the image input interface module. It has a built-in deep neural network model to extract the root boundary features in Chinese character images, generate boundary probability maps and boundary gradient maps, and fuse them into a unified boundary response map. The root connected component extraction module, connected to the root boundary detection module, is used to perform binarization processing on the unified boundary response map based on an adaptive threshold, and extract the root connected components and associated structured features. The spatial relationship identification module is used to determine the spatial relationship type between the roots and assign weights based on the centroid coordinates and bounding box parameters of the root connected domains. The root relationship graph construction module is used to construct a root relationship graph based on root nodes and their spatial relationships, where the node set represents the root and the edge set represents the spatial relationship and weight between the root nodes. The recursive decomposition control module is used to recursively decompose the root relationship diagram. Through structural energy calculation, structural type determination and optimal cutting function, it decomposes the smallest root unit layer by layer. The output interface module is used to output a standardized structured root relationship diagram.