A handwriting verification method, device, computer equipment and storage medium

Through the method based on twin neural network, the Ghostnet network is used to perform feature extraction and similarity calculation of handwritten handwriting handwriting, which solves the problem of insufficient accuracy and robustness of traditional handwritten handwriting verification methods, and achieves higher accuracy and efficiency.

CN113723303BActive Publication Date: 2025-03-18CHINA PING AN LIFE INSURANCE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111012994.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2025-03-18
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

The traditional handwritten handwriting verification method has problems with low accuracy and robustness, especially when facing the diversity and sloppy handwriting in different time periods or environments.

Method used

The handwriting verification method based on twin neural network is used to extract handwriting features of standard handwriting images and imitation handwriting images through the Ghostnet network model, calculate the similarity of features, and determine whether the preset similarity conditions are met to confirm the consistency of the handwriting.

Benefits of technology

It realizes the rapid and accurate comparison of whether it is the same handwriting in a given two handwriting pictures, with higher robustness and accuracy, while reducing model parameters and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113723303B_ABST
    Figure CN113723303B_ABST
Patent Text Reader

Abstract

The embodiments of the present application belong to the field of image detection technology in artificial intelligence, and relate to a handwriting verification method, device, computer equipment and storage medium based on twin neural networks. In addition, the present application also relates to blockchain technology, and the user's standard handwriting image and imitation handwriting image can be stored in the blockchain. After obtaining the imitation handwriting image imitated for the standard handwriting image, the present application extracts the standard handwriting features and the imitation handwriting features of the standard handwriting image and the imitation handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitation handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare whether the two pictures of given two handwritten handwriting pictures are the same handwriting, and has higher robustness and accuracy. At the same time, the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image detection in artificial intelligence, and in particular to a handwriting verification method, device, computer equipment and storage medium based on a twin neural network. Background Art

[0002] With the rapid development of Internet applications such as Internet finance, B2B e-commerce, tourism, and education, the demand for online electronic signatures has been driven. In order to make Internet business activities legal and well-documented, more and more Internet platforms are actively seeking legal and effective handwriting proofreading solutions.

[0003] There is a handwriting verification method that uses font recognition technology to identify handwriting tracks or spatial relationships of pixels, and then compares the identified feature results to achieve the purpose of handwriting verification.

[0004] However, the applicant found that traditional handwriting verification methods are generally not intelligent. Since the style and handwriting of handwriting are diverse or sloppy in different time periods or environments, which form interference factors, the verification results have certain defects in accuracy and robustness. It can be seen that traditional handwriting verification methods have the problem of low accuracy and robustness. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a handwriting verification method, device, computer equipment and storage medium based on a twin neural network. Traditional handwriting verification methods have the problems of low accuracy and robustness.

[0006] In order to solve the above technical problems, the present application embodiment provides a handwriting verification method based on a twin neural network, which adopts the following technical solution:

[0007] receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image;

[0008] Performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features;

[0009] Calculating the similarity between the standard handwriting feature and the imitation handwriting feature to obtain handwriting similarity;

[0010] Determining whether the handwriting similarity satisfies a preset similarity condition;

[0011] If the handwriting similarity satisfies the similarity condition, confirming that the handwriting image to be verified is consistent with the standard handwriting image;

[0012] If the handwriting similarity does not satisfy the similarity condition, it is determined that the handwriting image to be verified is inconsistent with the standard handwriting image.

[0013] In order to solve the above technical problems, the embodiment of the present application also provides a handwriting verification device based on a twin neural network, which adopts the following technical solution:

[0014] A request receiving module, used for receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image;

[0015] A feature extraction module, used for performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features;

[0016] A similarity calculation module, used for calculating the similarity between the standard handwriting feature and the imitation handwriting feature to obtain the handwriting similarity;

[0017] A similarity judgment module, used to judge whether the handwriting similarity meets a preset similarity condition;

[0018] A first result module, configured to confirm that the handwriting image to be tested is consistent with the standard handwriting image if the handwriting similarity satisfies the similarity condition;

[0019] The second result module is used to confirm that the handwriting image to be checked is inconsistent with the standard handwriting image if the handwriting similarity does not meet the similarity condition.

[0020] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0021] It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the handwriting verification method based on the twin neural network as described above are implemented.

[0022] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0023] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the handwriting verification method based on the twin neural network as described above are implemented.

[0024] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0025] The present application provides a handwriting verification method based on a twin neural network, comprising: receiving a handwriting verification request, the handwriting verification request carrying at least an imitation handwriting image corresponding to a standard handwriting image; performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image according to a Ghostnet network model to obtain standard handwriting features and imitation handwriting features; calculating the similarity between the standard handwriting features and the imitation handwriting features to obtain handwriting similarity; judging whether the handwriting similarity meets a preset similarity condition; if the handwriting similarity meets the similarity condition, confirming that the handwriting image to be verified is consistent with the standard handwriting image; if the handwriting similarity does not meet the similarity condition, confirming that the handwriting image to be verified is inconsistent with the standard handwriting image. After obtaining the imitated handwriting image imitated from the standard handwriting image, the present application extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, the present application has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 It is a flow chart of the implementation of the handwriting verification method based on the twin neural network provided in the first embodiment of the present application;

[0028] Figure 2 It is a schematic diagram of the structure of the Ghost module provided in Example 1 of the present application;

[0029] Figure 3 It is a schematic diagram of the structure of the twin neural network provided in Example 1 of the present application;

[0030] Figure 4 It is a flowchart of another implementation method of handwriting verification based on twin neural network provided in Example 1 of the present application;

[0031] Figure 5 yes Figure 4A flowchart of a specific implementation of step S401;

[0032] Figure 6 yes Figure 4 A flowchart of another specific implementation of step S401;

[0033] Figure 7 yes Figure 1 A flowchart of a specific implementation of step S102;

[0034] Figure 8 yes Figure 1 A flowchart of another specific implementation of step S102;

[0035] Fig. 9 is a schematic diagram of the character duty cycle provided in Example 1 of the present application;

[0036] Fig.10 It is a structural schematic diagram of a handwriting verification device based on a twin neural network provided in Example 2 of the present application;

[0037] Fig.11 It is a structural schematic diagram of another handwriting verification device based on a twin neural network provided in Example 2 of the present application;

[0038] Fig.12 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0040] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0042] like Figure 1 As shown, a flow chart of the implementation of the handwriting verification method based on the twin neural network provided in the first embodiment of the present application is shown. For the sake of convenience of explanation, only the parts related to the present application are shown.

[0043] The above-mentioned handwriting verification method based on twin neural network includes the following steps:

[0044] Step S101: receiving a handwriting verification request, wherein the handwriting verification request carries at least an imitation handwriting image corresponding to a standard handwriting image.

[0045] In an embodiment of the present application, when verifying whether the handwriting of the current object to be verified is legal and valid, the object to be verified is required to temporarily imitate and write the standard handwriting content (i.e. the above-mentioned standard handwriting image), and judge whether the object to be verified is legal and valid based on the written handwriting text (i.e. the above-mentioned imitated handwriting image).

[0046] In an embodiment of the present application, the handwriting verification request can be a request message sent by a requesting terminal, or the user can directly input the above-mentioned standard handwriting image and imitation handwriting image as the sample generation request, wherein the requesting terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., and a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of the requesting terminal here are only for the convenience of understanding and are not used to limit the present application.

[0047] Step S102: performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features.

[0048] In the embodiment of the present application, Ghostnet was proposed by Huawei Noah's Ark Laboratory in CVPR202. The name of the paper is: GhostNet: More Features from Cheap Operations. Simply put, Ghostnet extracts features through simpler operations to make overly large neural network models more lightweight.

[0049] In the embodiments of this application, see Figure 2, shows a schematic diagram of the structure of the Ghost module provided in Example 1 of the present application, firstly extracting a feature map by normal convolution with half the convolution kernel, then putting this feature map into a linear operation to obtain a new feature map, and finally merging the two parts. The linear operation refers to a 3x3 or 5x5 depth-level convolution process.

[0050] In an embodiment of the present application, the two backbone networks of the deep neural network are Ghostnet networks, and the training data is obtained from the real handwriting pictures of the business data itself. During the training process, the real handwriting pictures and the counterfeit handwriting pictures are input into the Ghostnet network as a pair of training data for learning. The loss of the network training adopts cross entropy for binary classification. After the model training is stable, the feature layer results of the Ghostnet network are deployed as practical applications. The deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0051] In the embodiments of the present application, the handwriting features mainly refer to the following aspects:

[0052] (1) Writing style: also known as writing style.

[0053] The overall characteristics of the writer's writing skills, writing level, and writing control ability are comprehensively reflected through factors such as the layout of the entire handwriting, the size, shape and structure of the characters, the changes in writing speed and strength, and the quality of the strokes;

[0054] (2) Layout characteristics: refers to the characteristics of the layout of the whole text or the arrangement and combination of partial text. Specifically, it is manifested in the spatial distribution characteristics between paragraphs, lines, characters, symbols and between each other, such as the direction and angle of the axis and baseline; the density between characters and lines; the proportional relationship between characters or symbols; the relationship between characters or symbols and grid lines; the characteristics of line indentation and protrusion; the position of the header and signature; the width and shape of the margins, footers and headers, etc.

[0055] (3) Writing features: also known as character shape features. Refers to the basic structure and writing method of single words and symbols. The elements that constitute the Chinese character shape are strokes, number of strokes, and the positional relationship of Chinese character components. Character shapes can be divided into simplified characters and traditional characters according to complexity; they can be divided into standardized characters, non-standard characters, variant characters, and old characters according to standardization; they can be divided into wrong characters and miswritten characters according to correctness;

[0056] (4) Shape characteristics: also known as font characteristics. Refers to the basic shape and style of a single word, including the style, size, shape, tilt direction, angle, etc. of a single word. The styles of a single word include regular script, semi-regular script, running script, running cursive script, cursive script, etc.; the external shapes of a single word include long, square, flat, round, elliptical, irregular shapes, etc.;

[0057] (5) Structural features: refers to the spatial layout and proportional relationship between certain fixed collocations of single words (such as signatures, dates, etc.), as well as the radicals, radicals, and strokes of single words. For example, the structural features of the left-right, up-down, inside-outside, and surrounding of the components of a single word, as well as the specific collocation proportional relationship between the components and strokes;

[0058] (6) Stroke order: refers to the writing order and direction between the components of a single word, between the strokes of a single word, and between a word and a symbol.

[0059] (7) Pen-stroke characteristics: refers to the comprehensive reflection of the changing characteristics of writing direction, angle, writing speed and strength in the handwriting during a complete writing process or a series of interrelated writing processes, as well as the changing characteristics of writing direction, angle, writing speed and strength reflected in the subtle writing movements of the strokes such as starting, ending, turning, folding, connecting, winding, pausing, lifting, swinging, trembling, shaking, dragging and carrying during the writing process.

[0060] In an embodiment of the present application, the feature extraction operation may be to input the above-mentioned standard handwriting image and the imitation handwriting image into two Ghostnet network models with the same parameters respectively to perform a vector conversion operation to obtain the standard handwriting feature and the imitation handwriting feature.

[0061] In the embodiments of this application, see Figure 3 , introduce the twin neural network, that is, introduce two Ghostnet network models with the same model and parameters, and extract features of the standard handwriting image and the imitation handwriting image respectively, so as to output two feature vectors Gw(x1)-standard handwriting features and Gw(x2)-imitation handwriting features.

[0062] In an embodiment of the present application, the feature extraction operation can also be to obtain the standard character duty cycle and the imitation character duty cycle corresponding to the above-mentioned standard handwriting image and the above-mentioned imitation handwriting image based on the character duty cycle, and use the standard character duty cycle and the imitation character duty cycle as the above-mentioned standard handwriting feature and the above-mentioned imitation handwriting feature.

[0063] Step S103: Calculate the similarity between the standard handwriting feature and the imitation handwriting feature to obtain the handwriting similarity.

[0064] In the embodiment of the present application, the handwriting similarity is mainly used to uniquely determine whether the above-mentioned imitation handwriting image and the standard handwriting image are unified handwriting, thereby determining whether the object to be verified is legal and valid.

[0065] In the embodiment of the present application, the similarity between the standard handwriting feature and the imitation handwriting feature can be obtained by calculating the Euclidean distance between the standard handwriting feature and the imitation handwriting feature according to the Euclidean distance algorithm to obtain the above handwriting similarity.

[0066] In the embodiment of the present application, the similarity between the standard handwriting features and the imitation handwriting features can also be based on the similarity between the character duty cycle of the imitation handwriting in the imitation handwriting image and the character duty cycle of the standard handwriting in the standard handwriting image as the above-mentioned handwriting similarity.

[0067] Step S104: determining whether the handwriting similarity satisfies a preset similarity condition.

[0068] In the embodiment of the present application, the user can preset a similarity condition threshold for determining whether the handwriting similarity is consistent according to actual conditions.

[0069] Step S105: If the handwriting similarity satisfies the similarity condition, it is confirmed that the handwriting image to be verified is consistent with the standard handwriting image.

[0070] In the embodiment of the present application, when the handwriting similarity meets the similarity condition threshold, it means that the handwriting of the object to be verified is completely consistent with the standard handwriting image, confirming that the object to be verified is legal and valid.

[0071] Step S106: If the handwriting similarity does not satisfy the similarity condition, it is determined that the handwriting image to be verified is inconsistent with the standard handwriting image.

[0072] In the embodiment of the present application, when the handwriting similarity does not meet the similarity condition threshold, it means that the handwriting of the object to be verified is not consistent with the standard handwriting image, confirming that the object to be verified is not legal and valid.

[0073] In an embodiment of the present application, a handwriting verification method based on a twin neural network is provided, the method comprising: receiving a handwriting verification request, the handwriting verification request carrying at least an imitation handwriting image corresponding to a standard handwriting image; performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively to obtain standard handwriting features and imitation handwriting features; calculating the similarity between the standard handwriting features and the imitation handwriting features to obtain handwriting similarity; judging whether the handwriting similarity satisfies a preset similarity condition; if the handwriting similarity satisfies the similarity condition, confirming that the handwriting image to be verified is consistent with the standard handwriting image; if the handwriting similarity does not satisfy the similarity condition, confirming that the handwriting image to be verified is inconsistent with the standard handwriting image. After obtaining the imitated handwriting image imitated from the standard handwriting image, the present application extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, the present application has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0074] Continue reading Figure 4 , shows an implementation flow chart of another handwriting verification method based on a twin neural network provided in Example 1 of the present application. For the sake of ease of explanation, only the parts related to the present application are shown.

[0075] In some optional implementations of this embodiment, after step S101, the following is further included: step S401; step S102 specifically includes: step S402.

[0076] Step S401: performing a preprocessing operation on the imitation handwriting image to obtain a preprocessed imitation handwriting image.

[0077] In an embodiment of the present application, the preprocessing operation may be to perform a binarization operation on the simulated handwriting image to obtain a binary handwriting image; perform an expansion operation on the handwriting pixel position of the binary handwriting image to obtain a connected area containing the simulated handwriting; and perform a cropping operation on the binary note image according to the connected area to obtain a simulated handwriting image.

[0078] In an embodiment of the present application, the preprocessed simulated handwriting image can be obtained by regularizing the simulated handwriting image according to a nonlinear regularization rule to obtain a regularized simulated handwriting image; and then interpolating the regularized simulated handwriting image according to a segmented interpolation processing rule to obtain the preprocessed simulated handwriting image.

[0079] Step S402: performing handwriting feature extraction operations on the standard handwriting image and the pre-processed imitation handwriting image respectively to obtain standard handwriting features and imitation handwriting features.

[0080] In the embodiment of the present application, since the standard handwriting image is pre-obtained image data, the standard handwriting image is not affected by factors such as the current environment. Therefore, there is no need to preprocess the standard handwriting image. Only the imitation handwriting image of the current imitation writing needs to be preprocessed.

[0081] In the embodiment of the present application, since different users have different writing habits, even if it is the same user, the handwritten text will be different in different writing environments. In addition, different writing devices will also affect the recognition of handwritten text. The image preprocessing model is used to adjust the height and width of each character to a uniform proportion, and at the same time simulate the trajectory of the characters in the imitation handwriting image to make it easier to recognize later.

[0082] Continue reading Figure 5 , showing Figure 4 A flowchart of a specific implementation of step S401 is shown in FIG. 1 . For ease of explanation, only the part related to the present application is shown.

[0083] In step S501, a binarization operation is performed on the simulated handwriting image to obtain a binary handwriting image.

[0084] In an embodiment of the present application, the binarization operation can be based on the original pixel value in the imitation handwriting image, by comparing with the pixel value. As an example, all similar pixels with pixel values ​​greater than a threshold are assigned a value of "0", and all pixels with pixel values ​​less than or equal to the threshold are assigned a value of "1". It should be understood that the example of the binarization operation here is only for the convenience of understanding and is not used to limit the present application.

[0085] In step S502, an expansion operation is performed on the handwriting pixel positions of the binary handwriting image to obtain a connected area containing the simulated handwriting.

[0086] In the embodiment of the present application, the expansion operation refers to the pixel expansion outward from the pixel value corresponding to the imitation handwriting, so that all the imitation handwriting can be included in a connected area. As an example, when imitating writing, the imitation handwriting may be continuous or discontinuous. In the embodiment of the present application, since the pixels where the imitation handwriting is located have the same pixel value in the binary image, the pixel expansion process is performed outward from these pixel values, so that all the imitation handwriting is included in a connected area.

[0087] In step S503, the binary handwriting image is cropped according to the connected regions to obtain a simulated handwriting image.

[0088] In the embodiment of the present application, the cropping operation is relative to the binary image. The above-mentioned imitation handwriting image only includes the signature area, and a large number of non-handwriting areas of the binary image are cropped, which can reduce the calculation of a large number of pixel values ​​in the non-handwriting area for subsequent operations and simplify the calculation amount of the feature extraction operation. At the same time, since the non-handwriting area is cropped, the interference of the non-handwriting area on the imitation handwriting feature extraction in the handwriting area can be reduced, thereby improving the accuracy of extracting handwriting features.

[0089] Continue reading Figure 6 , showing Figure 4 A flowchart of a specific implementation of step S201 is shown in FIG. 1 . For ease of explanation, only the part related to the present application is shown.

[0090] In some optional implementations of this embodiment, step S201 specifically includes: step S601 and step S602.

[0091] Step S601: regularizing the imitation handwriting image according to a nonlinear regularization rule to obtain a regularized imitation handwriting image.

[0092] In the embodiment of the present application, the nonlinear regularization rule changes the size of the simulated handwriting image while keeping the overall shape of the simulated handwriting image unchanged, which can largely keep the characters in the simulated handwriting image original with little distortion.

[0093] In the embodiment of the present application, the conversion formula for changing the character size of the imitation handwriting image can be:

[0094]

[0095] Among them, W represents the original width of the character, H represents the original height of the character, W' represents the normalized width of the character, H' represents the normalized height of the character, m represents the conversion ratio of the character width, and n represents the conversion ratio of the character height.

[0096] In the embodiment of the present application, if the coordinates of the character point of the imitation handwriting image are (x, y), the linear normalization calculation formula corresponding to the point coordinates is:

[0097]

[0098] Among them, (x, y) represents the original point coordinates of the character, (x`, y`) represents the original point coordinates of the character after regularization, m represents the conversion ratio of the width of the above character, and n represents the conversion ratio of the height of the above character.

[0099] Step S602: performing an interpolation operation on the regularized imitation handwriting image according to the segmented interpolation processing rule to obtain a pre-processed imitation handwriting image.

[0100] In an embodiment of the present application, the interpolation processing operation may be to simulate the trajectory of characters according to a piecewise linear interpolation constructor, thereby improving the recognition rate of handwritten text.

[0101] In the embodiment of the present application, it is assumed that there is an interval [a, b], and there are points x0, x1, x2, ... x n , whose size is a=x0<x1<x2<…<x n = b, f(x) is a function defined in the interval, and its corresponding function values ​​are y0, y1, y2, ...y n , if the function Satisfies the following conditions: a is on the interval [a, b], The function is a continuous function; b. In each subinterval [x i , x i+1 ](i=0, 1, 2..., n-1), is a polynomial of degree k; then The function is a piecewise k-order interpolation polynomial of f(x) on the interval [a, b]. When k = 1, it is piecewise linear interpolation, and when k = 2, it is piecewise parabolic interpolation. Piecewise linear interpolation is also called piecewise linear interpolation. In each subinterval [x i , x i+1 ](i=0, 1, 2..., n-1), is a linear interpolation polynomial, and its formula is expressed as:

[0102]

[0103] Among them, x, x i , x i+1 is a point on the interval [a, b], y, y i ,y i+1 is the function f(x) at the point x, x i , x i+1 The corresponding function value is, is a piecewise linear interpolation polynomial.

[0104] In the embodiment of the present application, due to the user's writing habits or interference from the external environment, the written characters appear to be missing strokes or shaking, making the handwritten text in the imitation handwriting image difficult to recognize in the subsequent process. By interpolating the regularized standard handwriting image, the difficulty of recognizing handwritten text in the subsequent process can be reduced.

[0105] Continue reading Figure 7 , showing Figure 1 Flowchart of a specific implementation manner of step S103. For ease of illustration, only the parts related to this application are shown.

[0106] In some alternative implementation manners of this embodiment, step S103 specifically includes: step S701.

[0107] Step S701: Calculate the Euclidean distance between the standard handwriting feature and the imitated handwriting feature according to the Euclidean distance algorithm to obtain the handwriting similarity.

[0108] In the embodiment of this application, the Euclidean distance, also known as the Euclidean metric, is the most common distance measure, which measures the absolute distance between two points in a multi-dimensional space. It can also be understood as: the actual distance between two points in an m-dimensional space, or the natural length of a vector (i.e., the distance from this point to the origin). The Euclidean distance in two-dimensional and three-dimensional spaces is the actual distance between two points, and this Euclidean distance is expressed as:

[0109]

[0110] where x i , y i respectively represent the coordinate values of the i-th point.

[0111] Continue to refer to Figure 8 , which shows Figure 1 Flowchart of another specific implementation manner of step S102 in ; for ease of illustration, only the parts related to this application are shown.

[0112] In some alternative implementation manners of this embodiment, step S102 specifically includes: step S801.

[0113] Step S801: Obtain the standard character duty cycle and the imitated character duty cycle corresponding to the standard handwriting image and the imitated handwriting image according to the character duty cycle, and use the standard character duty cycle and the imitated character duty cycle as the standard handwriting feature and the imitated handwriting feature.

[0114] In the embodiment of this application, the character duty cycle refers to the number of small units occupied by each character in the large unit occupied by the character. Refer to Fig. 9 , taking "character" as an example, the ratio of the number of gray units occupied in the large unit of the dotted line to the number of the entire large unit is the above-mentioned character duty cycle. It should be understood that the example of the character duty cycle here is only for easy understanding, and the user can adjust the size of the large unit or the small unit according to the actual situation to improve the accuracy of the character duty cycle.

[0115] In the embodiment of the present application, by introducing the character duty cycle as the handwriting feature of the standard handwriting image and the imitation handwriting image, the feature extraction operation is effectively simplified, thereby improving the efficiency of feature extraction.

[0116] In some optional implementation methods of the embodiments of the present invention, the above-mentioned vector conversion operation based on the Ghostnet network model can be used simultaneously to obtain the vector handwriting feature and the character duty cycle to obtain the duty cycle handwriting feature. Specifically, corresponding weight values ​​can be set for the vector handwriting feature and the duty cycle handwriting feature, so as to combine the feature data of the two to perform subsequent similarity calculations, thereby further improving the accuracy of handwriting verification.

[0117] In summary, the present application provides a handwriting verification method based on a twin neural network, the method comprising: receiving a handwriting verification request, the handwriting verification request carrying at least an imitation handwriting image corresponding to a standard handwriting image; performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively to obtain standard handwriting features and imitation handwriting features; calculating the similarity between the standard handwriting features and the imitation handwriting features to obtain handwriting similarity; judging whether the handwriting similarity meets a preset similarity condition; if the handwriting similarity meets the similarity condition, confirming that the handwriting image to be verified is consistent with the standard handwriting image; if the handwriting similarity does not meet the similarity condition, confirming that the handwriting image to be verified is inconsistent with the standard handwriting image. After obtaining the imitated handwriting image imitated from the standard handwriting image, the present application extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, the present application has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much. At the same time, the image preprocessing model is used to adjust the height and width of each character to a uniform ratio and simulate the trajectory of the characters in the imitation handwriting image to make it easier to identify later; the twin neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much; by introducing the character duty cycle as the handwriting feature of the standard handwriting image and the imitation handwriting image, the feature extraction operation is effectively simplified, thereby improving the efficiency of feature extraction; corresponding weight values ​​are set for the vector handwriting feature and the duty cycle handwriting feature, so as to combine the feature data of the two for subsequent similarity calculation, thereby further improving the accuracy of handwriting verification.

[0118] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned standard handwriting images and imitated handwriting images, the above-mentioned standard handwriting images and imitated handwriting images can also be stored in a node of a blockchain.

[0119] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0120] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0121] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0123] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0124] Embodiment 2

[0125] Further references Fig.10 , as a response to the above Figure 3 The present application provides an embodiment of a handwriting verification device based on a twin neural network. Figure 3 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0126] like Fig.10 As shown, the handwriting verification device 100 based on the twin neural network of this embodiment includes: a request receiving module 110, a feature extraction module 120, a similarity calculation module 130, a similarity judgment module 140, a first result module 150 and a second result module 160. Among them:

[0127] A request receiving module 110, for receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image;

[0128] A feature extraction module 120 is used to perform handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features;

[0129] A similarity calculation module 130 is used to calculate the similarity between the standard handwriting features and the imitation handwriting features to obtain the handwriting similarity;

[0130] A similarity determination module 140 is used to determine whether the handwriting similarity satisfies a preset similarity condition;

[0131] The first result module 150 is used to confirm that the handwriting image to be tested is consistent with the standard handwriting image if the handwriting similarity meets the similarity condition;

[0132] The second result module 160 is used to determine that the handwriting image to be checked is inconsistent with the standard handwriting image if the handwriting similarity does not meet the similarity condition.

[0133] In an embodiment of the present application, when verifying whether the handwriting of the current object to be verified is legal and valid, the object to be verified is required to temporarily imitate and write the standard handwriting content (i.e. the above-mentioned standard handwriting image), and judge whether the object to be verified is legal and valid based on the written handwriting text (i.e. the above-mentioned imitated handwriting image).

[0134] In an embodiment of the present application, the handwriting verification request can be a request message sent by a requesting terminal, or the user can directly input the above-mentioned standard handwriting image and imitation handwriting image as the sample generation request, wherein the requesting terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., and a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of the requesting terminal here are only for the convenience of understanding and are not used to limit the present application.

[0135] In the embodiment of the present application, Ghostnet was proposed by Huawei Noah's Ark Laboratory in CVPR202. The name of the paper is: GhostNet: More Features from Cheap Operations. Simply put, Ghostnet extracts features through simpler operations to make overly large neural network models more lightweight.

[0136] In the embodiments of this application, see Figure 2 , shows a schematic diagram of the structure of the Ghost module provided in Example 1 of the present application, firstly extracting a feature map by normal convolution with half the convolution kernel, then putting this feature map into a linear operation to obtain a new feature map, and finally merging the two parts. The linear operation refers to a 3x3 or 5x5 depth-level convolution process.

[0137] In an embodiment of the present application, the two backbone networks of the deep neural network are Ghostnet networks, and the training data is obtained from the real handwriting pictures of the business data itself. During the training process, the real handwriting pictures and the counterfeit handwriting pictures are input into the Ghostnet network as a pair of training data for learning. The l oss of the network training uses cross entropy for binary classification. After the model training is stable, the feature layer results of the Ghostnet network are deployed as practical applications. The deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0138] In the embodiments of the present application, the handwriting features mainly refer to the following aspects:

[0139] (1) Writing style: also known as writing style. It refers to the overall characteristics of the writer's writing skills, writing level, and writing control ability, which are comprehensively reflected by factors such as the layout of the entire handwriting, the size, shape and structure of the characters, the changes in writing speed and strength, and the quality of the strokes;

[0140] (2) Layout characteristics: refers to the characteristics of the layout of the whole text or the arrangement and combination of partial text. Specifically, it is manifested in the spatial distribution characteristics between paragraphs, lines, characters, symbols and between each other, such as the direction and angle of the axis and baseline; the density between characters and lines; the proportional relationship between characters or symbols; the relationship between characters or symbols and grid lines; the characteristics of line indentation and protrusion; the position of the header and signature; the width and shape of the margins, footers and headers, etc.

[0141] (3) Writing features: also known as character shape features. Refers to the basic structure and writing method of single words and symbols. The elements that constitute the Chinese character shape are strokes, number of strokes, and the positional relationship of Chinese character components. Character shapes can be divided into simplified characters and traditional characters according to complexity; they can be divided into standardized characters, non-standard characters, variant characters, and old characters according to standardization; they can be divided into wrong characters and miswritten characters according to correctness;

[0142] (4) Shape characteristics: also known as font characteristics. Refers to the basic shape and style of a single word, including the style, size, shape, tilt direction, angle, etc. of a single word. The styles of a single word include regular script, semi-regular script, running script, running cursive script, cursive script, etc.; the external shapes of a single word include long, square, flat, round, elliptical, irregular shapes, etc.;

[0143] (5) Structural features: refers to the spatial layout and proportional relationship between certain fixed collocations of single words (such as signatures, dates, etc.), as well as the radicals, radicals, and strokes of single words. For example, the structural features of the left-right, up-down, inside-outside, and surrounding of the components of a single word, as well as the specific collocation proportional relationship between the components and strokes;

[0144] (6) Stroke order: refers to the writing order and direction between the components of a single word, between the strokes of a single word, and between a word and a symbol.

[0145] (7) Pen-stroke characteristics: refers to the comprehensive reflection of the changing characteristics of writing direction, angle, writing speed and strength in the handwriting during a complete writing process or a series of interrelated writing processes, as well as the changing characteristics of writing direction, angle, writing speed and strength reflected in the subtle writing movements of the strokes such as starting, ending, turning, folding, connecting, winding, pausing, lifting, swinging, trembling, shaking, dragging and carrying during the writing process.

[0146] In an embodiment of the present application, the feature extraction operation may be to input the above-mentioned standard handwriting image and the imitation handwriting image into two Ghostnet network models with the same parameters respectively to perform a vector conversion operation to obtain the standard handwriting feature and the imitation handwriting feature.

[0147] In the embodiments of this application, see Figure 3 , introduce the twin neural network, that is, introduce two Ghostnet network models with the same model and parameters, and extract features of the standard handwriting image and the imitation handwriting image respectively, so as to output two feature vectors Gw(x1)-standard handwriting features and Gw(x2)-imitation handwriting features.

[0148] In an embodiment of the present application, the feature extraction operation can also be to obtain the standard character duty cycle and the imitation character duty cycle corresponding to the above-mentioned standard handwriting image and the above-mentioned imitation handwriting image based on the character duty cycle, and use the standard character duty cycle and the imitation character duty cycle as the above-mentioned standard handwriting feature and the above-mentioned imitation handwriting feature.

[0149] In the embodiment of the present application, the handwriting similarity is mainly used to uniquely determine whether the above-mentioned imitation handwriting image and the standard handwriting image are unified handwriting, thereby determining whether the object to be verified is legal and valid.

[0150] In the embodiment of the present application, the similarity between the standard handwriting feature and the imitation handwriting feature can be obtained by calculating the Euclidean distance between the standard handwriting feature and the imitation handwriting feature according to the Euclidean distance algorithm to obtain the above handwriting similarity.

[0151] In the embodiment of the present application, the similarity between the standard handwriting features and the imitation handwriting features can also be based on the similarity between the character duty cycle of the imitation handwriting in the imitation handwriting image and the character duty cycle of the standard handwriting in the standard handwriting image as the above-mentioned handwriting similarity.

[0152] In the embodiment of the present application, the user can preset a similarity condition threshold for determining whether the handwriting similarity is consistent according to actual conditions.

[0153] In the embodiment of the present application, when the handwriting similarity meets the similarity condition threshold, it means that the handwriting of the object to be verified is completely consistent with the standard handwriting image, confirming that the object to be verified is legal and valid.

[0154] In the embodiment of the present application, when the handwriting similarity does not meet the similarity condition threshold, it means that the handwriting of the object to be verified is not consistent with the standard handwriting image, confirming that the object to be verified is not legal and valid.

[0155] In an embodiment of the present application, a handwriting verification device 100 based on a twin neural network is provided, including: a request receiving module 110, used to receive a handwriting verification request, the handwriting verification request at least carrying an imitation handwriting image corresponding to a standard handwriting image; a feature extraction module 120, used to perform handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image according to a Ghostnet network model, respectively, to obtain standard handwriting features and imitation handwriting features; a similarity calculation module 130, used to calculate the similarity between the standard handwriting features and the imitation handwriting features, to obtain handwriting similarity; a similarity judgment module 140, used to judge whether the handwriting similarity meets a preset similarity condition; a first result module 150, used to confirm that the handwriting image to be verified is consistent with the standard handwriting image if the handwriting similarity meets the similarity condition; and a second result module 160, used to confirm that the handwriting image to be verified is inconsistent with the standard handwriting image if the handwriting similarity does not meet the similarity condition. After obtaining the imitated handwriting image imitated from the standard handwriting image, the present application extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, the present application has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0156] Continue reading Fig.11 , shows a structural schematic diagram of another handwriting verification device based on a twin neural network provided in Example 2 of the present application. For the sake of convenience of explanation, only the parts related to the present application are shown.

[0157] In some optional implementations of this embodiment, the handwriting verification device 100 based on the twin neural network further includes: a preprocessing module 170; the feature extraction module 120 includes: a first feature extraction submodule 121. Among them:

[0158] A preprocessing module 170, used for performing a preprocessing operation on the imitation handwriting image to obtain a preprocessed imitation handwriting image;

[0159] The first feature extraction submodule 121 is used to perform handwriting feature extraction operations on the standard handwriting image and the pre-processed imitation handwriting image to obtain standard handwriting features and imitation handwriting features.

[0160] In an embodiment of the present application, the preprocessing operation may be to perform a binarization operation on the simulated handwriting image to obtain a binary handwriting image; perform an expansion operation on the handwriting pixel position of the binary handwriting image to obtain a connected area containing the simulated handwriting; and perform a cropping operation on the binary note image according to the connected area to obtain a simulated handwriting image.

[0161] In an embodiment of the present application, the preprocessed simulated handwriting image can be obtained by regularizing the simulated handwriting image according to a nonlinear regularization rule to obtain a regularized simulated handwriting image; and then interpolating the regularized simulated handwriting image according to a segmented interpolation processing rule to obtain the preprocessed simulated handwriting image.

[0162] In the embodiment of the present application, since the standard handwriting image is pre-obtained image data, the standard handwriting image is not affected by factors such as the current environment. Therefore, there is no need to preprocess the standard handwriting image. Only the imitation handwriting image of the current imitation writing needs to be preprocessed.

[0163] In the embodiment of the present application, since different users have different writing habits, even if it is the same user, the handwritten text will be different in different writing environments. In addition, different writing devices will also affect the recognition of handwritten text. The image preprocessing model is used to adjust the height and width of each character to a uniform proportion, and at the same time simulate the trajectory of the characters in the imitation handwriting image to make it easier to recognize later.

[0164] In some optional implementations of this embodiment, the preprocessing module 170 includes: a binarization submodule, an expansion submodule, and a cropping submodule.

[0165] A binarization submodule is used to perform a binarization operation on the imitation handwriting image to obtain a binarized handwriting image;

[0166] An expansion submodule, used for performing an expansion operation on the handwriting pixel positions of the binary handwriting image to obtain a connected area containing the imitation handwriting;

[0167] The cropping submodule is used to perform a cropping operation on the binary handwriting image according to the connected area to obtain an imitation handwriting image.

[0168] In the embodiment of the present application, the cropping operation is relative to the binary image. The above-mentioned imitation handwriting image only includes the signature area, and a large number of non-handwriting areas of the binary image are cropped, which can reduce the calculation of a large number of pixel values ​​in the non-handwriting area for subsequent operations and simplify the calculation amount of the feature extraction operation. At the same time, since the non-handwriting area is cropped, the interference of the non-handwriting area on the imitation handwriting feature extraction in the handwriting area can be reduced, thereby improving the accuracy of extracting handwriting features.

[0169] In some optional implementations of this embodiment, the preprocessing module 170 further includes: a regularization submodule and an interpolation processing submodule.

[0170] A regularization submodule, used for regularizing the imitation handwriting image according to a nonlinear regularization rule to obtain a regularized imitation handwriting image;

[0171] The interpolation processing submodule is used to perform an interpolation processing operation on the regularized imitation handwriting image according to the segmented interpolation processing rule to obtain the pre-processed imitation handwriting image.

[0172] In the embodiment of the present application, due to the user's writing habits or interference from the external environment, the written characters appear to be missing strokes or shaking, making the handwritten text in the imitation handwriting image difficult to recognize in the subsequent process. By interpolating the regularized standard handwriting image, the difficulty of recognizing handwritten text in the subsequent process can be reduced.

[0173] In some optional implementations of this embodiment, the similarity calculation module 130 specifically includes: a Euclidean distance calculation submodule. Among them:

[0174] The Euclidean distance calculation submodule is used to calculate the Euclidean distance of the standard handwriting features and the imitation handwriting features according to the Euclidean distance algorithm to obtain the handwriting similarity.

[0175] In the embodiments of the present application, Euclidean distance, also known as Euclidean distance, is the most common distance metric, which measures the absolute distance between two points in multidimensional space. It can also be understood as: the real distance between two points in m-dimensional space, or the natural length of a vector (i.e., the distance from the point to the origin). The Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points, and the Euclidean distance is expressed as:

[0176]

[0177] Among them, x i ,y i Respectively represent the coordinate values ​​of the i-th point.

[0178] In some optional implementations of this embodiment, the feature extraction module 120 specifically further includes: a second feature extraction submodule. Among them:

[0179] The second feature extraction submodule is used to obtain the standard character duty cycle and the imitation character duty cycle corresponding to the standard handwriting image and the imitation handwriting image according to the character duty cycle, and use the standard character duty cycle and the imitation character duty cycle as the standard handwriting feature and the imitation handwriting feature.

[0180] In the embodiment of the present application, by introducing the character duty cycle as the handwriting feature of the standard handwriting image and the imitation handwriting image, the feature extraction operation is effectively simplified, thereby improving the efficiency of feature extraction.

[0181] In some optional implementation methods of the embodiments of the present invention, the above-mentioned vector conversion operation based on the Ghostnet network model can be used simultaneously to obtain the vector handwriting feature and the character duty cycle to obtain the duty cycle handwriting feature. Specifically, corresponding weight values ​​can be set for the vector handwriting feature and the duty cycle handwriting feature, so as to combine the feature data of the two to perform subsequent similarity calculations, thereby further improving the accuracy of handwriting verification.

[0182] In summary, the present application provides a handwriting verification 100 based on a twin neural network, including: a request receiving module 110, used to receive a handwriting verification request, the handwriting verification request carries at least an imitation handwriting image corresponding to a standard handwriting image; a feature extraction module 120, used to perform handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively, to obtain standard handwriting features and imitation handwriting features; a similarity calculation module 130, used to calculate the similarity between the standard handwriting features and the imitation handwriting features, to obtain handwriting similarity; a similarity judgment module 140, used to judge whether the handwriting similarity meets a preset similarity condition; a first result module 150, used to confirm that the handwriting image to be verified is consistent with the standard handwriting image if the handwriting similarity meets the similarity condition; a second result module 160, used to confirm that the handwriting image to be verified is inconsistent with the standard handwriting image if the handwriting similarity does not meet the similarity condition. After obtaining the imitated handwriting image imitated from the standard handwriting image, the present application extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image respectively, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, the present application has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much. At the same time, the image preprocessing model is used to adjust the height and width of each character to a uniform ratio and simulate the trajectory of the characters in the imitation handwriting image to make it easier to identify later; the twin neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much; by introducing the character duty cycle as the handwriting feature of the standard handwriting image and the imitation handwriting image, the feature extraction operation is effectively simplified, thereby improving the efficiency of feature extraction; corresponding weight values ​​are set for the vector handwriting feature and the duty cycle handwriting feature, so as to combine the feature data of the two for subsequent similarity calculation, thereby further improving the accuracy of handwriting verification.

[0183] To solve the above technical problems, the present application also provides a computer device. Please refer to FIG. 12 for details. Fig.12 This is a basic structural block diagram of the computer device in this embodiment.

[0184] The computer device 200 includes a memory 210, a processor 220, and a network interface 230 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 200 having components 210-230, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0185] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0186] The memory 210 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 210 can be an internal storage unit of the computer device 200, such as a hard disk or memory of the computer device 200. In other embodiments, the memory 210 can also be an external storage device of the computer device 200, such as a plug-in hard disk equipped on the computer device 200, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 210 can also include both the internal storage unit of the computer device 200 and its external storage device. In this embodiment, the memory 210 is generally used to store the operating system and various application software installed on the computer device 200, such as computer-readable instructions of the handwriting verification method based on the twin neural network, etc. In addition, the memory 210 can also be used to temporarily store various data that have been output or are to be output.

[0187] The processor 220 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 220 is generally used to control the overall operation of the computer device 200. In this embodiment, the processor 220 is used to run computer-readable instructions or process data stored in the memory 210, such as computer-readable instructions for running the handwriting verification method based on the twin neural network.

[0188] The network interface 230 may include a wireless network interface or a wired network interface. The network interface 230 is generally used to establish a communication connection between the computer device 200 and other electronic devices.

[0189] The computer device provided by the present application, after obtaining the imitated handwriting image imitated from the standard handwriting image, respectively extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, it has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0190] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the handwriting verification method based on the twin neural network as described above.

[0191] The computer-readable storage medium provided by the present application, after obtaining the imitated handwriting image imitated from the standard handwriting image, respectively extracts the standard handwriting features and the imitated handwriting features of the standard handwriting image and the imitated handwriting image, and finally calculates the handwriting similarity of the standard handwriting features and the imitated handwriting features to determine the handwriting similarity as a confirmation method for verifying whether the handwriting is consistent. The present application can quickly and accurately compare two given handwriting pictures to determine whether the two pictures are of the same handwriting; compared with the mainstream recognition method, it has higher robustness and accuracy. At the same time, the deep neural network uses the Ghostnet network as the backbone network, so that the feature extraction operation has fewer model parameters and higher processing efficiency under the condition that the accuracy does not change much.

[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0193] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A handwriting verification method based on twin neural network, characterized in that: The steps include: receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image; Performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features; The step of performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image according to the Ghostnet network model to obtain standard handwriting features and imitation handwriting features specifically includes the following steps: The standard handwriting image and the imitation handwriting image are respectively input into two Ghostnet network models with the same parameters to perform vector conversion operations to obtain standard handwriting features and imitation handwriting features; According to the character duty cycle, a standard character duty cycle and an imitation character duty cycle corresponding to the standard handwriting image and the imitation handwriting image are obtained, and the standard character duty cycle and the imitation character duty cycle are used as the standard duty cycle handwriting feature and the imitation duty cycle handwriting feature, wherein the character duty cycle refers to the ratio of the number of small units actually occupied by each character to the total number of small units in the large unit where the character is located; Setting corresponding weight values ​​for the standard handwriting feature, the imitation handwriting feature, the standard duty cycle handwriting feature and the imitation duty cycle handwriting feature; combining the weighted standard handwriting feature and the weighted standard duty cycle handwriting feature; combining the weighted imitation handwriting feature and the weighted imitation duty cycle handwriting feature; Calculating the similarity between the weighted standard handwriting feature and the weighted standard duty cycle handwriting feature and the weighted imitation handwriting feature and the weighted imitation duty cycle handwriting feature to obtain handwriting similarity; Determining whether the handwriting similarity satisfies a preset similarity condition; If the handwriting similarity satisfies the similarity condition, confirming that the imitation handwriting image is consistent with the standard handwriting image; If the handwriting similarity does not satisfy the similarity condition, it is determined that the simulated handwriting image is inconsistent with the standard handwriting image.

2. The handwriting verification method based on twin neural network according to claim 1 is characterized in that: After the step of receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image, the following steps are also included: Performing a preprocessing operation on the imitation handwriting image to obtain a preprocessed imitation handwriting image; The step of performing handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image to obtain standard handwriting features and imitation handwriting features specifically includes the following steps: The handwriting feature extraction operation is performed on the standard handwriting image and the preprocessed imitation handwriting image respectively to obtain the standard handwriting feature and the imitation handwriting feature.

3. The handwriting verification method based on twin neural network according to claim 2 is characterized in that: The step of performing a preprocessing operation on the imitation handwriting image to obtain the preprocessed imitation handwriting image specifically comprises the following steps: Performing a binarization operation on the imitation handwriting image to obtain a binarized handwriting image; Performing an expansion operation on the handwriting pixel positions of the binary handwriting image to obtain a connected area containing the imitation handwriting; The binary handwriting image is cropped according to the connected area to obtain the simulated handwriting image.

4. The handwriting verification method based on twin neural network according to claim 2 is characterized in that: The step of performing a preprocessing operation on the imitation handwriting image to obtain the preprocessed imitation handwriting image specifically comprises the following steps: Regularizing the imitation handwriting image according to a nonlinear regularization rule to obtain a regularized imitation handwriting image; The regularized imitation handwriting image is interpolated according to the segmented interpolation processing rule to obtain the pre-processed imitation handwriting image.

5. The handwriting verification method based on twin neural network according to claim 1 is characterized in that: The step of calculating the similarity between the standard handwriting feature and the imitation handwriting feature to obtain the handwriting similarity specifically comprises the following steps: The Euclidean distance between the standard handwriting feature and the imitation handwriting feature is calculated according to the Euclidean distance algorithm to obtain the handwriting similarity.

6. A handwriting verification device based on twin neural network, characterized in that: The device performs the steps of the handwriting verification method based on a twin neural network as described in any one of claims 1 to 5, and the device includes: A request receiving module, used for receiving a handwriting verification request, wherein the handwriting verification request carries at least a simulated handwriting image corresponding to a standard handwriting image; A feature extraction module, used to perform handwriting feature extraction operations on the standard handwriting image and the imitation handwriting image respectively to obtain standard handwriting features and imitation handwriting features; A similarity calculation module, used for calculating the similarity between the standard handwriting feature and the imitation handwriting feature to obtain the handwriting similarity; A similarity judgment module, used to judge whether the handwriting similarity meets a preset similarity condition; A first result module, configured to confirm that the imitation handwriting image is consistent with the standard handwriting image if the handwriting similarity satisfies the similarity condition; The second result module is used for confirming that the simulated handwriting image is inconsistent with the standard handwriting image if the handwriting similarity does not meet the similarity condition.

7. The handwriting verification device based on twin neural network according to claim 6 is characterized in that: The device further comprises: a preprocessing module; the feature extraction module comprises: a first feature extraction submodule, wherein: The preprocessing module is used to perform a preprocessing operation on the imitation handwriting image to obtain a preprocessed imitation handwriting image; The first feature extraction submodule is used to perform handwriting feature extraction operations on the standard handwriting image and the preprocessed imitation handwriting image respectively to obtain the standard handwriting features and the imitation handwriting features.

8. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the handwriting verification method based on a twin neural network as described in any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the handwriting verification method based on a twin neural network as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image feature fusion identification based signature authentic identification system and method

    CN104200239A

  • Signature verification method and device

    CN111178290A

  • Method and device for automatically verifying handwritten signature based on neural network model

    CN111428557A

  • Mobile phone shot text image matching method based on twin convolutional neural network

    CN111967488A

  • Handwriting comparison method and system, electronic equipment and storage medium

    CN112487853A