Handwriting recognition and identification method and device
Through the combination of K nearest neighbor method and convolutional neural network algorithm, automatic handwriting recognition and identification are realized, which solves the problems of low efficiency and high cost of handwriting identification in the existing technology, and improves the efficiency and accuracy of handwriting identification and identification. Reduced costs.
Patent Information
- Application Number
- CN202210544817.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, handwriting identification mainly relies on manual recognition, which results in low efficiency, high cost and low popularity, and cannot effectively improve the efficiency and accuracy of handwriting identification and identification.
The K nearest neighbor method and convolutional neural network algorithm are used to automatically identify the writing content of the target handwriting picture, and use the handwriting identification neural network model to determine the label of the writer to achieve automated handwriting identification.
It improves the efficiency and accuracy of handwriting recognition and identification, reduces costs, increases popularity, and avoids the problems of low efficiency and accuracy of manual identification.
Smart Images

Figure CN114937273B_ABST
Abstract
Description
Technical Field
[0001] The present invention can be used in the financial field or other fields, and in particular relates to a handwriting recognition and identification method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] In the modern society with rapid technological development, although there are tools to prove identity such as facial recognition and fingerprint recognition, in some life scenarios, personal handwriting information represented by personal signatures is still used as an important tool to prove personal identity, such as credit card signature swiping, contract signature, etc.
[0004] At present, handwriting identification is mainly achieved through manual identification, which is carried out by analyzing and comparing writing movements, text layout and other features. This leads to high cost and low efficiency of handwriting identification. It is not popular enough and most of the time, supplementary identification is carried out after problems occur in the current handwriting file. Summary of the invention
[0005] The embodiment of the present invention provides a handwriting recognition and identification method, which is used to improve the efficiency, accuracy and popularity of handwriting recognition and identification, and reduce the cost of handwriting recognition and identification. The method includes:
[0006] Obtain the target handwriting image to be identified;
[0007] Based on the K nearest neighbor method, the target handwriting image is recognized to determine the writing content of the target handwriting image;
[0008] Based on the convolutional neural network algorithm, the target handwriting picture is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting picture; the handwriting identification neural network model is obtained by training the neural network model according to the historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels;
[0009] When it is determined that the written content of the target handwriting image is the target user's own name, and the writer label corresponding to the target handwriting image is the target user himself, it is determined that the target handwriting image is written by the target user himself, and a notification message that the identification of the target handwriting image has passed is issued.
[0010] The embodiment of the present invention further provides a handwriting recognition and identification device, which is used to improve the efficiency, accuracy and popularity of handwriting recognition and identification, and reduce the cost of handwriting recognition and identification. The device includes:
[0011] A target handwriting image acquisition module is used to acquire a target handwriting image to be identified;
[0012] A handwriting recognition module is used to perform handwriting recognition on a target handwriting image based on a K nearest neighbor method to determine the writing content of the target handwriting image;
[0013] A handwriting identification module is used to input the target handwriting picture into the handwriting identification neural network model based on the convolutional neural network algorithm to obtain the writer label corresponding to the target handwriting picture; the handwriting identification neural network model is obtained by training the neural network model according to the historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels;
[0014] The notification information sending module is used to determine that the target handwriting picture is written by the target user himself when it is determined that the written content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, and send a notification message that the identification of the target handwriting picture has passed.
[0015] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned handwriting recognition and identification method when executing the computer program.
[0016] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned handwriting recognition and identification method is implemented.
[0017] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned handwriting recognition and identification method is implemented.
[0018] In an embodiment of the present invention, a target handwriting picture to be identified is obtained; based on the K nearest neighbor method, handwriting recognition is performed on the target handwriting picture to determine the writing content of the target handwriting picture; based on the convolutional neural network algorithm, the target handwriting picture is input into a handwriting identification neural network model to obtain a writer label corresponding to the target handwriting picture; the handwriting identification neural network model is trained based on historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels; when it is determined that the writing content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, it is determined that the target handwriting picture is written by the target user himself, and a target handwriting is issued. The notification information of the handwriting picture identification passing, compared with the technical solution in the prior art that can only manually identify and identify the handwriting picture, can automatically identify the writing content of the target handwriting picture through the K nearest neighbor method, and with the help of the handwriting identification neural network model, determine the writer label corresponding to the target handwriting picture, and automatically realize the identification of the target handwriting picture, avoiding the problems of low efficiency and accuracy that are inevitably caused by manual identification and identification of handwriting pictures under the prior art, and improving the efficiency and accuracy of handwriting recognition and identification. At the same time, it also solves the problem of low popularity of handwriting recognition and identification due to the high cost of handwriting recognition and identification under the prior art, reduces the cost of handwriting recognition and identification, and improves the popularity of handwriting recognition and identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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 creative work. In the drawings:
[0020] Figure 1 A flowchart of a handwriting recognition and identification method according to an embodiment of the present invention;
[0021] Figure 2 A specific example diagram of a handwriting recognition and identification method in an embodiment of the present invention;
[0022] Figure 3 A specific example diagram of a handwriting recognition and identification method in an embodiment of the present invention;
[0023] Figure 4 This is a structural example diagram of a handwriting recognition and identification device in an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0026] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: 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 may represent including any one or more elements selected from the set consisting of A, B, and C.
[0027] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.
[0028] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0029] The embodiments of the present invention involve the following terms, which are explained as follows:
[0030] K nearest neighbor method, also known as KNN algorithm, if most of the K nearest neighboring samples of a sample in the feature space belong to a certain category, then the sample also belongs to this category and has the characteristics of the samples in this category;
[0031] Convolutional neural network: CNN for short, is a type of feedforward neural network with deep structure and convolutional calculation, and one of the representative algorithms of deep learning. It is constructed by imitating the visual perception mechanism of organisms, and can perform supervised learning and unsupervised learning. The convolution kernel parameter sharing in the hidden layer and the sparsity of the inter-layer connection enable the convolutional neural network to grid features with less computational effort;
[0032] At present, in the modern society with rapid development of science and technology, although there are tools for proving identity such as facial recognition and fingerprint recognition, in some life scenarios, personal handwriting information represented by personal signatures is still used as an important tool to prove personal identity, such as credit card signature swiping, contract signature, etc.
[0033] At present, handwriting identification is mainly achieved through manual identification, which is carried out by analyzing and comparing writing movements, text layout and other features. This leads to high cost and low efficiency of handwriting identification. It is not popular enough and most of the time, supplementary identification is carried out after problems occur in the current handwriting file.
[0034] In order to solve the above problems, the present invention provides a method for handwriting recognition and identification. Figure 1 , the method may include:
[0035] Step 101: Obtain a target handwriting image to be identified;
[0036] Step 102: Based on the K nearest neighbor method, perform handwriting recognition on the target handwriting image to determine the writing content of the target handwriting image;
[0037] Step 103: Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image; the handwriting identification neural network model is obtained by training the neural network model according to the historical handwriting image identification data; the historical handwriting image identification data includes handwriting images corresponding to different writer labels;
[0038] Step 104: When it is determined that the written content of the target handwriting image is the target user's name, and the writer label corresponding to the target handwriting image is the target user himself, it is determined that the target handwriting image is written by the target user himself, and a notification message indicating that the identification of the target handwriting image has been passed is issued.
[0039] In an embodiment of the present invention, a target handwriting picture to be identified is obtained; based on the K nearest neighbor method, handwriting recognition is performed on the target handwriting picture to determine the writing content of the target handwriting picture; based on the convolutional neural network algorithm, the target handwriting picture is input into a handwriting identification neural network model to obtain a writer label corresponding to the target handwriting picture; the handwriting identification neural network model is trained based on historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels; when it is determined that the writing content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, it is determined that the target handwriting picture is written by the target user himself, and a target handwriting is issued. The notification information of the handwriting picture identification passing, compared with the technical solution in the prior art that can only manually identify and identify the handwriting picture, can automatically identify the writing content of the target handwriting picture through the K nearest neighbor method, and with the help of the handwriting identification neural network model, determine the writer label corresponding to the target handwriting picture, and automatically realize the identification of the target handwriting picture, avoiding the problems of low efficiency and accuracy that are inevitably caused by manual identification and identification of handwriting pictures under the prior art, and improving the efficiency and accuracy of handwriting recognition and identification. At the same time, it also solves the problem of low popularity of handwriting recognition and identification due to the high cost of handwriting recognition and identification under the prior art, reduces the cost of handwriting recognition and identification, and improves the popularity of handwriting recognition and identification.
[0040] During specific implementation, firstly, a target handwriting image to be identified is obtained.
[0041] In an embodiment, for example, an electronic document may be scanned to obtain a target handwriting image to be identified.
[0042] In specific implementation, after obtaining the target handwriting image to be identified, handwriting recognition is performed on the target handwriting image based on the K nearest neighbor method to determine the writing content of the target handwriting image.
[0043] In the embodiment, based on the K nearest neighbor method, the target handwriting image is subjected to handwriting recognition to determine the writing content of the target handwriting image, such as Figure 2 As shown, including:
[0044] Step 201: Based on the K nearest neighbor method, a plurality of handwriting images and historical data corresponding to the writing contents of the plurality of handwriting images are used as a training sample set to train an algorithm model of the K nearest neighbor method to obtain a trained K nearest neighbor algorithm model;
[0045] Step 202: converting the handwriting pixels in the target handwriting image into a two-dimensional matrix vector;
[0046] Step 203: Input the two-dimensional matrix vector into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
[0047] In one embodiment, the above method further includes:
[0048] Using multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures as a test sample set, testing the trained K nearest neighbor algorithm model, and obtaining a K nearest neighbor algorithm model that passes the test;
[0049] The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image, including:
[0050] The two-dimensional matrix vector is input into the tested K-nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
[0051] For example, the above-mentioned K-nearest neighbor method is used to perform handwriting recognition on the target handwriting image to determine the writing content of the target handwriting image, which may specifically include:
[0052] 1. Data preprocessing: convert the target handwriting image into a two-dimensional matrix and then into a vector; the KNN core algorithm can be implemented in subsequent steps, and the algorithm can be trained with a large number of training sets;
[0053] 2. The handwriting image is converted into a two-dimensional matrix and then into a vector;
[0054] Convert the target handwriting image into a two-dimensional matrix, which can be achieved by using pixel points, such as taking black pixels as 1 and white pixels as 0; convert the two-dimensional matrix into a vector (such as a one-dimensional array), for example, this step can be achieved using the matlab method;
[0055] 3. Implement the KNN core algorithm. A large number of training sets can be used to train the algorithm model to obtain a trained K nearest neighbor algorithm model:
[0056] The core of the above algorithm is: there is a training sample set, and each data in the sample set has a label (the writing content corresponding to each handwriting image). Here, the sample set is a number of handwritten samples converted into vectors, and the label of the sample is the corresponding word. Use a large number of sample sets to train the algorithm, and then finally input a new data without a label, that is, the handwritten word to be recognized. The algorithm compares the features of the data with the data in the sample set and extracts the most similar classification label of the sample, that is, the word corresponding to the handwritten word to be recognized.
[0057] The implementation process of the above algorithm is roughly as follows: calculate the distance between the pixel points in the known category data set and the current pixel point; and sort them in ascending order of distance; select k points with the smallest distance from the current point; determine the frequency of occurrence of the category of the first k points; return the category with the highest frequency of occurrence of the first k points as the predicted category of the current point, k is generally less than 20.
[0058] The value of k can be determined as follows: k refers to the k data closest to the feature, that is, the k data closest to the original description. Which type of data is the most common among these k data is judged as the current data type. The smaller the k value, the higher the complexity and the lower the error. Generally, it is 1--20.
[0059] For example, in this model, k is set to 3. Among the three data closest to the current data, two are of type "Zhang San" and one is of type "Li Hong". Then the algorithm will determine that the current data type is "Zhang San".
[0060] In one embodiment, the above-mentioned prediction classification is the final result of handwriting recognition; the knn algorithm is a classification algorithm, the writing content is the type, and the handwriting picture is the data under this type.
[0061] In the specific implementation, after obtaining the target handwriting picture to be identified, based on the convolutional neural network algorithm, the target handwriting picture is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting picture; the handwriting identification neural network model is trained based on the historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels.
[0062] In an embodiment, the above method further includes:
[0063] The convolutional layer, activation layer, pooling layer, and fully connected layer of the neural network model to be trained are established as follows:
[0064] Extract image feature values of different handwriting images and their corresponding labels of writers from historical handwriting image identification data; convert the extracted image feature values into matrix vectors corresponding to different handwriting images; use the matrix vectors corresponding to different handwriting images as the convolution layer of the neural network model to be trained;
[0065] Establishing an activation layer of the neural network model to be trained for calculating the matrix vector output by the convolution layer using an activation function;
[0066] Establishing a pooling layer of the neural network model to be trained for performing dimensionality reduction processing on the result calculated by the activation layer;
[0067] A fully connected layer of the neural network model to be trained is established to connect different convolutional layers, activation layers, and pooling layers.
[0068] In one embodiment, the handwriting identification neural network model is obtained by training the neural network model based on historical handwriting image identification data; the historical handwriting image identification data includes handwriting images corresponding to different writer labels.
[0069] In one embodiment, the above method further includes:
[0070] The handwriting identification neural network model is trained and verified as follows: Figure 3 As shown, the following steps may be included:
[0071] Step 301: using the historical handwriting image identification data as a training set, training the neural network model to be trained, and obtaining a trained handwriting identification neural network model;
[0072] Step 302: Using the historical handwriting image identification data as a verification set, verifying the trained handwriting identification neural network model, and obtaining a verified handwriting identification neural network model after the verification passes;
[0073] Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image, including:
[0074] Based on the convolutional neural network algorithm, the target handwriting image is input into the verified handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image.
[0075] In the above embodiment, the step of performing handwriting recognition on the target handwriting image based on the K nearest neighbor method to determine the writing content of the target handwriting image, and the step of inputting the target handwriting image into the handwriting identification neural network model based on the convolutional neural network algorithm to obtain the writer label corresponding to the target handwriting image, are in no particular order and can be set according to actual usage requirements.
[0076] For example, the training set should be: a large number of handwritten image samples and a large number of corresponding labels of handwriters (here refers to many people and many image samples). The final model is to input a handwritten image and return the label it belongs to (handwriter).
[0077] In one embodiment, the accuracy of the KNN and convolutional neural network algorithms is proportional to the degree of training, and a large number of training sets are required to train the algorithms.
[0078] For example, the step of inputting the target handwriting image into the handwriting identification neural network model based on the convolutional neural network algorithm to obtain the writer label corresponding to the target handwriting image may specifically include:
[0079] 1. First, the target handwriting image is cropped and the image data is processed; then, in the subsequent steps, the image parameters are extracted and the convolutional neural network algorithm is constructed; and the above algorithm is trained;
[0080] 2. Data cropping, processing image data;
[0081] 3. After the image is input, it is converted into RGB data of width × height × depth, and the data is de-meaned;
[0082] Extract image parameters, build a convolutional neural network algorithm, and sequentially establish the convolutional layer, activation layer, pooling layer, and fully connected layer of the neural network model to be trained:
[0083] Convolutional layer: constructs filters (neurons) at a specific step size, traverses the entire image file, calculates weight values, extracts the eigenvalues of the image, and outputs a smaller matrix;
[0084] Activation layer: Use the activation function to calculate the matrix output by the convolution layer. The activation function is a nonlinear function, such as relu;
[0085] Pooling layer: dimensionality reduction. For example, 28×28×3 data passes through a pooling layer with a size of 2×2 and a stride of 2, and outputs 14×14×3 reduced-dimensional data. Among them, 28*28 refers to the size of the image, which can be understood as pixels; 3 is the color channel of the image.
[0086] Fully connected layer: After passing through multiple different convolutional layers, activation layers, and pooling layers, the data is flattened into a one-dimensional network, input into the fully connected layer, and finally outputs the result.
[0087] 4. Train the algorithm
[0088] Based on the K nearest neighbor method, multiple handwriting images and historical data corresponding to the writing content of the multiple handwriting images are used as training sample sets to train the algorithm model of the K nearest neighbor method to obtain a trained K nearest neighbor algorithm model. For example, handwriting images are used as samples and handwriters are used as labels. After a large amount of training, handwriting is input to determine whether it is written by the person himself.
[0089] In specific implementation, when it is determined that the written content of the target handwriting image is the target user's name, and the writer label corresponding to the target handwriting image is the target user himself, the target handwriting image is determined to be written by the target user himself, and a notification message that the identification of the target handwriting image has passed is issued.
[0090] In the embodiment, when it is determined that the written content of the target handwriting image is not the name of the target user himself, or when the writer label corresponding to the target handwriting image is not the target user himself, it is determined that the target handwriting image is not written by the target user himself, or an alarm message that the identification of the target handwriting image has not passed is issued. A specific embodiment is given below to illustrate the specific application of the method of the present invention. In this embodiment, the following steps may be included:
[0091] 1. Handwriting scanning and input: obtain the target handwriting image to be identified and input the handwriting as an image;
[0092] 2. Handwriting recognition (based on KNN algorithm): Based on the K nearest neighbor method, the target handwriting image is recognized to determine the writing content of the target handwriting image: the image is processed into a vector, input into the trained KNN algorithm, recognize the handwriting, and return the recognition result. For example: the recognized writing content is: Zhang San;
[0093] 3. Handwriting identification (based on convolutional neural network). Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image: the image data is input into the trained convolutional neural network to identify the writer label corresponding to the image data.
[0094] 4. Result display: The writing content of the determined target handwriting picture and the label of the writer corresponding to the determined target handwriting picture are displayed together, and the display format is similar to: the identified writing content is: Zhang San, and the label of the writer corresponding to the target handwriting picture is Zhang San.
[0095] Of course, it is understandable that the above detailed process may have other variations, and the relevant variations should all fall within the protection scope of the present invention.
[0096] In an embodiment of the present invention, a target handwriting picture to be identified is obtained; based on the K nearest neighbor method, handwriting recognition is performed on the target handwriting picture to determine the writing content of the target handwriting picture; based on the convolutional neural network algorithm, the target handwriting picture is input into a handwriting identification neural network model to obtain a writer label corresponding to the target handwriting picture; the handwriting identification neural network model is trained based on historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels; when it is determined that the writing content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, it is determined that the target handwriting picture is written by the target user himself, and a target handwriting is issued. The notification information of the handwriting picture identification passing, compared with the technical solution in the prior art that can only manually identify and identify the handwriting picture, can automatically identify the writing content of the target handwriting picture through the K nearest neighbor method, and with the help of the handwriting identification neural network model, determine the writer label corresponding to the target handwriting picture, and automatically realize the identification of the target handwriting picture, avoiding the problems of low efficiency and accuracy that are inevitably caused by manual identification and identification of handwriting pictures under the prior art, and improving the efficiency and accuracy of handwriting recognition and identification. At the same time, it also solves the problem of low popularity of handwriting recognition and identification due to the high cost of handwriting recognition and identification under the prior art, reduces the cost of handwriting recognition and identification, and improves the popularity of handwriting recognition and identification.
[0097] As mentioned above, the present invention is intended to realize a handwriting reverse display recognition and identification tool. After scanning the handwriting information, the handwriting content is reversed, and it is identified whether it is the handwriting of the person himself, by: scanning the handwriting information to generate an image, identifying the handwriting reverse display and handwriting identification in parallel: using the KNN core algorithm to perform handwriting font recognition and reverse display of the font; using a convolutional neural network to perform handwriting identification. The embodiment of the present invention realizes the reverse display and identification of handwritten handwriting through machine learning and artificial intelligence training, solves the problem of high cost of manual identification, reduces the cost of handwriting identification, and can be verified on the spot when signing and writing, avoiding subsequent supplementary verification.
[0098] The present invention also provides a handwriting recognition and identification device, as described in the following embodiments. Since the principle of the device to solve the problem is similar to that of the handwriting recognition and identification method, the implementation of the device can refer to the implementation of the handwriting recognition and identification method, and the repeated parts will not be repeated.
[0099] The embodiment of the present invention also provides a handwriting recognition and identification device, which is used to improve the efficiency, accuracy and popularity of handwriting recognition and identification, and reduce the cost of handwriting recognition and identification. Figure 4 As shown, the device comprises:
[0100] The target handwriting image acquisition module 401 is used to acquire the target handwriting image to be identified;
[0101] The handwriting recognition module 402 is used to perform handwriting recognition on the target handwriting image based on the K nearest neighbor method to determine the writing content of the target handwriting image;
[0102] The handwriting identification module 403 is used to input the target handwriting picture into the handwriting identification neural network model based on the convolutional neural network algorithm to obtain the writer label corresponding to the target handwriting picture; the handwriting identification neural network model is obtained by training the neural network model according to the historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels;
[0103] The notification information sending module 404 is used to determine that the target handwriting picture is written by the target user himself when it is determined that the written content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, and send a notification message that the identification of the target handwriting picture has been passed.
[0104] In one embodiment, the handwriting recognition module is specifically used to:
[0105] Based on the K nearest neighbor method, multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures are used as training sample sets to train the algorithm model of the K nearest neighbor method to obtain a trained K nearest neighbor algorithm model;
[0106] Convert the handwriting pixels in the target handwriting image into a two-dimensional matrix vector;
[0107] The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
[0108] In one embodiment, it further includes:
[0109] Model validation module for:
[0110] Using multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures as a test sample set, testing the trained K nearest neighbor algorithm model, and obtaining a K nearest neighbor algorithm model that passes the test;
[0111] The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image, including:
[0112] The two-dimensional matrix vector is input into the tested K-nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
[0113] In one embodiment, it further includes:
[0114] The neural network model to be trained is used to build the module for:
[0115] The convolutional layer, activation layer, pooling layer, and fully connected layer of the neural network model to be trained are established as follows:
[0116] Extract image feature values of different handwriting images and their corresponding labels of writers from historical handwriting image identification data; convert the extracted image feature values into matrix vectors corresponding to different handwriting images; use the matrix vectors corresponding to different handwriting images as the convolution layer of the neural network model to be trained;
[0117] Establishing an activation layer of the neural network model to be trained for calculating the matrix vector output by the convolution layer using an activation function;
[0118] Establishing a pooling layer of the neural network model to be trained for performing dimensionality reduction processing on the result calculated by the activation layer;
[0119] A fully connected layer of the neural network model to be trained is established to connect different convolutional layers, activation layers, and pooling layers.
[0120] In one embodiment, it further includes:
[0121] Handwriting identification neural network model building module, used for:
[0122] The handwriting identification neural network model is trained and validated as follows:
[0123] Taking the historical handwriting image identification data as a training set, training the neural network model to be trained to obtain a trained handwriting identification neural network model;
[0124] The historical handwriting image identification data is used as a verification set to verify the trained handwriting identification neural network model. After the verification is passed, a verified handwriting identification neural network model is obtained;
[0125] Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image, including:
[0126] Based on the convolutional neural network algorithm, the target handwriting image is input into the verified handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image.
[0127] Based on the above invention concept, Figure 5 As shown, the present invention also proposes a computer device 500, including a memory 510, a processor 520, and a computer program 530 stored in the memory 510 and executable on the processor 520, and the processor 520 implements the above-mentioned handwriting recognition and identification method when executing the computer program 530.
[0128] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned handwriting recognition and identification method is implemented.
[0129] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned handwriting recognition and identification method is implemented.
[0130] In an embodiment of the present invention, a target handwriting picture to be identified is obtained; based on the K nearest neighbor method, handwriting recognition is performed on the target handwriting picture to determine the writing content of the target handwriting picture; based on the convolutional neural network algorithm, the target handwriting picture is input into a handwriting identification neural network model to obtain a writer label corresponding to the target handwriting picture; the handwriting identification neural network model is trained based on historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels; when it is determined that the writing content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, it is determined that the target handwriting picture is written by the target user himself, and a target handwriting is issued. The notification information of the handwriting picture identification passing, compared with the technical solution in the prior art that can only manually identify and identify the handwriting picture, can automatically identify the writing content of the target handwriting picture through the K nearest neighbor method, and with the help of the handwriting identification neural network model, determine the writer label corresponding to the target handwriting picture, and automatically realize the identification of the target handwriting picture, avoiding the problems of low efficiency and accuracy that are inevitably caused by manual identification and identification of handwriting pictures under the prior art, and improving the efficiency and accuracy of handwriting recognition and identification. At the same time, it also solves the problem of low popularity of handwriting recognition and identification due to the high cost of handwriting recognition and identification under the prior art, reduces the cost of handwriting recognition and identification, and improves the popularity of handwriting recognition and identification.
[0131] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A handwriting recognition and identification method, It is characterized in that include: Obtain the target handwriting image to be identified; Based on the K nearest neighbor method, the target handwriting image is recognized to determine the writing content of the target handwriting image; Based on the convolutional neural network algorithm, the target handwriting picture is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting picture; the handwriting identification neural network model is obtained by training the neural network model according to the historical handwriting picture identification data; the historical handwriting picture identification data includes handwriting pictures corresponding to different writer labels; When it is determined that the written content of the target handwriting image is the target user's own name, and the writer label corresponding to the target handwriting image is the target user himself, it is determined that the target handwriting image is written by the target user himself, and a notification message that the identification of the target handwriting image has passed is issued.
2. The method according to claim 1, It is characterized in that Based on the K nearest neighbor method, the target handwriting image is recognized to determine the writing content of the target handwriting image, including: Based on the K nearest neighbor method, multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures are used as training sample sets to train the algorithm model of the K nearest neighbor method to obtain a trained K nearest neighbor algorithm model; Convert the handwriting pixels in the target handwriting image into a two-dimensional matrix vector; The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
3. The method according to claim 2, It is characterized in that Also includes: Using multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures as a test sample set, testing the trained K nearest neighbor algorithm model, and obtaining a K nearest neighbor algorithm model that passes the test; The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image, including: The two-dimensional matrix vector is input into the tested K-nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
4. The method according to claim 1, It is characterized in that Also includes: The convolutional layer, activation layer, pooling layer, and fully connected layer of the neural network model to be trained are established as follows: Extract image feature values of different handwriting images and their corresponding labels of writers from historical handwriting image identification data; convert the extracted image feature values into matrix vectors corresponding to different handwriting images; use the matrix vectors corresponding to different handwriting images as the convolution layer of the neural network model to be trained; Establishing an activation layer of the neural network model to be trained for calculating the matrix vector output by the convolution layer using an activation function; Establishing a pooling layer of the neural network model to be trained for performing dimensionality reduction processing on the result calculated by the activation layer; A fully connected layer of the neural network model to be trained is established to connect different convolutional layers, activation layers, and pooling layers.
5. The method according to claim 4, It is characterized in that Also includes: The handwriting identification neural network model is trained and validated as follows: Taking the historical handwriting image identification data as a training set, training the neural network model to be trained to obtain a trained handwriting identification neural network model; The historical handwriting image identification data is used as a verification set to verify the trained handwriting identification neural network model. After the verification is passed, a verified handwriting identification neural network model is obtained; Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image, including: Based on the convolutional neural network algorithm, the target handwriting image is input into the verified handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image.
6. A handwriting recognition and identification device, It is characterized in that include: A target handwriting image acquisition module is used to acquire a target handwriting image to be identified; A handwriting recognition module is used to perform handwriting recognition on a target handwriting image based on a K nearest neighbor method to determine the writing content of the target handwriting image; A handwriting identification module is used to input the target handwriting image into the handwriting identification neural network model based on the convolutional neural network algorithm to obtain the writer label corresponding to the target handwriting image; The handwriting identification neural network model is obtained by training the neural network model according to historical handwriting image identification data; the historical handwriting image identification data includes handwriting images corresponding to different writer labels; The notification information sending module is used to determine that the target handwriting picture is written by the target user himself when it is determined that the written content of the target handwriting picture is the name of the target user himself, and the writer label corresponding to the target handwriting picture is the target user himself, and send a notification message that the identification of the target handwriting picture has passed.
7. The device according to claim 6, It is characterized in that The handwriting recognition module is specifically used for: Based on the K nearest neighbor method, multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures are used as training sample sets to train the algorithm model of the K nearest neighbor method to obtain a trained K nearest neighbor algorithm model; Convert the handwriting pixels in the target handwriting image into a two-dimensional matrix vector; The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
8. The device according to claim 7, It is characterized in that Also includes: Model validation module for: Using multiple handwriting pictures and historical data corresponding to the writing contents of the multiple handwriting pictures as a test sample set, testing the trained K nearest neighbor algorithm model, and obtaining a K nearest neighbor algorithm model that passes the test; The two-dimensional matrix vector is input into the trained K nearest neighbor algorithm model to obtain the writing content of the target handwriting image, including: The two-dimensional matrix vector is input into the tested K-nearest neighbor algorithm model to obtain the writing content of the target handwriting image.
9. The device according to claim 6, It is characterized in that Also includes: The neural network model to be trained is used to build the module for: The convolutional layer, activation layer, pooling layer, and fully connected layer of the neural network model to be trained are established as follows: Extract image feature values of different handwriting images and their corresponding labels of writers from historical handwriting image identification data; convert the extracted image feature values into matrix vectors corresponding to different handwriting images; use the matrix vectors corresponding to different handwriting images as the convolution layer of the neural network model to be trained; Establishing an activation layer of the neural network model to be trained for calculating the matrix vector output by the convolution layer using an activation function; Establishing a pooling layer of the neural network model to be trained for performing dimensionality reduction processing on the result calculated by the activation layer; A fully connected layer of the neural network model to be trained is established to connect different convolutional layers, activation layers, and pooling layers.
10. The device according to claim 9, It is characterized in that Also includes: Handwriting identification neural network model building module, used for: The handwriting identification neural network model is trained and validated as follows: Taking the historical handwriting image identification data as a training set, training the neural network model to be trained to obtain a trained handwriting identification neural network model; The historical handwriting image identification data is used as a verification set to verify the trained handwriting identification neural network model. After the verification is passed, a verified handwriting identification neural network model is obtained; Based on the convolutional neural network algorithm, the target handwriting image is input into the handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image, including: Based on the convolutional neural network algorithm, the target handwriting image is input into the verified handwriting identification neural network model to obtain the writer label corresponding to the target handwriting image.
11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
13. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
