A single-character extraction method and system based on signature stroke sequences
Through the signature list word extraction method based on stroke sequence, the downsampling and interpolation technology combined with neural network is used to solve the problem of recognition and segmentation of strokes in electronic signatures, the recognition accuracy is improved, and it is suitable for applications with high requirements such as judicial appraisal.
Patent Information
- Application Number
- CN202210781862.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-07-05
AI Technical Summary
The prior art cannot effectively divide the compact stroke signature in electronic signature recognition, resulting in low recognition accuracy and inability to meet the requirements of judicial appraisal and other requirements.
The signature list word extraction method based on stroke sequence is used to obtain stroke features at different sampling rates through downsampling and interpolation technology, and combine nested named entity recognition and bidirectional LSTM network to judge and cut strokes to improve recognition accuracy.
It realizes accurate identification of compact stroke signatures, improves the accuracy and robustness of electronic signature recognition, and meets high requirements such as judicial appraisal.
Smart Images

Figure CN115100748B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic signatures, and in particular to a method for extracting single characters in an electronic signature. Background Art
[0002] In the verification of electronic signatures, a large number of signature comparisons are involved. However, in some existing handwriting comparison methods, the comparison is basically carried out on the whole signature, and the signature is not segmented into single characters for comparison. This leads to the loss of a lot of stroke feature information in the verification and comparison of electronic signatures, and the obtained feature information is inaccurate, resulting in a series of problems such as incorrect verification results and decreased accuracy. It brings great difficulties to signature comparison and recognition with connected strokes in writing. Single-character extraction is also a prerequisite for the overall recognition of signatures as Chinese characters, and it can contribute to the long-term research and data construction in the field of signatures. Some existing overall recognition algorithms can accurately recognize the content of Chinese characters in some cases, but they cannot accurately separate all the strokes of the characters themselves, and their uses are very limited.
[0003] Chinese Patent Application with Publication No. CN113723413A, titled "A Method for Segmenting Handwritten Chinese Texts Based on the Snake Algorithm". It discloses a method for segmenting handwritten Chinese texts based on the snake algorithm, which is used for the segmentation of image texts. According to the vertical projection histogram of the text line and the stroke width of the characters, the weak stroke positions between characters are adaptively calculated. The snake algorithm is used to establish an initial segmentation trajectory in this area, and multiple constraint rules are formulated to optimize the segmentation path to achieve the rough segmentation of the handwritten text. According to the character width and the width-to-height ratio threshold, the connected characters are screened. Starting from the contour curve and skeleton features of the connected characters, the connected segmentation points are selected, and the snake algorithm is used for secondary segmentation. Combining the structural features of Chinese characters and the confidence of Chinese character recognition, the over-segmented characters are merged to obtain the final correct text segmentation result. This method is based on the segmentation of image texts. When this method segments the connected characters, due to the lack of the original writing trajectory, it cannot finely segment the strokes when there are intersections between the strokes of the characters, and it is easy to have the situation of incomplete stroke segmentation. At the same time, if the overlap between two characters is relatively serious, this method cannot segment the correct text. Finally, the accuracy rate of the segmentation by this method is relatively low, all below 90%, and it does not have much practical value.
[0004] Chinese patent application with publication number CN111160245A and title "A Dynamic Signature Recognition Method and Device" sequentially parses a signature file, performs character segmentation based on stroke attributes and stroke preprocessing to obtain at least two effective sampling points corresponding to each single character in the dynamic signature and the normalized coordinates of each said effective sampling point, classifies the feature vectors of each single character, and integrates the classification results of all single characters to achieve effective recognition of each single character in the dynamic signature. This method performs segmentation at the stroke level, but if there are partial single-stroke problems in the signature, that is, a single stroke cannot be simply classified into one character but is shared by two or more characters, this method cannot solve it.
[0005] Since the number of characters in an electronic signature is small and the signature characters are compact, there are connections between many scribbled signature single characters, that is, two characters in one stroke. Some existing single-character extraction methods, whether based on offline data (images) or online data (sequences), basically recognize the signature as a whole and do not segment and distinguish the connections between single characters, that is, the so-called one-stroke, and cannot accurately recognize the single characters in a compact connected-stroke signature, resulting in low accuracy in electronic signature recognition and unable to meet the requirements for authenticating the original handwriting of electronic signatures in high-demand application scenarios such as forensic identification. Summary of the Invention
[0006] In view of the fact that the number of characters in an electronic signature is small, there are many situations such as connections, intersections, and overlaps between strokes, and the existing technology has incomplete stroke segmentation and cannot recognize the situation where a single stroke is shared by two or more characters in the recognition and segmentation of the connections between single characters in electronic signature recognition, resulting in low signature recognition accuracy. The present invention performs general processing on the phenomena of signature stroke intersections and overlaps, and considers the stroke connections (abbreviated as connected strokes) between characters in the extraction of single characters in signature recognition.
[0007] The present invention proposes a method for extracting single signature characters based on a stroke sequence, including: a downsampling module that collects the signature stroke feature sequence, reduces the coordinate point set of the stroke feature sequence, and obtains the macroscopic features of the signature at a low sampling rate; an interpolation module that collects the electronic signature stroke feature sequence, interpolates and expands the coordinate point set of the stroke feature sequence, and obtains the microscopic features of the signature at a high sampling rate; the structures of single-character cutting module 1 and single-character cutting module 2 are the same. Single-character cutting module 1 uses the point set sequence (x up , y up ) output by the interpolation module, and single-character cutting module 2 uses the point set sequence (x reduce , y reduce) In the single-character cutting module, the stroke feature extraction module in it divides the strokes through point sets to generate stroke features. The single-character cutting module 1 and the single-character cutting module 2 use the nested named entity recognition method to predict the stroke attributes and character count confidence of the signature respectively based on the stroke features. The connected-stroke cutting module determines whether there are connected strokes according to the stroke attributes and character count confidence output by the single-character cutting module 1 and the single-character cutting module 2, and cuts the connected strokes in the signature.
[0008] Further preferably, obtaining the macroscopic features of the signature at a low sampling rate further includes that the downsampling module collects the original point set (x, y) of the electronic signature strokes, obtains the threshold angle θ, and uses a sliding window to start sliding on the point set to delete non-key points, and obtains a coordinate point set sequence (x reduce , y reduce ) with reduced stroke features; obtaining the microscopic features of the signature at a high sampling rate further includes setting the target stroke length k, cutting the strokes in the signature with a feature sequence length greater than k into several strokes with a length of k, and supplementing the positions of the strokes with a length less than k with the point set (0, 0) to make the length k, and converting all the strokes of a signature into a point set of an equal-length stroke set.
[0009] Further preferably, deleting the non-key points further includes: taking a sliding window of a predetermined length n, sliding from the starting point subscript i of the window to the points in the original signature stroke point set with the subscript i--n. When n stroke points of the sliding window are obtained, calculate the included angle θ i+1 , y i+1 ) with (x i as the vertex. If θ i >θ, then delete the coordinate point (x i+1 , y i+1 ) corresponding to the vertex in the original signature point set, and let the subscripts of the signature points greater than i be decreased by one, and recalculate the window with the starting point subscript i; if θ i ≤θ, then let the window slide backward, and continue to calculate the window with the starting point subscript i + 1 until all the points in the original stroke point set are slid through, and the macroscopic feature coordinate point set of the point set length obtained by the downsampling module is obtained.
[0010] Further preferably, obtaining the stroke attributes and the confidence degree of the number of characters further includes that the single-character cutting module 1 obtains the stroke embedding, the single-character cutting module 2 obtains the cross-stroke features, the equal-length signature stroke point set input module 1 with microscopic features is input, and after being mapped to a high-dimensional space through two fully connected layers to obtain the stroke feature variables, and then being mapped to an embedding space with a fixed dimension through a fully connected layer to obtain the stroke embedding; the equal-length signature stroke point set input module 2 with macroscopic features is mapped to a high-dimensional space through a fully connected layer, the signature stroke point set is convolved and max-pooled through a CNN, and then mapped to an embedding space with a fixed dimension through a fully connected layer to obtain the cross-stroke features, the stroke connection features obtained by connecting the stroke embedding and the cross-stroke features, the corresponding stroke attributes and the confidence degree of the number of characters are obtained by using a conditional random field, and the stroke embedding and the cross-stroke features are input into a bidirectional LSTM network and merged in the 1D direction to obtain the stroke connection features.
[0011] Further preferably, cutting the existing stroke connections in the signature includes determining the starting stroke number, the middle stroke number, and the ending stroke number of the character according to the attributes of the signature strokes and the corresponding confidence degrees, calculating the average confidence degree of all the starting stroke attributes, and taking the stroke with the highest average confidence degree as the starting stroke to determine the confidence degree of the number of characters. Specifically, it includes, according to the formula:
[0012] α1 = (|0.5 - α i | + |0.5 - α j | + |0.5 - α m′ | + |0.5 - α n′ | + |0.5 - α o′ |) to calculate the average confidence degree of the starting stroke attributes output by calculation module 1. According to the formula:
[0013] α2 = (|0.5 - α i′ | + |0.5 - α j | + |0.5 - α m | + |0.5 - α n | + |0.5 - α o |) to calculate the average confidence degree of the starting stroke attributes output by calculation module 2. Among them, α i , α j are the confidence degrees of the starting strokes i and j determined by module 1, α i′ , α j′ are the confidence degrees of the corresponding strokes i' and j' after downsampling, α m , α n , α o are the confidence degrees of the starting strokes m, n, and o determined by module 2, α m′ , α n′ , α o′Confidence levels corresponding to the interpolated strokes m', n', and o'.
[0014] The present invention also proposes a signature single-character extraction system based on a stroke sequence, including: a downsampling module, an interpolation module, a single-character cutting module 1, a single-character cutting module 2, and a connected-stroke cutting module. The downsampling module collects the signature stroke feature sequence, reduces the coordinate point set of the stroke feature sequence, and obtains the macroscopic features of the signature at a low sampling rate. The interpolation module collects the electronic signature stroke feature sequence, interpolates and expands the coordinate point set of the stroke feature sequence, and obtains the microscopic features of the signature at a high sampling rate. The structures of the single-character cutting module 1 and the single-character cutting module 2 are the same. The single-character cutting module 1 uses the point set sequence (x up , y up ) output by the interpolation module, and the single-character cutting module 2 uses the point set sequence (x reduce , y reduce ) output by the downsampling module. The stroke feature extraction module in the single-character cutting module divides the strokes through the point set to generate stroke features. The single-character cutting module 1 and the single-character cutting module 2 use the nested named entity recognition method to predict the stroke attributes and character number confidence levels of the signature respectively according to the stroke features. The connected-stroke cutting module determines whether there are connected strokes according to the stroke attributes and character number confidence levels output by the single-character cutting module 1 and the single-character cutting module 2, and cuts the connected strokes in the signature.
[0015] Further preferably, the obtaining of the macroscopic features of the signature at a low sampling rate further includes that the downsampling module collects the original point set (x, y) of the electronic signature stroke, obtains the threshold angle θ, and uses a sliding window to start sliding on the point set to delete non-key points, obtaining a coordinate point set sequence (x reduce , y reduce ) with reduced stroke features; the obtaining of the microscopic features of the signature at a high sampling rate further includes setting the target stroke length k, cutting the strokes with a feature sequence length greater than k in the signature stroke into several strokes with a length of k, and supplementing the positions of the strokes with a length less than k with the point set (0, 0) to make the length k, converting all the strokes of a signature into a point set of an equal-length stroke set.
[0016] Further preferably, the single - character cutting module 1 obtains stroke embeddings, and the single - character cutting module 2 obtains cross - stroke features. The equal - length signature stroke point set input module 1 with microscopic features is input into it. After being mapped to a high - dimensional space through two fully - connected layers to obtain stroke feature variables, and then being mapped to an embedding space with a fixed dimension through a fully - connected layer to obtain stroke embeddings; the equal - length signature stroke point set input module 2 with macroscopic features is mapped to a high - dimensional space through a fully - connected layer, and the signature stroke point set is convolved and max - pooled through a CNN, and then mapped to an embedding space with a fixed dimension through a fully - connected layer to obtain cross - stroke features. The stroke connection features obtained by connecting the stroke embeddings and the cross - stroke features are used to obtain the corresponding stroke attributes and the confidence of the number of characters by using a conditional random field.
[0017] Further preferably, according to the attributes of the signature strokes and the corresponding confidence levels, determine the starting stroke number, the middle stroke number, and the ending stroke number of the character, calculate the average confidence level of all starting stroke attributes, and take the stroke with a high average confidence level as the starting stroke to determine the confidence level of the number of characters. Specifically, it includes, according to the formula:
[0018] α1 = (|0.5 - α i |+|0.5 - α j |+|0.5 - α m′ |+|0.5 - α n′ |+|0.5 - α o′ |) Calculate the average confidence level of the starting stroke attributes output by module 1. According to the formula:
[0019] α2 = (|0.5 - α i′ |+|0.5 - α j′ |+|0.5 - α m |+|0.5 - α n |+|0.5 - α o |) Calculate the average confidence level of the starting stroke attributes output by module 2. Among them, α i , α j are the confidence levels of the starting strokes i and j determined by module 1, α i′ , α j′ are the confidence levels of the corresponding strokes i′ and stroke h' after downsampling, α m , α n , α o are the confidence levels of the starting strokes m, n, and o determined by module 2, α m′ , α n′ , α o′ are the confidence levels of the corresponding strokes m', n', and o' after interpolation.
[0020] The present invention uses a stroke-level neural network to predict the attribution of strokes and whether they are connected strokes, and can accurately recognize single characters in a compact connected-stroke signature. At the same time, interpolation technology and downsampling technology are used with different sampling rates to improve the robustness of the model, thereby obtaining a more robust single-character extraction effect. Different prediction tendencies are assigned to different prediction modules to make each module complementary. At the same time, it can solve the phenomena of stroke crossing and overlap, greatly improving the signature recognition accuracy. At the same time, the judgment and cutting of connected strokes are carried out according to stroke attributes and confidence levels, improving the accuracy and speed of judgment and cutting, so that such situations can also be better solved, and it has great practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic structural diagram of the single-character extraction system of the present invention;
[0022] Figure 2 It is the structure of the single-character cutting module under the bidirectional LSTM network. DETAILED DESCRIPTION OF THE INVENTION
[0023] In order to facilitate a clear understanding of the present invention and make the technical problems to be solved, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help a comprehensive understanding of the embodiments of the present invention. Therefore, those skilled in the art should clearly understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. In addition, descriptions of known functions and structures are omitted for clarity and conciseness. It should be understood that the embodiments are only for explaining the present invention and not for limiting the protection scope of the present invention.
[0024] The present invention provides a general and efficient method for extracting single characters of electronic signatures based on multi-modal algorithms, which can accurately recognize single characters in a compact connected-stroke signature. The following describes the implementation of the present invention in detail with reference to the accompanying drawings and specific examples.
[0025] As Figure 1 shown is a schematic structural diagram of the single-character extraction system of the present invention, including: a downsampling module, an interpolation module, a single-character cutting module 1, a single-character cutting module 2, and a connected-stroke cutting module. The downsampling module collects the stroke feature sequence of the electronic signature and reduces the coordinate point set of the stroke feature sequence through downsampling, so that the single-character cutting module can learn the macroscopic features of the signature at a low sampling rate. For any electronic signature stored in the form of a coordinate point set (x, y) (both x and y are vectors of the electronic signature stroke point set) with a length l, the coordinate point set with a length of l is converted through downsampling into a coordinate point set with a length of l reduce (x reduce , yreduce ), where l reduce ≤ l. The coordinate point set obtained after downsampling enables the single-character cutting module to learn the features of the signature at a low sampling rate, that is, relatively macroscopic features.
[0026] The downsampling technique can use various methods, such as time-based downsampling, length-based downsampling, etc. The following is a specific example of the downsampling method that uses a sliding window to convert the coordinate points of the electronic signature stroke feature sequence.
[0027] Collect the original point set (x, y) of the electronic signature stroke, obtain the threshold angle θ, start sliding the sliding window on the point set, and delete non-key points during the sliding process from start to end. For example: during the sliding process, a sliding window with a predetermined length n (the length n can take any value, here 3 is used as an example) can be taken, and it slides from the starting point subscript 1 of the window to the points in the original point set of the signature stroke with the subscript l - n. When the starting point subscript of the window is 1, the stroke points obtained by the sliding window are (x1, y1), (x2, y2),...(x n , y n ), when n stroke points of the sliding window are obtained, calculate the included angle between the n points. Let the starting point i of the window where the sliding window is located (in the above example, i = 1), then the included angle calculated between the n points is the angle θ with (x i+1 , y i+1 ) as the vertex i , if n is 3, that is, calculate the angle θ with (x1, y1), (x3, y3) as the endpoints and (x2, y2) as the vertex i , if the included angle is greater than the threshold angle θ, if θ i > θ, then delete the coordinate point (x i+1 , y i+1 ) corresponding to the vertex of this angle in the original point set of the electronic signature, and subtract 1 from the subscripts of the signature points with subscripts greater than i, and recalculate the window with the starting point subscript i; if θ i ≤ θ, then slide the window backward, that is, continue to calculate the window with the starting point subscript i + 1. Generally speaking, the length l of the point set obtained by the downsampling module reduce can be about right.
[0028] The interpolation module also collects the electronic signature stroke feature sequence, and expands the coordinate point set of the stroke feature sequence through interpolation, so that the single-character cutting module can learn the microscopic features of the signature at a high sampling rate. For any electronic signature with a coordinate point set (x, y) and a storage form of length l, the coordinate point set with a length of l is converted into a coordinate point set (x up of length l up , y up ) through interpolation technology, where l ≤ lup ; The purpose of downsampling is to enable the next single-character cutting module to learn the features of the signature at a high sampling rate, that is, relatively microscopic features. The interpolation technique can use various methods, for example, resampling based on time, cubic interpolation method, etc.
[0029] There are various ways to divide the stroke coordinate point set after the above-mentioned downsampling and interpolation into strokes. For example, it can be divided by Bezier curves, divided from the pen-lifting state, divided from the writing pressure, etc. Taking the division method from the pen-lifting state as an example, this method mainly divides from the natural pen-lifting and pen-dropping states of the writer. Between each pen-dropping and the next pen-lifting, it is regarded as a stroke. However, since the number of points in each stroke is different, in the process of dividing the stroke by the point set, the target stroke length k can be set. If a certain stroke is too long, it can be cut into several strokes with the target stroke length k. For the point set with a length less than the target stroke length k, the point positions are supplemented with (0, 0) so that the remaining length is k. If a certain stroke is too short, the point positions are directly supplemented with (0, 0) so that the stroke length is the target stroke length k. Finally, the point set dividing stroke module can convert a signature into a set of strokes with equal length.
[0030] The network structures of single-character cutting module 1 and single-character cutting module 2 are exactly the same. They are both prediction and segmentation modules based on the stroke level. The output result point set sequence (x up , y up ) of the interpolation module is used by single-character cutting module 1, and the output result point set sequence (x reduce , y reduce ) of the downsampling module is used by single-character cutting module 2.
[0031] The coordinate point set sequence (x up , y up ) of the stroke feature sequence expanded by interpolation and the coordinate point set sequence (x reduce , y reduce ) of the stroke feature sequence reduced by downsampling are respectively input into single-character cutting module 1 and single-character cutting module 2. Strokes are divided from the point set, features are generated from the strokes, and the stroke features are input into the neural network in single-character cutting module 1 and single-character cutting module 2, and the attribute prediction of the strokes is carried out using the nested named entity recognition method.
[0032] Multiple forms of neural networks can be selected, such as LSTM, BERT, etc. Here, the bidirectional long short-term memory artificial neural network (Bi-LSTM) is taken as an example for illustration. Figure 2 Schematically shows the structure of the single-character cutting module under the bidirectional LSTM network. Stroke embeddings are obtained through single-character cutting module 1, and cross-stroke features are obtained through single-character cutting module 2.
[0033] The equal-length signature stroke point set input single-character cutting module 1 of the point set partitioning stroke module conversion is mapped to a high-dimensional space through two fully connected layers (FC) to obtain a stroke feature variable, and then through another fully connected layer, it is mapped into an embedding space of a fixed dimension. The fixed dimension can be set according to prior experience, usually 64, 128, 256, etc., to obtain a stroke embedding. The equal-length signature stroke point set input single-character cutting module 2 of the point set partitioning stroke module conversion is mapped to a high-dimensional space through a fully connected layer (FC), and the signature stroke point set is convolved and max-pooled through a convolutional neural network (CNN), and then through a fully connected layer (MaxPooling), it is mapped into an embedding space of a fixed dimension to obtain a cross-stroke feature.
[0034] The stroke embedding and the cross-stroke feature are input into the bidirectional LSTM network for merging in the 1D direction, that is, the stroke connection feature obtained by concatenating the stroke embedding output by the single-character cutting module 1 and the cross-stroke feature output by the single-character cutting module 2. The conditional random field (CRF layer) is used to obtain the attributes of the corresponding strokes and the corresponding confidence levels. The stroke attributes can be divided into three types: the start stroke B (Begin) of the character, the intermediate stroke I (Intermediate) of the character, and the end stroke E (End) of the character. Due to the existence of the connection between characters and within each character during signature, each stroke may have multiple attributes. For example, a stroke may be both the end of one character and the start of the next character.
[0035] The connected-stroke cutting module first selects the segmentation results of the single-character cutting module 1 and the single-character cutting module 2, and then judges the situation of connected strokes. If there are connected strokes, it performs cutting; if there are no connected strokes, it directly gives the result. According to the attributes of the signature strokes and the corresponding confidence levels, the numbers of attributes B, I, and E in the corresponding signature are obtained, and the preliminary signature word count is predicted. Considering that the usual signature is 2 or 3 characters, the connected-stroke cutting module combines the confidence level and makes a selection according to the number of single characters initially cut by module 1 and module 2. There may be the following situations:
[0036] (1) If the number of single characters obtained by module 1 and module 2 for signature cutting is the same, select this same number as the signature word count;
[0037] (2) If the number of characters obtained by module 1 and module 2 for signature cutting is different, then calculate the average confidence level of all start stroke B attributes, and select the stroke with the higher average confidence level as the start stroke. First, select the output of the module with a segmentation count of 2 or 3 as the basis for the connected-stroke cutting module to judge the signature word count during segmentation.
[0038] (3) If the number of characters obtained by the signature cutting of Module 1 and Module 2 is 2 characters or 3 characters, calculate the stroke confidence according to the stroke attributes of Module 1 and Module 2 respectively, and determine the result number of characters of the corresponding single-character cutting module selected according to the confidence as the basis for the segmentation by the connected-stroke cutting module. The following is a specific example. Suppose: the B-attribute strokes obtained by Module 1 are stroke i and stroke j, and the B-attribute strokes obtained by Module 2 are stroke m, stroke n, and stroke o. Find the corresponding sampling rate, and obtain the corresponding stroke i′ and stroke j′ after downsampling of stroke i and stroke j, and the corresponding stroke m′, stroke n′, and o′ after interpolation of stroke m, stroke n, and o. Set the confidence symbol as, then the confidence of the above strokes in the single-character cutting module 1 is α i , α j , α m′ α n′ , α o′ , and the confidence of the above strokes in the single-character cutting module 2 is α i′ , α j′ , α m , α n , α o , the confidence α1 of the single-character cutting module 1 can be calculated according to the following formula:
[0039] α1 = (|0.5 - α i | + |0.5 - α j | + |0.5 - α m′ | + |0.5 - α n′ | + |0.5 - α o′ |)
[0040] According to the formula:
[0041] α2 = (|0.5 - α i′ | + |0.5 - α j′ | + |0.5 - α m | + |0.5 - α n | + |0.5 - α o |) calculate the confidence of the single-character cutting module 2, and select the number of signature characters segmented by the single-character cutting module with higher confidence as the basis for the connected-stroke cutting of the single-character cutting module.
[0042] The cursive stroke cutting module divides cursive strokes according to the number of characters segmented and the stroke attributes. Among the initially segmented single characters predicted to have cursive strokes, it is determined whether there are both the starting stroke B and the character ending stroke E attributes at the same time. A single character ranges from each stroke with attribute B to the next stroke with attribute E. If there are no strokes with both stroke attributes B and E, the character is no longer segmented. If the stroke attributes of the segmented character are B and E at the same time, then this stroke is a cursive stroke and needs to be processed. At this time, considering that it should be after the previous character ends and the next character starts, so the first half should have attribute E and the second half should have attribute B. According to the confidence of the character ending stroke E attribute and the confidence of the starting stroke B attribute, according to the formula r target =(α E -0.5) / (α E +α B -1), the segmentation ratio of the characters obtained by the single-character cutting module is calculated.
[0043] Among the common Chinese character strokes, including strokes such as dots, horizontal lines, vertical lines, left-falling strokes, and right-falling strokes, no stroke will be written right-upward. Only in uncommon Chinese character strokes, such as the horizontal fold and hook stroke, does such a situation exist. At the same time, in cursive strokes, there is usually a stroke that goes right-upward between two characters as the main body of the connecting stroke. Therefore, when it is detected that a stroke develops right-upward in the signature and extends beyond the range of the written point set on the x-axis, record the position ratio r candidate of this position to the overall stroke position. For example, in a stroke with a point set length, such as 30 dots, find the subscript of the point that meets the above description. If the order is 6, then the position ratio of this position to the overall stroke is Record all r candidate that meet the conditions. After that, find the position ratio r target that is closest to the segmentation ratio r candidate The positions corresponding to it. The positions before this position form a new stroke and are given attribute E, and the positions after this position form a new stroke and are given attribute B. If no positions that meet the conditions are found, take the one with a higher confidence of attribute B or E as the attribute of this stroke. If attribute B is taken, the previous stroke is given attribute E. If attribute E is taken, the next stroke is given attribute B.
[0044] After all cursive strokes are segmented, all strokes have only one attribute. Then, each character ranges from each stroke with attribute B to the next stroke with attribute E to obtain the single-character extraction result.
[0045] The above-described embodiments are only one of the implementation manners of the present invention. Ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A signature single-character extraction method based on a stroke sequence, characterized in that, It includes: The downsampling module collects the signature stroke feature sequence, reduces the coordinate point set of the stroke feature sequence, and obtains the macroscopic features of the signature at a low sampling rate. The interpolation module collects the electronic signature stroke feature sequence, interpolates and expands the coordinate point set of the stroke feature sequence, and obtains the microscopic features of the signature at a high sampling rate. The structures of the single-character cutting module 1 and the single-character cutting module 2 are the same. The single-character cutting module 1 uses the point set sequence output by the interpolation module, and the single-character cutting module 2 uses the point set sequence output by the downsampling module. The stroke feature extraction module in the single-character cutting module divides the strokes through the point set to generate stroke features. The single-character cutting module 1 and the single-character cutting module 2 use the nested named entity recognition method to predict the stroke attributes and character count confidence of the signature respectively according to the stroke features. The connected-stroke cutting module determines whether there are connected strokes based on the stroke attributes and character count confidence output by the single-character cutting module 1 and the single-character cutting module 2, and cuts the connected strokes in the signature; obtaining the stroke attributes and character count confidence includes that the single-character cutting module 1 obtains stroke embeddings, the single-character cutting module 2 obtains cross-stroke features, the stroke connection features obtained by connecting the stroke embeddings and the cross-stroke features, and using the conditional random field to obtain the corresponding stroke attributes and character count confidence; cutting the connected strokes in the signature includes, according to the attributes of the signature strokes and the corresponding confidence, determining the starting stroke number, the middle stroke number, and the ending stroke number of the character, calculating the average confidence of all starting stroke attributes, taking the stroke with a high average confidence as the starting stroke to determine the character count confidence, and selecting the number of signature characters segmented by the single-character cutting module with a high confidence as the basis when the single-character cutting module performs connected-stroke segmentation.
2. The method according to claim 1, wherein The macro features for obtaining signatures at low sampling rates further include that the downsampling module collects the original point set (x, y) of the electronic signature strokes, obtains the threshold angle θ, and starts sliding a sliding window on the point set to delete non-key points, resulting in a sequence of coordinate point sets (x reduce , y reduce ) that reduce the stroke features; The deletion of non-critical points further comprises: taking a sliding window of a predetermined length n, sliding from the starting point of the window with the index i to the point in the signature stroke original point set with the index in, and after obtaining n stroke points of the sliding window, calculating the distance between the n point and the starting point of the current sliding window and multiplying it by (x i+1 ,y i+1 ) is the angle θ at the vertex i , if θ i >θ, then delete the coordinate point (x i+1 ,y i+1 ), and decrement the signature point subscripts greater than i by one, and recalculate the window with the starting point subscript i; if θ i ≤θ, the window is made to slide backward, and the calculation of the window with the starting point index i+1 is continued until all points in the original point set of the stroke are completed and the macro feature coordinate point set of the point set length obtained by the downsampling module is obtained.
3. The method according to claim 2, characterized in that, Divide the stroke coordinate point sets after downsampling and interpolation above into strokes, set the target stroke length k, cut the strokes with a feature sequence length greater than k in the signature strokes into several strokes with a length of k, and supplement the points of the strokes with a length less than k with the point set (0,0) to make the length k, and convert all the strokes of a signature into a point set of an equal-length stroke set.
4. The method according to any one of claims 1-3, characterized in that, Input the equal-length signature stroke point set with microscopic features into the single-character cutting module 1, map it to a high-dimensional space through two fully connected layers to obtain the stroke feature variable, and then map it to an embedding space with a fixed dimension through another fully connected layer to obtain the stroke embedding; input the equal-length signature stroke point set with macroscopic features into the single-character cutting module 2, map it to a high-dimensional space through a fully connected layer, perform convolution and max pooling on the signature stroke point set through CNN, and then map it to an embedding space with a fixed dimension through another fully connected layer to obtain the cross-stroke features.
5. The method according to claim 4, wherein The further segmentation of the connected strokes includes: if there is no stroke with stroke attributes B and E in the segmented characters, the character is no longer segmented. If a certain stroke in the segmented characters has stroke attributes B and E at the same time, according to the confidence level α of the end stroke E attribute E , the confidence level α of the start stroke B attribute B , according to the formula r target =(α E -0.5) / (α E +α B -1) to calculate the segmentation ratio of the character, detect that the stroke develops rightward and upward and extends beyond the range of the written point set on the x-axis, and record the point position ratio r of this position to the overall stroke candidate , find the point position ratio r target closest to the segmentation ratio r candidate The points before the corresponding point position form a new stroke, which is given the E attribute as the end stroke, and the points after this point position form a new stroke, which is given the B attribute as the start stroke.
6. The method according to claim 5, characterized in that, According to the formula: α1 = (|0.5 - α i | + |0.5 - α j | + |0.5 - α m' | + |0.5 - α n' | + |0.5 - α o' |) calculate the average confidence of the start stroke attributes output by module 1. According to the formula: α2 = (|0.5 - α j' | + |0.5 - α j' | + |0.5 - α m | + |0.5 - α n | + |0.5 - α o |) calculate the average confidence of the start stroke attributes output by module 2. Among them, α i , α j are the confidences of the start strokes i and j determined by module 1, α i' , α j' are the confidences of the corresponding strokes i' and j' after downsampling, α m , α n , α o are the confidences of the start strokes m, n, and o determined by module 2, α m' , α n' , α o' are the confidences of the corresponding strokes m', n', and o' after interpolation.
7. A signature single-character extraction system based on a stroke sequence, characterized in that It includes: Downsampling module, interpolation module, single-character cutting module 1, single-character cutting module 2, and cursive cutting module. The downsampling module collects the signature stroke feature sequence, reduces the coordinate point set of the stroke feature sequence, and obtains the macroscopic features of the signature at a low sampling rate. The interpolation module collects the electronic signature stroke feature sequence, interpolates and expands the coordinate point set of the stroke feature sequence, and obtains the microscopic features of the signature at a high sampling rate. The structures of single-character cutting module 1 and single-character cutting module 2 are the same. Single-character cutting module 1 uses the point set sequence (x up , y up ) output by the interpolation module, and single-character cutting module 2 uses the point set sequence (x reduce , y reduce ) output by the downsampling module. The stroke feature extraction module in the single-character cutting module divides the strokes through the point set to generate stroke features. Single-character cutting module 1 and single-character cutting module 2 use the nested named entity recognition method to predict the stroke attributes and character count confidence of the signature respectively based on the stroke features. The cursive cutting module determines whether there is a cursive based on the stroke attributes and character count confidence output by single-character cutting module 1 and single-character cutting module 2, and cuts the cursive strokes in the signature; obtaining the stroke attributes and character count confidence includes that single-character cutting module 1 obtains stroke embeddings, single-character cutting module 2 obtains cross-stroke features, connects the stroke embeddings and cross-stroke features to obtain stroke connection features, and uses a conditional random field to obtain the corresponding stroke attributes and character count confidence; cutting the existing cursive strokes in the signature includes determining the starting stroke number, middle stroke number, and ending stroke number of the character according to the attributes and corresponding confidence of the signature strokes, calculating the average confidence of all starting stroke attributes, taking the stroke with a high average confidence as the starting stroke to determine the character count confidence, and selecting the number of signature characters segmented by the single-character cutting module with a high confidence as the basis for the single-character cutting module to perform cursive stroke segmentation.
8. The system according to claim 7, characterized in that, The obtaining of the macroscopic features of the signature at a low sampling rate further includes that the downsampling module collects the original point set (x, y) of the electronic signature strokes, obtains the threshold angle θ, and uses a sliding window to start sliding on the point set to delete non-key points, obtaining a sequence of coordinate point sets (x reduce , y reduce ) that reduce the stroke features.
9. The system according to claim 7 or 8, characterized in that, Set the target stroke length k, cut the strokes with a feature sequence length greater than k in the signature strokes into several strokes with a length of k, and supplement the points of the strokes with a length less than k with the point set (0,0) to make the length k, and convert all the strokes of a signature into a point set of an equal-length stroke set.
10. The system according to claim 9, characterized in that, Input the equal-length signature stroke point set with microscopic features into module 1, map it to a high-dimensional space through two fully connected layers to obtain the stroke feature variable, and then map it to an embedding space with a fixed dimension through a fully connected layer to obtain the stroke embedding; input the equal-length signature stroke point set with macroscopic features into module 2, map it to a high-dimensional space through a fully connected layer, perform convolution and max pooling on the signature stroke point set through CNN, and then map it to an embedding space with a fixed dimension through a fully connected layer to obtain the cross-stroke feature.
11. The system according to claim 10, wherein According to the formula: α1 = (|0.5 - α i | + |0.5 - α j | + |0.5 - α m' | + |0.5 - α n' | + |0.5 - α o' |), calculate the average confidence of the start stroke attributes output by module 1. According to the formula: α2 = (|0.5 - α i' | + |0.5 - α j' | + |0.5 - α m | + |0.5 - α n | + |0.5 - α o |), calculate the average confidence of the start stroke attributes output by module 2. Among them, α i , α j are the confidences of the start strokes i and j determined by module 1. α i' , α j' are the confidences of the corresponding strokes i' and j' after downsampling. α m , α n , α o are the confidences of the start strokes m, n, and o determined by module 2. α m' , α n' , α o' are the confidences of the corresponding strokes m', n', and o' after interpolation.
Citation Information
Patent Citations
Dynamic signature identification method and device
CN111160245A
Handwritten Chinese text segmentation method based on Snake
CN113723413A
Real-time stroke-order and stroke-direction independent handwriting recognition
US20140361983A1
Handwriting recognition method and device
WO2015161823A1