Long text handwriting recognition method and device based on deep learning and medium
Through the alignment-segment-deep learning comparison-fusion method, the problem of low accuracy in handwriting electronic long text handwriting recognition in the prior art is solved, which improves the recognition accuracy and optimizes the processing flow.
Patent Information
- Application Number
- CN202411359360.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-24
AI Technical Summary
Existing electronic signature recognition technology is difficult to effectively identify long text handwriting, especially Chinese characters with more than 5 characters in ethnic minorities, resulting in a decrease in accuracy. In addition, deep learning models ignore local information when processing long sequences and cannot be directly applied to handwritten electronic long texts. Handwriting recognition.
Dynamic time regularization (DTW) algorithm is used to align handwritten electronic long text, and the segment alignment path is multiple subsequences of equal length. The deep learning model is used to compare the rearranged subsequences to calculate the similarity score, and finally pass Fusion results in the final handwriting recognition results.
It significantly improves the accuracy of handwriting and long text handwriting recognition, avoids the problem of increasing cumulative errors, solves the difficulties of deep learning models when processing unequal signature sequences, and makes the processing process more optimized and efficient.
Smart Images

Figure CN119181138A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signature verification, and specifically to a long text handwriting recognition method, device and medium based on deep learning. Background Art
[0002] With the development of science and technology, electronic document processing technology has been more and more widely used in our daily life. Among them, electronic signature recognition technology, as an important electronic document processing technology, is widely used in banking, government, e-commerce and other fields. Most of the current electronic signature recognition technologies can only support Han names, and most of the characters are 4 characters or less. However, with the development of business, the electronic signature recognition algorithm that only supports Han names is no longer sufficient to support a wider range of business scenarios. The most representative scenario is the recognition of Chinese names of more than 5 characters of ethnic minority compatriots. my country is a multi-ethnic country, and each ethnic group has its own language and culture, which leads to differences in names between different ethnic groups. Therefore, the recognition of Chinese names of ethnic minorities is an important task. The long text handwriting recognition method based on deep learning proposed in the present invention can be applied to the field of electronic handwritten signatures, can be applied to the recognition scenario of ethnic minority Chinese names of more than 5 characters, effectively improve the accuracy of electronic signature comparison of ethnic minority Chinese names of more than 5 characters, and can also be applied to other scenarios of handwritten electronic long text handwriting of more than 5 characters, with great market demand and application prospects.
[0003] The existing electronic signature recognition solution mainly realizes the comparison of electronic signatures by using the DTW (Dynamic Time Warping) algorithm. Usually, the DTW algorithm is used to align the sampling points of the signature to be retained and the signature to be verified, and then the alignment path is obtained. Then, the cumulative distance of all sampling point pairs on the alignment path is calculated and used as the distance between the two electronic signatures to identify the verification sample. However, the existing technology still has some problems in the application of handwritten electronic long text handwriting recognition.
[0004] First, because handwritten electronic long texts are longer, they contain more handwriting features and have higher complexity. If the existing electronic signature handwriting recognition method (alignment using the DTW algorithm and calculation of the cumulative distance on the alignment path) is continued to be used for handwriting recognition of handwritten electronic long texts, the accuracy will decrease. The reason for the decrease in accuracy is that handwritten electronic long texts have a longer length, so compared with ordinary signatures of 4 characters or less, handwritten electronic long texts have an alignment path that is 2 times or more longer; and the existing electronic signature recognition method needs to calculate the cumulative distance based on this alignment path; the longer the alignment path, the greater the cumulative error in calculating the cumulative distance; the greater the error, the lower the accuracy. At the same time, for long sequences, deep learning models pay more attention to global information and ignore local information. Therefore, the existing electronic signature recognition algorithm cannot be directly applied to the recognition of handwritten electronic long text handwriting.
[0005] Therefore, how to improve the accuracy of handwriting recognition of long handwritten electronic texts when the length of the handwritten electronic texts is long is an important problem facing current technology.
[0006] Patent CN114333076A provides an improved DTW algorithm for online signature comparison. For the sample signature and the signature to be verified, the DTW algorithm is used to align the sampling points between the two and obtain the alignment path. Then, the cumulative distance of all sampling point pairs on the alignment path is calculated and used as the distance between the two electronic signatures to identify the verification sample. However, the handwritten electronic long text has a longer length. Therefore, compared with ordinary signatures of 4 characters or less, the handwritten electronic long text has a longer alignment path of 2 times or more; and the electronic signature recognition method needs to calculate the cumulative distance based on this alignment path; the longer the alignment path, the greater the cumulative error of calculating the cumulative distance; the greater the error, the lower the accuracy. Therefore, this method is not suitable for handwriting recognition of long handwritten texts.
[0007] Patent CN117437700A discloses an online handwriting determination method based on kinematics, which uses motion features such as speed to segment the signature trajectory and extracts the features of the trajectory segmentation to provide accurate basic data information for handwriting identification, handwriting compression, handwriting display, etc. Different from this method, the segmentation in this method is to segment the DTW alignment path of two long handwritten texts, rather than directly segmenting the handwriting. Summary of the invention
[0008] The technical problem addressed by the present invention is that the longer the alignment path obtained by the DTW algorithm for handwritten electronic signatures of longer texts, the greater the cumulative error in calculating the cumulative distance. The greater the error, the lower the accuracy. At the same time, for long text sequences, the deep learning model pays more attention to global information and ignores local information, which further reduces the accuracy of handwriting recognition.
[0009] In view of the problems existing in the prior art, the present application provides, in a first aspect, a long text handwriting recognition method based on deep learning, comprising:
[0010] Use the dynamic time warping DTW algorithm to align the point feature sequences of the retained sample X and the sample to be verified Y to obtain the alignment path Path DTW (X,Y);
[0011] Align the path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged;
[0012] The deep learning model is used to compare the rearranged subsequences and the similarity scores s of the retained sample X and the sample to be verified Y in the rearranged subsequence are calculated respectively. i ;
[0013] The similarity score s of each rearranged subsequence i The fusion is performed to obtain the final handwriting recognition result.
[0014] Preferably, before obtaining the alignment path, the method further includes using optical character recognition (OCR) technology to perform content recognition on the long text.
[0015] Preferably, the point feature sequence and the alignment path of the retained sample X and the sample to be verified Y are:
[0016] X=[x1,x2,...,x i ,...,x N ]
[0017] Y=[y1,y2,...,y j ,...,y M ]
[0018] Path DTW (X,Y)=[(i1,j1),...,(i t ,j t ),...,(i K ,j K )],
[0019] Where N and M are the lengths of the reserved sample X and the sample to be verified Y, and usually N≠M, x i and j represents the point features of the i-th and j-th handwritten electronic handwriting sampling points of the retained sample X and the verification sample Y respectively; K is the length of the alignment path, (i t ,j t ) indicates that at the tth moment of the alignment path, the i-th sample Xt Points and the jth validation sample t Points Alignment.
[0020] Preferably, t ,j t are the indexes of the aligned retained sample X and the sample to be verified Y at time t, that is, the sampling point of the retained sample X at time t is The sampling points of the validation sample Y are And satisfy:
[0021] 1≤i t-1 ≤i t ≤i t+1 ≤N
[0022] 1≤j t-1 ≤j t ≤j t+1 ≤M,
[0023] The length K of the alignment path satisfies the boundary conditions of the dynamic time warping DTW algorithm, namely
[0024] max(N,M)≤K≤N+M-1.
[0025] Preferably, the length k of the subsequence is set according to actual operation requirements, including being set according to the characteristics and requirements of the deep learning model; the calculation formula for the number of subsequence segments is:
[0026]
[0027] Among them, n k is the alignment path Path of length K DTW (X, Y) is segmented and rounded down to the integer of the subsequence length k; if it cannot be divided evenly, the remaining part of the alignment path is discarded or filled with 0.
[0028] Preferably, the alignment path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged, including that the segmented sequence is:
[0029] Seg1=[(i1,j1),...,(i k ,j k )]
[0030] Seg2=[(i k+1 ,j k+1 ),...,(i 2k ,j 2k )] ...
[0032]
[0033] For Seg1, the rearranged subsequence is:
[0034] X1=X(Seg1)=[X(i1),...,X(i k )]
[0035] Y1=Y(Seg1)=[Y(j1),...,Y(j k )]
[0036] Get the rearranged subsequence set of the retained sample sequence And the rearranged subsequence set of the sample sequence to be verified
[0037] Preferably, the deep learning model is used to process sequence data, including a recurrent neural network (RNN) model, a convolutional neural network (CNN) model, and a long short-term memory (LSTM) network model.
[0038] Preferably, the fusion adopts average fusion or weighted fusion, and the similarity score s of each segment is i The fusion is performed to obtain a final handwriting recognition similarity result s. It is determined whether the handwriting recognition similarity result s is greater than a preset threshold, if so, the handwriting recognition is determined to be similar, otherwise, it is determined to be dissimilar.
[0039] Preferably, if the number of retained samples is greater than 1, the similarity results between the sample to be verified and each retained sample are calculated respectively, and all similarity results are averaged or weighted averaged to obtain the handwriting recognition results of multiple retained sample scenarios.
[0040] In a second aspect, the present application further provides a long text handwriting recognition device based on deep learning, comprising:
[0041] The alignment unit is used to align the point feature sequences of the retained sample X and the sample to be verified Y using the dynamic time warping DTW algorithm to obtain the alignment path Path DTW (X,Y);
[0042] Segmentation unit, used to align the path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged;
[0043] A deep learning unit is used to compare the rearranged subsequences using a deep learning model, and calculate the similarity scores s of the retained sample X and the sample to be verified Y in the rearranged subsequences respectively. i ;
[0044] The fusion comparison unit is used to calculate the similarity score s of each rearranged subsequence i The fusion is performed to obtain the final handwriting recognition result.
[0045] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the long text handwriting recognition method based on deep learning as described in the first aspect are implemented.
[0046] This application has at least the following beneficial effects:
[0047] Support for long text recognition: This technical solution effectively solves the problem that most current electronic signature recognition technologies only support Han names with less than 4 characters. It can support the recognition of long texts, such as the Chinese names of ethnic minorities with more than 5 characters. It can also be applied to the recognition scenarios of other handwritten electronic long texts with more than 5 characters, meeting a wider range of business needs and application scenarios.
[0048] Improve recognition accuracy: By combining deep learning and DTW (dynamic time warping) algorithms, handwritten electronic long texts are aligned, segmented, compared and fused through deep learning, thus avoiding the problem of increased cumulative errors in long text handwriting recognition. At the same time, it solves the difficulties of deep learning models in processing signature sequences of unequal lengths, making the processing flow more optimized and efficient, and significantly improving the accuracy of handwritten electronic long text handwriting recognition.
[0049] Improve system flexibility: In the segmentation and fusion stages, you can adjust the segment length and fusion weight, preset thresholds and other parameters to flexibly configure according to specific business scenarios and needs to meet recognition requirements in different situations. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a handwriting recognition flow chart of a single sample signature scenario in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.
[0052] The technical solution of this application mainly adopts the following technical means: for a given sample of handwritten electronic long text and a handwritten electronic long text to be verified, the alignment-segmentation-calculation-fusion method is used to perform handwriting recognition of the handwritten electronic long text. First, the DTW algorithm is used to align the two handwritten electronic long texts to obtain their alignment path; then, the alignment path is segmented; secondly, for each segment, the deep learning model is used to calculate its similarity; finally, the fusion method is used to fuse the similarity results of each segment to obtain the handwriting recognition result of the handwritten electronic long text.
[0053] Embodiment 1
[0054] A long text handwriting recognition method based on deep learning is provided, comprising:
[0055] Use the dynamic time warping DTW algorithm to align the point feature sequences of the retained sample X and the sample to be verified Y to obtain the alignment path Path DTW (X,Y);
[0056] Align the path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged;
[0057] The deep learning model is used to compare the rearranged subsequences and the similarity scores s of the retained sample X and the sample to be verified Y in the rearranged subsequence are calculated respectively. i ;
[0058] The similarity score s of each rearranged subsequence i The fusion is performed to obtain the final handwriting recognition result.
[0059] like Figure 1 The flowchart of handwriting recognition of handwritten electronic long text in a single sample scenario in this exemplary embodiment is shown. The sample handwriting X and the verification handwriting Y are collected and obtained, and the alignment paths of the two handwritten long texts are obtained by alignment. Then, the alignment paths are segmented to obtain segmented alignment paths. The original handwritten long text is indexed according to the segmented results, and input into the deep learning model to obtain the similarity of each segment. Finally, the learning output results are weighted and fused to form the final handwritten long text similarity. Finally, the similarity is compared with the threshold to obtain the electronic handwritten long text handwriting recognition result.
[0060] The following takes a single sample as an example to illustrate the handwriting recognition method for handwritten electronic signatures with higher complexity and longer length, and then introduces the processing method for multiple sample scenarios.
[0061] Alignment
[0062] To verify the handwriting content of a long handwritten electronic text, usually, you can first use optical character recognition technology (OCR) to identify the content of the handwriting of the long electronic text to ensure the smoothness of the subsequent process, or you can directly identify and compare the handwriting of the long handwritten electronic text without performing content recognition.
[0063] Obtain the reserved sample X and the to-be-verified sample Y for alignment, where both X and Y are handwritten electronic long texts. Specifically, it includes:
[0064] Obtain the sample X of the handwritten electronic long text and the sample Y to be verified, and obtain the point feature data sequence respectively, that is,
[0065] X=[x1,x2,...,x i ,...,x N ]
[0066] Y=[y1,y2,...,y j ,...,y M ]
[0067] Among them, N and M represent the length of the reserved sample X and the sample to be verified Y, respectively, and usually N≠M, x i and j They represent the point features of the i-th and j-th handwritten electronic handwriting sampling points of the retained sample X and the verification sample Y respectively.
[0068] Then, the DTW (Dynamic Time Warping) algorithm is used to align the retained sample X and the verification sample Y to obtain the DTW alignment path:
[0069] Path DTW (X,Y)=[(i1,j1),...,(i t ,j t ),...,(i K ,j K )]
[0070] Path DTW (X,Y) is the alignment path of the retention sample X and the verification sample Y, which is a sequence of length K, where the tth item is (i t ,j t ), indicating that at the tth moment of the alignment path, the i-th retained sample X t Points and the jth validation sample t Points Align. That is, i t ,j t are the indexes of the aligned X and Y at time t, and satisfy:
[0071] 1≤i t-1 ≤it ≤i t+1 ≤N
[0072] 1≤j t-1 ≤j t ≤j t+1 ≤M
[0073] K is the length of the alignment path, which is determined by the DTW algorithm and satisfies the boundary conditions of the DTW algorithm:
[0074] max(N,M)≤K≤N+M-1
[0075] Segmentation
[0076] Since handwritten electronic long texts are usually long, N, M, and K are longer than ordinary Chinese names. If we continue to align the path Path DTW (X, Y) calculates the cumulative distance, the cumulative error of the cumulative distance will also increase with the length of the handwriting, affecting the accuracy of handwriting recognition.
[0077] In order to avoid the impact of increased cumulative errors, this method does not use the alignment path to calculate the cumulative distance as the basis for handwriting recognition, but uses deep learning methods to estimate the similarity of two long text handwriting sequences as the basis for handwriting recognition. However, the use of deep learning methods will also bring two new problems:
[0078] (1) The signature sequences are of different lengths, and the deep learning model cannot process them in batches;
[0079] (2) For long sequences, deep learning models pay more attention to global information.
[0080] In order to solve the above two problems, this patent proposes to align the path Oath DTW (X,Y) segmentation method to make:
[0081] (1) The length of each segment is equal after segmentation;
[0082] (2) After segmentation, the deep learning model can only see local information, thus preventing it from focusing too much on global information.
[0083] The key point of segmentation is to align the handwritten electronic long text with a length of K to the path Path DTW (X,Y) is divided into multiple subsequences of length k. For different X and Y, Path DTW The length K of (X,Y) is also different, while the length k of the subsequence can be set to a fixed value. Therefore, segmentation can simplify a problem of an indefinite length sequence into a problem of a fixed length sequence.
[0084] There is no strict requirement for the segmentation method. It only needs to divide the unequal length sequence of length K into several subsequences of length k. A specific embodiment of segmentation is given below:
[0085] Assume that the DTW alignment path of two handwritten electronic long texts is Path DTW The length of (X, Y) is K, and the length of each segment after segmentation is given as k. k can be set arbitrarily according to the needs of the subsequent deep learning model. According to the formula:
[0086]
[0087] The number of segments can be calculated. Since K may not be divisible by k, in this embodiment, n k Round down
[0088]
[0089] The remaining part after rounding down can be discarded or padded with 0 to obtain the final fixed-length segmentation result.
[0090] Formulate segmentation for the alignment path between two handwriting samples:
[0091] Path DTW (X,Y)=[(i1,j1),...,(i t ,j t ),...,(i K ,j K )]
[0092] The result after segmentation can be expressed as:
[0093] Seg1=[(i1,j1),...,(i k ,j k )]
[0094] Seg2=[(i k+1 ,j k+1 ),...,(i 2k ,j 2k )] ...
[0096]
[0097] Seg1, Represents the alignment path sequence Path DTW The first and nth subsequences after (X,Y) segmentation k subsequences. From the formula, we can see that the length of each subsequence is k.
[0098] According to the segmentation results, the retained sample X and the to-be-verified sample Y can be rearranged. The following takes the first segment subsequence (Seg1) as an example to illustrate the rearrangement method:
[0099] X1=X(Seg1)=[X(i1),...,X(i k )]
[0100] Y1=Y(Seg1)=[Y(j1),...,Y(j k )]
[0101] Among them, X1 and Y1 represent the subsequence of sample X and the subsequence of sample Y after rearrangement according to the first alignment path segment subsequence Seg1, X(i1) represents the i1th point in the retained sample sequence X, and Y(j1) represents the j1th point in the sample sequence Y to be verified. The rearrangement method for other segments is similar.
[0102] After rearrangement, the rearranged subsequence set of the retained sample sequence can be obtained And the rearranged subsequence set of the sample sequence to be verified Among them, each segment X i And each segment Y i They are all sequences of length k, which facilitates the calculation of subsequent deep learning models.
[0103] Deep Learning Models
[0104] Get the subsequence set of the retained sample sequence And the subsequence set of the sample sequence to be verified After that, the deep learning model is called to compare each subsequence separately. Given the deep learning model Model, the similarity score of each subsequence is given by the Model:
[0105] s i =Model(X i ,Y i ), 1≤i≤n k
[0106] Among them, s i is the i-th subsequence X of the retained sample X i and the i-th subsequence Y of the sample Y to be verified i The similarity score of .
[0107] The above-mentioned Model can be any deep learning model, such as recurrent neural network (RNN), long short-term memory network (LSTM), convolutional neural network (CNN), etc. Its input is two sequences of equal length, and its output is the similarity score s of the two sequences, where s is a scalar.
[0108] For recurrent neural networks (RNN) or long short-term memory networks (LSTM), two equal-length input sequences can be concatenated in the feature dimension, and then the concatenated features at each moment are input into the network to obtain the hidden vector at each moment. Finally, the average vector of the hidden vectors at all moments is obtained, and then the similarity score is calculated through a fully connected layer. For convolutional neural networks (CNN), two equal-length input sequences can also be concatenated in the feature dimension, and then the deep features are calculated through several one-dimensional convolutional layers, and finally the similarity score of the input is calculated using a fully connected layer. There is no obvious difference between different deep learning models. It only needs to ensure that the input and output forms meet the above requirements.
[0109] Fusion
[0110] Get {s i |1≤i≤n k}, we need to fuse the scores of each segment to obtain the similarity between the retained sample X and the sample to be verified Y. One method is to use average fusion:
[0111]
[0112] Or use weighted fusion:
[0113]
[0114] Among them, {w i |1≤i≤n k} is the preset weight, w i It can be set artificially based on experience.
[0115] Finally, the similarity s is compared with the preset threshold t' to obtain the result of handwriting recognition pass / fail. The setting of the threshold t' can be adjusted according to the requirements of the business scenario for high pass rate or low false pass rate.
[0116] In the scenario of multiple retained samples, there are multiple retained samples and one sample to be verified. The multiple retained sample problem can be decomposed into multiple single retained sample problems. For each retained sample, the similarity score can be calculated with the sample to be verified through the above steps 1 to 4. After obtaining the similarity score between each retained sample and the sample to be verified, the average of all similarity scores can be obtained to obtain the similarity score between the retained sample and the sample to be verified in the scenario of multiple retained samples.
[0117] Embodiment 2
[0118] A long text handwriting recognition device based on deep learning, comprising:
[0119] The alignment unit is used to align the point feature sequences of the retained sample X and the sample to be verified Y using the dynamic time warping DTW algorithm to obtain the alignment path Path DTW (X,Y);
[0120] Segmentation unit, used to align the path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged;
[0121] A deep learning unit is used to compare the rearranged subsequences using a deep learning model, and calculate the similarity scores s of the retained sample X and the sample to be verified Y in the rearranged subsequences respectively. i ;
[0122] The fusion comparison unit is used to calculate the similarity score s of each rearranged subsequence i The fusion is performed to obtain the final handwriting recognition result.
[0123] Embodiment 3
[0124] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the long text handwriting recognition method based on deep learning as described in Example 1 are implemented.
[0125] This application proposes a method, device and medium for long text handwriting recognition based on deep learning, which performs four steps of alignment-segmentation-deep learning comparison-fusion on handwritten electronic long text handwriting to obtain the recognition result of long text handwriting. This method solves the problem that traditional handwriting recognition methods are not applicable to long text handwriting and improves the accuracy of long text handwriting recognition.
[0126] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A long text handwriting recognition method based on deep learning, characterized in that: include: Use the dynamic time warping DTW algorithm to align the point feature sequences of the retained sample X and the sample to be verified Y to obtain the alignment path Path DTW (X,Y); Align the Oath Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged; The rearranged subsequences are compared using a deep learning model, and the similarity scores between each retained sample subsequence and the corresponding sample subsequence to be verified in the rearranged subsequence are calculated respectively; The similarity scores of each rearranged subsequence are fused to obtain the final handwriting recognition result.
2. The long text handwriting recognition method according to claim 1, characterized in that: Before obtaining the alignment path, the method further includes using optical character recognition (OCR) technology to perform content recognition on the long text.
3. The long text handwriting recognition method according to claim 1, characterized in that: The point feature sequence and the alignment path of the retained sample X and the sample to be verified Y are: X=[x1,x2,…,x i ,…,x N ] T=[y1,y2,...,y j ,...,y M ] Path DTW (X,Y)=[(i1,j1),...,(i t ,j t ),...,(i K ,j K )], Among them, (i t ,j t ) indicates that at the tth moment of the alignment path, the i-th sample X t Points and the jth validation sample t Points Alignment, i t ,j t are the indexes of the aligned X and Y at time t, respectively. N and M are the lengths of the retained sample X and the sample to be verified Y, and N≠M. i and j They represent the point features of the i-th and j-th handwritten electronic handwriting sampling points of the retained sample X and the verification sample Y respectively, and K is the length of the alignment path.
4. The long text handwriting recognition method according to claim 3, characterized in that: The length K of the alignment path satisfies the boundary conditions of the dynamic time warping DTW algorithm, namely max(N,M)≤K≤N+M-1.
5. The long text handwriting recognition method according to claim 1, characterized in that: The length k of the subsequence is set according to actual operation requirements, including being set according to the characteristics and requirements of the deep learning model; the calculation formula for the number of subsequence segments is: Among them, n k is the alignment path Path of length K DTW (X, Y) is segmented and rounded down to the integer of the subsequence length k; if it cannot be divided evenly, the remaining part of the alignment path is discarded or filled with 0.
6. The long text handwriting recognition method according to claim 5, characterized in that: The alignment path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged, including that the segmented sequence is: Seg1=[(i1,j1),...,(i k ,j k )] Seg2=[(i k+1 ,j k+1 ),...,(and 2k ,j 2k )] ... For Seg1, the rearranged subsequence is: X1=X(Seg1)=[X(i1),...,X(i k )] Y1=Y(Seg1)=[Y(j1),...,Y(j k )] Get the rearranged subsequence set of the retained sample sequence And the rearranged subsequence set of the sample sequence to be verified The rearranged subsequence is obtained by indexing the elements in the segmented sequence.
7. The long text handwriting recognition method according to any one of claims 1 to 6, characterized in that: The deep learning model compares the rearranged subsequences by splicing two input sequences of equal length in the feature dimension, then inputting the splicing features at each moment into a recurrent neural network or a long short-term memory network to obtain the hidden vector at that moment, and finally obtaining the average vector of the hidden vectors at all moments, and calculating the similarity score through a fully connected layer.
8. The long text handwriting recognition method according to any one of claims 1 to 6, characterized in that: The deep learning model compares the rearranged subsequences by concatenating two equal-length input sequences in the feature dimension, calculating the deep features through a plurality of one-dimensional convolutional layers, and calculating the similarity score of the input through a fully connected layer.
9. The long text handwriting recognition method according to any one of claims 1 to 6, characterized in that: The similarity score s i The fusion includes average fusion or weighted fusion, and the similarity score s of each segment is i Perform fusion to obtain the handwriting recognition similarity s; The similarity s is compared with a preset threshold t'. If s is greater than t', the handwriting is determined to be similar; otherwise, it is determined to be dissimilar.
10. A long text handwriting recognition device based on deep learning, characterized in that: include: The alignment unit is used to align the point feature sequences of the retained sample X and the sample to be verified Y using the dynamic time warping DTW algorithm to obtain the alignment path Path DTW (X,Y); Segmentation unit, used to align the path Path DTW (X,Y) is segmented into multiple subsequences of equal length, and the retained sample X and the sample to be verified Y are rearranged; A deep learning unit is used to compare the rearranged subsequences using a deep learning model, and calculate the similarity scores s of the retained sample X and the sample to be verified Y in the rearranged subsequences respectively. i ; The fusion comparison unit is used to calculate the similarity score s of each rearranged subsequence i The fusion is performed to obtain the final handwriting recognition result.
11. The device according to claim 10 is characterized in that The deep learning model can adopt: recurrent neural network (RNN), long short-term memory network (LSTM), convolutional neural network (CNN), whose input is two equal-length sequences and output is the similarity score of the two sequences. When the deep learning model is a recurrent neural network or a long short-term memory network, the two equal-length input sequences are spliced in the feature dimension, the hidden vector at each moment is obtained according to the splicing features of the moment, the average vector of the hidden vectors at all moments is calculated, and then the similarity score is calculated through a fully connected layer; when the deep learning model is a convolutional neural network, the two equal-length input sequences are spliced in the feature dimension, the deep features are calculated through several one-dimensional convolutional layers, and the similarity score of the input is calculated using a fully connected layer.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the long text handwriting recognition method based on deep learning as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Text-independent end-to-end handwriting recognition method based on deep learning
CN105893968A
Online signature authentication system and method based on soft dynamic time warping
US20230385394A1
Cited By
Handwriting identification system, method and equipment based on multi-dimensional sequence alignment and deep learning, and medium
CN120913279A
