Handwriting identification method, device, equipment and storage medium

Through the handwriting identification method based on the attention mechanism, the texture and spatial structure features of handwritten signatures are extracted, which solves the problem of inaccurate identification caused by light difference and unclear handwriting in the existing technology, realizes efficient and automated handwriting identification, and simplifies feature extraction process and improves model generalization.

CN113239840BActive Publication Date: 2024-10-15AGRICULTURAL BANK OF CHINA
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110566922.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2024-10-15
Estimated Expiration
2041-05-24

AI Technical Summary

Technical Problem

In the existing technology, when the lighting is poor or the handwriting is unclear, the handwritten signature identification results are inaccurate and inefficient. Moreover, the traditional method requires manual acquisition of image features, the degree of automation is not high, and the model training is complex.

Method used

The handwriting identification method based on the attention mechanism is used to extract the texture features and spatial structure features of the handwriting to be identified to reduce the interference of redundant features and improve the accuracy and efficiency of identification. It uses multi-scale convolution modules, spatial attention modules and channel attention. The force module performs feature extraction and improves model generalization through data enhancement.

Benefits of technology

It improves the accuracy and efficiency of handwriting identification results, reduces redundant feature interference, improves automation, simplifies the feature extraction process, and improves the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113239840B_ABST
    Figure CN113239840B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a handwriting identification method, device, equipment and storage medium, the method comprising: obtaining an image to be identified, the image to be identified including handwriting to be identified; extracting texture features and spatial structure features of the handwriting to be identified based on an attention mechanism; and determining the authenticity of the handwriting to be identified based on the texture features and spatial structure features. In the present disclosure, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified can be focused on, thereby reducing the interference of other redundant features and improving the accuracy of handwriting identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a handwriting identification method, device, equipment and storage medium. Background Art

[0002] With the development of information technology, handwritten signatures, as an important form of identity authentication, are widely used in all walks of life, and the requirements for authenticity authentication of handwritten signatures are becoming increasingly higher.

[0003] At present, image processing technology is usually used to segment and recognize characters of handwritten signatures to verify the authenticity of handwritten signatures. However, when the light is poor or the handwriting is not clear, the identification results obtained by this identification method will be inaccurate and not efficient enough. Summary of the invention

[0004] The embodiments of the present disclosure provide a handwriting identification method, device, equipment and storage medium for improving the accuracy of handwriting identification results and enhancing identification efficiency.

[0005] In a first aspect, an embodiment of the present disclosure provides a handwriting identification method, comprising: obtaining an image to be identified, wherein the image to be identified includes handwriting to be identified; based on an attention mechanism, extracting texture features and spatial structure features of the handwriting to be identified; and determining the authenticity of the handwriting to be identified based on the texture features and spatial structure features.

[0006] In some embodiments, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified are extracted, including: based on the attention mechanism, by performing multiple feature extractions on the handwriting to be identified, feature maps of different sizes are obtained, wherein the output of the current feature extraction is used as the input of the next feature extraction, and the feature map contains the texture features and spatial structure features of the handwriting to be identified extracted correspondingly; accordingly, the authenticity of the handwriting to be identified is determined based on the texture features and spatial structure features, including: normalizing the feature maps obtained by multiple feature extractions to obtain an identification result, and the identification result is used to reflect the authenticity of the handwriting to be identified.

[0007] In some embodiments, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified are extracted, including: extracting the texture features and spatial structure features of the handwriting to be identified through a feature extraction module, the feature extraction module is obtained by training based on the attention mechanism, the feature extraction module includes at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer, the size of the feature map output by each feature extraction unit is different, the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification results.

[0008] In a second aspect, an embodiment of the present disclosure provides a handwriting identification model training method, wherein the handwriting identification model includes a feature extraction module and a normalization layer, the feature extraction module includes at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer, and the size of the feature map output by each feature extraction unit is different, and the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimensionality of the image features, and the fully connected layer is used to output the classification results.

[0009] The handwriting identification model training method includes: obtaining handwriting samples, the handwriting samples including real handwriting samples and copied handwriting samples corresponding to the real handwriting samples; iteratively training an initial handwriting identification model according to the real handwriting samples and the copied handwriting samples until the loss value of the initial handwriting identification model is less than or equal to a preset loss value, thereby obtaining a handwriting identification model.

[0010] In some embodiments, the initial handwriting identification model is iteratively trained based on real handwriting samples and copied handwriting samples, including: performing data enhancement processing on the real handwriting samples and the copied handwriting samples to obtain target real handwriting samples and target copied handwriting samples, the data enhancement processing including at least one of the following processing methods: rotation processing, blur processing, noise processing and color gamut adjustment; the initial handwriting identification model is iteratively trained based on the target real handwriting samples and the target copied handwriting samples.

[0011] In some embodiments, the initial handwriting identification model is iteratively trained based on the target real handwriting samples and the target copied handwriting samples, including: obtaining training parameters for training the initial handwriting identification model, wherein the training parameters include at least one of the following: optimizer type, initial learning rate, number of iterations, and number of early terminations; inputting the target real handwriting samples and the target copied handwriting samples into the initial handwriting identification model, and training the initial handwriting identification model using the training parameters.

[0012] In a third aspect, an embodiment of the present disclosure provides a handwriting identification device, comprising: an acquisition unit, used to acquire an image to be identified, wherein the image to be identified includes handwriting to be identified; a processing unit, used to extract texture features and spatial structure features of the handwriting to be identified based on an attention mechanism; and a determination unit, used to determine the authenticity of the handwriting to be identified based on the texture features and spatial structure features.

[0013] In some embodiments, the processing unit is specifically used to: based on the attention mechanism, obtain feature maps of different sizes by performing multiple feature extractions on the handwriting to be identified, wherein the output of the current feature extraction is used as the input of the next feature extraction, and the feature map contains the texture features and spatial structure features of the handwriting to be identified extracted correspondingly; accordingly, determine the authenticity of the handwriting to be identified based on the texture features and spatial structure features, including: normalizing the feature maps obtained by multiple feature extractions to obtain an identification result, and the identification result is used to reflect the authenticity of the handwriting to be identified.

[0014] In some embodiments, the processing unit is specifically used to: extract texture features and spatial structure features of the handwriting to be identified through a feature extraction module, the feature extraction module is obtained based on attention mechanism training, the feature extraction module includes at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer, and the size of the feature map output by each feature extraction unit is different. The feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification results.

[0015] In a fourth aspect, the disclosed embodiment provides a handwriting identification model training device, comprising: the handwriting identification model comprises a feature extraction module and a normalization layer, the feature extraction module comprises at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer, and the size of the feature map output by each feature extraction unit is different, the feature extraction unit comprises a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to perform dimensionality reduction processing on the image features, and the fully connected layer is used to output the classification results.

[0016] The handwriting identification model training device includes: an acquisition unit, which is used to acquire handwriting samples, and the handwriting samples include real handwriting samples and copied handwriting samples corresponding to the real handwriting samples; a training unit, which is used to iteratively train the initial handwriting identification model according to the real handwriting samples and the copied handwriting samples until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, thereby obtaining the handwriting identification model.

[0017] In some embodiments, the training unit is specifically used to perform data enhancement processing on real handwriting samples and copied handwriting samples to obtain target real handwriting samples and target copied handwriting samples, and the data enhancement processing includes at least one of the following processing methods: rotation processing, blur processing, noise processing and color gamut adjustment; according to the target real handwriting samples and target copied handwriting samples, the initial handwriting identification model is iteratively trained.

[0018] In some embodiments, the training unit is specifically used to obtain training parameters for training an initial handwriting identification model, wherein the training parameters include at least one of the following: optimizer type, initial learning rate, number of iterations, and number of early terminations; input the target real handwriting sample and the target copied handwriting sample into the initial handwriting identification model, and train the initial handwriting identification model using the training parameters.

[0019] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and at least one processor, the memory being used to store program instructions, the processor being used to call program instructions in the memory, executing the handwriting identification method provided in the first aspect, and / or executing the handwriting identification model training method provided in the second aspect.

[0020] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon; when the computer program is executed, the handwriting identification method provided in the first aspect is implemented, and / or the handwriting identification model training method provided in the second aspect is implemented.

[0021] In a seventh aspect, an embodiment of the present disclosure provides a computer program product. When the computer program is executed by a processor, it implements the handwriting identification method provided in the first aspect, and / or implements the handwriting identification model training method provided in the second aspect.

[0022] The embodiments of the present disclosure provide a handwriting identification method, device, equipment and storage medium, the method comprising: obtaining an image to be identified, the image to be identified including handwriting to be identified; extracting texture features and spatial structure features of the handwriting to be identified based on an attention mechanism; and determining the authenticity of the handwriting to be identified based on the texture features and spatial structure features. In the present disclosure, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified can be focused on, thereby reducing the interference of other redundant features and improving the accuracy of handwriting identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0024] Figure 1 A schematic diagram of a scene of handwriting identification provided by an embodiment of the present disclosure;

[0025] Figure 2 A flowchart of a handwriting identification method provided by an embodiment of the present disclosure;

[0026] Figure 3 A flowchart of a handwriting identification method provided by another embodiment of the present disclosure;

[0027] Figure 4 A schematic diagram of the structure of a handwriting identification model provided by an embodiment of the present disclosure;

[0028] Figure 5 A flowchart of a handwriting identification method provided by another embodiment of the present disclosure;

[0029] Figure 6 A schematic diagram of the structure of a feature extraction module provided in one embodiment of the present disclosure;

[0030] Figure 7 A schematic diagram of the structure of a feature extraction unit provided in one embodiment of the present disclosure;

[0031] Figure 8 A schematic diagram of the structure of a handwriting identification model provided by another embodiment of the present disclosure;

[0032] Fig. 9 A flowchart of a handwriting identification model training method provided in one embodiment of the present disclosure;

[0033] Fig.10 A visual schematic diagram of the training process of a handwriting identification model provided in an embodiment of the present disclosure;

[0034] Fig.11 A flowchart of a handwriting identification model training method provided by another embodiment of the present disclosure;

[0035] Fig.12 A schematic diagram of the structure of a handwriting identification device provided in one embodiment of the present disclosure;

[0036] Fig.13 A schematic diagram of the structure of a handwriting identification model training device provided in one embodiment of the present disclosure;

[0037] Fig.14 A schematic diagram of the structure of an electronic device provided in one embodiment of the present disclosure.

[0038] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0040] Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.

[0041] In the context of the embodiments of the present disclosure, the term "including" and its various variations may be understood as open terms, which mean "including but not limited to"; the term "based on" may be understood as "based at least in part on"; the term "one embodiment" may be understood as "at least one embodiment"; the term "another embodiment" may be understood as "at least one other embodiment". Other terms that may appear but are not mentioned here should not be interpreted or defined in a manner inconsistent with the concepts on which the embodiments of the present disclosure are based, unless explicitly stated. Note that in the following description, "vehicle" may be used as an example of a means of transportation. However, the scope of the embodiments of the present disclosure is not limited to this, and any means of transportation that can adopt the charging system described herein is included in the scope of the embodiments of the present disclosure.

[0042] The description includes references to the accompanying drawings that form a part of the detailed description. The accompanying drawings show diagrams according to exemplary embodiments. These embodiments, which may also be referred to herein as "examples," are described in sufficient detail to enable those skilled in the art to practice the embodiments of the claimed subject matter described herein. The embodiments may be combined, other embodiments may be used, or structural, logical, and electrical changes may be made without departing from the scope and spirit of the claimed subject matter. It should be understood that the embodiments described herein are not intended to limit the scope of the subject matter, but rather to enable those skilled in the art to practice, make, and / or use the subject matter.

[0043] First, the relevant terms in the embodiments of the present disclosure are explained:

[0044] Attention mechanism: A set of weight coefficients learned autonomously by the network, which emphasizes the areas of interest in a "dynamically weighted" manner while suppressing irrelevant background areas.

[0045] Tensorflow: An end-to-end open source machine learning platform and a computing framework for deep learning.

[0046] Keras: A computing framework for deep learning known for its ease of use and convenience.

[0047] Generative Adversarial Network (CNN): A variation of a neural network that learns by pitting two neural networks against each other.

[0048] VGG-16: Very Deep Convolutional Networks for Large-Scale Image Recognition, is a classic neural network structure for image recognition. 16 means that there are 16 convolutional layers in this neural network structure.

[0049] With the development of information technology, handwritten signatures, as an important form of identity authentication, are widely used in all walks of life, and the requirements for authenticity authentication of handwritten signatures are becoming increasingly higher.

[0050] For example, in the financial field, the most important criterion for evaluating the financial industry is security. With the advancement of the financial industry and the development of science and technology, in the era of the prosperity of Internet technology, more technologies in the financial industry have begun to transform towards digitalization and electronicization. In the process of transformation, the security issues of the financial industry have also been placed in a more prominent position. Among them, the authenticity of the customer's handwritten signature in key business has become crucial.

[0051] At present, image processing technology is usually used to segment and recognize characters of handwritten signatures to verify the authenticity of handwritten signatures. Other solutions also use CNN and improved VGG-16 network or handwriting identification methods based on adversarial neural networks.

[0052] However, the above traditional handwriting identification method has the following problems:

[0053] (1) There are errors in handwriting identification in complex scenes such as poor lighting;

[0054] (2) It is necessary to segment the characters of the handwriting individually, which increases the workload of character processing and is not efficient enough. At the same time, it does not take into account the overall writing habits of the writer, which will cause errors in the identification results;

[0055] (3) The processing speed of signature handwriting identification using traditional image processing methods is slow and cannot meet the growing business needs. In addition, image features need to be acquired manually, which is not universal and has a low degree of automation.

[0056] (4) Although the method of using deep learning to identify signatures can achieve good results, it also has problems such as the neural network model being too complex and the model training being difficult.

[0057] In view of this, the embodiments of the present disclosure provide a handwriting identification method, apparatus, device and storage medium, which extract the texture features and spatial structure features of the handwriting to be identified based on the attention mechanism, so as to focus on the texture features and spatial structure features of the handwriting to be identified during the handwriting identification process, reduce the interference of other redundant features, and improve the accuracy of the handwriting identification results.

[0058] For ease of understanding, first combine Figure 1 The application scenarios of the embodiments of the present disclosure are described as follows:

[0059] Figure 1 A schematic diagram of a scene of handwriting identification provided by an embodiment of the present disclosure. Figure 1 As shown, the scene includes: a handwriting identification device 101 and an image to be identified, wherein the image to be identified includes a font to be identified.

[0060] Among them, the handwriting identification device 101 can be any type of device, for example, it can be a handwriting collection device with a handwriting collection function, such as a POS machine, etc.; it can also be other types of equipment, such as a notebook, a real-time computer, a personal digital assistant (Personal Digital Assistant, referred to as: PDA), a smart phone, a tablet computer, an automotive product, a wearable device and other devices, which are not specifically limited here.

[0061] On the one hand, the handwriting identification process can be real-time, that is, when the handwriting identification device 101 is a handwriting collection device with a handwriting collection function, when the user writes on the image collection device, the handwriting collection device will collect the handwriting in the current writing image in real time and identify the authenticity of the handwriting in real time.

[0062] On the other hand, the handwriting identification process may also be non-real-time, that is, the user may input any image to be identified into the handwriting identification device 101, and the handwriting identification device 101 may perform authenticity identification on the handwriting to be identified in the image to be identified.

[0063] Optionally, the handwriting identification device 101 can also perform handwriting identification in batches.

[0064] The following is a detailed description of the technical solutions of the embodiments of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.

[0065] Figure 2 A flowchart of a handwriting identification method provided in an embodiment of the present disclosure. The execution subject of the embodiment of the present disclosure may be the above-mentioned handwriting identification device, which may be implemented in software and / or hardware. For example, the handwriting identification device may include but is not limited to electronic devices such as computers and servers. The server may be a single server, or a server cluster consisting of several servers, or a cloud computing service center. Figure 2 As shown, the handwriting identification method provided by the embodiment of the present disclosure includes the following steps:

[0066] S201, obtaining an image to be identified.

[0067] The image to be identified includes handwriting to be identified.

[0068] S202. Based on the attention mechanism, extract the texture features and spatial structure features of the handwriting to be identified.

[0069] Among them, the texture features of the handwriting to be identified are used to describe the surface properties of the handwriting to be identified in the image to be identified, and the spatial structure features are used to describe the mutual spatial positions or relative direction relationships between multiple strokes segmented from the handwriting to be identified in the image to be identified. These relationships can also be divided into connection / adjacency relationships, overlap / overlapping relationships, and inclusion / containment relationships, etc.

[0070] In practical applications, spatial position information can usually be divided into two categories: relative spatial position information and absolute spatial position information. Relative spatial position information emphasizes the relative situation between strokes, such as up, down, left, and right relationships, while absolute spatial position information emphasizes the distance and orientation relationship between strokes.

[0071] It should be noted that the specific scheme for extracting the texture features and spatial structure features of the handwriting to be identified is shown in the subsequent embodiments.

[0072] S203: Determine the authenticity of the handwriting to be authenticated based on the texture features and the spatial structure features.

[0073] In the present disclosure, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified are extracted, and the texture features and spatial structure features of the handwriting to be identified can be focused on during the recognition process, thereby reducing the interference of other redundant features and improving the accuracy of the handwriting identification results. In addition, based on the attention mechanism, there is no need to segment the characters of the handwriting individually, and there is no need to manually obtain image features, which greatly improves the automation of handwriting identification and is more efficient.

[0074] The following is a detailed description of the scheme for extracting the texture features and spatial structure features of the handwriting to be identified based on the attention mechanism in the above embodiment in combination with the embodiments.

[0075] Figure 3 The flowchart of the handwriting identification method provided by another embodiment of the present disclosure is as follows. Based on the above embodiment, the technical solution of the present disclosure will be described in more detail. Figure 3 As shown, the handwriting identification method provided by the embodiment of the present disclosure may include the following steps:

[0076] S301, obtaining an image to be identified.

[0077] The image to be identified includes the handwriting to be identified.

[0078] S302. Based on the attention mechanism, feature maps of different sizes are obtained by performing multiple feature extractions on the handwriting to be identified.

[0079] The output of the current feature extraction is used as the input of the next feature extraction, and the feature map contains the texture features and spatial structure features of the handwriting to be identified extracted in the corresponding time.

[0080] S303, normalizing the feature graphs obtained through multiple feature extractions to obtain an identification result, which is used to reflect the authenticity of the handwriting to be identified.

[0081] It should be noted that the specific method of normalization is not specifically limited in the embodiments of the present disclosure. For example, the extracted features can be normalized by a normalized exponential function (Softmax function). As for the specific scheme of normalization, reference can be made to the prior art and will not be repeated here.

[0082] In the disclosed embodiment, based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified can be focused on during the recognition process, thereby reducing the interference of other redundant features and improving the accuracy of the handwriting identification results. In addition, by performing multiple feature extractions on the handwriting to be identified through the attention mechanism, feature maps of different sizes can be obtained, thereby obtaining more image features to improve the image recognition accuracy and ultimately improve the accuracy of the handwriting identification results.

[0083] In some embodiments, the authenticity of the handwriting can also be identified by a handwriting identification model. Specifically, the handwriting identification model is obtained by training based on the attention mechanism, and the handwriting identification model can be, for example, a neural network model based on the attention mechanism.

[0084] The handwriting identification model may include: a feature extraction module and a normalization layer. The feature extraction module is used to extract features from the handwriting to be identified, and the normalization layer is used to identify the handwriting to be identified based on the extracted features to obtain the handwriting identification result.

[0085] Specifically, Figure 4 This is a schematic diagram of the structure of a handwriting identification model provided by an embodiment of the present disclosure. Figure 4 As shown, the handwriting identification model 400 of the embodiment of the present disclosure includes: a feature extraction module 401 and a normalization layer 402.

[0086] The feature extraction module 401 is used to extract the image features of the handwriting to be identified in the image to be identified, obtain a feature map, and output the feature map to the normalization layer 402, wherein the image features include features such as spatial structure features and texture features;

[0087] Furthermore, the normalization layer 402 is used to identify the authenticity of the handwriting to be identified based on the spatial structure features and the texture features, and determine the authenticity of the handwriting to be identified.

[0088] The following is a detailed description of the process and principle of handwriting identification by the handwriting identification model in the embodiment of the present disclosure in combination with specific embodiments:

[0089] Figure 5 The flowchart of the handwriting identification method provided by another embodiment of the present disclosure is as follows. Based on the above embodiment, the technical solution of the present disclosure will be described in more detail. Figure 5 As shown, the handwriting identification method provided by the embodiment of the present disclosure may include the following steps:

[0090] S501: Obtain an image to be identified.

[0091] S502: extracting texture features and spatial structure features of the handwriting to be identified through a feature extraction module.

[0092] S503: Determine the authenticity of the handwriting to be authenticated based on the texture features and the spatial structure features.

[0093] For easier understanding, please refer to Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the structure of a feature extraction module provided in an embodiment of the present disclosure. Figure 6 As shown, the feature extraction module 401 includes at least one feature extraction unit 403 and a fully connected layer 404.

[0094] Among them, the feature extraction unit 403 is used to extract the features of the handwriting to be identified in the image to be processed based on the attention mechanism and generate the corresponding feature map; the fully connected layer 404 is used to output the classification result according to the feature map.

[0095] It should be noted that Figure 6 The feature extraction unit 403 in the embodiment is shown as feature extraction unit 1, feature extraction unit 2, ..., feature extraction unit n, but is not limited thereto, wherein n is an integer greater than or equal to 1.

[0096] In practical applications, feature extraction unit 1, feature extraction unit 2, ... feature extraction unit n are connected in sequence, and the last feature extraction unit (feature extraction unit n) is connected to the fully connected layer 404. It should be understood that the size of the feature map output by each feature extraction unit 403 is different. Figure 7 The specific structure of the feature extraction unit 403 and the feature extraction principle are explained.

[0097] Figure 7 This is a schematic diagram of the structure of a feature extraction unit provided in one embodiment of the present disclosure. Figure 7 As shown, each feature extraction unit 403 includes a convolution module 4031, a multi-scale convolution module 4032, a spatial attention module 4033, a channel attention module 4032 and a pooling layer 4035.

[0098] Among them, the convolution module 4031 is used to extract the shape features and / or position features of the handwriting to be identified; the multi-scale convolution module 4032 is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified; the spatial attention module 4033 is used for the convolutional block attention module (CBAM) to extract the spatial structure features of the handwriting to be identified; the channel attention module 4034 is used to extract the texture features of the handwriting to be identified based on the compression and expansion network (Squeeze-and-Excitation Networks, SENet), and the pooling layer 4035 is used to perform dimensionality reduction processing on the image features.

[0099] In some embodiments, there is no specific limitation on the number of structures in each feature extraction unit 403. For example, feature extraction unit 1, feature extraction unit 2, and feature extraction unit 3 each include two convolution modules 4031, and feature extraction unit 4 and feature extraction unit 5 may include three convolution modules 4031, and so on.

[0100] In some other embodiments, the multi-scale dilated convolution module 4032 is composed of dilated convolution layers of different scales, and the output results of multiple dilated convolution layers of different scales are combined to obtain the output of the multi-scale dilated convolution module 4032. The embodiment of the present disclosure does not specifically limit the number of dilated convolution layers of different scales.

[0101] It should also be noted that the embodiment of the present disclosure does not specifically limit the convolution kernel size of each module in each feature extraction unit 403, the output feature map size, and the number of output feature maps. For example, taking each feature extraction module 401 including 5 feature extraction units 403 and 3 fully connected layers 404 as an example, the parameters of the structure of the handwriting identification model provided by the embodiment of the present disclosure are shown in the following table:

[0102]

[0103] Correspondingly, the structure corresponding to the handwriting identification model parameters in the above table can be found in Figure 8 , Figure 8 This is a schematic diagram of the structure of a handwriting identification model provided by another embodiment of the present disclosure. It should be noted that: Figure 8 In the figure, five feature extraction units and three fully connected layers are used as an example, but this is not a limitation in practical applications.

[0104] In the disclosed embodiments, through the handwriting identification model based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified can be focused on during the handwriting identification process, thereby reducing the interference of other redundant features and improving the accuracy of the handwriting identification results. Moreover, during the identification process, since different feature extraction units are used to output feature maps of different sizes, the features in the handwriting to be identified can be fully explored, thereby improving the image recognition accuracy and further improving the accuracy of the handwriting identification results.

[0105] In addition, since the handwriting identification model can automatically extract the features of the handwriting to be identified, compared with manual extraction, it can greatly improve the efficiency of handwriting feature extraction, thereby improving the efficiency of handwriting identification.

[0106] The following is a detailed description of the training method of the handwriting identification model in conjunction with a specific embodiment.

[0107] Please continue to refer to Figure 4 ,like Figure 4 As shown, the handwriting identification model 400 provided by the embodiment of the present disclosure includes: a feature extraction module 401 and a normalization layer 402, wherein the feature extraction module 401 is used to extract image features of the handwriting to be identified in the image to be identified, obtain a feature map, and output the feature map to the normalization layer 402, wherein the image features include: spatial structure features and texture features.

[0108] Furthermore, the normalization layer 402 is used to identify the authenticity of the handwriting to be identified based on the spatial structure features and the texture features, and determine the authenticity of the handwriting to be identified.

[0109] Fig. 9 This is a flow chart of a handwriting identification model training method provided in an embodiment of the present disclosure. It should be noted that the execution subject of the embodiment of the present disclosure can be the handwriting identification device mentioned above or other devices, which is not limited here.

[0110] like Fig. 9 As shown, the handwriting identification model training method provided by the embodiment of the present disclosure includes the following steps:

[0111] S901, obtaining a handwriting sample.

[0112] The handwriting samples include real handwriting samples and copied handwriting samples corresponding to the real handwriting samples.

[0113] In this step, there is no limitation on the method of obtaining the handwriting sample for copying. For example, it can be copied manually based on the real sample handwriting, or it can be automatically generated based on the real handwriting sample.

[0114] S902. Iteratively train the initial handwriting identification model according to the real handwriting samples and the copied handwriting samples until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, thereby obtaining the handwriting identification model.

[0115] It should be understood that the structure of the initial handwriting identification model is the same as the structure of the handwriting identification model, and the structure of the initial handwriting identification model will not be repeated here.

[0116] This step is specifically as follows: input the real handwriting samples and the copied handwriting samples into the initial handwriting identification model, iteratively train the initial handwriting identification model through the real handwriting samples and the copied handwriting samples, and output the loss value (loss value) of each iterative training.

[0117] Furthermore, when the output loss value is less than the preset loss value, it indicates that the handwriting identification model has completed training, and the current model is determined to be the handwriting identification model. The size of the preset loss value can be set according to actual needs and is not specifically limited here.

[0118] Fig.10 A visual diagram of the training process of the handwriting identification model provided in one embodiment of the present disclosure. Fig.10 As shown, during the training process, both the verification loss and the training loss show a downward trend, indicating that the handwriting identification model is learning at this time. When the verification loss and / or the training loss is less than the preset value, it means that the handwriting identification model has completed the training, and the current model is determined to be a handwriting identification model.

[0119] In some embodiments, the handwriting identification model can also be determined by the accuracy of the model. This step is: according to the real handwriting sample and the copied handwriting sample, the initial handwriting identification model is iteratively trained until the accuracy of the initial handwriting identification model is greater than or equal to the preset accuracy value, and the handwriting identification model at this time is obtained. As for the specific training process, it will not be repeated here.

[0120] In the disclosed embodiment, the initial handwriting identification model is trained by using real handwriting samples and copied handwriting samples, so that the model can fully learn the characteristics of real handwriting and forged handwriting, thereby obtaining an accurate handwriting identification model, and then in the handwriting identification process, more accurate identification results can be obtained through the handwriting identification model.

[0121] Fig.11 A flowchart of a handwriting identification model training method provided by another embodiment of the present disclosure is shown below. Based on the above embodiment, the technical solution of the present disclosure will be described in more detail. Fig.11 As shown, the handwriting identification model training method provided by the embodiment of the present disclosure may include the following steps:

[0122] S1101, obtaining a handwriting sample.

[0123] The handwriting samples include real handwriting samples and copied handwriting samples corresponding to the real handwriting samples.

[0124] Among them, step S1101 and Fig. 9 Step S901 in the illustrated embodiment is similar, and details may be referred to the above embodiment, which will not be described again here.

[0125] S1102, performing data enhancement processing on the real handwriting sample and the copied handwriting sample to obtain a target real handwriting sample and a target copied handwriting sample.

[0126] In some embodiments, since the number of collected handwriting samples is small, the generalization of the trained handwriting identification model is low. Therefore, data enhancement processing can be performed on the handwriting samples to obtain handwriting sample data in different scenarios, increase the feature types of the handwriting samples, and ultimately improve the generalization of the handwriting identification model.

[0127] The data enhancement processing includes at least one of the following processing methods: rotation processing, blur processing, noise adding processing and color gamut adjustment.

[0128] Specifically, rotation processing, for example, is to rotate the real handwriting sample and / or the copied handwriting sample at a certain angle to obtain sample images with different tilt directions; blur processing, for example, is to use frosted glass effect to perform appropriate blur processing on the real handwriting sample and / or the copied handwriting sample; noise processing, for example, is to add Gaussian noise or salt and pepper noise to the real handwriting sample and / or the copied handwriting sample; color gamut adjustment, for example, is to adjust the brightness, saturation and hue of the real handwriting sample and / or the copied handwriting sample.

[0129] As for other data enhancement methods, they will not be described here one by one.

[0130] S1103. According to the target real handwriting samples and the target copied handwriting samples, the initial handwriting identification model is iteratively trained to obtain a handwriting identification model.

[0131] The training process of step S1103 is described below in combination with steps S1131 and S1132.

[0132] S1131. Obtain training parameters for training an initial handwriting identification model.

[0133] Among them, the training parameters include at least one of the following: optimizer type (Optimizer), initial learning rate (Learning Rate), number of iterations (Epochs), number of early terminations (Early Stopping) and Dropout, etc. The specific values ​​of the above training parameters can be set according to needs, and the embodiments of the present disclosure do not make specific limitations.

[0134] It should also be noted that the learning framework used in the training process of the embodiments of the present disclosure may be, for example, a Keras framework with Tensorflow as the backend.

[0135] S1132. Input the target real handwriting sample and the target copied handwriting sample into the initial handwriting identification model, train the initial handwriting identification model through training parameters, until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, and obtain the handwriting identification model.

[0136] In this solution, the change of the loss value of the model is used to determine whether to continue training. Ideally, when the loss value is 0, it means that the model can fully learn the characteristics of the handwriting sample, but in reality, the loss value may not be 0. Therefore, a preset loss value can be set according to demand. When the loss value in the iterative training process is less than or equal to the preset loss value, the training is determined to be completed, and then the model obtained by the current training is determined to be a handwriting identification model.

[0137] In another embodiment, during training, if the loss value does not decrease, or even increases, it means that the model can no longer learn favorable features from the handwriting samples. Therefore, if it is determined that the loss value has not decreased in a preset number of iterative trainings, it can be determined that the training is over, and then the model obtained by the current training is determined to be a handwriting identification model.

[0138] For example, taking the optimizer using the Adam algorithm, the initial learning rate being 0.001, the number of iterations being 20,000, and the number of early terminations being 3 as an example, if the loss value of the model does not decrease in three consecutive iterative trainings, the training is stopped and the dropout parameter is set.

[0139] In the disclosed embodiment, by performing data enhancement processing on handwriting samples, handwriting sample data in different scenarios can be obtained, the feature types of handwriting samples can be increased, and the generalization of the handwriting identification model can be finally improved.

[0140] Fig.12 This is a schematic diagram of the structure of a handwriting identification device provided by an embodiment of the present disclosure. Fig.12 As shown, the handwriting identification device 1200 includes:

[0141] The acquisition unit 1201 is used to acquire the image to be identified, which includes the handwriting to be identified; the processing unit 1202 is used to extract the texture features and spatial structure features of the handwriting to be identified based on the attention mechanism; the determination unit 1203 is used to determine the authenticity of the handwriting to be identified based on the texture features and spatial structure features.

[0142] In some embodiments, the processing unit 1202 is specifically used to: based on the attention mechanism, obtain feature maps of different sizes by performing multiple feature extractions on the handwriting to be identified, wherein the output of the current feature extraction is used as the input of the next feature extraction, and the feature map contains the texture features and spatial structure features of the handwriting to be identified extracted correspondingly; accordingly, determine the authenticity of the handwriting to be identified based on the texture features and spatial structure features, including: normalizing the feature maps obtained by multiple feature extractions to obtain an identification result, and the identification result is used to reflect the authenticity of the handwriting to be identified.

[0143] In some embodiments, the processing unit 1202 is specifically used to: extract texture features and spatial structure features of the handwriting to be identified through a feature extraction module, the feature extraction module is obtained based on attention mechanism training, the feature extraction module includes at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer. The size of the feature map output by each feature extraction unit is different, and the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification results.

[0144] It can be understood that the handwriting identification device provided in the embodiments of the present disclosure can be used to execute the handwriting identification method provided in any of the above method embodiments, and its implementation principle and technical effects are similar. For details, please refer to the above method embodiments and will not be repeated here.

[0145] Fig.13 A schematic diagram of the structure of a handwriting identification model training device provided for an embodiment of the present disclosure. The handwriting identification model includes a feature extraction module and a normalization layer, the feature extraction module includes at least one feature extraction unit and a fully connected layer, at least one feature extraction unit is connected in sequence, the last feature extraction unit is connected to the fully connected layer, the size of the feature map output by each feature extraction unit is different, the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification results.

[0146] like Fig.13 As shown, the handwriting identification model training device 1300 includes: an acquisition unit 1301, which is used to acquire handwriting samples, the handwriting samples including real handwriting samples and copied handwriting samples corresponding to the real handwriting samples;

[0147] The training unit 1302 is used to iteratively train the initial handwriting identification model according to the real handwriting samples and the copied handwriting samples until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, thereby obtaining the handwriting identification model.

[0148] In some embodiments, the acquisition unit 1301 is specifically used to perform data enhancement processing on the real handwriting samples and the copied handwriting samples to obtain target real handwriting samples and target copied handwriting samples, and the data enhancement processing includes at least one of the following processing methods: rotation processing, blur processing, noise processing and color gamut adjustment; according to the target real handwriting samples and the target copied handwriting samples, the initial handwriting identification model is iteratively trained.

[0149] In some embodiments, the training unit 1302 is specifically used to obtain training parameters for training the initial handwriting identification model, wherein the training parameters include at least one of the following: optimizer type, initial learning rate, number of iterations, and number of early terminations; input the target real handwriting sample and the target copied handwriting sample into the initial handwriting identification model, and train the initial handwriting identification model using the training parameters.

[0150] It can be understood that the handwriting identification model training device provided in the embodiment of the present disclosure can be used to execute the handwriting identification model training method provided in any of the above method embodiments, and its implementation principle and technical effects are similar. Please refer to the above method embodiments for details, which will not be repeated here.

[0151] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. The electronic device 1400 of this embodiment may be the terminal device or server (or a component that can be used for the terminal device or server) mentioned in the aforementioned method embodiment, which can be used to implement the method corresponding to the terminal device or server described in the aforementioned method embodiment, and the specific details are referred to in the aforementioned method embodiment, which will not be repeated here.

[0152] The electronic device 1400 may include one or more processors 1401, which may also be referred to as a processing unit, and may implement certain control or processing functions. The processor 1401 may be a general-purpose processor or a dedicated processor, etc. For example, it may be a baseband processor or a central processing unit. The baseband processor may be used to process data, and the central processing unit may be used to control the electronic device 1400, execute software programs, and process data of software programs.

[0153] In one possible design, the processor 1401 may also store instructions 1403 or data (such as test parameters). The instructions 1403 may be executed by the processor 1401, so that the electronic device 1400 executes the handwriting identification method described in the above method embodiment and / or the handwriting identification model training method.

[0154] In yet another possible design, the electronic device 1400 may include a circuit that can implement the functions of sending, receiving, or communicating in the aforementioned method embodiments.

[0155] In one possible implementation, the electronic device 1400 may include one or more memories 1402, on which instructions 1404 may be stored. The instructions may be executed on the processor 1401, so that the electronic device 1400 executes the information processing method described in the above method embodiment.

[0156] In a possible implementation, data may also be stored in the memory 1402. The processor 1401 and the memory 1402 may be provided separately or integrated together.

[0157] In a possible implementation, the electronic device 1400 may further include a transceiver 1405 and / or an antenna 1406. The processor 1401 may be referred to as a processing unit, which controls the electronic device 1400. The transceiver 1405 may be referred to as a transceiver unit, a transceiver, a transceiver circuit, or a transceiver, etc., which is used to implement the transceiver function of the electronic device 1400.

[0158] Among them, the specific implementation process of the processor 1401 and the transceiver 1405 can refer to the relevant description of the above embodiments, which will not be repeated here.

[0159] The processor 1401 and transceiver 1405 described in the present disclosure can be implemented on an integrated circuit (IC), an analog IC, a radio frequency integrated circuit (RFIC), a mixed signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc.

[0160] It can be understood by those skilled in the art that Fig.14 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0161] It should be noted here that the above-mentioned electronic device provided by the present disclosure is used to implement the handwriting identification method or handwriting identification model training method described in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0162] The embodiments of the present disclosure also provide a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the terminal device, the processor is enabled to execute the handwriting identification method in the above method embodiments and / or the handwriting identification model training method.

[0163] The disclosed embodiments further provide a computer program product, including a computer program. When the computer program is executed by a processor, the handwriting identification method in the above method embodiments and / or the handwriting identification model training method are implemented.

[0164] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0165] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0166] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0167] In the above server embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The steps of the method disclosed in the present disclosure may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0168] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the schemes disclosed herein. The embodiments of the present disclosure are intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0169] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A handwriting identification method, characterized in that: include: Acquire an image to be identified, wherein the image to be identified includes handwriting to be identified; Based on the attention mechanism, the texture features and spatial structure features of the handwriting to be identified are extracted; wherein the spatial structure features are used to describe the spatial position or relative direction relationship between multiple strokes segmented from the handwriting to be identified in the image to be identified; the relationship includes: connection / adjacency relationship, overlap / overlap relationship and inclusion / inclusion relationship; Determining the authenticity of the handwriting to be identified based on the texture features and the spatial structure features; extracting the texture features and the spatial structure features of the handwriting to be identified based on the attention mechanism includes: The texture features and spatial structure features of the handwriting to be identified are extracted by a feature extraction module, the feature extraction module is obtained by training based on the attention mechanism, the feature extraction module includes at least one feature extraction unit and a fully connected layer, the at least one feature extraction unit is connected in sequence, the last feature extraction unit is connected to the fully connected layer, the size of the feature map output by each feature extraction unit is different, the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification results.

2. The handwriting identification method according to claim 1, characterized in that: The method of extracting the texture features and spatial structure features of the handwriting to be identified based on the attention mechanism includes: Based on the attention mechanism, feature maps of different sizes are obtained by performing multiple feature extractions on the handwriting to be identified, wherein the output of the current feature extraction is used as the input of the next feature extraction, and the feature map contains the texture features and spatial structure features of the handwriting to be identified extracted in the corresponding time; Correspondingly, determining the authenticity of the handwriting to be identified based on the texture features and the spatial structure features includes: normalizing the feature map obtained by multiple feature extractions to obtain an identification result, and the identification result is used to reflect the authenticity of the handwriting to be identified.

3. The handwriting identification method according to claim 1, characterized in that: Before acquiring the image to be identified, the method further includes: training a handwriting identification model, the handwriting identification model includes a feature extraction module and a normalization layer, the feature extraction module includes at least one feature extraction unit and a fully connected layer, the at least one feature extraction unit is connected in sequence, the last feature extraction unit is connected to the fully connected layer, the size of the feature map output by each feature extraction unit is different, the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape feature and / or position feature of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, extract the feature of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure feature of the handwriting to be identified, the channel attention module is used to extract the texture feature of the handwriting to be identified, the pooling layer is used to perform dimensionality reduction processing on the image feature, and the fully connected layer is used to output the classification result; The handwriting identification model training method comprises: obtaining handwriting samples, wherein the handwriting samples include real handwriting samples and copied handwriting samples corresponding to the real handwriting samples; The initial handwriting identification model is iteratively trained according to the real handwriting samples and the copied handwriting samples until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, thereby obtaining the handwriting identification model.

4. The handwriting identification method according to claim 3, characterized in that: The iterative training of the initial handwriting identification model according to the real handwriting sample and the copied handwriting sample comprises: Performing data enhancement processing on the real handwriting sample and the copied handwriting sample to obtain a target real handwriting sample and a target copied handwriting sample, wherein the data enhancement processing includes at least one of the following processing methods: rotation processing, blur processing, noise adding processing and color gamut adjustment; The initial handwriting identification model is iteratively trained according to the target real handwriting samples and the target copied handwriting samples.

5. The handwriting identification method according to claim 4, characterized in that: The iterative training of the initial handwriting identification model according to the target real handwriting sample and the target copied handwriting sample comprises: Acquire training parameters for training the initial handwriting identification model, wherein the training parameters include at least one of the following: optimizer type, initial learning rate, number of iterations, and number of early terminations; The target real handwriting sample and the target copied handwriting sample are input into the initial handwriting identification model, and the initial handwriting identification model is trained by the training parameters.

6. A handwriting identification device, characterized in that: include: An acquisition unit, used for acquiring an image to be identified, wherein the image to be identified includes handwriting to be identified; A processing unit, for extracting texture features and spatial structure features of the handwriting to be identified based on an attention mechanism; wherein the spatial structure features are used to describe the spatial position or relative direction relationship between multiple strokes segmented from the handwriting to be identified in the image to be identified; the relationship includes: connection / adjacency relationship, overlap / overlap relationship and inclusion / inclusion relationship; A determination unit, used to determine the authenticity of the handwriting to be identified based on the texture feature and the spatial structure feature; The processing unit is specifically used to extract the texture features and spatial structure features of the handwriting to be identified through a feature extraction module. The feature extraction module is obtained by training based on the attention mechanism. The feature extraction module includes at least one feature extraction unit and a fully connected layer. The at least one feature extraction unit is connected in sequence, and the last feature extraction unit is connected to the fully connected layer. The size of the feature map output by each feature extraction unit is different. The feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape features and / or position features of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, and extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, and the channel attention module is used to extract the texture features of the handwriting to be identified. The pooling layer is used to reduce the dimension of the image features, and the fully connected layer is used to output the classification result.

7. A handwriting identification model training device, characterized in that: The handwriting identification model includes a feature extraction module and a normalization layer, the feature extraction module includes at least one feature extraction unit and a fully connected layer, the at least one feature extraction unit is connected in sequence, the last feature extraction unit is connected to the fully connected layer, the size of the feature map output by each feature extraction unit is different, the feature extraction unit includes a convolution module, a multi-scale convolution module, a spatial attention module, a channel attention module and a pooling layer, wherein the convolution module is used to extract the shape feature and / or position feature of the handwriting to be identified, the multi-scale convolution module is used to expand the convolution receptive field of the handwriting to be identified, extract the features of the multi-scale image space corresponding to the handwriting to be identified, the spatial attention module is used to extract the spatial structure features of the handwriting to be identified, the channel attention module is used to extract the texture features of the handwriting to be identified, the pooling layer is used to perform dimensionality reduction processing on the image features, and the fully connected layer is used to output the classification result; The handwriting identification model training device comprises: an acquisition unit, which is used to acquire handwriting samples, wherein the handwriting samples include real handwriting samples and copied handwriting samples corresponding to the real handwriting samples; The training unit is used to iteratively train the initial handwriting identification model according to the real handwriting sample and the copied handwriting sample until the loss value of the initial handwriting identification model is less than or equal to the preset loss value, thereby obtaining the handwriting identification model.

8. An electronic device, characterized in that: include: A memory and at least one processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute the handwriting identification method as described in any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program; when the computer program is executed, the handwriting identification method according to any one of claims 1 to 5 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the handwriting identification method as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Image processing method, device and electronic equipment

    CN106934397A

  • Character recognition method and device, electronic equipment and storage medium

    CN111899292A

  • Handwriting recognition method and device, electronic equipment and storage medium

    CN112686134A

  • Off-line English handwriting recognition method based on attention mechanism

    CN112686345A

  • Chinese text handwriting recognition method and device based on macro and micro features and storage medium

    CN112766082A