A neural network-based online signature authentication method
By using a neural network-based online signature authentication method, which extracts features using similarity vectors and long short-term memory networks and dynamically assigns handwriting point weights, the method solves the problems of insufficient robustness and generalization ability in existing technologies and achieves higher recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUJIAN JOYUSING TECHNOLOGY CO LTD
- Filing Date
- 2022-08-12
- Publication Date
- 2026-07-21
Smart Images

Figure CN115393876B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an online signature authentication method based on neural networks, belonging to the field of online signature authentication. Background Technology
[0002] Currently, there are two main types of signature verification systems. One type is the online signature verification system, which uses specific handwriting tools (writing tablets, styluses, smartphones, etc.) to collect dynamic handwriting information when a person signs, including pen lifting and lowering, position coordinates, pressure, speed, etc. The other type is the offline signature system, which does not collect the dynamic information of the writer when writing, but simply saves the signature handwriting on different media in the form of images, etc.
[0003] Online signature verification systems fall into two main categories: function-based methods and parameter-based methods.
[0004] 1. In functional methods, the authenticity of a signature is determined by comparing the feature vectors of the signature to be tested and the correct signature at the same time point, i.e., calculating the similarity of the signature feature sequence. The similarity is then compared with a similarity threshold to identify the authenticity of the signature. For functional methods, the most important aspect is aligning the sequence according to time points. If alignment is performed when a user's signature has missing strokes, it can easily cause an overall offset, resulting in poor robustness. For example, patent CN107657241B, "A Signature Authenticity Identification System for Pens," samples signature features multiple times at equal time intervals and calculates a comprehensive similarity based on the signature features. The relationship between the comprehensive similarity and a similarity threshold is then compared to identify the authenticity of the signature.
[0005] 2. The parametric method primarily calculates data throughout the signing process (signature time, line length, tilt angle, aspect ratio, average velocity, and average acceleration, etc.), combines this data into corresponding feature vectors, and then distinguishes between genuine and counterfeit signatures by comparing the Euclidean distance between the feature vectors of the test signature and the correct signature to see if it exceeds a certain threshold. This method requires manually setting the threshold for the Euclidean distance of the feature vectors, and different thresholds need to be experimented with for different combinations of feature vectors, resulting in poor generalization ability.
[0006] In summary, a highly robust online signature verification method is needed.
[0007] The paper "Research on Handwritten Signature Authentication Based on LSTM Neural Network" discloses the extraction of positional and velocity features of the signature, and the use of LSTM + classification function (softmax, divided into k classes) for authentication. However, this method directly inputs the features of the signature to be authenticated into the neural network, and the output result is the probability that the signature belongs to a certain person; therefore, the method has poor generalization ability and is only suitable for application scenarios with a small number of users. Summary of the Invention
[0008] To overcome the problems existing in the prior art, this invention designs an online signature authentication method based on neural networks. The method takes the similarity vector between the correct signature and the signature to be authenticated as input, uses the authentication model to learn the distributed feature representation of the similarity vector, and performs true and false classification based on the distributed feature representation to obtain the authentication result. It has strong robustness and generalization ability.
[0009] To achieve the above objectives, the present invention adopts the following technical solution:
[0010] An online signature authentication method based on neural networks includes the following steps:
[0011] Obtain first signature information and second signature information, wherein the first signature information and second signature information include feature values of several handwriting points;
[0012] Calculate the similarity vector between the first signature information and the second signature information based on the feature values of the handwriting points.
[0013] The similarity vector is input into the identification model to obtain the identification result; the identification model includes a feature extraction network.
[0014] Furthermore, the identification model includes a feature extraction network and an activation layer;
[0015] The identification model outputs the confidence level of the similarity vector, and the identification result is obtained by comparing the confidence level with the confidence threshold.
[0016] Furthermore, the feature value includes at least one of position value, pressure value, and velocity value.
[0017] Further, the step of calculating the similarity vector between the first signature information and the second signature information based on the feature values of the handwriting points specifically involves:
[0018] The first signature information and the second signature information are respectively divided into several first handwriting sequences and several second handwriting sequences;
[0019] Based on the feature values of the handwriting points, the similarity between each first handwriting sequence and the corresponding second handwriting sequence is calculated, resulting in a similarity vector containing several similarities.
[0020] Furthermore, the step of separately splitting the first signature information and the second signature information into several first handwriting sequences and several second handwriting sequences is specifically as follows:
[0021] Extract the peaks and troughs from the first and second signature information to obtain the first peak-trough sequence and the second peak-trough sequence; determine several segmentation points using the DTW algorithm based on the first and second peak-trough sequences; and segment the first and second signature information into several first handwriting sequences and several second handwriting sequences according to the several segmentation points.
[0022] Further, the similarity between the first handwriting sequence and the corresponding second handwriting sequence is calculated, specifically including:
[0023] For each handwriting point in the first handwriting sequence, calculate the Euclidean distance between its feature value and at least one handwriting point in the second handwriting sequence; sum the several Euclidean distances to obtain the similarity between the first handwriting sequence and the corresponding second handwriting sequence.
[0024] Further, the step of calculating the Euclidean distance between each handwriting point in the first handwriting sequence and the feature value of at least one handwriting point in the second handwriting sequence is specifically as follows:
[0025] For the i-th handwriting point in the first handwriting sequence, calculate the Euclidean distance between its eigenvalue and the eigenvalues of the i-th handwriting point to the (i+r)-th handwriting point in the second handwriting sequence, where r ranges from 0 to the ratio of the lengths of the first and second handwriting sequences.
[0026] Furthermore, it also includes assigning different weights to several of the Euclidean distances;
[0027] The weighted sum of several Euclidean distances is used as the similarity between the first handwriting sequence and the corresponding second handwriting sequence. Specifically, the Euclidean distance between the i-th handwriting in the first handwriting sequence and the i-th handwriting feature value in the second handwriting sequence is assigned a first weight, and the Euclidean distance between the i-th handwriting in the first handwriting sequence and the (i+r)-th (r≠0)-th handwriting feature value in the second handwriting sequence is assigned a second weight, with the first weight being greater than the second weight.
[0028] Furthermore, the similarity between the first handwriting sequence and the corresponding second handwriting sequence is calculated, expressed by the formula:
[0029]
[0030] in, The length of handwriting sequence A is represented by floor; floor represents the floor function; R represents the ratio of the lengths of handwriting sequence A to handwriting sequence B, R≥1; D() represents the Euclidean distance. This represents the i-th stroke in the handwriting sequence A; The handwriting point represents the (i+r)th handwriting point in the handwriting sequence B; w represents the weight. .
[0031] Technical Solution Two
[0032] An online signature authentication system based on a neural network includes:
[0033] A signature acquisition unit is used to acquire first signature information and second signature information, wherein the first signature information and the second signature information include feature values of a plurality of handwriting points.
[0034] A signature preprocessing unit is used to calculate a similarity vector between the first signature information and the second signature information based on the feature values of the handwriting points.
[0035] The signature authentication unit is equipped with an authentication model, which is used to output the authentication result based on the similarity vector.
[0036] Compared with the prior art, the present invention has the following features and beneficial effects:
[0037] 1. This invention takes the similarity vector between the correct signature and the signature to be identified as input, uses the identification model to learn the distributed feature representation of the similarity vector, and performs true / false classification based on the distributed feature representation to obtain the identification result. It has strong robustness and generalization ability.
[0038] 2. Existing technologies maintain consistent sequence length by padding the beginning and end of the handwriting sequence with zeros. However, this invention dynamically allocates the weights of the Euclidean distance between the feature values of handwriting points during the calculation of handwriting sequence similarity. This ensures that handwriting point i in a shorter handwriting sequence corresponds to multiple surrounding handwriting points (i…i+r) in a longer handwriting sequence, with the weight decreasing as the distance increases (w=1, w=Rr), thereby reducing the impact of inconsistent stroke lengths on similarity.
[0039] 3. This invention employs spatial distribution features, stroke pressure features, and stroke writing speed features of signatures, taking into account not only stroke similarity information but also the pressure value information corresponding to the strokes; effectively improving the recognition effect of attacks with high similarity to copied handwriting, thereby improving the final recognition rate.
[0040] 4. This invention uses Long Short-Term Memory (LSTM) networks to extract features. Compared with traditional feature engineering, LTM networks do not require tedious manual feature design processes. Furthermore, LTM networks have better generalization capabilities and are suitable for recognizing sequential data such as handwriting, resulting in high recognition accuracy. Attached Figure Description
[0041] Figure 1 This is a flowchart of the invention;
[0042] Figure 2 This is a schematic diagram of the signature to be authenticated;
[0043] Figure 3 This is a diagram illustrating a correct signature. Detailed Implementation
[0044] The present invention will now be described in more detail with reference to the embodiments.
[0045] Example 1
[0046] like Figure 1 As shown, an online signature authentication method based on neural networks includes the following steps:
[0047] S1. Obtain the first signature information and the second signature information:
[0048] The user performs a signature action on the signature device. The signature device collects the user's handwriting in a time sequence and collects the feature values of the handwriting points at each sampling time point (in this embodiment, the feature values include position value, pressure value, and speed value) to obtain the first signature information.
[0049] Find the user's historical signature information on the same model of signing device as the second signature information.
[0050] In this embodiment, the first signature is the signature to be authenticated, such as... Figure 2 As shown, the second signature is the correct signature, as follows. Figure 3 As shown.
[0051] S2. Perform the following preprocessing on the first signature information and the second signature information respectively:
[0052] S21. Scaling: Read the minimum (y_min) and maximum (y_max) vertical coordinates of the handwriting points in the signature information; scale the coordinates (x, y) of each handwriting point in the signature information according to the following formula to make the x and y axes of the signature information scale proportionally:
[0053] x_new=x / (y_max-y_min)*1000(1)
[0054] y_new=y / (y_max-y_min)*1000(2)
[0055] In the formula, x_new represents the x value after the scaling operation; y_new represents the y value after the scaling operation.
[0056] S22. Interpolation: Traverse each stroke point in the signature information and insert new stroke points evenly at intervals of 10 between adjacent stroke points with a Euclidean distance greater than or equal to 10.
[0057] S3. Separate the first signature information and the second signature information into several first handwriting sequences and several second handwriting sequences respectively according to the following steps:
[0058] S31. Extract the peaks and troughs from the first signature information and the second signature information respectively according to the following steps to obtain the first peak-trough sequence and the second peak-trough sequence:
[0059] Within the signature information, locate the local maxima and local minima along the y-axis of the handwriting points. Mark the local maxima along the y-axis as peaks and the local minima as troughs, thus obtaining a peak-trough sequence.
[0060] Calculate the distance between each adjacent peak and each adjacent trough, and filter out handwriting points with a distance less than 10; calculate the height of the peak and the depth of the trough, and filter out handwriting points with a peak height and trough depth less than 100; obtain the filtered peak and trough sequence.
[0061] S32. Based on the first peak-valley sequence and the second peak-valley sequence, determine several segmentation points using the DTW algorithm.
[0062] Assume that the length of the first peak-valley sequence obtained from the first signature information is m, and the length of the second peak-valley sequence obtained from the second signature information is n.
[0063] Calculate the distance matrix: Calculate the Euclidean distance from each handwriting point in the first peak-valley sequence to each handwriting point in the second peak-valley sequence, resulting in an m*n matrix.
[0064] Calculate the path matrix: Traverse the distance matrix and calculate the minimum cumulative path value from matrix element (1,1) to matrix element (m,n) for each matrix element, resulting in an m*n matrix, expressed by the formula:
[0065] (3)
[0066] In the formula, qi is the i-th point on the handwriting sequence q, cj is the j-th point on the handwriting sequence c, d is the Euclidean distance between qi and cj, and r is the cumulative path value of matrix element (i, j) in the path matrix.
[0067] Calculate the optimal path: Starting from the matrix element (m,n) in the path matrix, take the smallest number in the left, upper left, and upper directions until the matrix element (1,1) is reached, and the optimal path is obtained. The optimal path is the sequence of split points.
[0068] S33. According to the sequence of dividing points, divide the first signature information and the second signature information into several first handwriting sequences and several second handwriting sequences respectively.
[0069] In this embodiment, the peaks and troughs of the handwriting points are calculated based on the y-axis change value. Then, DTW is used to calculate the corresponding peaks and troughs between two handwritings for alignment. Finally, the handwritings between the peaks and troughs are divided to obtain several handwriting sequences, so that one handwriting sequence corresponds to one stroke.
[0070] S4. For each first handwriting sequence, calculate its similarity to the corresponding second handwriting sequence to obtain a similarity vector containing several similarity values:
[0071] For each handwriting point in the first handwriting sequence, calculate the Euclidean distance between its feature values and those of multiple handwriting points in the second handwriting sequence. Sum these Euclidean distances to obtain the similarity between the first handwriting sequence and the corresponding second handwriting sequence, expressed by the formula:
[0072] (4)
[0073] In the formula, R represents the length of handwriting sequence A; floor represents the floor function; R represents the ratio of the lengths of handwriting sequence A to those of handwriting sequence B. D() represents Euclidean distance; This represents the i-th stroke in the handwriting sequence A; The handwriting point represents the (i+r)th handwriting point in the handwriting sequence B; w represents the weight. In this formula, for the first and second handwriting sequences, the shorter handwriting sequence is designated as handwriting sequence A, and the longer handwriting sequence is designated as handwriting sequence B, to ensure that R ≥ 1. The length of the handwriting sequence is specifically the number of handwriting points in the handwriting sequence.
[0074] (5)
[0075] In the formula, , Represents the x-axis and y-axis coordinates of the i-th handwriting point in handwriting sequence A; , This represents the x-axis and y-axis coordinates of the (i+r)th stroke point in the handwriting sequence B.
[0076] (6)
[0077] In the formula, This represents the pressure value of the i-th stroke point in the handwriting sequence A; This represents the pressure value of the (i+r)th stroke point in the handwriting sequence B.
[0078] (7)
[0079] In the formula, This represents the velocity value of the i-th stroke point in the handwriting sequence A; This represents the velocity value of the (i+r)th stroke point in the handwriting sequence B.
[0080] Substituting equations (5), (6), and (7) into equation (4) respectively, we obtain the similarity between the first handwriting sequence and its corresponding second handwriting sequence in three dimensions (i.e., position value, pressure value, and velocity value). = ( ).
[0081] Calculate the similarity between each first handwriting sequence and its corresponding second handwriting sequence sequentially using the method described above. To obtain the similarity vector ,in This represents the similarity between the i-th first handwriting sequence and its corresponding second handwriting sequence.
[0082] S5. Transfer the similarity vector The input is fed into the identification model. The feature extraction network in the identification model (a long short-term memory network is used in this embodiment) outputs a 1*1*1 vector. After being processed by the sigmoid function of the activation layer, the output value is between 0 and 1. The confidence level is compared with the confidence threshold to obtain the true or false category, i.e., the identification result.
[0083] Example 2
[0084] Build and train the identification model:
[0085] Construct a sample dataset: Traverse the electronic signature handwriting dataset and calculate the similarity vector between each pair of signature information; use the similarity vector of the signature information of the same person as positive sample data and label it as 1, and use the similarity vector of the signature information of different people as negative sample data and label it as 0.
[0086] Sample data augmentation: To improve the diversity of sample data and enable the identification model to achieve better convergence, the sample data is augmented. Augmentation methods include adding noise and small-angle rotation.
[0087] Sample dataset partitioning: The sample dataset is divided into training set, validation set and test set in a ratio of 9:0.5:0.5.
[0088] An identification model was constructed, comprising a Long Short-Term Memory (LSTM) network and an activation layer. The LSM network includes an input layer, a hidden node layer, and an output layer; the activation layer uses the sigmoid function.
[0089] The identification model is trained using the training set, and its hyperparameters are iteratively updated. During training, the loss value is calculated using binary cross-entropy loss as the loss function, and the loss value is backpropagated to update the weight parameters in the network layers.
[0090] Example 3
[0091] Corresponding to the above-mentioned online signature authentication method based on neural networks, an online signature authentication system based on neural networks includes a signature acquisition unit, a signature preprocessing unit, and a signature authentication unit.
[0092] A signature acquisition unit is used to acquire first signature information and second signature information, wherein the first signature information and the second signature information include feature values of a plurality of handwriting points.
[0093] A signature preprocessing unit is used to calculate a similarity vector between the first signature information and the second signature information based on the feature values of the handwriting points.
[0094] The signature authentication unit is equipped with an authentication model, which is used to output the authentication result based on the similarity vector.
[0095] It should be noted that the above-mentioned online signature authentication system based on neural networks is also used to implement the method steps corresponding to the above embodiments, which will not be repeated here.
[0096] It should be noted that the functional units / modules in the various embodiments of the present invention can be integrated into one processing unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated into one unit / module. The integrated unit / module described above can be implemented in hardware or in the form of software functional units / modules.
[0097] From the above description of the embodiments, those skilled in the art will clearly understand that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein, or combinations thereof. For software implementation, some or all of the processes of the embodiments can be implemented by a computer program instructing the associated hardware. During implementation, the program can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a computer. Computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible to a computer.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should be able to analyze that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the essence and scope of the technical solutions of the present invention.
Claims
1. An online signature authentication method based on neural networks, characterized in that, Includes the following steps: Obtain first signature information and second signature information, wherein the first signature information and second signature information include feature values of several handwriting points; Based on the feature values of the handwriting points, the similarity vector between the first signature information and the second signature information is calculated as follows: The first signature information and the second signature information are respectively divided into several first handwriting sequences and several second handwriting sequences; Based on the feature values of the handwriting points, for each first handwriting sequence, calculate its similarity to the corresponding second handwriting sequence to obtain a similarity vector containing several similarity values; the calculation of the similarity between the first handwriting sequence and the corresponding second handwriting sequence specifically includes: For each handwriting point in the first handwriting sequence, calculate the Euclidean distance between its feature value and at least one handwriting point in the second handwriting sequence; sum the several Euclidean distances to obtain the similarity between the first handwriting sequence and the corresponding second handwriting sequence, expressed by the formula: In the formula, R represents the length of handwriting sequence A; floor represents the floor function; R represents the ratio of the lengths of handwriting sequence A to those of handwriting sequence B. D() represents Euclidean distance; This represents the i-th stroke in the handwriting sequence A; The handwriting point represents the (i+r)th handwriting point in the handwriting sequence B; w represents the weight. In this formula, for the first and second handwriting sequences, the shorter handwriting sequence is used as handwriting sequence A in the formula, and the longer handwriting sequence is used as handwriting sequence B in the formula, to ensure that R≥1; the length of the handwriting sequence is specifically the number of handwriting points in the handwriting sequence. The similarity vector is input into the identification model to obtain the identification result; the identification model includes a feature extraction network.
2. The online signature authentication method based on a neural network according to claim 1, characterized in that, The identification model includes a feature extraction network and an activation layer; The identification model outputs the confidence level of the similarity vector, and the identification result is obtained by comparing the confidence level with the confidence threshold.
3. The online signature authentication method based on a neural network according to claim 1, characterized in that, The characteristic value includes at least one of the following: position value, pressure value, and velocity value.
4. The online signature authentication method based on a neural network according to claim 1, characterized in that, The step of splitting the first signature information and the second signature information into several first handwriting sequences and several second handwriting sequences respectively is as follows: Extract the peaks and troughs from the first and second signature information to obtain the first peak-trough sequence and the second peak-trough sequence; determine several segmentation points using the DTW algorithm based on the first and second peak-trough sequences; and segment the first and second signature information into several first handwriting sequences and several second handwriting sequences according to the several segmentation points.
5. An online signature authentication system based on a neural network, characterized in that, include: A signature acquisition unit is used to acquire first signature information and second signature information, wherein the first signature information and the second signature information include feature values of a plurality of handwriting points. The signature preprocessing unit is used to calculate the similarity vector between the first signature information and the second signature information based on the feature values of the handwriting points, specifically: The first signature information and the second signature information are respectively divided into several first handwriting sequences and several second handwriting sequences; Based on the feature values of the handwriting points, for each first handwriting sequence, calculate its similarity to the corresponding second handwriting sequence to obtain a similarity vector containing several similarity values; the calculation of the similarity between the first handwriting sequence and the corresponding second handwriting sequence specifically includes: For each handwriting point in the first handwriting sequence, calculate the Euclidean distance between its feature value and at least one handwriting point in the second handwriting sequence; sum the several Euclidean distances to obtain the similarity between the first handwriting sequence and the corresponding second handwriting sequence, expressed by the formula: In the formula, R represents the length of handwriting sequence A; floor represents the floor function; R represents the ratio of the lengths of handwriting sequence A to those of handwriting sequence B. D() represents Euclidean distance; This represents the i-th stroke in the handwriting sequence A; The handwriting point represents the (i+r)th handwriting point in the handwriting sequence B; w represents the weight. In this formula, for the first and second handwriting sequences, the shorter handwriting sequence is used as handwriting sequence A in the formula, and the longer handwriting sequence is used as handwriting sequence B in the formula, to ensure that R≥1; the length of the handwriting sequence is specifically the number of handwriting points in the handwriting sequence. The signature authentication unit is equipped with an authentication model, which is used to output the authentication result based on the similarity vector.