Chinese writing error intelligent identification method and system based on deep neural network
By normalizing and topologically constructing Chinese character images and combining them with deep neural networks, the problem that traditional methods have difficulty in identifying structural errors in Chinese characters is solved, and high-accuracy and explainable Chinese writing error recognition is achieved.
Patent Information
- Application Number
- CN202511312234.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Existing Chinese character recognition technology has difficulty in effectively identifying structural errors within Chinese characters, and its recognition accuracy and interpretability are insufficient, especially when dealing with situations such as misaligned enclosing relationships, unbalanced proportions of left and right components, or cross-stroke deviations.
By obtaining the binary Chinese character image, normalizing the coordinates and extracting the skeleton, constructing the glyph topology map, calculating the structural paradigm label and consistency measurement, generating the structural feature vector, and inputting it into the deep neural network model for error recognition.
It achieves high-accuracy recognition and explainability of Chinese character writing errors, can identify whether there are structural writing errors and their types, and improves robustness and discrimination capabilities.
Smart Images

Figure CN120808364A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of writing error recognition, and particularly relates to a Chinese writing error intelligent recognition method and system based on a deep neural network. BACKGROUND
[0002] With the development of informatization and digitization, Chinese writing recognition has wide application in the fields of intelligent education, electronic marking, online learning and human-computer interaction. Existing Chinese character recognition technology mainly focuses on the overall matching and classification of characters, taking optical character recognition or handwriting input recognition as the core. However, for structural errors in the actual writing process, such as surrounding relationship misplacement, left-right component proportion imbalance or crossing stroke deviation, traditional methods often fail to effectively recognize them. Such errors are not simply missing strokes or noise interference, but involve the spatial layout and geometric relationship of the internal structure of Chinese characters. For such cases, traditional methods based on template matching or statistical learning often fail to make accurate judgments, and the interpretability of the recognition results is also limited.
[0003] In recent years, deep neural networks have made significant progress in image recognition and pattern classification, and can improve the processing capacity of complex tasks through end-to-end feature learning. However, existing deep learning-based Chinese character recognition mainly focuses on character shape classification, and lacks research on fine-grained judgment of writing structural errors. At the same time, relying solely on image convolution features makes it difficult to fully utilize the topological relationship and geometric measurement features of Chinese strokes, and there are still certain limitations in distinguishing standard character shapes and structural error character shapes. SUMMARY
[0004] The application provides a Chinese writing error intelligent recognition method and system based on a deep neural network, which solves the technical problems of being difficult to effectively recognize internal structural errors of Chinese characters, insufficient recognition accuracy and interpretability in related technologies.
[0005] The application provides a Chinese writing error intelligent recognition method based on a deep neural network, which includes the following steps: Step 1, obtaining a Chinese single character image of a target Chinese character after binaryzation processing, determining an outer frame, a center, a height and a width, and performing coordinate normalization to obtain a normalized binary character shape image; Step 2, performing skeleton extraction and node labeling on the normalized binary character shape image to construct a character shape topology graph describing stroke connection relationship; Step 3, determining a structure paradigm label and completing component division based on the character shape topology graph and image projection to obtain outer surrounding area and inner part area, left component and right component and intersection point information; wherein the structure paradigm label includes: surrounding structure paradigm label, left-right structure paradigm label and crossing structure paradigm label; Step 4, calculate the surrounding structure consistency measure, left-right structure consistency measure and cross structure consistency measure according to the structure paradigm label respectively, and obtain a structure measure set; Step 5, obtain the standard measure set corresponding to step 4 based on the standard form of the target Chinese character, and set a fixed tolerance to form a standard parameter interval, align and encode the structure measure set and the standard parameter interval item by item to generate a structure feature vector; Step 6, input the normalized binary character image, the character topological graph, the structure paradigm label and the structure feature vector into the trained deep neural network model, and output the error recognition result of the Chinese character image through the deep neural network model, wherein the error recognition result includes whether there is a structural writing error and the corresponding error type.
[0006] Further, a binary processed Chinese character image is obtained, the bounding box, center, height and width are determined, and coordinate normalization is performed to obtain a normalized binary character image, including: Step 11, extract the foreground pixel set, determine the bounding box containing the foreground pixel set, and calculate the left boundary, right boundary, upper boundary and lower boundary of the bounding box; Step 12, calculate the bounding box width as the difference between the right boundary and the left boundary, the height as the difference between the lower boundary and the upper boundary, and the geometric center coordinates as the midpoint of the left boundary and the right boundary and the midpoint of the upper boundary and the lower boundary based on the bounding box; Step 13, perform translation and scale normalization on the foreground pixel coordinates according to the geometric center coordinates and the bounding box height, and detect the offset angle of the main direction of the foreground pixels in the bounding box by the least square method, and when the offset angle is greater than a preset offset threshold, perform rotation correction on all foreground pixels to generate a normalized binary character image.
[0007] Further, the normalized binary character image is skeletonized and labeled to construct a character topological graph describing the stroke connection relationship, including: Step 21, perform an iterative thinning operation on the normalized binary character image, and keep the connectivity and endpoint number of the original foreground pixels unchanged during the thinning process, and continue to iterate until the strokes are all converged to a single-pixel width to obtain a skeleton image; Step 22, in the skeleton image, calculate the neighborhood degree of each skeleton pixel with eight-neighborhood as the judgment range, label the end point when the neighborhood degree is 1, label the transition point when the neighborhood degree is 2, and label the intersection point when the neighborhood degree is greater than or equal to 3 to form a node set; for the skeleton pixels located at the boundary, the actual neighborhood pixel number is used as the basis for degree calculation; Step 23, constructing a glyph topology graph with endpoints and junctions as vertices and shortest connected paths between them as edges.
[0008] Further, the determination of the outer surrounding region and the inner part region comprises: Step 31, enumerating closed paths without self-intersection in the glyph topology graph and forming a closed loop set; Step 32, judging whether the inside of each closed loop contains foreground pixels by using the ray method to obtain a candidate closed loop set meeting the condition; Step 33, when there are multiple candidate closed loops, selecting the closed loop with the largest geometric area as the outer surrounding region; and defining the union of connected foreground pixels inside the closed loop as the inner part region; when there are nested closed loops, only taking the outermost layer as the outer surrounding region; after the division of the outer surrounding region and the inner part region is completed, generating a surrounding structure paradigm label.
[0009] Further, the component division comprises: Step 41, counting the number of foreground pixels in each column of the normalized binary glyph image in the horizontal direction to obtain a vertical projection sequence; Step 42, detecting the index interval of adjacent columns with zero projection value, and determining that the glyph has a left-right structure when the width of the interval accounts for more than a first preset proportion of the entire bounding box width and the height in the vertical direction exceeds a second preset proportion; Step 43, selecting the column with the minimum difference in the number of foreground pixels on the left and right sides in the index interval of adjacent columns as a division line, defining the set of foreground pixels on the left side of the division line as a left component, and defining the set of foreground pixels on the right side as a right component; after the division of the left component and the right component is completed, generating a left-right structure paradigm label.
[0010] Further, the acquisition of the intersection point information comprises: Step 51, calling the intersection point set in the labeled node set, and extracting the adjacent edge direction vector of each intersection point, the direction vector being a displacement vector from the intersection point to the adjacent skeleton pixel; Step 52, calculating the included angle of any two direction vectors and determining according to a preset angle deviation threshold and a preset vertical tolerance threshold; Step 53, when there are two pairs of approximately opposite and mutually perpendicular directions, determining the intersection point as X-type; when there is one pair of approximately opposite directions and another perpendicular direction, determining as T-type; when there are two approximately perpendicular directions without opposite pairs, determining as L-type; Step 54, recording the intersection point and its corresponding type as intersection point information, and generating an intersection structure paradigm label.
[0011] Further, the surrounding structure consistency measure, the left-right structure consistency measure and the cross structure consistency measure are calculated according to the structure paradigm label respectively to obtain a structural measure set, including: Step 61, normalize the geometric quantities related to length according to the height of the circumscribed frame, normalize the geometric quantities related to area according to the area of the circumscribed frame, and normalize the position coordinates with the left upper corner of the circumscribed frame as the origin, respectively, to form a unified measure reference; Step 62, when the structure paradigm label contains the surrounding structure paradigm label, calculate the surrounding structure consistency measure, including: taking the ratio of the area of the inner part to the area of the outer surrounding part as the area ratio; taking the minimum distance difference between the inner part and the upper and lower boundaries of the outer surrounding part and the sum as the upper and lower white area asymmetry; taking the minimum distance difference between the inner part and the left and right boundaries of the outer surrounding part and the sum as the left and right white area asymmetry; taking the relative offset between the center of mass of the inner part and the center of mass of the outer surrounding part as the alignment deviation; Step 63, when the structure paradigm label contains the left-right structure, calculate the left-right structure consistency measure, including: taking the proportion of the difference between the centers of mass of the left and right parts to the width of the circumscribed frame as the center of mass horizontal difference; taking the proportion of the overlapping length of the vertical projection intervals of the inner and outer parts to the length of the longer interval as the vertical height overlap ratio; for the width sequence obtained by scanning the white area channel row by row, taking the minimum value as the proportion of the minimum width of the channel to the width of the circumscribed frame, taking the variance of the width sequence as the channel width variance, and taking the proportion of the number of times the width sequence decreases between adjacent rows to the total number of rows as the channel narrowing frequency; Step 64, when the structure paradigm label contains the cross structure, calculate the cross structure consistency measure for each intersection point in the intersection point information, including: taking the included angle between the two adjacent main stroke direction vectors of the intersection point as the main stroke included angle; taking the normalized coordinates of the intersection point coordinates relative to the left upper corner of the circumscribed frame as the relative position; Step 65, assemble the various measure indicators obtained in steps 62 to 64 into a structural measure set in a fixed order, and establish an index mapping.
[0012] Further, the generation process of the structural feature vector includes: Step 71, calculate the standard measure set corresponding to the structural measure set in step 4 based on the standard form of the target Chinese character; Step 72, for each item of the standard measure set, set a fixed tolerance to form a standard parameter space, and the fixed tolerance is a preset percentage of the standard measure value; Step 73, align the structural metric set with the specification parameter interval item by item, calculate the signed deviation of each item from the center of the specification parameter interval, the interval out-of-bound proportion and the out-of-bound indication, wherein the signed deviation is the ratio of the actual metric minus the center of the specification parameter interval to the interval half-width; the interval out-of-bound proportion is the proportion of the actual metric exceeding the specification parameter interval to the width of the specification parameter interval; the out-of-bound indication is a Boolean variable marking whether the actual metric is located outside the specification parameter interval; Step 74, assemble the alignment results obtained in step 73 into a structural feature vector according to the fixed order of index mapping.
[0013] Further, the deep neural network model comprises a multi-branch input module, a gating fusion module, an attention aggregation module and a multi-label classification output module; the multi-branch input module comprises a convolutional neural network branch, a graph convolutional network branch and a fully connected network branch; The deep neural network model outputs an error recognition result of the Chinese character image, comprising: Step 81, input the normalized binary glyph image into the convolutional neural network branch to extract the regionalized appearance features of the outer bounding region, the inner part region and the left and right components; input the glyph topology graph into the graph convolutional network branch to extract the structural features of the stroke connection relationship and the crossing complexity; input the structural feature vector into the fully connected network branch to extract the sequence of the out-of-bound proportion of each consistency metric and the specification parameter interval; Step 82, the gating fusion module generates a gating vector based on the out-of-bound proportion sequence and acts on each branch feature representation through element-wise multiplication to weight the features; Step 83, the attention aggregation module calculates attention weights in combination with the structural paradigm label and the out-of-bound proportion sequence, the structural paradigm label is input as a condition of attention after one-hot encoding, used for weighted aggregation between regional features and structural features; Step 84, input the fused features into the multi-label classification output layer to output the error recognition result, the error recognition result includes: whether there is a structural writing error, and the error type; wherein the error type includes: surrounding structure error, left and right structure error, crossing structure error.
[0014] The present application provides a Chinese writing error intelligent recognition system based on a deep neural network, comprising: An image normalization module acquires a Chinese character image of a target Chinese character after binaryzation processing, determines the circumscribed frame, center, height and width, and performs coordinate normalization to obtain a normalized binary glyph image; A skeleton topology construction module performs skeleton extraction and node labeling on the normalized binary glyph image to construct a glyph topology graph describing the stroke connection relationship; A paradigm division module determines a structural paradigm label based on the character topological graph and the image projection and completes component division to obtain an outer surrounding area and an inner component area, a left component and a right component, and intersection point information; wherein the structural paradigm label includes a surrounding structural paradigm label, a left-right structural paradigm label, and an intersection structural paradigm label; A consistency measurement module calculates a surrounding structural consistency measurement, a left-right structural consistency measurement, and an intersection structural consistency measurement according to the structural paradigm label to obtain a structural consistency measurement set; A feature vector generation module obtains a standard measurement set corresponding to the consistency measurement module based on a standard character of a target Chinese character, sets a fixed tolerance to form a standard parameter interval, aligns and encodes the structural consistency measurement set and the standard parameter interval item by item to generate a structural feature vector; A deep recognition module takes the normalized binary character image, the character topological graph, the structural paradigm label, and the structural feature vector as input and inputs them into a deep neural network model trained to output an error recognition result of a Chinese character image, wherein the error recognition result includes whether there is a structural writing error and a corresponding error type.
[0015] The present application has the advantages that: the present application can realize unified processing in terms of position, scale, and inclination by normalizing the character image, extracting the skeleton, and constructing the topology, thereby ensuring the stability of input data under different writing conditions; by introducing the structural paradigm label and component division, the surrounding structure, the left-right structure, and the intersection structure are explicitly modeled, and the structural feature vector with physical meaning and interpretability is generated by aligning the consistency measurement and the standard character item by item, thereby overcoming the defect that the traditional method relies on overall similarity determination and is difficult to identify fine-grained structural errors; by jointly inputting the image feature, the topological feature, and the structural feature vector into the deep neural network model and supplementing the gating fusion and attention aggregation mechanism, local geometric details and complex relationships across components can be effectively captured, thereby improving the robustness and discrimination ability for diversified writing errors. Overall, the present application can not only output whether there is a writing error, but also explicitly identify the error type, thereby realizing high accuracy and interpretability. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a flowchart of the Chinese writing error intelligent recognition method based on a deep neural network of the present application. DETAILED DESCRIPTION
[0017] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that the discussion of these implementations is merely meant to provide a better understanding of the subject matter described herein and can be changed in ways not for departing from the scope thereof as set forth in the appended claims. Various examples can omit, substitute, or add various procedures or components as appropriate. Also, features described with respect to some examples can be combined in other examples.
[0018] As shown in Figure 1 The intelligent recognition method of Chinese writing errors based on deep neural network includes the following steps: Step 1, obtaining a Chinese single character image of a target Chinese character after binarization processing, determining the bounding box, center, height and width, and performing coordinate normalization to obtain a normalized binary glyph image; Step 2, skeleton extraction and node labeling are performed on the normalized binary glyph image to construct a glyph topology graph describing the connection relationship of strokes; Step 3, based on the glyph topology graph and image projection, determine the structure paradigm label and complete the component division to obtain the outer enclosing area and inner part area, left component and right component, and intersection point information; wherein the structure paradigm label includes: enclosing structure paradigm label, left and right structure paradigm label, and intersection structure paradigm label; Step 4, according to the structure paradigm label, calculate the enclosing structure consistency measure, left and right structure consistency measure and intersection structure consistency measure respectively to obtain a structure measure set; Step 5, based on the standard glyph of the target Chinese character, obtain the standard measure set corresponding to step 4, and set a fixed tolerance to form a standard parameter interval, align and encode the structure measure set and the standard parameter interval item by item to generate a structure feature vector; Step 6, input the normalized binary glyph image, glyph topology graph, structure paradigm label and structure feature vector as input into the trained deep neural network model, and output the error recognition result of the Chinese single character image through the deep neural network model, wherein the error recognition result includes: whether there is a structural writing error and the corresponding error type.
[0019] In one embodiment of the present application, the image of the target Chinese character is obtained by scanning, electronic handwriting board input, camera shooting and the like, and binarization processing is performed to obtain a Chinese single character image containing foreground and background, wherein the foreground pixels are used to represent the stroke area, and the background pixels are used to represent the blank area; the Chinese single character image can highlight the geometric structure of the strokes and simplify the data expression.
[0020] In one embodiment of the present application, the Chinese single character image of the target Chinese character after binarization is obtained, the bounding box, center, height and width are determined, and the coordinate normalization is performed to obtain the normalized binary character image, including: Step 11, foreground and background separation is performed on the input Chinese single character image, the pixel points corresponding to strokes are taken as a foreground pixel point set, and a bounding box capable of completely containing the foreground pixel point set is determined. The bounding box is defined by four boundary lines of left boundary, right boundary, upper boundary and lower boundary, thereby limiting the smallest rectangular region containing strokes; Step 12, based on the bounding box, the bounding box width is calculated as the difference between the right boundary and the left boundary, the height is calculated as the difference between the lower boundary and the upper boundary, and the geometric center coordinates are calculated as the midpoint of the left boundary and the right boundary and the midpoint of the upper boundary and the lower boundary; Step 13, according to the geometric center coordinates and the bounding box height, translation and scale normalization are performed on the foreground pixel point coordinates, the overall position of strokes is adjusted to a unified coordinate system, and the strokes of different size character shapes are kept consistent in scale; and the main direction of the foreground pixel points in the bounding box is fitted by the least square method to detect the offset angle, when the offset angle is greater than a preset offset threshold, it is determined that the character shape is obviously inclined, and rotation correction is performed on all foreground pixel points to generate a normalized binary character shape image; this step makes the character shape image keep standard alignment in the horizontal and vertical directions.
[0021] Through the above steps, the present application can effectively normalize the stroke structure of Chinese single character in position, scale and rotation direction, thereby eliminating the geometric differences brought by different writers and different writing conditions, and ensuring that the input data of subsequent skeleton extraction, structure analysis and deep neural network recognition are under a unified standard.
[0022] In one embodiment of the present application, skeleton extraction and node labeling are performed on the normalized binary character shape image, and a character shape topology graph describing the connection relationship of strokes is constructed, including: Step 21, an iterative thinning operation is performed on the normalized binary character shape image, during the thinning process, the foreground pixels of the stroke edge are gradually removed in each iteration step, and the connectivity and the number of end points of the original stroke are kept from being damaged, thereby avoiding the breakage of the stroke structure or the loss of end points; the thinning process continues until all strokes in the image converge to a single-pixel width, and a skeleton image retaining the overall morphology of the stroke is obtained; Step 22, in the skeleton image, the neighborhood degree of each skeleton pixel is calculated within an eight-neighborhood judgment range, the neighborhood degree of 1 is labeled as an end point, the neighborhood degree of 2 is labeled as a transition point, and the neighborhood degree greater than or equal to 3 is labeled as a cross point, forming a node set; for the skeleton pixels located at the boundary, the actual neighborhood pixel number is taken as the basis for degree calculation; Step 23, constructing a graph topology with endpoints and intersection points as vertices and shortest connected paths consisting of transition points therebetween as edges; the graph topology can accurately represent the connection relationship and interaction mode of strokes of Chinese characters.
[0023] Through the above steps, the present application can convert stroke images from the pixel level to a topology structure, retaining the global connectivity of writing strokes and simplifying data expression, thereby improving the accuracy and interpretability of the overall error recognition method.
[0024] In an embodiment of the present application, the determination of the outer enclosing region and the inner part region comprises: Step 31, enumerating closed paths without self-intersection in the graph topology and forming a closed loop set; the closed path represents that the starting point and the ending point of the path coincide, and no intersection is generated inside the path, thereby ensuring the geometric integrity of the closed loop; Step 32, using the ray method to judge whether the inside of each closed loop contains foreground pixels, obtaining a candidate closed loop set that meets the condition; specifically, a ray is emitted outward from an arbitrary point inside the closed loop, and the number of intersection points of the ray with the boundary of the closed loop is counted; when the number of intersection points meets the odd number judgment principle, it is indicated that there is a foreground pixel region inside the closed loop; Step 33, when there are multiple candidate closed loops, selecting the closed loop with the largest geometric area as the outer enclosing region to ensure that the outer enclosing region can cover the stroke structure to the maximum extent; and defining the union set of connected foreground pixels inside the closed loop as the inner part region; when there are nested closed loops, only the outermost layer is taken as the outer enclosing region to avoid repeated division; after the division of the outer enclosing region and the inner part region is completed, a surrounding structure paradigm label is generated.
[0025] Through the above steps, the present application can accurately recognize and separate the surrounding relationship in complex stroke structures, ensure that the division of the inner and outer regions has geometric rationality and topological consistency, thereby improving the extraction accuracy of the surrounding structure related features and providing a stable structure reference for the judgment of error types.
[0026] In an embodiment of the present application, the component division comprises: Step 41, counting the number of foreground pixels in each column in the horizontal direction of the normalized binary graph image to obtain a vertical projection sequence; the vertical projection sequence can reflect the distribution of strokes in the horizontal direction; when the projection value of a column is zero, it indicates that there is no foreground pixel in the column, which belongs to a background column; Step 42, detecting the index interval of adjacent columns with zero projection value; when the width of the interval accounts for more than a first preset proportion of the overall bounding box width and the height in the vertical direction exceeds a second preset proportion, it is determined that the graph has a left-right structure; the above conditions ensure that the detected zero value interval is not only wide enough, but also continuous in the vertical direction, which can effectively serve as a separation area for left and right components; Step 43, selecting a column with the minimum difference between the number of left and right side foreground pixels in the adjacent column index interval as the division line, defining the set of foreground pixels on the left side of the division line as the left component, and defining the set of foreground pixels on the right side of the division line as the right component; after completing the division of the left component and the right component, generating the left-right structure paradigm label.
[0027] In an embodiment of the present application, the acquisition of the intersection information comprises: Step 51, calling the intersection set in the labeled node set, and extracting the adjacent edge direction vector of each intersection, wherein the direction vector is the displacement vector from the intersection to the adjacent skeleton pixel; the vector can represent the direction characteristics of the stroke extension in the neighborhood of the intersection; Step 52, calculating the included angle of any two direction vectors, and determining whether the different direction vectors belong to the approximately opposite relationship or the approximately perpendicular relationship according to the preset angle deviation threshold and the preset perpendicular tolerance threshold; Step 53, when there are two pairs of approximately opposite and mutually perpendicular directions, determining the intersection as X type; when there is one pair of approximately opposite directions and another perpendicular direction, determining as T type; when there are two approximately perpendicular directions without opposite pairs, determining as L type; Step 54, recording the intersection and its corresponding type as intersection information, and generating the intersection structure paradigm label, wherein the intersection structure paradigm label can accurately describe the intersection structure characteristics in the character.
[0028] Through the above steps, the present application can finely classify the intersections on the basis of the topological graph, ensure that different types of intersection structures are distinguished in the recognition process, thereby improving the recognition accuracy of the intersection type writing errors, and enhancing the explainability of the overall method.
[0029] In an embodiment of the present application, the structure consistency metrics are calculated according to the structure paradigm label, respectively, to obtain a structure consistency metric set, including: Step 61, normalizing the length-related geometric quantities according to the height of the circumscribed frame, normalizing the area-related geometric quantities according to the area of the circumscribed frame, and taking the left upper corner of the circumscribed frame as the origin to normalize the position coordinates respectively with respect to the height and width of the circumscribed frame, to form a unified metric reference; wherein the length-related geometric quantities include the width and height of the circumscribed frame, the minimum distance from the inner part to the outer enclosing boundary, the horizontal distance between the left and right components, the white area channel width, and the distance from the intersection to the boundary, etc.; the area-related geometric quantities include the area of the outer enclosing region, the area of the inner part region, and the area of the left and right component regions; this step can eliminate the influence of the size and position differences of the written characters, so that different character forms have comparability under the same dimension; Step 62, when the structure paradigm label contains a surrounding structure, calculate the surrounding structure consistency measure, including: taking the ratio of the area of the inner part to the area of the outer surrounding as the area ratio to measure the size relationship of the inner part in the outer surrounding; taking the ratio of the minimum distance difference of the inner part to the upper and lower boundaries of the outer surrounding to the sum as the upper and lower white area asymmetry to reflect the offset of the inner part in the vertical direction; taking the ratio of the minimum distance difference of the inner part to the left and right boundaries of the outer surrounding to the sum as the left and right white area asymmetry to reflect the horizontal balance; taking the relative offset between the center of mass of the inner part and the center of mass of the outer surrounding as the alignment deviation to measure the overall alignment of the inner and outer parts; Step 63, when the structure paradigm label contains a left-right structure, calculate the left-right structure consistency measure, including: taking the proportion of the center of mass difference of the left and right parts to the width of the bounding box as the center of mass horizontal difference to measure the symmetry of the left and right parts; taking the proportion of the overlapping length of the vertical projection intervals of the inner and outer parts to the longer interval length as the vertical height overlap ratio to reflect the consistency of the left and right parts in the vertical direction; taking the minimum width of the white area channel obtained by scanning the width sequence in each row as the minimum width of the channel to determine whether there is a narrow channel, taking the variance of the width sequence as the channel width variance to measure the volatility of the channel width, and taking the proportion of the number of times the width sequence decreases between adjacent rows to the total number of rows as the channel narrowing frequency to reflect whether the channel continuity is abnormally contracted; Step 64, when the structure paradigm label contains a cross structure, calculate the cross structure consistency measure for each intersection point in the intersection point information, including: taking the included angle between the two adjacent main stroke direction vectors of the intersection point as the main stroke included angle to measure the angle characteristics of the cross stroke; taking the normalized coordinates of the intersection point coordinates relative to the top left corner of the bounding box as the relative position to represent the relative position of the intersection point in the overall glyph; Step 65, assemble the various measurement indicators obtained in steps 62 to 64 into a structure measurement set in a fixed order, and establish an index mapping; the various measurement indicators include: area ratio, upper and lower white area asymmetry, left and right white area asymmetry, alignment deviation, center of mass horizontal difference, vertical height overlap ratio, minimum channel width, channel width variance, channel narrowing frequency, main stroke included angle and relative position; the index mapping is used to clearly correspond each measurement indicator to the structure paradigm and physical meaning to which it belongs, ensuring that each measurement indicator can be called and traced back in the subsequent comparison and feature coding process.
[0030] Through the above steps, the present application can convert complex glyph structures into normalized numerical measures, both preserving the spatial geometric characteristics of the stroke structure and the component relationship, and achieving comparability between different glyphs, thereby providing a complete, stable and interpretable feature basis for subsequent error identification.
[0031] In an embodiment of the present application, the generation process of the structural feature vector comprises: In step 71, based on the standard form of the target Chinese character, the standard metric set corresponding to the structural metric set in step 4 is calculated in the same processing manner as the previous steps; wherein the standard form comes from a pre-set standard font library and is one-to-one corresponding to the target Chinese character; In step 72, for each item of the standard metric set, a fixed tolerance is set to form a standard parameter space, and the fixed tolerance is a pre-set percentage of the standard metric value, which is used to reflect the reasonable deviation range allowed under normal writing conditions. By introducing the fixed tolerance, false judgments caused by individual writing differences or slight noise can be avoided, thereby enhancing the overall adaptability; In step 73, the structural metric set and the standard parameter interval are aligned item by item, and the signed deviation of each item from the center of the standard parameter interval, the interval out-of-bound proportion, and the out-of-bound indication are calculated, wherein the signed deviation is the ratio of the actual metric minus the center of the interval to the interval half-width, which is used to reflect the direction and amplitude of the actual value deviation from the standard center; the interval out-of-bound proportion is the proportion of the actual metric exceeding the standard parameter interval to the width of the standard parameter interval, which is used to quantify the severity of the out-of-bound; the out-of-bound indication is a Boolean variable indicating whether the actual metric is outside the standard parameter interval; through the combination of the above three types of indicators, the deviation between the actual metric and the standard metric can be comprehensively described from different dimensions; In step 74, the alignment results obtained in step 73 are assembled into a structural feature vector in a fixed order according to the index mapping.
[0032] In an embodiment of the present application, the deep neural network model comprises a multi-branch input module, a gated fusion module, an attention aggregation module, and a multi-label classification output module; The error recognition result of the Chinese single character image is output by the deep neural network model, which comprises: In step 81, the multi-branch input module comprises a convolutional neural network branch, a graph convolutional network branch, and a fully connected network branch; the normalized binary character image is input into the convolutional neural network branch to extract the regionalized appearance features of the outer bounding region, the inner part region, and the left and right components; the character form topology graph is input into the graph convolutional network branch to extract the structural features of stroke connection relationship and cross complexity; the structural feature vector is input into the fully connected network branch to extract the out-of-bound proportion sequence of each consistency metric and standard parameter interval; through the multi-branch input module, different source feature representations can be obtained in parallel, ensuring that the three types of information of character appearance, topology structure, and standard metric are all encoded; In step 82, the gating fusion module generates a gating vector based on the out-of-bound proportion sequence, and acts on each branch feature representation through element-wise multiplication to weight the features; when the deviation of a certain structural paradigm is large, the weight of the corresponding feature branch is enhanced, thereby highlighting the feature contribution related to the anomaly. This gating mechanism can introduce the structural consistency measurement result as an explicit control signal, enabling the deep neural network model to have higher sensitivity to potential abnormal regions during the fusion process; In step 83, the attention aggregation module calculates attention weights by combining the structural paradigm label with the out-of-bound proportion sequence; after one-hot encoding, the structural paradigm label is used as the conditional input of attention, for weighting and converging between regional features and structural features; through this process, the model can apply higher weights to key regions according to the paradigm label, thereby achieving differentiated focusing and dynamic fusion of features; In step 84, the fused features are input into a multi-label classification output layer to output an error recognition result, which includes whether there is a structural writing error and the error type; the error type includes surrounding structure error, left-right structure error, and cross structure error.
[0033] Through the above implementation process, the image appearance features, topological structure features, and specification deviation features are uniformly input into the deep neural network, and the dynamic adjustment of feature contribution is realized through gating fusion and attention aggregation, thereby ensuring the expression of the model while enhancing the interpretability and robustness of the recognition result, and improving the accuracy and practicality of Chinese writing error recognition.
[0034] It should be noted that the structural feature vector generated in step 5 of the present application is based on the alignment result of the item-by-item measurement of the target Chinese character and the standard character form, which mainly serves to express the geometric proportion, symmetry, and cross position structural information in a quantitative manner, thereby providing a feature set with clear physical meaning. This feature set has strong interpretability and can directly reflect the specific structural deviation situation. However, relying solely on these manually defined features cannot fully cover the complex detail information in the character form, such as stroke thickness variation, local distortion pattern, and nonlinear interaction between different structural domains, so it is not enough to ensure high robustness in diversified writing scenarios. Therefore, in step 6, the deep neural network model is introduced, and the normalized binary character form image, character form topology graph, structural paradigm label, and structural feature vector obtained in step 5 are used as joint inputs. On the one hand, the deep neural network can automatically capture the stroke texture, local geometric pattern, and high-dimensional association features across components through end-to-end learning, making up for the details that cannot be covered by manual measurement; on the other hand, the structural feature vector is used as an explicit input for training and inference, providing the network with interpretable prior constraints, thereby guiding the model to pay more attention to the key regions of structural errors during recognition.
[0035] The embodiment also provides a deep neural network-based Chinese writing error intelligent recognition system, comprising: An image normalization module acquires a Chinese single-character image of the target Chinese character subjected to the binarization processing, determines a bounding box, a center, a height, and a width, and performs coordinate normalization to obtain a normalized binary glyph image; A skeleton topology construction module performs skeleton extraction and node labeling on the normalized binary glyph image to construct a glyph topology graph describing stroke connection relationships; A paradigm division module determines structural paradigm labels and completes component division based on the glyph topology graph and image projection to obtain an outer enclosing area and an inner component area, left and right components, and intersection point information; wherein the structural paradigm labels include: enclosing structural paradigm labels, left and right structural paradigm labels, and intersection structural paradigm labels; A consistency measurement module respectively calculates enclosing structural consistency measurements, left and right structural consistency measurements, and intersection structural consistency measurements according to the structural paradigm labels to obtain a structural consistency measurement set; A feature vector generation module acquires a standard measurement set corresponding to the consistency measurement module based on a standard glyph of the target Chinese character, sets a fixed tolerance to form a standard parameter interval, aligns and encodes the structural consistency measurement set and the standard parameter interval item by item to generate a structural feature vector; A deep recognition module takes the normalized binary glyph image, the glyph topology graph, the structural paradigm labels, and the structural feature vector as inputs, inputs them into a deep neural network model trained, and outputs an error recognition result of the Chinese single-character image by the deep neural network model, wherein the error recognition result includes: whether there is a structural writing error and a corresponding error type.
[0036] It should be noted that the interval and threshold size are set for ease of comparison, wherein the size of the threshold depends on the number of sample data and the base number set by the person skilled in the art for each group of sample data, as long as the proportional relationship of the parameters and the quantized values is not affected. And the above formulas are all dimensionless calculations of the values. The formula is obtained by software simulation of a large amount of data to obtain a formula closest to the actual situation. The preset parameters in the formula are set by the person skilled in the art according to the actual situation.
[0037] The embodiments of the present application are described above, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not limiting. Those skilled in the art can make many forms under the inspiration of the present embodiment, which are all within the protection of the present embodiment.
Claims
1. An intelligent recognition method for Chinese writing errors based on deep neural networks, characterized by: The following steps are involved: Step 1, obtaining a Chinese character image of a target Chinese character that has been binarized, determining the bounding box, center, height and width, and performing coordinate normalization to obtain a normalized binary character image; Step 2: performing skeleton extraction and node labeling on the normalized binary glyph image to construct a glyph topology map describing the connection relationship of the strokes; Step 3: Determine the structural paradigm labels based on the glyph topology map and image projection and complete component division, obtaining information about the outer enclosing area and inner area, left and right components, and intersections. The structural paradigm labels include: an enclosing structural paradigm label, a left-right structural paradigm label, and an intersection structural paradigm label. Step 4, calculating the surrounding structure consistency measure, the left-right structure consistency measure, and the cross-structure consistency measure according to the structural paradigm label to obtain a set of structural measures; Step 5: Based on the standard shape of the target Chinese character, a standard metric set corresponding to step 4 is obtained, and a fixed tolerance is set to form a standard parameter interval. The structural metric set and the standard parameter interval are aligned and encoded item by item to generate a structural feature vector. Step 6: Input the normalized binary glyph image, glyph topology map, structural paradigm label, and structural feature vector as input to the trained deep neural network model, and output the error recognition result of the Chinese single character image through the deep neural network model, wherein the error recognition result includes: whether there are structural writing errors and the corresponding error type.
2. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1 is characterized in that: Obtain a binary Chinese character image, determine the bounding box, center, height, and width, and perform coordinate normalization to obtain a normalized binary character image, including: Step 11: extract a foreground pixel set, determine a bounding box containing the foreground pixel set, and calculate the left boundary, right boundary, upper boundary, and lower boundary of the bounding box; Step 12: Based on the bounding box, the width of the bounding box is calculated as the difference between the right boundary and the left boundary, the height is calculated as the difference between the lower boundary and the upper boundary, and the geometric center coordinates are the midpoints of the left boundary and the right boundary and the midpoints of the upper boundary and the lower boundary; Step 13, based on the geometric center coordinates and the height of the bounding box, perform translation and scale normalization processing on the foreground pixel coordinates, and detect the offset angle by fitting the main direction of the foreground pixel points in the bounding box through the least squares method. When the offset angle is greater than the preset offset threshold, perform rotation correction on all foreground pixels to generate a normalized binary glyph image.
3. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 2 is characterized in that: Performing skeleton extraction and node annotation on the normalized binary glyph image to construct a glyph topology diagram describing the stroke connection relationship, including: Step 21, performing an iterative thinning operation on the normalized binary glyph image, maintaining the connectivity and number of endpoints of the original foreground pixels during the thinning process, and continuing the iteration until all strokes converge to a single pixel width, thereby obtaining a skeleton image; Step 22: Calculate the neighborhood degree of each skeleton pixel in the skeleton image using eight neighborhoods as the judgment range. Pixels with a neighborhood degree of 1 are marked as endpoints, pixels with a neighborhood degree of 2 are marked as transition points, and pixels with a neighborhood degree greater than or equal to 3 are marked as intersections, forming a node set. For skeleton pixels located at the boundary, the degree is calculated based on the actual number of neighboring pixels. Step 23: construct a glyph topology graph with endpoints and intersections as vertices and the shortest connected paths between them through transition points as edges.
4. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1, characterized in that: The determination of the outer surrounding area and the inner area includes: Step 31, enumerating closed paths without self-intersection in the glyph topology graph and forming a closed loop set; Step 32: Using the ray method to determine whether each closed loop contains a foreground pixel, a set of candidate closed loops that meet the conditions is obtained; Step 33: When there are multiple candidate closed loops, the closed loop with the largest geometric area is selected as the outer enclosing area; and the union of the connected foreground pixels inside the closed loop is defined as the inner region; when there are nested closed loops, only the outermost layer is taken as the outer enclosing area; after completing the division of the outer enclosing area and the inner region, the enclosing structure paradigm label is generated.
5. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1, characterized in that: The component division includes: Step 41, counting the number of foreground pixels of the normalized binary glyph image column by column in the horizontal direction to obtain a vertical projection sequence; Step 42 , detecting adjacent column index intervals with zero projection values, and determining that the glyph has a left-right structure when the ratio of the width of the interval to the width of the entire bounding box is greater than a first preset ratio and the ratio of the vertical height of the interval exceeds a second preset ratio; In step 43, a column that minimizes the difference in the number of foreground pixels on the left and right sides is selected within the adjacent column index interval as a dividing line, and the set of foreground pixels on the left side of the dividing line is defined as a left component, and the set of foreground pixels on the right side is defined as a right component. After the division of the left component and the right component is completed, left and right structural paradigm labels are generated.
6. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1, characterized in that: The acquisition of the intersection information includes: Step 51: call the intersection point set in the marked node set, and extract the adjacent edge direction vector of each intersection point, where the direction vector is the displacement vector from the intersection point to the adjacent skeleton pixel; Step 52, calculating the angle between any two direction vectors, and making a determination based on a preset angle deviation threshold and a preset vertical tolerance threshold; Step 53: When there are two pairs of directions that are approximately opposite and perpendicular to each other, the intersection is determined to be X-shaped; when there is a pair of directions that are approximately opposite and there is another perpendicular direction, the intersection is determined to be T-shaped; when there are two pairs of directions that are approximately perpendicular and there is no pair of directions that are opposite, the intersection is determined to be L-shaped; In step 54 , the intersection and its corresponding type are recorded as intersection information, and an intersection structure paradigm label is generated.
7. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1, characterized in that: The enclosing structure consistency measure, the left-right structure consistency measure, and the cross structure consistency measure are calculated according to the structural paradigm label to obtain a set of structural measures, including: Step 61: Normalize geometric quantities related to length by the height of the bounding box, normalize geometric quantities related to area by the area of the bounding box, and normalize position coordinates by the height and width of the bounding box, respectively, with the upper left corner of the bounding box as the origin, to form a unified measurement benchmark; Step 62: When the structure paradigm tag includes an enclosure structure paradigm tag, calculate the enclosure structure consistency metric, including: using the ratio of the area of the inner part area to the area of the outer enclosure area as the area ratio; using the ratio of the minimum distance difference between the inner part and the upper and lower boundaries of the outer enclosure to the sum as the upper and lower white area asymmetry; using the ratio of the minimum distance difference between the inner part and the left and right boundaries of the outer enclosure to the sum as the left and right white area asymmetry; using the relative offset between the center of mass of the inner part and the center of mass of the outer enclosure as the alignment deviation; Step 63: When the structural paradigm label includes left and right structures, a left-right structure consistency metric is calculated, including: using the ratio of the difference in the center of gravity of the left and right components to the width of the bounding box as the horizontal center of gravity difference; using the ratio of the overlapping length of the vertical projection intervals of the inner and outer components to the length of the longer interval as the vertical height overlap ratio; for the width sequence obtained in the line-by-line scanning of the white area channel, taking the ratio of the minimum value to the width of the bounding box as the channel minimum width, taking the variance of the width sequence as the channel width variance, and taking the ratio of the number of times the width sequence drops between adjacent rows to the total number of rows as the channel narrowing frequency; Step 64: When the structural paradigm tag includes an intersection structure, a cross structure consistency metric is calculated for each intersection in the intersection information, including: using the angle between two adjacent main stroke direction vectors at the intersection as the main stroke angle; using the normalized coordinates of the intersection coordinate relative to the upper left corner of the bounding box as the relative position; Step 65: Assemble the various metric indicators obtained from steps 62 to 64 into a structured metric set in a fixed order, and establish an index mapping.
8. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 7, characterized in that: The process of generating structural feature vectors includes: Step 71, calculating a standard metric set corresponding to the structural metric set in step 4 based on the standard shape of the target Chinese character; Step 72: For each item in the canonical metric set, a fixed tolerance is set to form a canonical parameter space, where the fixed tolerance is a preset percentage of the canonical metric value; Step 73: Align the set of structural metrics with the specification parameter interval item by item, and calculate the signed deviation, interval out-of-bounds ratio, and out-of-bounds indication of each item relative to the center of the specification parameter interval. The signed deviation is the ratio of the actual metric minus the center of the specification parameter interval to the half-width of the interval; the interval out-of-bounds ratio is the ratio of the portion of the actual metric that exceeds the specification parameter interval to the width of the specification parameter interval; and the out-of-bounds indication is a Boolean variable that marks whether the actual metric is outside the specification parameter interval. Step 74: Assemble the alignment results obtained in step 73 into a structural feature vector according to the fixed order of the index mapping.
9. The method for intelligently identifying Chinese writing errors based on a deep neural network according to claim 1, characterized in that: The deep neural network model includes: a multi-branch input module, a gated fusion module, an attention aggregation module and a multi-label classification output module; the multi-branch input module includes a convolutional neural network branch, a graph convolutional network branch and a fully connected network branch; Outputting error recognition results of Chinese single-character images through the deep neural network model includes: Step 81: Input the normalized binary glyph image into the convolutional neural network branch to extract regionalized appearance features of the outer bounding area, inner area, and left and right components; input the glyph topology graph into the graph convolutional network branch to extract structural features of stroke connectivity and cross-complexity; input the structural feature vector into the fully connected network branch to extract the cross-boundary ratio sequence of each consistency measure and the standard parameter interval; Step 82: The gated fusion module generates a gated vector based on the out-of-bounds ratio sequence, and acts on each branch feature representation by element-by-element multiplication to weight the features; Step 83: The attention aggregation module calculates the attention weight by combining the structural paradigm label and the out-of-bounds ratio sequence. The structural paradigm label is one-hot encoded and used as the conditional input of attention to perform weighted aggregation between regional features and structural features. In step 84, the fused features are input into the multi-label classification output layer to output the error recognition result. The error recognition result includes: whether there is a structural writing error and the error type; wherein the error type includes: surrounding structure error, left-right structure error, and cross structure error.
10. The intelligent Chinese writing error recognition system based on deep neural network is characterized by: The method for intelligently identifying Chinese writing errors based on a deep neural network as described in any one of claims 1 to 9 comprises: An image normalization module obtains a Chinese character image of a target Chinese character that has been binarized, determines the bounding box, center, height, and width, and performs coordinate normalization to obtain a normalized binary character image; A skeleton topology construction module performs skeleton extraction and node annotation on the normalized binary glyph image to construct a glyph topology map describing the connection relationship of the strokes; The paradigm division module determines the structural paradigm labels based on the glyph topology map and image projection and completes the component division, obtaining the outer and inner regions, left and right components, and intersection information. The structural paradigm labels include: the enclosing structural paradigm label, the left and right structural paradigm label, and the intersection structural paradigm label. A consistency measurement module calculates the surrounding structure consistency measurement, the left-right structure consistency measurement and the cross structure consistency measurement according to the structural paradigm label to obtain a structural measurement set; A feature vector generation module obtains a standard measurement set corresponding to the consistency measurement module based on the standard shape of the target Chinese character, sets a fixed tolerance to form a standard parameter interval, aligns and encodes the structural measurement set with the standard parameter interval item by item, and generates a structural feature vector; The deep recognition module takes the normalized binary glyph image, glyph topology map, structural paradigm label and structural feature vector as input, and inputs them into the trained deep neural network model. The deep neural network model outputs the error recognition results of the Chinese single-character image, where the error recognition results include: whether there are structural writing errors and the corresponding error types.
Citation Information
Patent Citations
Chinese character hard-tipped pen writing evaluation method and system based on stroke characteristics and detection point threshold
CN117746429A
Cross-modal handwritten text recognition method based on graphic structure guide perception
CN118334682A
Writing evaluation method and device based on book channel grid, equipment and medium
CN118865414A
Chinese character structure and geometric space interactive writing method
CN120580707A
Real time handwriting recognition system
US5991441A
Cited By
Dictation content generation interaction method based on large model
CN121116078A