Handwriting identification method, device, computer equipment and storage medium
By combining multiple handwriting identification models and weight determination models to calculate the distortion of handwriting, the problem of insufficient accuracy and reliability of handwriting identification in the existing technology is solved, and more accurate handwriting identification results are achieved.
Patent Information
- Application Number
- CN202310352394.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-01-16
- Filing Date
- 2023-03-28
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Existing handwriting identification methods lack the accuracy and reliability to reach a practical application level. Existing models each have their own advantages and disadvantages and are limited in scope of application, failing to achieve the expected market results.
By pre-training multiple handwriting identification models, multiple identification results of the handwriting to be identified are determined, and the weight of each identification result is determined by using a weight determination model. Then, the distortion degree is calculated based on the multiple identification results and weights, and the authenticity of the handwriting is finally judged.
The accuracy of handwriting identification is improved, the results are more accurate, and the limitations of single model identification are overcome.
Smart Images

Figure CN116434251B_ABST
Abstract
Description
Technical field
[0001] The present application relates to the field of handwriting identification, and in particular to a handwriting identification method, apparatus, computer equipment and storage medium. [Background Technology]
[0002] Handwriting identification is the process of identifying and recognizing handwriting created through writing. Because writing habits are specific and stable, and are reflected in handwriting, handwriting can be used to verify identity and document authenticity.
[0003] However, manual identification is no longer suitable for today's large-scale social needs. Therefore, many artificial intelligence models have emerged, such as: dynamic time warping (DTW) model for online signatures; CNN model; Knn model; traditional Euclidean distance method, etc. However, no method can achieve the accuracy and reliability required for practical applications. Each method has its own advantages and disadvantages and different scopes of application. In other words, no single method has yet achieved the expected market effect. [Summary of the invention]
[0004] The present application provides a handwriting identification method, apparatus, computer equipment and storage medium, which can determine multiple identification results corresponding to the handwriting to be identified through multiple pre-trained handwriting identification models, and determine the weights of the multiple handwriting identification results through a weight determination model, and then determine the distortion corresponding to the handwriting to be identified based on the multiple identification results and the weight of each handwriting identification result, and finally determine the authenticity of the handwriting to be identified based on the distortion. Compared with the current handwriting identification using only one model, the handwriting identification result is more accurate.
[0005] The first aspect of the present application provides a handwriting identification method, comprising:
[0006] Acquire target handwriting corresponding to a target user, wherein the target handwriting is the handwriting to be authenticated, and the target user is a user who has stored the authentic handwriting;
[0007] Preprocessing the target handwriting to obtain target handwriting data;
[0008] Inputting the target handwriting data into a plurality of handwriting identification models respectively to obtain a plurality of identification results corresponding to the target handwriting data;
[0009] Inputting the plurality of identification results and the target handwriting data into a weight determination model to determine a weight corresponding to each of the plurality of identification results;
[0010] Determining the distortion degree corresponding to the target handwriting identification data according to the multiple identification results and the weight corresponding to each identification result;
[0011] Comparing the distortion degree corresponding to the target handwriting data with a preset threshold to obtain a comparison result;
[0012] The authenticity of the target handwriting is identified based on the comparison result.
[0013] A second aspect of the present application provides a handwriting identification device, comprising:
[0014] an acquisition unit, configured to acquire a target handwriting corresponding to a target user, wherein the target handwriting is the handwriting to be authenticated, and the target user is a user who has stored the authentic handwriting;
[0015] a preprocessing unit, configured to preprocess the target handwriting to obtain target handwriting data;
[0016] an initial identification unit, configured to input the target handwriting data into a plurality of handwriting identification models respectively, so as to obtain a plurality of identification results corresponding to the target handwriting data;
[0017] a weight determination unit, configured to input the plurality of identification results and the target handwriting data into a weight determination model to determine a weight corresponding to each of the plurality of identification results;
[0018] a distortion degree determining unit, configured to determine the distortion degree corresponding to the target handwriting identification data according to the plurality of identification results and the weight corresponding to each identification result;
[0019] a comparison unit, configured to compare the distortion degree corresponding to the target handwriting data with a preset threshold value to obtain a comparison result;
[0020] The final identification unit is used to identify the authenticity of the target handwriting according to the comparison result.
[0021] A third aspect of an embodiment of the present application provides a data processing device, which includes at least one connected processor, memory and transceiver, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the steps of the handwriting identification method described in the first aspect above.
[0022] A fourth aspect of an embodiment of the present application provides a computer storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the handwriting identification method described in any one of the above aspects.
[0023] Compared with the related art, in the embodiment provided by the present application, multiple identification results corresponding to the handwriting to be identified can be determined through multiple pre-trained handwriting identification models, and the weights of the multiple handwriting identification results can be determined through a weight determination model. Then, the distortion corresponding to the handwriting to be identified is determined based on the multiple identification results and the weight of each handwriting identification result. Finally, the authenticity of the handwriting to be identified is determined based on the distortion. Compared with the current use of only one model for handwriting identification, the result of handwriting identification is more accurate.
Brief Description of the Drawings
[0024] Figure 1 A schematic diagram of the system architecture of the handwriting identification system provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of the architecture of a transformer layer provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of the architecture of a convolutional neural network provided in an embodiment of the present application;
[0027] Figure 4 Another schematic diagram of the architecture of a convolutional neural network provided in an embodiment of the present application;
[0028] Figure 5 A flowchart of a handwriting identification method provided in an embodiment of the present application;
[0029] Figure 6 A schematic diagram of the normal distribution curve of real handwriting and fake handwriting provided in an embodiment of the present application;
[0030] Figure 7 A schematic diagram of the virtual structure of a handwriting identification device provided in an embodiment of the present application;
[0031] Figure 8 A schematic diagram of the hardware structure of the server provided in an embodiment of the present application. [Specific implementation method]
[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0033] Figure 1FIG1 is a schematic diagram of the system architecture of a handwriting identification system provided in an embodiment of the present application. The handwriting identification system 100 includes an execution device 110, a training device 120, a database 130, a client device 140, a data storage system 150, and a data acquisition device 160. The execution device 110 is configured with an input / output (I / O) interface 112 for data exchange with external devices. A user can input data into the I / O interface 112 through the client device 140.
[0034] When the execution device 110 preprocesses the input data, or when the computing module 111 of the execution device 110 performs calculations and other related processing (such as implementing the functions of the neural network in this application), the execution device 110 can call the data, code, etc. in the data storage system 150 for the corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing in the data storage system 150.
[0035] Finally, the I / O interface 112 returns the processing result to the client device 140 so as to provide it to the user.
[0036] Optionally, the client device 140 may be, for example, a control unit in an autonomous driving system or a functional algorithm module in a mobile phone terminal. For example, the functional algorithm module may be used to implement related tasks.
[0037] It is worth noting that the training device 120 can generate corresponding target models / rules based on different training data for different goals or different tasks. The corresponding target models / rules can be used to achieve the above goals or complete the above tasks, thereby providing users with the desired results.
[0038] exist Figure 1 In the case shown, the user can manually input data, which can be operated through the interface provided by I / O interface 112. In another case, client device 140 can automatically send input data to I / O interface 112. If the automatic transmission of input data by client device 140 requires user authorization, the user can set the corresponding permissions in client device 140. The user can view the results output by execution device 110 on client device 140, which can be displayed, sounded, or displayed in a specific form. Client device 140 can also serve as a data acquisition terminal, collecting input data input into I / O interface 112 and output results from I / O interface 112 as new sample data, and storing them in database 130. Of course, the collection can also be performed without going through client device 140, and instead the input data input into I / O interface 112 and output results from I / O interface 112 as new sample data can be directly stored in database 130 by I / O interface 112.
[0039] It is worth noting that Figure 1 This is only a schematic diagram of the system architecture of a handwriting identification system provided in an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 1 In the embodiment, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 can also be placed in the execution device 110.
[0040] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.
[0041] (1) Neural Network
[0042] A neural network can be composed of neural units. A neural unit can refer to an operation unit that takes xs (i.e., input data) and intercept 1 as input. The output of the operation unit can be:
[0043]
[0044] Where, s = 1, 2, ... n, n is a natural number greater than 1, W s is x s The weight of the neural unit, b is the bias of the neural unit, and f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0045] (2) Deep Neural Networks
[0046] A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with many hidden layers. The term "many" here does not necessarily refer to a specific metric. Based on the location of different layers within a DNN, the neural network can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and all layers in between are hidden layers. Layers are fully connected, meaning that any neuron in layer i is connected to any neuron in layer i+1.
[0047] (3) Loss function
[0048] During the training of a deep neural network, because we want the output of the deep neural network to be as close as possible to the desired predicted value, we can compare the current network's predicted value with the desired target value and then update the weight vector of each layer of the neural network based on the difference between the two. (Of course, before the first update, there is usually an initialization process, which pre-configures the parameters for each layer in the deep neural network.) For example, if the network's predicted value is too high, the weight vector is adjusted to make it predict a lower value. This adjustment is continued until the deep neural network can predict the desired target value or a value very close to the desired target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value." This is the loss function (or objective function), which is an important equation used to measure the difference between the predicted value and the target value. For example, the loss function output value (loss) indicates a greater difference, so training a deep neural network becomes a process of minimizing this loss.
[0049] (4) Backpropagation algorithm
[0050] Convolutional neural networks can use the back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during training, reducing the reconstruction error loss of the super-resolution model. Specifically, the forward propagation of the input signal to the output generates an error loss. This error loss information is then backpropagated to update the parameters of the initial super-resolution model, thereby converging the error loss. The BP algorithm is a backward propagation movement dominated by the error loss, aiming to obtain the optimal super-resolution model parameters, such as the weight matrix.
[0051] (5) Transformer layer
[0052] Reference Figure 2 , Figure 2 This is a schematic diagram of the architecture of a transformer layer, such as Figure 2As shown, the neural network includes an embedding layer and at least one transformer layer, and the at least one transformer layer can be N transformer layers (N is an integer greater than 0), wherein each transformer layer includes an attention layer, an add&norm layer, a feed forward layer, and an add&norm layer that are adjacent in sequence. In the embedding layer, the current input is embedded to obtain multiple feature vectors; in the attention layer, P input vectors are obtained from the previous layer of the transformer layer, and with any first input vector among the P input vectors as the center, based on the correlation between each input vector within a preset attention window range and the first input vector, the intermediate vector corresponding to the first input vector is obtained, thereby determining the P intermediate vectors corresponding to the P input vectors; in the pooling layer, the P intermediate vectors are merged into Q output vectors, wherein the multiple output vectors obtained by the last transformer layer in the transformer layer are used as feature representations of the current input.
[0053] (6) Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. The convolutional neural network includes a feature extractor consisting of a convolution layer and a subsampling layer. The feature extractor can be regarded as a filter, and the convolution process can be regarded as using a trainable filter to convolve with an input image or convolution feature plane (feature map). The convolution layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal (for example, the first convolution layer and the second convolution layer in this embodiment). In the convolution layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layers. A convolution layer usually contains several feature planes, and each feature plane can be composed of some neural units arranged in a rectangular shape. The neural units in the same feature plane share weights, and the shared weights here are the convolution kernels.
[0054] Convolution kernels can be initialized as matrices of random size, and during the training process of the convolutional neural network, the convolution kernels can be learned to obtain reasonable weights. In addition, the direct benefit of shared weights is that they reduce the number of connections between the layers of the convolutional neural network, while also reducing the risk of overfitting.
[0055] Specifically, such as Figure 3 The illustrated convolutional neural network (CNN) 100 may include an input layer 110 , a convolutional layer / pooling layer 120 , where the pooling layer is optional, and a neural network layer 130 .
[0056] Among them, the structure composed of the convolution layer / pooling layer 120 and the neural network layer 130 can be the first convolution layer and the second convolution layer described in this application, the input layer 110 is connected to the convolution layer / pooling layer 120, the convolution layer / pooling layer 120 is connected to the neural network layer 130, the output of the neural network layer 130 can be input to the activation layer, and the activation layer can perform nonlinear processing on the output of the neural network layer 130.
[0057] Convolutional layer / pooling layer 120:
[0058] Convolutional layer:
[0059] like Figure 3 The convolutional layer / pooling layer 120 shown may include layers 121-126, for example. In one implementation, layer 121 is a convolutional layer, layer 122 is a pooling layer, layer 123 is a convolutional layer, layer 124 is a pooling layer, layer 125 is a convolutional layer, and layer 126 is a pooling layer. In another implementation, layers 121 and 122 are convolutional layers, layer 123 is a pooling layer, layers 124 and 125 are convolutional layers, and layer 126 is a pooling layer. That is, the output of a convolutional layer can be used as the input of a subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
[0060] Taking the convolution layer 121 as an example, the convolution layer 121 can include many convolution operators, which are also called kernels. The convolution operator can essentially be a weight matrix. The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can extract information from the input data, thereby helping the convolutional neural network 100 to make correct predictions.
[0061] When the convolutional neural network 100 has multiple convolutional layers, the initial convolutional layer (for example, 121) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 100 increases, the features extracted by the later convolutional layers (for example, 126) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0062] Pooling layer:
[0063] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer, such as Figure 3 The layers 121-126 in the example 120 can be a convolution layer followed by a pooling layer, or multiple convolution layers can be followed by one or more pooling layers.
[0064] Neural Network Layer 130:
[0065] After being processed by the convolution layer / pooling layer 120, the convolution neural network 100 is not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 120 only extracts features and reduces the parameters brought by the input data. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 100 needs to use the neural network layer 130 to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer 130 may include multiple hidden layers (such as Figure 3 131, 132 to 13n) and the output layer 140 shown, the parameters contained in the multi-layer hidden layer can be pre-trained according to relevant training data of a specific task type.
[0066] After the multiple hidden layers in the neural network layer 130, that is, the last layer of the entire convolutional neural network 100 is the output layer 140, which has a loss function similar to the classification cross entropy, specifically for calculating the prediction error. Once the forward propagation of the entire convolutional neural network 100 (such as Figure 3 The propagation from 110 to 140 is forward propagation), and the reverse propagation (such as Figure 3 The propagation from 140 to 110 is back propagation) and then starts to update the weight values and biases of the aforementioned layers to reduce the loss of the convolutional neural network 100 and the error between the result output by the convolutional neural network 100 through the output layer and the ideal result.
[0067] It should be noted that if Figure 3 The convolutional neural network 100 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models such as recurrent neural networks, for example, Figure 4 The multiple convolutional layers / pooling layers shown are operated in parallel, and the features extracted from each layer are input to the full neural network layer 130 for processing.
[0068] (7) BN: Through mini-batch normalization, the differences in parameter optimization caused by inputs at different levels are eliminated, the possibility of overfitting in a certain layer of the model is reduced, and training can proceed more smoothly. The BN coefficients can be: mean μ, variance σ, scale parameter γ, and offset parameter β.
[0069] The handwriting identification method will be described below from the perspective of a handwriting identification device. The handwriting identification device may be a server or a service unit in the server, and the specific details are not limited thereto.
[0070] Please refer to Figure 5 , Figure 5 The flowchart of the handwriting identification method provided in the embodiment of the present application includes:
[0071] 501. Obtain target handwriting corresponding to the target user.
[0072] In this embodiment, the handwriting identification device can obtain the target handwriting corresponding to the target user. The target handwriting is the handwriting to be determined to be authentic. The target user is a user who has stored real handwriting. That is, the target handwriting may be written by the target user or imitated by other users. The handwriting identification device can receive the target handwriting written by any user under the target user's account.
[0073] 502. Preprocess the target handwriting to obtain target handwriting data.
[0074] In this embodiment, after obtaining the target handwriting corresponding to the target user, the handwriting identification device can preprocess the target handwriting to obtain target handwriting data. The preprocessing (also known as data cleaning, data organization or data processing) refers to the process of performing various checks and reviews on the data to correct missing values, spelling errors, normalize / standardize numerical values to make them comparable, convert data (such as logarithmic conversion), and other problems.
[0075] It should be noted that the target handwriting data is a time series function. For example, the target handwriting is T, and the time length of the target handwriting is N. That is, the target handwriting includes N moments, and each moment corresponds to a handwriting data. Finally, the target handwriting data can be identified as follows:
[0076] T={T0,T1,T2,...,T n ,...,T N}, wherein the handwriting point data at time T0 includes but is not limited to the following data: time T0, x, y coordinate values of the writing pen at time T0, pressure sensitivity of the writing pen at time T0, tilt angle of the tip of the writing pen relative to the writing board at T0 (identified by x, y coordinate values) and other data.
[0077] 503. Input the target handwriting data into multiple handwriting identification models to obtain multiple identification results corresponding to the target handwriting data.
[0078] In this embodiment, the handwriting identification device can pre-train a training data set through a neural network model to obtain a handwriting identification model. The training data set includes real handwriting data corresponding to each user among multiple users and false handwriting data corresponding to each user. That is, the handwriting identification model is used to determine the authenticity of handwriting rewritten under a user account that previously stored real handwriting data; thereafter, the handwriting identification device can determine the identification result corresponding to the target handwriting data through the handwriting identification model.
[0079] 504. Input the multiple identification results into a weight determination model to determine the weights corresponding to the multiple identification results.
[0080] In this embodiment, the handwriting identification device can determine the weights corresponding to multiple identification results through a pre-trained weight determination model. For n independent and complete handwriting identification models, since their accuracy and reliability in achieving practical application levels vary, another deep learning framework can be introduced to determine the weight of each output result corresponding to the n handwriting identification models through deep learning methods, thereby achieving the optimal accuracy and reliability of the n handwriting identification models. The training process of the weight determination model is described below:
[0081] Step 1: Obtain a training data set, where each training sample in the training data set includes the real handwriting data corresponding to the user and the fake handwriting data corresponding to the user.
[0082] In this step, the handwriting identification device may obtain a training data set, which includes multiple training samples, each of which includes real handwriting data corresponding to a user and false handwriting data corresponding to the user. It is understood that each training sample may include at least two real handwriting data and one false handwriting data corresponding to a single user, or may also include at least two real handwriting data and one false handwriting data corresponding to each of multiple users, with each of the multiple users corresponding to at least two real handwriting data and one false handwriting data.
[0083] Step 2: Preprocess each training sample in the training data set.
[0084] In this step, the handwriting identification device can preprocess each training sample in the training data set. The preprocessing (also known as data cleaning, data organization or data processing) refers to the process of performing various checks and reviews on the data to correct missing values, spelling errors, normalize / standardize the values to make them comparable, convert the data (such as logarithmic conversion), and other problems.
[0085] It is understandable that the handwriting identification device can divide the training data set according to a certain ratio, for example, according to a ratio of 3:7, and use 7 parts of the data in the training data set as training samples for model training, and the remaining 3 parts of the data as test samples to test and adjust the trained model. Of course, it can also be divided according to other ratios, such as 2:8, 2 parts as test samples, and 8 parts as training samples, without specific limitation.
[0086] Step 3: Determine the mean square error and standard deviation corresponding to the target signature duration of the target training sample after preprocessing.
[0087] In this step, the signing duration refers to the time from the beginning of the user's signature when the pressure sensitivity is not zero to the end of the signature when the pressure sensitivity is zero. Since one's own signature has been repeated for a long time and is also the part of the handwriting that one is most proficient in, a stable duration has been formed, which is generally shorter. However, when others imitate signatures or write other people's signatures, due to psychological factors and lack of familiarity with signatures, the signing duration is unstable and generally longer than one's own signature.
[0088] The handwriting identification device determines the mean square error corresponding to the target signature duration using the following formula:
[0089]
[0090] Wherein, μ is the mean square error corresponding to the target signature duration, T i is the target signature duration, and n is the total number of signature sampling points.
[0091] The standard deviation of the target signature duration is determined by the following formula:
[0092]
[0093] Wherein, μ is the mean square error corresponding to the target training sample, S is the standard deviation corresponding to the target training sample, is the mean square error corresponding to the target training sample, and the target training sample is any training sample in the training sample set.
[0094] Step 4: Construct a normal distribution curve corresponding to the target training sample based on the mean square error and standard deviation corresponding to the target signature duration.
[0095] In this step, it is assumed that the signature duration is a random event that conforms to the normal distribution. The real signature and the false signature are considered to be two independent events, and therefore conform to different normal distributions. For example, Figure 6 As shown, Figure 6 The normal distribution curves for authentic signatures and forged signatures provided in the embodiments of this application are shown in Figures A, B, and C for authentic signatures, and D for forged signatures. The handwriting identification device can construct a normal distribution curve for the target training sample based on the mean square error and standard deviation corresponding to the target signature duration using the following formula:
[0096]
[0097] Wherein, f(x) is the normal distribution function, μ is the mean square error corresponding to the target training sample, and δ is the standard deviation corresponding to the target training sample.
[0098] Step 5: Determine multiple identification results corresponding to the target training samples based on multiple handwriting identification models. The multiple handwriting identification models are models obtained by pre-training the handwriting data of multiple users through a neural network. The handwriting data includes real handwriting data, false handwriting data and corresponding labels.
[0099] In this embodiment, the handwriting identification device can pre-train the handwriting data of multiple users through a neural network, and the handwriting data of the multiple users includes real handwriting data, false handwriting data and corresponding labels corresponding to each of the multiple users; thereafter, the handwriting identification device can input the target training sample into multiple handwriting identification models to determine the identification results corresponding to each of the multiple handwriting identification models.
[0100] Step 6: Adjust the loss function of the weight determination model based on multiple identification results and the normal distribution curve.
[0101] In this embodiment, the handwriting identification device can construct two loss functions, namely a positive sample loss function and a negative sample loss function, wherein the positive sample loss function is defined as:
[0102]
[0103] Among them, L1 is the positive sample loss function, k i is the weight of the i-th handwriting identification model, n is the number of handwriting identification models, x i is the identification result of the target training sample by the i-th handwriting identification model;
[0104] The negative sample loss function is defined as:
[0105]
[0106] Among them, L2 is the negative sample loss function.
[0107] Afterwards, the handwriting identification device can adjust the weighted positive sample loss function or the negative sample loss function according to the identification result and the normal distribution curve.
[0108] Step 7: Perform iterative training based on the adjusted loss function until the preset iteration termination condition is reached to obtain a weight determination model.
[0109] In this step, the handwriting identification device can iteratively execute steps 3 to 6 using the adjusted loss function until a preset iteration termination condition is met, ultimately obtaining a weight determination model. During the iterative training process, the handwriting identification device determines whether the iteration termination condition has been met. If so, it stops iteration and executes step 7. If not, it repeats steps 3 to 6.
[0110] Specifically, the handwriting identification device can determine whether the number of iterations reaches a preset value, and if so, determine that a preset iteration termination condition is met.
[0111] or,
[0112] The handwriting identification device can determine whether the positive sample loss function or the negative sample loss function converges, that is, the loss function no longer changes significantly after multiple iterations. If so, it is determined that the preset iteration termination condition is met.
[0113] In practical applications, the handwriting identification device may also use other conditions as iteration termination conditions, which are not specifically limited here.
[0114] The following uses four handwriting identification models (Model 1, Model 2, Model 3, and Model 4) as examples to illustrate the training method of the weight determination model. The weight function of the weight determination model is calculated using the following formula:
[0115] K i =f(x)f i (x), f i (x) is the parameter that needs to be trained. According to the normal distribution theory, for an independent signature duration x i Event, due to the advance signature length x i Labeled, we can determine x i For a real signature, the construction time is x i The corresponding normal distribution curve can be determined, and the signature duration normal distribution curve is likely to be concentrated near μ. Therefore, Model 1, Model 2, Model 3 and Model 4 are suitable for the signature duration x. i There is a relationship between the accuracy of the identification result and the μ value. i (x), define K i =f(x)f i (x), through artificial intelligence deep learning, the amount of data is large enough to learn f i (x), that is, a correct benchmark is established, and all others are compared with this and f is obtained through deep learning methods. i (x), the following is f i (x) Parameter training process is described in detail:
[0116] Initial value setting: The initial value of each model weight is set to the average, that is, f1(x), f2(x), ...f i (x)…f n (x) are all 1 / n, that is, f i (x) = 1 / n, where n is the number of handwriting identification models;
[0117] When training a data set, that is, inputting a set of labeled signature durations into each handwriting identification model in n models, the output x of each handwriting identification model is i According to the signature duration label, the corresponding value of the signature duration can be determined. That is, f(x) is known. Therefore, the output of the weighted determination model y=∑K i x i , where K i =f(x)f i (x), we can get the output y corresponding to the signature duration, and the loss function constructed in advance is based on the output corresponding to the signature duration and its accurate value. and It should be noted that, When a positive sample is input into the handwriting identification model, this weight determines the loss function of the model. This weight determines the loss function of the model when negative samples are input into the handwriting identification model.
[0118] Therefore, according to the deep learning process, the loss function L1 or L2 is continuously adjusted, so that the parameter f of each handwriting identification model i (x) make adjustments;
[0119] The parameters f of each handwriting identification model are adjusted in a large number of data sets. i (x) is learned. (Here, each handwriting identification model parameter f i (x) Adjust or learn so that the loss function L1 or L2 is minimized (the trend of adjustment or learning) until the preset iteration termination condition is reached, thereby obtaining a trained weight determination model.
[0120] 505. Determine the distortion degree corresponding to the target handwriting identification data according to the multiple identification results and the weight corresponding to each identification result.
[0121] In this embodiment, after determining multiple identification results and the weight corresponding to each identification result, the handwriting identification device can calculate the distortion corresponding to the target handwriting identification data using the following formula:
[0122]
[0123] Among them, Y is the distortion corresponding to the target handwriting identification data, n is the number of handwriting identification models, k i is the weight of the i-th handwriting identification model, x i is the identification result of the i-th handwriting identification model.
[0124] 506. Compare the distortion degree corresponding to the target handwriting data with a preset threshold to obtain a comparison result.
[0125] In this embodiment, after obtaining the distortion degree corresponding to the target handwriting data according to the handwriting identification model, the handwriting identification device may modify the distortion degree corresponding to the target handwriting data and compare it with a preset threshold to obtain a comparison result.
[0126] 507. Determine the authenticity of the target handwriting based on the comparison results.
[0127] In this embodiment, if the comparison result shows that the distortion degree corresponding to the target handwriting is greater than a preset threshold, it is determined that the target handwriting is not the real handwriting of the target user, that is, it is false handwriting; if the comparison result shows that the distortion degree corresponding to the target handwriting is less than the preset threshold, it is determined that the target handwriting is the real handwriting of the target user.
[0128] To sum up, it can be seen that in the embodiments provided by the present application, multiple identification results corresponding to the handwriting to be identified can be determined through multiple pre-trained handwriting identification models, and the weights of the multiple handwriting identification results can be determined through a weight determination model, and then the distortion corresponding to the handwriting to be identified can be determined based on the multiple identification results and the weight of each handwriting identification result, and finally the authenticity of the handwriting to be identified can be determined based on the distortion. Compared with the current handwriting identification method that only uses one model, the result of handwriting identification is more accurate.
[0129] The above describes the present application from the perspective of a handwriting identification method, and the following describes the present application from the perspective of a handwriting identification device.
[0130] See also Figure 7 , Figure 7 This is a virtual structural diagram of a handwriting identification device provided in an embodiment of the present application. The handwriting identification device 700 includes:
[0131] An acquisition unit 701 is configured to acquire a target handwriting corresponding to a target user, wherein the target handwriting is the handwriting to be authenticated, and the target user is a user who has stored the authentic handwriting;
[0132] A preprocessing unit 702 is used to preprocess the target handwriting to obtain target handwriting data;
[0133] The initial identification unit 703 is used to input the target handwriting data into multiple handwriting identification models to obtain multiple identification results corresponding to the target handwriting data;
[0134] A weight determination unit 704 is configured to input the plurality of identification results and the target handwriting data into a weight determination model to determine a weight corresponding to each of the plurality of identification results;
[0135] A distortion degree determining unit 705 is configured to determine the distortion degree corresponding to the target handwriting identification data according to the multiple identification results and the weight corresponding to each identification result;
[0136] The comparison unit 706 is used to compare the distortion degree corresponding to the target handwriting data with a preset threshold to obtain a comparison result;
[0137] The final identification unit 707 is used to identify the authenticity of the target handwriting according to the comparison result.
[0138] In one possible design, the device further includes:
[0139] The model training unit 708 is used to:
[0140] Acquire a training data set, wherein each training sample in the training data set includes real handwriting data corresponding to each of a plurality of users and false handwriting data corresponding to each of the plurality of users, wherein the real handwriting data and the false handwriting data include a signature duration corresponding to each of the users;
[0141] Preprocessing each training sample in the training data set;
[0142] Determining a mean square error and a standard deviation corresponding to a target signature duration of a preprocessed target training sample, wherein the target training sample is any training sample in the training data set;
[0143] Constructing a normal distribution curve corresponding to the target training sample based on the mean square error and standard deviation corresponding to the target signature duration;
[0144] Determining multiple identification results corresponding to the target training samples according to the multiple handwriting identification models, wherein the multiple handwriting identification models are models obtained by pre-training handwriting data of multiple users through a neural network;
[0145] adjusting a loss function of the weight determination model based on the multiple identification results and the normal distribution curve;
[0146] The training sample set is traversed based on the adjusted loss function until a preset iteration termination condition is reached to obtain the weight determination model.
[0147] In one possible design, the model training unit 708 is specifically configured to:
[0148] The mean square error corresponding to the target signature duration is determined by the following formula:
[0149]
[0150] Wherein, μ is the mean square error corresponding to the target signature duration, T i is the target signature duration, and n is the total number of signature sampling points.
[0151] In one possible design, the model training unit 707 is further specifically configured to:
[0152] The mean square error corresponding to the target training sample is determined by the following formula:
[0153]
[0154] Wherein, μ is the mean square error corresponding to the target training sample, S is the standard deviation corresponding to the target training sample, is the mean square error corresponding to the target training sample.
[0155] In one possible design, the model training unit 708 is further specifically configured to:
[0156] The normal distribution curve corresponding to the target training sample is constructed using the following formula:
[0157]
[0158] Wherein, f(x) is the normal distribution function, μ is the mean square error corresponding to the target training sample, and δ is the standard deviation corresponding to the target training sample.
[0159] In one possible design, the model training unit 708 is further specifically configured to:
[0160] Determine whether the number of iterations reaches a preset value, and if so, determine whether the preset iteration termination condition is met.
[0161] or,
[0162] Determine whether the loss function of the initial recognition model converges, and if so, determine whether the preset iteration termination condition is met.
[0163] In one possible design, the final identification unit 707 is specifically configured to:
[0164] If the comparison result shows that the distortion degree corresponding to the target handwriting is greater than the preset threshold, it is determined that the target handwriting is not the real handwriting of the target user;
[0165] If the comparison result shows that the distortion degree corresponding to the target handwriting is less than the preset threshold, it is determined that the target handwriting is the real handwriting of the target user.
[0166] Figure 8This is a schematic diagram of the structure of the server of this application. The server can be built inside the handwriting identification device, such as Figure 8 As shown, the server 800 of this embodiment includes at least one processor 801, at least one network interface 804 or other user interface 803, a memory 805, and at least one communication bus 802. The server 800 may optionally include a user interface 803, including a display, a keyboard, or a clicking device. The memory 805 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 805 stores execution instructions. When the server 800 is running, the processor 801 communicates with the memory 805, and the processor 801 calls the instructions stored in the memory 805 to execute the above-mentioned handwriting identification method. The operating system 806 includes various programs for implementing various basic services and processing tasks based on hardware.
[0167] The server provided in the embodiment of the present application can execute the technical solution of the embodiment of the above-mentioned handwriting identification method. Its implementation principle and technical effects are similar and will not be repeated here.
[0168] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer executes the computer program, the computer program implements the method flow related to the handwriting identification device in any of the above method embodiments. Correspondingly, the computer can be the above handwriting identification device.
[0169] The present application also provides a computer program or a computer program product including the computer program. When the computer program is executed on a computer, the computer implements the method flow associated with the handwriting identification device in any of the above-mentioned method embodiments. Correspondingly, the computer may be the above-mentioned handwriting identification device.
[0170] In the above Figure 1 In the corresponding embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0171] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A handwriting identification method, characterized in that: include: Acquire target handwriting corresponding to a target user, wherein the target handwriting is the handwriting to be authenticated, and the target user is a user who has stored the authentic handwriting; Preprocessing the target handwriting to obtain target handwriting data; Inputting the target handwriting data into a plurality of handwriting identification models respectively to obtain a plurality of identification results corresponding to the target handwriting data; Inputting the plurality of identification results and the target handwriting data into a weight determination model to determine a weight corresponding to each of the plurality of identification results; Determining the distortion degree corresponding to the target handwriting identification data according to the multiple identification results and the weight corresponding to each identification result; Comparing the distortion degree corresponding to the target handwriting data with a preset threshold to obtain a comparison result; Identify the authenticity of the target handwriting based on the comparison result, The method further comprises: Acquire a training data set, wherein each training sample in the training data set includes real handwriting data corresponding to each of a plurality of users and false handwriting data corresponding to each of the plurality of users, wherein the real handwriting data and the false handwriting data include a signature duration corresponding to each of the users; Preprocessing each training sample in the training data set; Determining a mean square error and a standard deviation corresponding to a target signature duration of a preprocessed target training sample, wherein the target training sample is any training sample in the training data set; Constructing a normal distribution curve corresponding to the target training sample based on the mean square error and standard deviation corresponding to the target signature duration; Determining multiple identification results corresponding to the target training samples according to the multiple handwriting identification models, wherein the multiple handwriting identification models are models obtained by pre-training handwriting data of multiple users through a neural network; adjusting a loss function of the weight determination model based on the multiple identification results and the normal distribution curve; The training sample set is traversed based on the adjusted loss function until a preset iteration termination condition is reached to obtain the weight determination model.
2. The method according to claim 1, characterized in that Determining the mean square error corresponding to the target signature duration of the preprocessed target training sample includes: The mean square error corresponding to the target signature duration is determined by the following formula: ; in, is the mean square error corresponding to the target signature duration, How long it takes to sign for the target, The total number of signature sampling points.
3. The method according to claim 1, characterized in that Determining the standard deviation of the target signature duration of the preprocessed target training sample includes: ; in, is the standard deviation corresponding to the target training sample, is the mean square error corresponding to the target training sample, is the total number of signature sampling points, The duration of signing for the target.
4. The method according to claim 1, wherein The constructing of a normal distribution curve corresponding to the target training sample based on the mean square error and the standard deviation corresponding to the signature duration includes: The normal distribution curve corresponding to the target training sample is constructed using the following formula: ; in, is the normal distribution function, is the mean square error corresponding to the target training sample, is the standard deviation corresponding to the target training sample.
5. The method according to claim 1, wherein The method further comprises: Determine whether the number of iterations reaches a preset value, and if so, determine whether the preset iteration termination condition is met. or, Determine whether the loss function of the initial recognition model converges, and if so, determine whether the preset iteration termination condition is met.
6. The method according to any one of claims 1 to 5, characterized in that The identifying the authenticity of the target handwriting according to the comparison result includes: If the comparison result shows that the distortion degree corresponding to the target handwriting is greater than the preset threshold, it is determined that the target handwriting is not the real handwriting of the target user; If the comparison result shows that the distortion degree corresponding to the target handwriting is less than the preset threshold, it is determined that the target handwriting is the real handwriting of the target user.
7. A handwriting identification device, characterized in that: include: an acquisition unit, configured to acquire a target handwriting corresponding to a target user, wherein the target handwriting is the handwriting to be authenticated, and the target user is a user who has stored the authentic handwriting; a preprocessing unit, configured to preprocess the target handwriting to obtain target handwriting data; an initial identification unit, configured to input the target handwriting data into a plurality of handwriting identification models respectively, so as to obtain a plurality of identification results corresponding to the target handwriting data; a weight determination unit, configured to input the plurality of identification results and the target handwriting data into a weight determination model to determine a weight corresponding to each of the plurality of identification results; a distortion degree determining unit, configured to determine the distortion degree corresponding to the target handwriting identification data according to the plurality of identification results and the weight corresponding to each identification result; a comparison unit, configured to compare the distortion degree corresponding to the target handwriting data with a preset threshold value to obtain a comparison result; The final identification unit is used to identify the authenticity of the target handwriting based on the comparison result. Model training unit, used for: Acquire a training data set, wherein each training sample in the training data set includes real handwriting data corresponding to each of a plurality of users and false handwriting data corresponding to each of the plurality of users, wherein the real handwriting data and the false handwriting data include a signature duration corresponding to each of the users; Preprocessing each training sample in the training data set; Determining a mean square error and a standard deviation corresponding to a target signature duration of a preprocessed target training sample, wherein the target training sample is any training sample in the training data set; Constructing a normal distribution curve corresponding to the target training sample based on the mean square error and standard deviation corresponding to the target signature duration; Determining multiple identification results corresponding to the target training samples according to the multiple handwriting identification models, wherein the multiple handwriting identification models are models obtained by pre-training handwriting data of multiple users through a neural network; adjusting a loss function of the weight determination model based on the multiple identification results and the normal distribution curve; The training sample set is traversed based on the adjusted loss function until a preset iteration termination condition is reached to obtain the weight determination model.
8. A data processing device, characterized in that: include: At least one connected processor, memory and transceiver, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the steps of the handwriting identification method according to any one of claims 1 to 6.
9. A computer storage medium, characterized in that include: Instructions, when the instructions are executed on a computer, enable the computer to execute the steps of the handwriting identification method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for authenticating relative writing time of contract or written pledge
CN101975758A
Method for determining correctness of cutting result of Chinese character pattern
CN106503706A