Handwriting identification method and handwriting identification model training method
By using the target handwriting recognition model in handwriting recognition technology for feature extraction and processing, combined with feature screening and classification recognition, the problem of inaccurate handwriting recognition in the prior art is solved, and the accuracy and efficiency of recognition are improved.
Patent Information
- Application Number
- CN202411343916.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to accurately identify handwriting, which affects the reliability of symbol analysis.
By obtaining the image to be identified, input the target handwriting recognition model for feature extraction and processing, combining feature screening and classification recognition, the accuracy of handwriting recognition is improved.
Improve the accuracy and efficiency of handwriting recognition, and reduce the waste of identification errors and computing resources.
Smart Images

Figure CN119399779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a handwriting recognition method and a handwriting recognition model training method. Background Art
[0002] With the development of information technology, the demand for automated scoring and data analysis is growing, which has led to the emergence of some automated scoring systems based on optical character recognition (OCR) and image processing technology. These systems can automatically identify the fill-in areas and student answers on the answer sheet, but their recognition and analysis capabilities for handwritten correction symbols are still limited. Due to the diversity and complexity of correction symbols, such as the large differences in size and shape of correction symbols, as well as individual differences in writing style, existing image recognition technology is difficult to accurately identify handwriting, which in turn affects the reliability of symbol analysis. Summary of the invention
[0003] In view of the above-mentioned defects in the prior art, the technical problem to be solved by the present invention is how to improve the accuracy and effectiveness of handwriting recognition.
[0004] In order to solve at least one of the above-mentioned technical problems, the present invention discloses a handwriting recognition method and a handwriting recognition model training method.
[0005] According to one aspect of the present disclosure, there is provided a handwriting recognition method, comprising:
[0006] Acquire an image to be identified; the image to be identified includes a target identification object;
[0007] Input the image to be recognized into the target handwriting recognition model, perform feature extraction on the image to be recognized, and obtain feature information to be recognized corresponding to the target recognition object;
[0008] Based on the target handwriting recognition model, feature processing is performed on the feature information to be recognized to obtain feature screening information and information to be classified and recognized;
[0009] Based on the feature screening information, feature screening is performed on the to-be-classified identification information to obtain a feature screening result;
[0010] Based on the target handwriting recognition model and the feature screening result, the to-be-classified recognition information is classified and recognized to obtain a target recognition result corresponding to the target recognition object.
[0011] In some possible embodiments, the feature processing of the feature information to be identified based on the target handwriting recognition model to obtain feature screening information and the identification information to be classified includes:
[0012] Inputting the feature information to be identified into the feature processing layer;
[0013] Based on the position determination unit, the feature information to be identified is subjected to feature binarization processing to obtain the feature screening information;
[0014] Based on the feature recognition unit, feature recognition is performed on the feature information to be recognized to obtain the recognition information to be classified; the recognition information to be classified includes the feature information to be classified and mask information corresponding to the feature information to be classified.
[0015] In some possible embodiments, the feature screening of the to-be-classified identification information based on the feature screening information to obtain a feature screening result includes:
[0016] Determining whether the feature screening information is consistent with the mask information;
[0017] If the two are consistent, determining that the identification information to be classified corresponding to the mask information is abnormal identification information;
[0018] If the two are inconsistent, determining that the identification information to be classified corresponding to the mask information is normal identification information;
[0019] The abnormal identification information and the normal identification information are determined as the feature screening result.
[0020] In some possible embodiments, the classifying and identifying the to-be-classified identification information based on the target handwriting recognition model and the feature screening result to obtain a target identification result corresponding to the target identification object includes:
[0021] Determining normal identification information from the identification information to be classified based on the feature screening result;
[0022] Inputting the normal identification information into the result classification layer;
[0023] Based on the result classification layer, the normal recognition information is classified and recognized to obtain the target recognition result corresponding to the target recognition object.
[0024] In some possible embodiments, the target handwriting recognition model includes a feature extraction layer;
[0025] The step of inputting the image to be recognized into a target handwriting recognition model, extracting features from the image to be recognized, and obtaining feature information to be recognized corresponding to the target recognition object includes:
[0026] Inputting the image to be recognized into the feature extraction layer;
[0027] Based on the feature extraction layer, feature extraction is performed on the image to be identified to obtain multi-scale feature information corresponding to the image to be identified;
[0028] Based on the feature extraction layer, feature fusion is performed on the multi-scale feature information to generate the feature information to be identified corresponding to the target identification object.
[0029] According to a second aspect of the present disclosure, a method for training a handwriting recognition model is provided, comprising:
[0030] Acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object;
[0031] Inputting the sample recognition image into a preset handwriting recognition model;
[0032] Perform handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label;
[0033] Based on the target loss function, the multiple handwriting type labels corresponding to the sample recognition object and the multiple handwriting recognition information, the training loss information is obtained; the target loss function is determined based on the smoothing parameter and the number of handwriting types;
[0034] The preset handwriting recognition model is trained based on the training loss information to obtain a target handwriting recognition model.
[0035] In some possible embodiments, performing handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object includes:
[0036] Inputting the sample recognition image into the feature extraction layer;
[0037] Based on the feature extraction layer, feature extraction is performed on the sample identification object to obtain multi-scale sample feature information corresponding to the sample identification object;
[0038] Based on the feature extraction layer, feature fusion is performed on the multi-scale sample feature information to generate feature information of the sample to be identified corresponding to the sample identification object;
[0039] Handwriting recognition is performed on the sample feature information to be recognized based on the preset handwriting recognition model to obtain the multiple handwriting recognition information corresponding to the sample recognition object.
[0040] In some possible embodiments, the performing handwriting recognition on the feature information of the sample to be recognized based on the preset handwriting recognition model to obtain the plurality of handwriting recognition information corresponding to the sample recognition object includes:
[0041] Inputting the feature information of the sample to be identified into the feature processing layer;
[0042] Based on the position determination unit, feature binarization processing is performed on the feature information of the sample to be identified to obtain sample feature screening information;
[0043] Based on the feature recognition unit, feature recognition is performed on the feature information of the sample to be recognized to obtain the identification information of the sample to be classified; the identification information of the sample to be classified includes the feature information of the sample to be classified, the sample mask information corresponding to the feature information of the sample to be classified, and the handwriting type label corresponding to the feature information of the sample to be classified;
[0044] The sample feature screening information, the feature information of the sample to be classified, the sample mask information and the handwriting type label are classified and identified to obtain a plurality of handwriting recognition information corresponding to the sample recognition object.
[0045] According to a third aspect of the present disclosure, a handwriting recognition device is provided, the device comprising:
[0046] An image acquisition module is used to acquire an image to be identified; the image to be identified includes a target identification object;
[0047] A feature extraction module is used to input the image to be recognized into a target handwriting recognition model, extract features from the image to be recognized, and obtain feature information to be recognized corresponding to the target recognition object;
[0048] A feature processing module, used for performing feature processing on the feature information to be identified based on the target handwriting recognition model to obtain feature screening information and information to be classified and identified;
[0049] A feature screening module, used to perform feature screening on the to-be-classified identification information based on the feature screening information, and obtain a feature screening result;
[0050] The result output module is used to classify and identify the information to be classified based on the target handwriting recognition model and the feature screening result, and obtain a target recognition result corresponding to the target recognition object.
[0051] According to a fourth aspect of the present disclosure, a training device for a handwriting recognition model is provided, the device comprising:
[0052] A sample acquisition module, used to acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object;
[0053] A model input module, used for inputting the sample recognition image into a preset handwriting recognition model;
[0054] A handwriting recognition module, used for performing handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label;
[0055] A loss information determination module, used to obtain training loss information based on a target loss function, a plurality of handwriting type labels corresponding to the sample recognition object, and the plurality of handwriting recognition information; the target loss function is determined based on a smoothing parameter and the number of handwriting types;
[0056] The model training module is used to perform model training on the preset handwriting recognition model based on the training loss information to obtain a target handwriting recognition model.
[0057] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by the processor to implement the handwriting recognition method and / or the handwriting recognition model training method as described above.
[0058] According to a sixth aspect of the present disclosure, a computer storage medium is provided, in which at least one instruction and at least one program are stored, and the at least one instruction and the at least one program are loaded and executed by a processor to implement the handwriting recognition method and / or the handwriting recognition model training method as described above.
[0059] The implementation of the present invention has the following beneficial effects:
[0060] In the present invention, the image to be identified includes a target identification object, and the image to be identified is input into a target handwriting recognition model. The target handwriting recognition model can perform foreground and background binary classification detection and feature extraction on the image to be identified, and generate feature information to be identified corresponding to the target identification object, thereby ensuring the reliability and comprehensiveness of the target identification object and its feature information, and reducing recognition errors and recognition omissions; then, based on the target handwriting recognition model, feature processing is performed on the feature information to be identified to obtain feature screening information and identification information to be classified, and feature screening is performed on the identification information to be classified according to the feature screening information to determine abnormal identification information, so as to avoid the target handwriting recognition model from identifying the abnormal identification information and obtaining erroneous results, thereby reducing the waste of computing resources; at the same time, classification and recognition are performed according to the feature screening results and the target handwriting recognition model, which can further improve the accuracy and efficiency of handwriting recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 A schematic diagram of a flow chart corresponding to the handwriting recognition model training method provided in an embodiment of the present invention;
[0063] Figure 2 An example diagram of the types of correction symbols provided in an embodiment of the present invention;
[0064] Figure 3 A schematic diagram of the structure corresponding to the handwriting recognition model provided in an embodiment of the present invention;
[0065] Figure 4 A schematic diagram of a flow chart corresponding to a handwriting recognition method provided by an embodiment of the present invention;
[0066] Figure 5 A schematic diagram of a process flow corresponding to the overall throwing of an abnormal symbol provided in an embodiment of the present invention;
[0067] Figure 6 A schematic diagram of a process flow corresponding to the throwing of a straight bar symbol exception provided in an embodiment of the present invention;
[0068] Figure 7 A schematic diagram of a corresponding process of throwing a forward and backward slash symbol exception provided in an embodiment of the present invention;
[0069] Figure 8 A schematic diagram of a process flow corresponding to a check mark exception thrown according to an embodiment of the present invention;
[0070] Fig. 9 A schematic diagram of a process flow corresponding to a cross symbol exception thrown according to an embodiment of the present invention;
[0071] Fig.10 A schematic diagram of a process flow corresponding to throwing a half-checked exception provided by an embodiment of the present invention;
[0072] Fig.11 A schematic diagram of a process flow corresponding to a half-checked exception without a check mark is provided in an embodiment of the present invention;
[0073] Fig.12 A schematic diagram of the structure of a handwriting recognition device provided by an embodiment of the present invention;
[0074] Fig.13 A structural schematic diagram corresponding to the handwriting recognition model training device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0077] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0078] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0079] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0080] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0081] Figure 1 A flowchart corresponding to the handwriting recognition model training method provided in an embodiment of the present invention; the execution subject can be any electronic device capable of executing the training method, such as a terminal, a server, etc., wherein the terminal can be a tablet computer, a laptop, or a personal computer (PC). The server can be a single server or a server cluster consisting of multiple servers.
[0082] In the present invention, the handwriting recognition model can be applied to different handwriting recognition scenarios, such as identifying the writer of the handwriting, identifying the meaning of the text or symbol of the handwriting, and identifying the type of text or symbol of the handwriting. The following is an example of a recognition model trained to recognize the type of correction symbols on the answer sheet, where the answer sheet can be any carrier that can carry handwriting. Figure 1 , a training method for a handwriting recognition model, comprising:
[0083] Step S101: Acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object;
[0084] In a feasible embodiment, the sample recognition object can be various types of correction symbols. According to different people's writing habits and different symbol representation methods, the types and quantities of symbol types can be determined. The types and quantities of symbols can be continuously updated. In the present invention, the number of symbol types can be determined to be 14. Please refer to the symbol types. Figure 2, at least including a correct mark, a wrong mark, a circle, a triangle, a five-pointed star, a forward slash, a backward slash, a question mark, a half-correct mark with a check mark, a half-correct mark without a check mark, etc.; the sample recognition image can be a picture of an answer sheet including correction symbols; the handwriting type label can be a rectangular frame of different colors, used to represent different symbol types, or any other label that can mark and distinguish various correction symbols. That is, the sample recognition image can be: an answer sheet image including various correction symbols, and various correction symbols have been classified and marked with rectangular frames of different colors.
[0085] Step S102: inputting the sample recognition image into a preset handwriting recognition model;
[0086] The preset handwriting recognition model may include: a feature extraction layer, which is used to receive the input image for foreground and background binary classification detection and extract features from the input image; a feature processing layer, which is used to process the feature information extracted by the feature extraction layer; and a result classification layer, which is used to perform fine-grained multi-classification on the feature information obtained after processing by the feature processing layer, and output the recognition result.
[0087] Figure 3 For a structural diagram corresponding to the handwriting recognition model provided in the embodiment of the present invention, please refer to Figure 3 In a specific embodiment, the feature extraction layer may include a multi-scale extraction unit and a feature fusion unit; the multi-scale extraction unit may be FPN (Feature Pyramid Networks), which is used to extract multi-scale features of the input image image, and the feature fusion unit may be conv (Convolution), which is used to fuse the multi-scale features to obtain feature information corresponding to the input image.
[0088] The feature processing layer may include a position determination unit and a feature recognition unit; the position determination unit may use DBNet (Differentiation Network, a segmentation-based text detection algorithm) to process the input feature information, and perform semantic segmentation and decoupling on the hook turning points and cross intersection points corresponding to the ambiguous symbol group (such as a forward slash and a check mark, a half check mark with a check mark and a half check mark without a check mark, or any other combination of two symbols that may cause ambiguity) to determine the position information of the hook turning points and cross intersection points; the feature recognition unit may use ROIPooling (Region of Interest Pooling) to further extract features from the input feature information to obtain more accurate feature information.
[0089] During the training process, the feature processing layer may also include an instance segmentation unit. The instance segmentation unit may use a Mask branch to generate a segmentation mask corresponding to the input feature information. For the obtained mask information, a Gaussian Map may be combined for feature extraction, and key point detection may be used for auxiliary training, thereby improving the accuracy and comprehensiveness of feature information extraction.
[0090] The result classification layer may be a cls_head (sub-classification head), which is used to classify and identify the feature map to generate a recognition result corresponding to the input image, and the recognition result may include a handwriting type label.
[0091] Step S103: performing handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label;
[0092] In a specific embodiment, step 103 may include:
[0093] Step S1031: inputting the sample recognition image into the feature extraction layer;
[0094] Specifically, the sample recognition image includes the sample recognition object and the handwriting type label corresponding to the sample recognition object, that is, the answer sheet image includes a variety of correction symbols that have been pre-classified using rectangular frames of different colors.
[0095] Step S1032: Based on the feature extraction layer, extract features of the sample identification object to obtain multi-scale sample feature information corresponding to the sample identification object;
[0096] Specifically, the sample recognition image is input into the feature extraction layer of the preset handwriting recognition model. First, the multi-scale sample feature information corresponding to the sample recognition object in the sample recognition image is obtained through the multi-scale extraction unit. This can be achieved through a bottom-up path. The multi-scale sample feature information may include sample features of each scale and candidate areas corresponding to the sample features of each scale.
[0097] Step S1033: Based on the feature extraction layer, feature fusion is performed on the multi-scale sample feature information to generate feature information of the sample to be identified corresponding to the sample identification object;
[0098] Furthermore, the sample features of each scale and the candidate regions corresponding to the sample features of each scale are input into the feature fusion unit, so as to fuse the sample features of each scale and obtain the feature information of the sample to be identified.
[0099] By setting up a feature extraction layer, performing foreground and background binary classification detection on the sample recognition image, and combining multi-scale feature information to obtain the feature information of the sample to be recognized, the recall of the correction symbols can be guaranteed, thereby improving the comprehensiveness and reliability of feature determination.
[0100] Step S1034: performing handwriting recognition on the sample feature information to be recognized based on the preset handwriting recognition model to obtain the plurality of handwriting recognition information corresponding to the sample recognition object.
[0101] Specifically, performing handwriting recognition on the feature information of the sample to be recognized based on the preset handwriting recognition model to obtain the plurality of handwriting recognition information corresponding to the sample recognition object may include:
[0102] Step S10341: inputting the feature information of the sample to be identified into the feature processing layer;
[0103] In a specific embodiment, first, the feature information of the sample to be identified is respectively input into two units of the feature processing layer.
[0104] Step S10342: Based on the position determination unit, perform feature binarization processing on the feature information of the sample to be identified to obtain sample feature screening information;
[0105] In a specific embodiment, after the feature information of the sample to be identified is input into the position determination unit, DBNet is used to perform feature binarization processing on the feature information of the sample to be identified, which can be the detection and segmentation of key points of the feature information of the sample to be identified, wherein the key points can be the inflection points and cross points mentioned above, or any other points that can achieve "distinguishing two symbols in the ambiguous symbol group"; the present invention takes cross points and inflection points as examples for explanation.
[0106] Specifically, using DBNet to detect and segment key points of the features of the samples to be identified may include: generating a probability map and a threshold map corresponding to the feature information of the samples to be identified, comparing the probability map and the threshold map pixel by pixel, and then obtaining the final binarization result, that is, the sample feature screening information; Figure 3 As shown, after the feature information of the sample to be identified is input into DBNet, the sample feature screening information corresponding to the cross intersection point and the sample feature screening information corresponding to the hook inflection point can be output.
[0107] In addition, for the symbol circle ○, since ○ has no endpoints, its sample feature screening information is pure black and there is no white key point.
[0108] By detecting and segmenting the key points of the symbols, we can avoid confusion problems such as endpoints and intersections when the correction symbols are small, and reduce the "multi-frame overlap" problem caused by confusion, thereby improving the accuracy of the feature processing process and the comprehensiveness of feature determination.
[0109] Step S10343: Based on the feature recognition unit, feature recognition is performed on the feature information of the sample to be recognized to obtain identification information of the sample to be classified; the identification information of the sample to be classified includes the feature information of the sample to be classified, sample mask information corresponding to the feature information of the sample to be classified, and a handwriting type label corresponding to the feature information of the sample to be classified;
[0110] In one embodiment, after the feature information of the sample to be identified is input into the feature recognition unit, the feature information of the sample to be identified is pooled and classified based on the feature recognition unit to obtain information to be classified, wherein the identification information of the sample to be identified includes the feature information of the sample to be classified and the handwriting type label corresponding to the feature information of the sample to be classified.
[0111] In the model training stage, the instance segmentation unit is further integrated into the feature recognition unit, so that the sample mask information is extracted in the process of feature recognition of the sample feature information to be recognized, so the sample recognition information to be classified also includes the sample mask information. For the sample mask information, it can also be combined with the feature extractor (which can perform key point detection) for further auxiliary training.
[0112] After obtaining the sample feature screening information and the identification information of the sample to be classified, the two are input together into the result classification layer. In the result classification layer, the sample feature screening information and the identification information of the sample to be classified are feature fused, and the obtained endpoint position information is used to assist in the classification of the correction symbols.
[0113] Combining the sample feature screening information and the identification information of the samples to be classified can ensure the semantic segmentation results corresponding to the ambiguous correction symbols in the handwriting recognition process, improve the accuracy and reliability of the recognition of ambiguous correction symbols, and reduce the recognition errors caused by confusion.
[0114] Step S10344: classify and identify the sample feature screening information, the feature information of the sample to be classified, the sample mask information and the handwriting type label to obtain a plurality of handwriting recognition information corresponding to the sample recognition object.
[0115] In a specific embodiment, sample feature screening information, feature information of samples to be classified, sample mask information and handwriting type labels are input into the result classification layer for classification and recognition, and multiple handwriting recognition information corresponding to the sample recognition object is obtained, and the handwriting recognition information corresponds to the handwriting type label.
[0116] Step S104: obtaining training loss information based on a target loss function, a plurality of handwriting type labels corresponding to the sample recognition object, and the plurality of handwriting recognition information; the target loss function is determined based on a smoothing parameter and the number of handwriting types;
[0117] In a specific embodiment, the target loss function is based on the label smooth loss function, and a smoothing parameter and the number of handwriting type labels are introduced to improve the target loss function. The obtained target loss function is as follows:
[0118]
[0119] Among them, is the smoothing parameter, and K is the number of handwriting type labels.
[0120] Specifically, the pseudo code for implementing the target loss function is as follows:
[0121] The input values are: true label y_true, predicted result y_pred, smoothing parameter α and number of categories num_classes,topK; the output value is: encoded label y_smooth.
[0122]
[0123] Among them, 0.6 is the preset confidence, and y_smooth is the training loss information. The improved target loss function will not drop too fast when the prediction is correct during the training phase, and will not punish too much when the prediction is wrong, so that it is not easy to fall into the local optimal point. This can suppress the phenomenon of network overfitting to a certain extent. For scenes with relatively close classification categories, the network's prediction will not be too absolute. After introducing the l be l smoothing technique, by allocating these minority probabilities, the absolute data can also be reduced during the training process.
[0124] Step S105: performing model training on the preset handwriting recognition model based on the training loss information to obtain a target handwriting recognition model.
[0125] In a specific embodiment, the preset handwriting recognition model is iteratively updated based on the training loss information, so as to obtain a target handwriting recognition model whose target recognition result meets the preset confidence.
[0126] In an embodiment of the present invention, a target detection method is used to detect and locate valid correction symbol areas in image texts, and then the valid areas are fine-grainedly classified. In addition, instance segmentation is performed on some symbol categories based on endpoints, inflection points, etc., and the point segmentation features are fused with the red pen symbol features to assist the classification effect in the fine-grained classification stage, which can improve the accuracy of handwriting recognition. At the same time, combined with the improved target loss function, overfitting can be suppressed, thereby optimizing the loss information determination and model training process.
[0127] Furthermore, after the target handwriting recognition model is trained to meet the application requirements, it can be applied to the handwriting recognition method; wherein, handwriting recognition can be applied to different handwriting recognition scenarios, such as identifying the writer of the handwriting, identifying the meaning of the text or symbol corresponding to the handwriting, identifying the type of text or symbol corresponding to the handwriting, etc. The following will take the identification of the type of correction symbol on the answer sheet as an example, and specifically combine Figure 3 The answer sheet can be any carrier that can carry handwriting. In the present invention, the correction symbols marked on the answer sheet are used as an example for explanation.
[0128] Figure 4 FIG. 1 is a flow chart showing the handwriting recognition method according to an embodiment of the present invention. Figure 4 In a specific embodiment, the handwriting recognition method includes:
[0129] Step S401: obtaining an image to be identified; the image to be identified includes a target identification object;
[0130] In a possible embodiment, if Figure 3 As shown, the image to be identified is image, and the target identification objects are C1, C2 and C3.
[0131] Step S402: inputting the image to be recognized into a target handwriting recognition model, performing feature extraction on the image to be recognized, and obtaining feature information to be recognized corresponding to the target recognition object;
[0132] In a specific embodiment, step S402 may include:
[0133] Step S4021: inputting the image to be recognized into the feature extraction layer;
[0134] Step S4022: Based on the feature extraction layer, extract features of the image to be identified to obtain multi-scale feature information corresponding to the image to be identified;
[0135] Specifically, the image is input into the FPN in the feature extraction layer to obtain multi-scale feature information corresponding to the image to be identified, that is, the features of multiple scales and the corresponding candidate areas corresponding to C1, the features of multiple scales and the corresponding candidate areas corresponding to C2, and the features of multiple scales and the corresponding candidate areas corresponding to C3.
[0136] Step S4023: Based on the feature extraction layer, feature fusion is performed on the multi-scale feature information to generate the feature information to be identified corresponding to the target identification object.
[0137] Specifically, feature fusion is performed on the multi-scale feature information of C1, C2 and C3 respectively to obtain the feature information to be identified corresponding to C1, the feature information to be identified corresponding to C2, and the feature information to be identified corresponding to C3.
[0138] Step S403: Based on the target handwriting recognition model, feature processing is performed on the feature information to be recognized to obtain feature screening information and information to be classified and recognized;
[0139] In a specific embodiment, step S403 may include:
[0140] Step S4031: inputting the feature information to be identified into the feature processing layer;
[0141] Specifically, the feature information to be identified corresponding to C1, the feature information to be identified corresponding to C2, and the feature information to be identified corresponding to C3 are respectively input into the position processing unit DBNet and the feature identification unit.
[0142] Step S4032: Based on the position determination unit, perform feature binarization processing on the feature information to be identified to obtain the feature screening information;
[0143] Specifically, feature binarization processing is performed on the feature information to be identified corresponding to C1, the feature information to be identified corresponding to C2, and the feature information to be identified corresponding to C3, respectively, to obtain feature screening information corresponding to C1, feature screening information corresponding to C2, and feature screening information corresponding to C3.
[0144] The feature screening information is used to determine abnormal identification information from multiple feature information to be identified. It can also be considered that the feature screening information is used to determine abnormal identification objects from multiple target identification objects. In the embodiment of the present invention, ambiguous symbols are regarded as abnormal identification objects, and the feature information to be identified corresponding to the ambiguous symbols is determined as abnormal identification information.
[0145] Step S4033: Based on the feature recognition unit, feature recognition is performed on the feature information to be recognized to obtain the recognition information to be classified; the recognition information to be classified includes the feature information to be classified and mask information corresponding to the feature information to be classified.
[0146] Specifically, the standard handwriting type label B0 is also input into the target handwriting recognition model. The standard handwriting type label B0 can also be pre-set in the target handwriting recognition model in the form of preset data; the standard handwriting type label B0 is combined with the feature information to be recognized corresponding to C1 to perform pooling processing poo l and classification processing h1 (h1, h2 and h3 are all heads, used to recognize feature information) to obtain the recognition information to be classified, wherein the recognition information to be classified includes the feature information to be classified C1, the handwriting label information B1 corresponding to the feature information to be classified, and the mask information M1 corresponding to the feature information to be classified; the handwriting label information B1 is combined with the feature information to be recognized corresponding to C2 to perform pooling processing poo l and classification processing h2 to obtain the recognition information to be classified, wherein the recognition information to be classified includes the feature information to be classified C2, the handwriting label information B2 corresponding to the feature information to be classified, and the mask information M2 corresponding to the feature information to be classified; the handwriting label information B2 is combined with the feature information to be recognized corresponding to C3 to perform pooling processing poo l and classification processing h2 to obtain the recognition information to be classified, wherein the recognition information to be classified includes the feature information to be classified C2, the handwriting label information B2 corresponding to the feature information to be classified, and the mask information M2 corresponding to the feature information to be classified l and classification processing h3, obtain the identification information to be classified, wherein the identification information to be classified includes the feature information to be classified C3, the handwriting label information B3 corresponding to the feature information to be classified, and the mask information M3 corresponding to the feature information to be classified. Re-searching by combining multiple handwriting label types obtained by recognition can improve the accuracy of handwriting recognition, that is, the recognition of correction symbols.
[0147] Step S404: Based on the feature screening information, feature screening is performed on the information to be classified and identified to obtain a feature screening result;
[0148] In a specific embodiment, step S404 may include:
[0149] Step S4041: determining whether the feature screening information is consistent with the mask information;
[0150] Specifically, in order to ensure the recognition accuracy of ambiguous correction symbols, they need to be thrown out as abnormal symbols. The method of throwing out can be to pre-set the correction symbols containing specific key points as symbols that need to be thrown out, and mark the feature filtering information corresponding to the thrown out symbols; then, by comparing the marked feature filtering information and mask information, determine the recognition information that needs to be input into the result classification layer.
[0151] Step S4042: If the two are consistent, determining that the identification information to be classified corresponding to the mask information is abnormal identification information;
[0152] In a specific embodiment, if the marked feature screening information and the mask information are consistent, it means that the identification information to be classified corresponding to the mask information needs to be thrown out, and it is determined to be abnormal identification information.
[0153] For abnormal identification information, determine the correction symbol corresponding to the abnormal identification information and throw them out. After throwing, manual verification can be introduced to ensure the reliability of correction symbol recognition. In the process of model recognition, the logic of throwing abnormal identification information can be found in Figure 5-11 . Figure 5 The overall throwing process corresponding to all abnormal identification information, Figure 6-Figure 11 They are straight slash symbol ambiguity throwing, forward and backward slash symbol ambiguity throwing, check symbol ambiguity throwing, cross symbol ambiguity throwing, half pair with check symbol ambiguity throwing and half pair without check symbol ambiguity throwing.
[0154] Step S4043: If the two are inconsistent, determining that the identification information to be classified corresponding to the mask information is normal identification information;
[0155] In a specific embodiment, if the marked feature screening information and the mask information are consistent, it means that the to-be-classified identification information corresponding to the mask information does not need to be thrown out, and it is determined to be normal identification information, and is input into the result classification layer for classification and identification.
[0156] Step S4044: Determine that the abnormal identification information and the normal identification information are the feature screening results.
[0157] Specifically, the feature screening result indicates whether the identification information to be classified is abnormal identification information or normal identification information.
[0158] Step S405: Based on the target handwriting recognition model and the feature screening result, the to-be-classified recognition information is classified and recognized to obtain a target recognition result corresponding to the target recognition object.
[0159] In a specific embodiment, step S405 may include:
[0160] Step S4051: determining normal identification information from the identification information to be classified based on the feature screening result;
[0161] Step S4052: inputting the normal identification information into the result classification layer;
[0162] Step S4053: Based on the result classification layer, classify and identify the normal recognition information to obtain the target recognition result corresponding to the target recognition object.
[0163] Specifically, the normal recognition information is input into the result classification layer, and the ROI alignment process is performed, and then the cls_head is used to perform more accurate classification, and the target recognition result C12 including the recognition results corresponding to the multiple correction symbols is output.
[0164] In an embodiment of the present invention, the image to be identified includes a target identification object, and the image to be identified is input into a target handwriting recognition model. The target handwriting recognition model can perform foreground and background binary classification detection and feature extraction on the image to be identified, and generate feature information to be identified corresponding to the target identification object, thereby ensuring the reliability and comprehensiveness of the target identification object and its feature information, and reducing recognition errors and recognition omissions; then, based on the target handwriting recognition model, feature processing is performed on the feature information to be identified to obtain feature screening information and identification information to be classified, and feature screening is performed on the identification information to be classified according to the feature screening information to determine abnormal identification information, so as to avoid the target handwriting recognition model from identifying the abnormal identification information and obtaining erroneous results, thereby reducing the waste of computing resources; at the same time, classification and identification based on the feature screening results and the target handwriting recognition model can further improve the accuracy of handwriting recognition.
[0165] The embodiment of the present invention also provides a handwriting recognition device, such as Fig.12 As shown, the device comprises:
[0166] The image acquisition module 1210 is used to acquire an image to be recognized; the image to be recognized includes a target recognition object;
[0167] The feature extraction module 1220 is used to input the image to be recognized into the target handwriting recognition model, extract features from the image to be recognized, and obtain feature information to be recognized corresponding to the target recognition object;
[0168] The feature processing module 1230 is used to perform feature processing on the feature information to be identified based on the target handwriting recognition model to obtain feature screening information and identification information to be classified;
[0169] A feature screening module 1240 is used to perform feature screening on the to-be-classified identification information based on the feature screening information to obtain a feature screening result;
[0170] The result output module 1250 is used to classify and identify the information to be classified based on the target handwriting recognition model and the feature screening result, and obtain a target recognition result corresponding to the target recognition object.
[0171] In some other embodiments, the feature processing module 1230 further includes:
[0172] A first input module, used for inputting the feature information to be identified into the feature processing layer;
[0173] A binarization processing module, used for performing feature binarization processing on the feature information to be identified based on the position determination unit to obtain the feature screening information;
[0174] The feature recognition module is used to perform feature recognition on the feature information to be recognized based on the feature recognition unit to obtain the recognition information to be classified; the recognition information to be classified includes the feature information to be classified and mask information corresponding to the feature information to be classified.
[0175] In some other embodiments, the feature screening module 1240 further includes:
[0176] A judgment module, used to judge whether the feature screening information is consistent with the mask information;
[0177] A first information determination module, configured to determine that the identification information to be classified corresponding to the mask information is abnormal identification information if the two are consistent;
[0178] A second information determination module, configured to determine that the identification information to be classified corresponding to the mask information is normal identification information if the two are inconsistent;
[0179] A result determination module is used to determine that the abnormal identification information and the normal identification information are the feature screening results.
[0180] In some other embodiments, the result output module 1250 further includes:
[0181] A third information determination module, configured to determine normal identification information from the identification information to be classified based on the feature screening result;
[0182] A second input module, used for inputting the normal identification information into the result classification layer;
[0183] A classification and recognition module is used to classify and recognize the normal recognition information based on the result classification layer to obtain the target recognition result corresponding to the target recognition object.
[0184] In some other embodiments, the feature extraction module 1220 further includes:
[0185] A third input module, used for inputting the image to be recognized into the feature extraction layer;
[0186] A multi-scale information extraction module, used to extract features of the image to be identified based on the feature extraction layer, and obtain multi-scale feature information corresponding to the image to be identified;
[0187] A feature fusion module is used to perform feature fusion on the multi-scale feature information based on the feature extraction layer to generate the feature information to be identified corresponding to the target identification object.
[0188] The present invention also provides a handwriting recognition model training device, see Fig.13 , the device comprises:
[0189] The sample acquisition module 1310 is used to acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object;
[0190] Model input module 1320, used for inputting the sample recognition image into a preset handwriting recognition model;
[0191] The handwriting recognition module 1330 is used to perform handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label;
[0192] A loss information determination module 1340, configured to obtain training loss information based on a target loss function, a plurality of handwriting type labels corresponding to the sample recognition object, and the plurality of handwriting recognition information; the target loss function is determined based on a smoothing parameter and the number of handwriting types;
[0193] The model training module 1350 is used to perform model training on the preset handwriting recognition model based on the training loss information to obtain a target handwriting recognition model.
[0194] In some other embodiments, the handwriting recognition module 1330 further includes:
[0195] A first sample input module, used for inputting the sample recognition image into the feature extraction layer;
[0196] A sample feature extraction module, used to extract features of the sample identification object based on the feature extraction layer to obtain multi-scale sample feature information corresponding to the sample identification object;
[0197] A sample feature fusion module, used to perform feature fusion on the multi-scale sample feature information based on the feature extraction layer to generate feature information of the sample to be identified corresponding to the sample identification object;
[0198] The sample handwriting recognition module is used to perform handwriting recognition on the sample feature information to be recognized based on the preset handwriting recognition model to obtain the multiple handwriting recognition information corresponding to the sample recognition object.
[0199] In some other embodiments, the sample handwriting recognition module 1330 further includes:
[0200] A second sample input module, used to input the feature information of the sample to be identified into the feature processing layer;
[0201] A sample binarization processing module, used to perform feature binarization processing on the feature information of the sample to be identified based on the position determination unit to obtain sample feature screening information;
[0202] A sample feature recognition module, configured to perform feature recognition on the feature information of the sample to be recognized based on the feature recognition unit to obtain the sample recognition information to be classified; the sample recognition information to be classified includes the sample feature information to be classified, sample mask information corresponding to the sample feature information to be classified, and a handwriting type label corresponding to the sample feature information to be classified;
[0203] The sample recognition module is used to classify and recognize the sample feature screening information, the feature information of the sample to be classified, the sample mask information and the handwriting type label to obtain a plurality of handwriting recognition information corresponding to the sample recognition object.
[0204] The device and method embodiments in the device embodiment are based on the same inventive concept and are used to implement the above-mentioned handwriting recognition method and / or handwriting recognition model training method.
[0205] An embodiment of the present invention also provides an electronic device, comprising: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a handwriting recognition method and / or a handwriting recognition model training method as described in any one of the method embodiments.
[0206] An embodiment of the present invention also provides a storage medium, which can be set in a server to store at least one instruction, at least one program, code set or instruction set used to implement the method embodiment. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the handwriting recognition method and / or the handwriting recognition model training method as described in any one of the method embodiments.
[0207] Optionally, in an embodiment of the present invention, the above-mentioned storage medium may be located in at least one of a plurality of network servers of a computer network. Optionally, in an embodiment of the present invention, the above-mentioned storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0208] It can be seen from the embodiments provided by the present invention that, in the present invention, the image to be identified includes a target identification object, and the image to be identified is input into the target handwriting recognition model. The target handwriting recognition model can perform foreground and background binary classification detection and feature extraction on the image to be identified, and generate feature information to be identified corresponding to the target identification object, thereby ensuring the reliability and comprehensiveness of the target identification object and its feature information, and reducing recognition errors and recognition omissions; then, based on the target handwriting recognition model, feature processing is performed on the feature information to be identified to obtain feature screening information and identification information to be classified, and feature screening is performed on the identification information to be classified according to the feature screening information to determine abnormal identification information, so as to avoid the target handwriting recognition model from identifying the abnormal identification information and obtaining erroneous results, thereby reducing the waste of computing resources; at the same time, classification and identification based on the feature screening results and the target handwriting recognition model can further improve the accuracy of handwriting recognition.
[0209] It should be noted that various embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used in this article is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A handwriting recognition method, characterized in that: The method comprises: Acquire an image to be identified; the image to be identified includes a target identification object; Input the image to be recognized into the target handwriting recognition model, perform feature extraction on the image to be recognized, and obtain feature information to be recognized corresponding to the target recognition object; Based on the target handwriting recognition model, feature processing is performed on the feature information to be recognized to obtain feature screening information and information to be classified and recognized; Based on the feature screening information, feature screening is performed on the to-be-classified identification information to obtain a feature screening result; Based on the target handwriting recognition model and the feature screening result, the to-be-classified recognition information is classified and recognized to obtain a target recognition result corresponding to the target recognition object.
2. A handwriting recognition method according to claim 1, characterized in that: The target handwriting recognition model includes a feature processing layer; the feature processing layer includes a position determination unit and a feature recognition unit; The step of performing feature processing on the feature information to be identified based on the target handwriting recognition model to obtain feature screening information and information to be classified and identified includes: Inputting the feature information to be identified into the feature processing layer; Based on the position determination unit, the feature information to be identified is subjected to feature binarization processing to obtain the feature screening information; Based on the feature recognition unit, feature recognition is performed on the feature information to be recognized to obtain the recognition information to be classified; the recognition information to be classified includes the feature information to be classified and mask information corresponding to the feature information to be classified.
3. A handwriting recognition method according to claim 2, characterized in that: The step of performing feature screening on the to-be-classified identification information based on the feature screening information to obtain a feature screening result includes: Determining whether the feature screening information is consistent with the mask information; If the two are consistent, determining that the identification information to be classified corresponding to the mask information is abnormal identification information; If the two are inconsistent, determining that the identification information to be classified corresponding to the mask information is normal identification information; The abnormal identification information and the normal identification information are determined as the feature screening result.
4. A handwriting recognition method according to claim 1, characterized in that: The target handwriting recognition model also includes a result classification layer; The step of classifying and identifying the to-be-classified identification information based on the target handwriting recognition model and the feature screening result to obtain a target identification result corresponding to the target identification object includes: Determining normal identification information from the identification information to be classified based on the feature screening result; Inputting the normal identification information into the result classification layer; Based on the result classification layer, the normal recognition information is classified and recognized to obtain the target recognition result corresponding to the target recognition object.
5. A handwriting recognition method according to claim 1, characterized in that: The target handwriting recognition model includes a feature extraction layer; The step of inputting the image to be recognized into a target handwriting recognition model, extracting features from the image to be recognized, and obtaining feature information to be recognized corresponding to the target recognition object includes: Inputting the image to be recognized into the feature extraction layer; Based on the feature extraction layer, feature extraction is performed on the image to be identified to obtain multi-scale feature information corresponding to the image to be identified; Based on the feature extraction layer, feature fusion is performed on the multi-scale feature information to generate the feature information to be identified corresponding to the target identification object.
6. A method for training a handwriting recognition model, used to implement the handwriting recognition method according to any one of claims 1 to 5, characterized in that: The training method comprises: Acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object; Inputting the sample recognition image into a preset handwriting recognition model; Perform handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label; Based on the target loss function, the multiple handwriting type labels corresponding to the sample recognition object and the multiple handwriting recognition information, the training loss information is obtained; the target loss function is determined based on the smoothing parameter and the number of handwriting types; The preset handwriting recognition model is trained based on the training loss information to obtain a target handwriting recognition model.
7. A method for training a handwriting recognition model according to claim 6, characterized in that: The preset handwriting recognition model includes a feature extraction layer; The step of performing handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object includes: Inputting the sample recognition image into the feature extraction layer; Based on the feature extraction layer, feature extraction is performed on the sample identification object to obtain multi-scale sample feature information corresponding to the sample identification object; Based on the feature extraction layer, feature fusion is performed on the multi-scale sample feature information to generate feature information of the sample to be identified corresponding to the sample identification object; Handwriting recognition is performed on the sample feature information to be recognized based on the preset handwriting recognition model to obtain the multiple handwriting recognition information corresponding to the sample recognition object.
8. The method for training a handwriting recognition model according to claim 7, characterized in that: The preset handwriting recognition model includes a feature processing layer, and the feature processing layer includes a position determination unit and a feature recognition unit; The step of performing handwriting recognition on the feature information of the sample to be recognized based on the preset handwriting recognition model to obtain the plurality of handwriting recognition information corresponding to the sample recognition object includes: Inputting the feature information of the sample to be identified into the feature processing layer; Based on the position determination unit, feature binarization processing is performed on the feature information of the sample to be identified to obtain sample feature screening information; Based on the feature recognition unit, feature recognition is performed on the feature information of the sample to be recognized to obtain the identification information of the sample to be classified; the identification information of the sample to be classified includes the feature information of the sample to be classified, the sample mask information corresponding to the feature information of the sample to be classified, and the handwriting type label corresponding to the feature information of the sample to be classified; The sample feature screening information, the feature information of the sample to be classified, the sample mask information and the handwriting type label are classified and identified to obtain a plurality of handwriting recognition information corresponding to the sample recognition object.
9. A handwriting recognition device, characterized in that: The device comprises: An image acquisition module is used to acquire an image to be identified; the image to be identified includes a target identification object; A feature extraction module is used to input the image to be recognized into a target handwriting recognition model, perform feature extraction on the image to be recognized, and obtain feature information to be recognized corresponding to the target recognition object; A feature processing module, used for performing feature processing on the feature information to be identified based on the target handwriting recognition model to obtain feature screening information and information to be classified and identified; A feature screening module, used to perform feature screening on the to-be-classified identification information based on the feature screening information, and obtain a feature screening result; The result output module is used to classify and identify the information to be classified based on the target handwriting recognition model and the feature screening result, and obtain a target recognition result corresponding to the target recognition object.
10. A training device for a handwriting recognition model, characterized in that: The device comprises: A sample acquisition module, used to acquire a sample recognition image; the sample recognition image includes a sample recognition object and a plurality of handwriting type labels corresponding to the sample recognition object; A model input module, used for inputting the sample recognition image into a preset handwriting recognition model; A handwriting recognition module, used for performing handwriting recognition on the sample recognition object based on the preset handwriting recognition model to obtain a plurality of handwriting recognition information corresponding to the sample recognition object; each piece of handwriting recognition information corresponds to a handwriting type label; A loss information determination module, used to obtain training loss information based on a target loss function, a plurality of handwriting type labels corresponding to the sample recognition object, and the plurality of handwriting recognition information; the target loss function is determined based on a smoothing parameter and the number of handwriting types; The model training module is used to perform model training on the preset handwriting recognition model based on the training loss information to obtain a target handwriting recognition model.
11. An electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by the processor to implement the handwriting recognition method as described in any one of claims 1 to 5 or the training method of the handwriting recognition model as described in any one of claims 6 to 8.
12. A computer storage medium, wherein at least one instruction and at least one program are stored in the computer storage medium, wherein the at least one instruction and the at least one program are loaded and executed by a processor to implement the handwriting recognition method as described in any one of claims 1 to 5 or the handwriting recognition model training method as described in any one of claims 6 to 8.