Signature generation method and device, electronic equipment, storage medium and program product

By removing strokes from the signed image to generate incomplete signed images, the problem of insufficient negative samples in the signature database is solved, and the accuracy of signature recognition is improved.

CN120452000APending Publication Date: 2025-08-08PING AN INT FINANCIAL LEASING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510535926.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

There are fewer negative samples in existing signature databases, resulting in poor accuracy in identifying incomplete signatures by OCR technology and signature integrity recognition models.

Method used

By obtaining the pixel set corresponding to each stroke in the signed image, and removing the strokes from the signed image based on the pixel information, an incomplete signed image is generated and the target database is updated.

Benefits of technology

It improves the efficiency of generating incomplete signatures, and enhances the accuracy of optical character recognition technology and signature integrity recognition model to identify incomplete signatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452000A_ABST
    Figure CN120452000A_ABST
Patent Text Reader

Abstract

The invention provides a signature generation method and device, electronic equipment, a storage medium and a program product, and belongs to the technical field of financial science and technology. The method comprises the following steps: acquiring a pixel set corresponding to each stroke in a first signature image; acquiring information of each pixel in a first pixel set corresponding to the first stroke; based on the information of each pixel in the first pixel set, removing the first stroke from the first signature image to obtain a second signature image; wherein the second signature image is used for updating the signature image in the target database; the target database comprises at least one of an optical character recognition font library and a training database of the signature integrity recognition model. According to the method and the device, the efficiency of generating the incomplete signature can be improved, the difficulty of generating the incomplete signature is reduced, and the target database obtained by updating the incomplete signature generated by the method and the device can improve the accuracy of identifying signature characters by an optical character identification technology and / or identifying the incomplete signature by a signature integrity identification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to a signature generation method, device, electronic device, storage medium and program product. Background Art

[0002] Signature recognition technology has been widely used in the field of financial technology. Signature recognition scenarios in this field are generally divided into two categories: signature content recognition and signature integrity recognition. In signature content recognition scenarios, optical character recognition (OCR) technology is generally used to identify each character in the signature. In signature integrity recognition scenarios, such as the signing of leasing business documents, signature integrity recognition models are generally used to identify the integrity of the signature to ensure the legal validity of the signature.

[0003] Regardless of the signature recognition scenario, a signature database with abundant negative samples is often required to ensure the effectiveness of OCR technology or signature integrity recognition models. However, the samples in current signature databases are mostly historical signature data. Because incomplete signatures are a risk factor for default, they are inherently rare and difficult to collect in historical signature data. This means that the current databases have few negative samples, resulting in poor accuracy in recognizing signature characters using OCR technology and in recognizing incomplete signatures using signature integrity recognition models. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a signature generation method, device, electronic device, storage medium and program product, aiming to improve the efficiency of generating incomplete signatures and reduce the difficulty of generating incomplete signatures, so that the target database updated based on the incomplete signatures generated by the present application can improve the accuracy of optical character recognition technology in recognizing signature characters and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures.

[0005] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application proposes a signature generation method, including: obtaining a pixel set corresponding to each stroke in a first signature image; obtaining information of each pixel in the first pixel set corresponding to the first stroke; based on the information of each pixel in the first pixel set, removing the first stroke from the first signature image to obtain a second signature image; wherein, the second signature image is used to update the signature image in a target database; the target database includes at least one item of an optical character recognition font library and a training database of a signature integrity recognition model.

[0006] In some embodiments, the information of each pixel includes a pixel value of each pixel; removing the first stroke from the first signature image based on the information of each pixel in the first pixel set to obtain a second signature image includes: obtaining a background pixel value of the first signature image; changing the pixel value of each pixel in the first pixel set to the background pixel value to obtain the second signature image.

[0007] In some embodiments, obtaining a pixel set corresponding to each stroke in the first signature image includes: obtaining each target pixel in the first signature image whose pixel value is within a target range; the target range is determined based on the color channel attributes and background pixel values of the first signature image; and using a region growing algorithm to group each target pixel based on the similarity between the target pixels to obtain the pixel set.

[0008] In some embodiments, the method of using a region growing algorithm to group target pixels based on similarities between target pixels to obtain the pixel set includes: selecting an i-th pixel from target pixels according to the pixel arrangement order of the first signature image, wherein i is a positive integer; when the access state of the i-th pixel is a pending access state, using the region growing algorithm to divide the i-th pixel and the j-th pixel into the same group based on the similarities between the i-th pixel and other pixels in the target pixels; wherein the j-th pixel is a pixel among the other pixels whose similarity to the i-th pixel is greater than a preset value; updating the access states of the i-th pixel and the j-th pixel to a visited state; updating i to i+1, and returning to the step of selecting the i-th pixel from target pixels until the target pixels are grouped to obtain the pixel set; when the access state of the i-th pixel is a visited state, updating i to i+1, and returning to the step of selecting the i-th pixel from target pixels.

[0009] In some embodiments, after obtaining the pixel sets corresponding to each stroke in the first signature image, the signature generation method further includes: obtaining information of each pixel in a second pixel set corresponding to a second stroke; and based on the information of each pixel in the second pixel set, removing the second stroke from the first signature image to obtain a third signature image.

[0010] In some embodiments, after obtaining the second signature image, the signature generation method further includes: obtaining a target signature image whose signature integrity is to be identified; inputting the target signature image into the trained signature integrity recognition model to obtain a signature integrity recognition result of the target signature image; before inputting the target signature image into the trained signature integrity recognition model to obtain a signature integrity recognition result of the target signature image, the signature generation method further includes: obtaining a training data set, wherein the training data set includes multiple training samples, each of the training samples includes the second signature image and a signature integrity label result corresponding to the second signature image; using the training data set, training the preset signature integrity recognition model until a training stop condition is met, thereby obtaining the trained signature integrity recognition model.

[0011] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes a signature generation device, including: a first acquisition module, a second acquisition module and a processing module; the first acquisition module is used to obtain a pixel set corresponding to each stroke in a first signature image; the second acquisition module is used to obtain information of each pixel in a first pixel set corresponding to the first stroke; the processing module is used to remove the first stroke from the first signature image based on the information of each pixel in the first pixel set to obtain a second signature image; wherein the second signature image is used to update the signature image in a target database; the target database includes at least one of an optical character recognition font library and a training database of a signature integrity recognition model.

[0012] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.

[0013] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.

[0014] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present application proposes a computer program product, which is stored in a storage medium and implements the method described in the first aspect when the computer program product is executed by at least one processor.

[0015] The present application proposes a signature generation method, device, electronic device, storage medium and program product, which removes the first stroke from the first signature image based on the information of each pixel in the first pixel set corresponding to the first stroke to obtain a second signature image, which can improve the efficiency of generating incomplete signatures and reduce the difficulty of generating incomplete signatures, so that the target database obtained by updating the incomplete signature generated by the present application can improve the accuracy of optical character recognition technology in recognizing signature characters and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flow chart of the signature generation method provided in the embodiment of the present application;

[0017] Figure 2 This is a flow chart of step S103 provided in an embodiment of the present application;

[0018] Figure 3 is a schematic diagram of a process for obtaining a pixel set provided in an embodiment of the present application;

[0019] Figure 4 This is a schematic diagram of the structure of the signature generation device provided in an embodiment of the present application;

[0020] Figure 5 This is a hardware structure diagram of an electronic device provided in an embodiment of the present application;

[0021] Figure 6 This is another hardware structure diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0023] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0025] In the field of financial technology, regardless of the signature recognition scenario, a signature database with a rich set of positive and negative samples is often required to ensure the effectiveness of OCR technology or signature integrity recognition models. However, the samples in current signature databases are mostly historical signature data. Because incomplete signatures are a risk factor for default, they are inherently rare and difficult to collect in historical signature data. This means that there are relatively few negative samples in current signature databases, resulting in poor accuracy in both OCR technology and signature integrity recognition models for identifying incomplete signatures.

[0026] Based on this, embodiments of the present application provide a signature generation method, apparatus, electronic device, storage medium, and program product to improve the efficiency and reduce the difficulty of generating incomplete signatures. This allows the target database updated based on the incomplete signatures generated by the present application to improve the accuracy of optical character recognition technology in recognizing signature characters and / or the accuracy of signature integrity recognition models in recognizing incomplete signatures. This will be specifically illustrated through the following embodiments, first describing the signature generation method in the embodiments of the present application.

[0027] The signature generation method provided in the embodiments of the present application can be applied to electronic devices or software of electronic devices, and the electronic devices can be terminals or servers. In some embodiments, the terminal can be a smartphone, tablet computer, laptop computer, desktop computer, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the signature generation method, etc., but is not limited to the above forms.

[0028] 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, and the like. 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, and the like 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 via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0029] Figure 1 This is an optional flowchart of the signature generation method provided in the embodiment of the present application. Figure 1 The signature generation method in the embodiment may include but is not limited to steps S101 to S103.

[0030] Step S101: Obtain pixel sets corresponding to each stroke in the first signature image;

[0031] Optionally, the first signature image can be obtained by photographing the complete signature signed by the user, or by extracting the complete signature image from historical signature data; when classified according to color channel attributes, the first signature image can be any type of binary image, grayscale image, red, green and blue three-channel (Red Green Blue, RGB) image and red, green and blue transparency four-channel (Red Green Blue Alpha, RGBA) image.

[0032] In actual implementation, the first signature image can be input into the trained stroke segmentation model to obtain the information of each stroke in the first signature image. Further, based on the information of each stroke, the pixels corresponding to each stroke can be extracted to obtain the pixel sets corresponding to each stroke. The region growing algorithm can also be used to group the target pixels based on the similarity between the target pixels in the first signature image to obtain the pixel sets corresponding to the strokes in the first signature image. The specific implementation can be found in the relevant description below and will not be described here.

[0033] Step S102: Obtain information of each pixel in the first pixel set corresponding to the first stroke;

[0034] Optionally, the first stroke may be any one stroke in the first signature image; or may be any multiple strokes in the first signature image.

[0035] In the case where the first stroke is any stroke in the first signature image, the embodiment of the present application can remove the stroke from the first signature image based on information of each pixel in the pixel set corresponding to the stroke to obtain a second signature image missing one stroke.

[0036] In the case where the first stroke is any multiple strokes in the first signature image, the embodiment of the present application can remove the multiple strokes from the first signature image based on information of each pixel in the pixel set corresponding to the multiple strokes, thereby obtaining a second signature image lacking the multiple strokes.

[0037] Step S103: Based on information of each pixel in the first pixel set, the first stroke is removed from the first signature image to obtain a second signature image; wherein the second signature image is used to update the signature image in the target database; the target database includes at least one of an optical character recognition word library and a training database of a signature integrity recognition model.

[0038] Optionally, the information of each pixel includes at least one of a pixel value, a coordinate value, and transparency of each pixel.

[0039] In actual implementation, the first signature image can be cropped based on the coordinate values of each pixel in the first pixel set corresponding to the first stroke to remove the first stroke from the first signature image to obtain a second signature image; the first stroke can also be removed from the first signature image by setting the transparency of each pixel in the first pixel set corresponding to the first stroke to 0 to obtain a second signature image; the first stroke can also be removed from the first signature image by changing the pixel value of each pixel in the first pixel set corresponding to the first stroke to the background pixel value of the first signature image. The specific implementation can be found in the relevant description below and is not described here.

[0040] In steps S101 to S103 shown in the embodiment of the present application, based on the information of each pixel in the first pixel set corresponding to the first stroke, the first stroke is removed from the first signature image to obtain a second signature image, which can improve the efficiency of generating incomplete signatures and reduce the difficulty of generating incomplete signatures, so that the target database obtained by updating the incomplete signature generated by the present application can improve the accuracy of optical character recognition technology in recognizing signature characters and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures.

[0041] See also Figure 2 In step S103, based on the information of each pixel in the first pixel set, the first stroke is removed from the first signature image to obtain the second signature image, which may include but is not limited to:

[0042] Step S201: Obtain background pixel values of the first signature image;

[0043] Step S202: changing the pixel value of each pixel in the first pixel set to a background pixel value to obtain a second signature image.

[0044] In actual implementation, when the user signs on a preset signature template, the background pixel value of the first signature image can be obtained by obtaining the preset value of the background pixel of the pre-stored preset signature template; when the user signs on a non-preset signature template, the background pixel value of the first signature image can be obtained by performing background pixel analysis on the first signature image.

[0045] Furthermore, the values of each pixel in the pixel set corresponding to other strokes in the first signature image can be kept unchanged, and only the pixel value of each pixel in the first pixel set corresponding to the first stroke can be changed to the background pixel value, so that the first stroke is hidden in the first signature image while the display effect of other strokes in the first signature image remains unchanged, and a second signature image is obtained in which the first stroke is missing compared to the first signature image.

[0046] The embodiment of the present application obtains the background pixel value of the first signature image and changes the pixel value of each pixel in the first pixel set to the background pixel value to obtain the second signature image, which can improve the efficiency of generating incomplete signatures and reduce the difficulty of generating incomplete signatures, so that the target database obtained by updating the incomplete signature generated by the present application can improve the accuracy of optical character recognition technology in recognizing signature characters and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures.

[0047] In some embodiments, the above step S101: obtaining pixel sets corresponding to respective strokes in the first signature image includes:

[0048] Obtaining target pixels in the first signature image whose pixel values are within a target range; the target range is determined based on color channel attributes and background pixel values of the first signature image;

[0049] The region growing algorithm is used to group target pixels based on the similarity between them to obtain a pixel set.

[0050] Optionally, when the color channel attributes of the first signature image indicate that the first signature image is a binary image and the background pixel values of the first signature image are 0, the target range can be determined as pixel values equal to 255, and pixels in the first signature image with pixel values equal to 255 can be determined as target pixels. When the color channel attributes of the first signature image indicate that the first signature image is an RGB image and the background pixel values of each of the R, G, and B channels of the first signature image are all 255, the target range can be determined as pixel values of each of the R, G, and B channels within the range of [0, 255), and pixels in the first signature image with pixel values of each of the R, G, and B channels within the range of [0, 255) can be determined as target pixels.

[0051] In actual implementation, the i-th pixel can be first selected from each target pixel according to the pixel arrangement order of the first signature image. Then, for the selected i-th pixel, a region growing algorithm can be used to group the i-th pixel and the j-th pixel into the same group based on the similarity between the i-th pixel and other pixels in the target pixels. The j-th pixel is a pixel among the other pixels whose similarity to the i-th pixel is greater than a preset value. Then, i can be updated to i+1, and the step of selecting the i-th pixel from each target pixel is returned to execute until all target pixels are grouped to obtain a pixel set. Optionally, the preset value can be determined through experimental calibration to define the degree of similarity between the i-th pixel and the j-th pixel.

[0052] In order to further improve the efficiency of grouping each target pixel, it is possible to determine whether to execute the above-mentioned region growing algorithm for the i-th pixel based on the access status of the i-th pixel, and to divide the i-th pixel and the j-th pixel into the same group based on the similarity between the i-th pixel and other pixels in each target pixel, so as to improve the efficiency of grouping each target pixel. The specific implementation can be found in the relevant description below and is not described here.

[0053] The embodiment of the present application obtains each target pixel in the first signature image whose pixel values are within the target range, and uses a region growing algorithm to group each target pixel based on the similarity between the target pixels. This can accurately determine the pixel sets corresponding to each stroke in the first signature image, thereby improving the effect of generating an incomplete signature based on the pixel sets corresponding to each stroke. The target database obtained by updating the incomplete signature generated by the present application can improve the accuracy of optical character recognition technology in recognizing signature characters, and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures.

[0054] In some embodiments, the region growing algorithm is used to group target pixels based on similarities between target pixels to obtain a pixel set, including:

[0055] According to the pixel arrangement order of the first signature image, select the i-th pixel from each target pixel;

[0056] When the access state of the i-th pixel is the pending access state, the i-th pixel and the j-th pixel are divided into the same group based on the similarity between the i-th pixel and other pixels in each target pixel using a region growing algorithm; wherein the j-th pixel is a pixel among other pixels whose similarity with the i-th pixel is greater than a preset value; the access state of the i-th pixel and the j-th pixel is updated to the visited state; i is updated to i+1, and the step of selecting the i-th pixel from each target pixel is returned to be executed until all target pixels are grouped to obtain a pixel set;

[0057] When the access state of the i-th pixel is the visited state, i is updated to i+1, and the step of selecting the i-th pixel from each target pixel is returned to be executed.

[0058] Optionally, the pixels of the first signature image may be arranged in a row order or a column order. In actual implementation, the i-th pixel may be selected from the target pixels of the first signature image by traversing the target pixels in each row one by one according to the row order of the first signature image; or the i-th pixel may be selected from the target pixels of the first signature image by traversing the target pixels in each column one by one according to the column order of the first signature image.

[0059] Optionally, the initial access state of each target pixel in the first signature image is a state to be visited. For the i-th pixel, the access state of the i-th pixel and the j-th pixel can be updated to a visited state when executing the step of using a region growing algorithm to divide the i-th pixel and the j-th pixel into the same group based on the similarity between the i-th pixel and other pixels in each target pixel. In actual implementation, a visited matrix of the same size as the first signature image can be created, and based on the execution of the above steps, the visit matrix values corresponding to the i-th pixel and the j-th pixel can be updated in real time. In this way, the access state of each target pixel can be determined by obtaining the visit matrix value corresponding to each target pixel. Taking the i-th pixel as an example, the access matrix value corresponding to the i-th pixel can be true or false, true represents that the access state of the i-th pixel is a visited state, and false represents that the access state of the i-th pixel is a state to be visited.

[0060] Optionally, for the first target pixel selected according to the pixel arrangement order of the first signature image, before grouping the first target pixel, a pixel set (regions) corresponding to the first target pixel can be created, and starting from the first target pixel, other target pixels whose similarity with the first target pixel is higher than a preset value are filled into the pixel set corresponding to the first target pixel through a region growing algorithm (for example, a boundary tracking and segmentation (BTS) method) until the pixel set corresponding to the first target pixel is filled; then, for the next target pixel, a pixel set corresponding to the next target pixel is created, and starting from the next target pixel, other target pixels whose similarity with the next target pixel is higher than a preset value are filled into the pixel set corresponding to the next target pixel through a region growing algorithm until the pixel set corresponding to the next target pixel is filled; the above steps are repeated until the target pixels in the first signature image are grouped, and the pixel sets corresponding to the strokes in the first signature image are obtained.

[0061] See also Figure 3 The signature generation method provided in the embodiment of the present application may also include, but is not limited to, the following steps:

[0062] Step S301: Acquire target pixels in the first signature image whose pixel values are within a target range;

[0063] Step S302: selecting the i-th pixel from each target pixel according to the pixel arrangement order of the first signature image;

[0064] Step S303: determining whether the access state of the i-th pixel is a pending access state;

[0065] If the access state of the i-th pixel is the pending access state, step S304 is executed: using a region growing algorithm, based on the similarity between the i-th pixel and other pixels in each target pixel, the i-th pixel and the j-th pixel are divided into the same group; wherein the j-th pixel is a pixel among the other pixels whose similarity with the i-th pixel is greater than a preset value;

[0066] Step S305: updating the access status of the i-th pixel and the j-th pixel to the visited status;

[0067] Step S306: determining whether all target pixels in the first signature image have been grouped;

[0068] If all target pixels have not been grouped, execute step S307: update i to i+1, and return to step S302;

[0069] If all target pixels have been grouped, the process ends;

[0070] When the access state of the i-th pixel is the accessed state, step S306 is executed.

[0071] The specific implementation process of the above steps S301 to S307 is described in the above embodiment and will not be repeated here.

[0072] In the embodiment of the present application, when selecting the i-th pixel from each target pixel, by judging the access status of the i-th pixel, it is determined whether to execute the step of using the region growing algorithm to divide the i-th pixel and the j-th pixel into the same group based on the similarity between the i-th pixel and other pixels in each target pixel. This can improve the efficiency and accuracy of determining the pixel sets corresponding to each stroke in the first signature image, and further improve the efficiency and effect of generating an incomplete signature based on the pixel sets corresponding to each stroke, so that the target database obtained by updating the incomplete signature generated based on the present application can improve the accuracy of optical character recognition technology in recognizing signature characters, and / or the accuracy of signature integrity recognition model in recognizing incomplete signatures.

[0073] In some embodiments, after the above step S101: obtaining pixel sets corresponding to respective strokes in the first signature image, the signature generation method further includes:

[0074] Obtaining information of each pixel in a second pixel set corresponding to a second stroke;

[0075] Based on information of each pixel in the second pixel set, the second stroke is removed from the first signature image to obtain a third signature image.

[0076] Optionally, the second stroke is any one stroke in the first signature image; or any multiple strokes in the first signature image; the second stroke may be completely different from or partially different from the first stroke.

[0077] In addition, based on the information of each pixel in the second pixel set, the second stroke is removed from the first signature image to obtain the third signature image. The specific implementation process can refer to the specific implementation process of the above step S103 and will not be repeated here.

[0078] In the embodiment of the present application, based on the above-mentioned method of removing the first stroke from the first signature image based on the information of each pixel in the first pixel set corresponding to the first stroke to obtain the second signature image, the second stroke can be further removed from the first signature image based on the information of each pixel in the second pixel set to obtain a third signature image. This is equivalent to performing multiple stroke removal operations on the first signature image to obtain different stroke-missing signature images; since the strokes in the first signature image are randomly removed each time, the repetition rate of the removed strokes is low. Such an operation can greatly increase the number of stroke-missing signature images or incomplete signature images.

[0079] In one embodiment, after obtaining the second signature image in step S103, the signature generation method provided in the embodiment of the present application further includes:

[0080] Obtaining a target signature image whose signature integrity is to be identified;

[0081] The target signature image is input into the trained signature integrity recognition model to obtain the signature integrity recognition result of the target signature image.

[0082] Optionally, the target signature image is obtained by photographing the target signature whose signature integrity is to be identified; similar to the above-mentioned first signature image, when classified according to color channel attributes, the target signature image can also be any type of binary image, grayscale image, red, green, and blue three-channel (Red Green Blue, RGB) image, and red, green, and blue four-channel transparency (Red Green Blue Alpha, RGBA) image.

[0083] In actual implementation, the signature integrity recognition result of the target signature image can be that the target signature corresponding to the target signature image is complete or incomplete; it can also be that the target signature corresponding to the target signature image is complete, or the target signature corresponding to the target signature image is incomplete and there is an explanation of missing strokes corresponding to the target signature.

[0084] In one embodiment, before inputting the target signature image into the trained signature integrity recognition model to obtain a signature integrity recognition result of the target signature image, the signature generation method further includes:

[0085] Obtaining a training data set, wherein the training data set includes a plurality of training samples, each training sample including a second signature image and a signature integrity label result corresponding to the second signature image;

[0086] The preset signature integrity recognition model is trained using the training data set until the training stop condition is met, thereby obtaining a trained signature integrity recognition model.

[0087] In actual implementation, when the number of second signature images is limited, each training sample can also include the above-mentioned third signature image and the signature integrity label result corresponding to the third signature image. In this way, the training effect of the signature integrity recognition model can be improved by increasing the training samples in the training data set.

[0088] Optionally, the aforementioned method of using the training data set to train a preset signature integrity recognition model until a training stop condition is met, thereby obtaining a trained signature integrity recognition model, including:

[0089] For each training sample, perform the following steps:

[0090] Inputting the training sample into a preset signature integrity recognition model, performing signature integrity recognition on the second signature image using the preset signature integrity recognition model, and obtaining a signature integrity recognition result of the second signature image;

[0091] Determining a loss function value of a preset signature integrity recognition model according to the signature integrity recognition result of the second signature image and the signature integrity label result corresponding to the second signature image;

[0092] When the loss function value does not meet the training stop condition, the model parameters of the preset signature integrity recognition model are adjusted to obtain an updated signature integrity recognition model, and the updated signature integrity recognition model is trained using the next training sample until the training stop condition is met, thereby obtaining a trained signature integrity recognition model.

[0093] It is worth mentioning that, taking the signature integrity recognition model as an example, the Resnet model trained based on the training samples in the training database updated based on the stroke-missing signature image generated in the embodiment of the present application can achieve an accuracy rate of 77% in recognizing signature integrity.

[0094] In the embodiment of the present application, based on the information of each pixel in the first pixel set corresponding to the first stroke, the first stroke is removed from the first signature image to obtain the second signature image, and then the signature integrity recognition model is further trained based on the second signature image and the signature integrity recognition result corresponding to the second signature image, thereby effectively increasing the number of negative samples in the training database of the signature integrity recognition model, thereby improving the accuracy of the signature integrity recognition model in recognizing incomplete signatures, so that when the target signature image to be identified for signature integrity is input into the trained signature integrity recognition model, an accurate recognition result of whether the target signature corresponding to the target signature image is complete can be obtained.

[0095] In one embodiment, after obtaining the second signature image in step S103, the signature generation method provided in the embodiment of the present application further includes:

[0096] Performing character splitting on the second signature image to obtain characters corresponding to the second signature image;

[0097] Based on the characters corresponding to the second signature image, the optical character recognition word library is updated, so that each character in the target signature can be accurately recognized using optical character recognition technology based on the updated optical character recognition word library.

[0098] In the embodiment of the present application, based on the information of each pixel in the first pixel set corresponding to the first stroke, the first stroke is removed from the first signature image to obtain the second signature image, and then the second signature image is further split into characters to obtain the characters corresponding to the second signature image. Based on the characters corresponding to the second signature image, the optical character recognition library is updated, so that in the process of actually using optical character recognition technology to recognize signature characters, each character in the signature can be accurately recognized based on the updated optical character recognition library.

[0099] In a specific embodiment, the signature generation method provided in the embodiment of the present application may also include, but is not limited to, the following steps:

[0100] Step 1: Obtain a first signature image and convert the first signature image into a binary image: for example, a black background (pixel value 0) and white text (pixel value 255);

[0101] Step 2: Create a visited matrix of the same size as the first signature image. The visited matrix stores the visit status value of each pixel in the first signature image, which is used to determine whether each pixel in the first signature image has been visited.

[0102] Step 3: Create a pixel set list (regions_list) for storing pixel sets corresponding to each stroke in the first signature image;

[0103] Step 4: traverse each row of pixels in the first signature image row by row, select the current pixel, and perform the following operations on the current pixel:

[0104] ① Determine whether the visited value of the current pixel is True and / or whether the (img) value of the current pixel is 0; if the visited value of the current pixel is True and / or the pixel (img) value is 0, skip the subsequent steps and continue to select the next pixel; wherein, the img value of the current pixel is 0, indicating that the current pixel is a background pixel of the first signature image;

[0105] ② Since strokes at the pixel level (whether binary, grayscale, RGB, or RGBA) must correspond to a connected region, when the visited value of the current pixel is False and / or the pixel (img) value is greater than 0, the current pixel is the target pixel mentioned above. Based on the current pixel, a pre-created pixel set (such as the BTS method) can be filled using a region growing algorithm to obtain a set of connected pixels; and the visited values of the pixels filled in the pixel set are updated to True;

[0106] ③Add the filled regions to regions_list;

[0107] Step 5: In regions_list, based on the experience of invalid signatures, at least one region can be randomly selected, and the pixel value of each pixel in the region can be changed from 255 to 0 to remove the strokes corresponding to the region from the first signature image (also known as erasing or deleting), thereby obtaining a second signature image;

[0108] Step 6: Save the second signature image to a new image file, thereby generating a signature image with missing strokes.

[0109] It is worth mentioning that when there are fewer signature images with missing strokes generated, the above step 5 can be performed multiple times for the first signature image. Since the strokes in the first signature image are randomly removed each time the above step 5 is performed, the stroke removal repetition rate is low, which can greatly increase the number of signature images with missing strokes.

[0110] In addition, since each stroke at the pixel level (whether it is a binary image, grayscale image, RGB image, or RGBA image) must correspond to a connected area, for each stroke, the pixel set obtained based on step 4 is a set of connected pixels; based on the above connectivity characteristics, it is converted into a connected area deletion task, thereby realizing batch automated operation.

[0111] The embodiment of the present application is based on the characteristic that a stroke must correspond to a connected region at the pixel level (whether it is a binary image, grayscale image, RGB image, or RGBA image). By utilizing a region growing algorithm, the target pixel and other pixels whose similarity with the target pixel is higher than a preset value are filled into a pixel set, which can improve the accuracy of determining the pixel sets corresponding to each stroke in the first signature image; further, the task of removing the first stroke in the first signature image is converted into the task of deleting the connected region in the first signature image. When the first signature image is a binary image and the background pixel value of the first signature image is 0, at least one pixel set is randomly selected and the pixel value of each pixel in the pixel set is changed from 255 to 0, so that at least one stroke is removed from the first signature image to obtain a second signature. The invention can improve the efficiency of generating incomplete signatures based on the pixel sets corresponding to each stroke, and can ensure that there are no traces of stroke erasure in the second signature image obtained; further, when there are fewer stroke-missing signature images generated, the above-mentioned stroke removal steps can be automatically performed in batches for the first signature image. Since the strokes in the first signature image are randomly removed each time, the stroke removal repetition rate is low, so a large number of stroke-missing signature images can be generated; in summary, the target database obtained by updating the incomplete signatures generated by the present application can improve the accuracy of identifying signature characters using optical character recognition technology in the field of financial technology, and / or the accuracy of identifying incomplete signatures of leasing business documents using signature integrity recognition models, so as to ensure that the signatures of leasing business documents are legally effective.

[0112] See also Figure 4 The embodiment of the present application further provides a signature generation device 400 that can implement the above-mentioned signature generation method. The device includes: a first acquisition module 401, a second acquisition module 402 and a processing module 403.

[0113] The first acquisition module 401 is used to acquire pixel sets corresponding to the strokes in the first signature image.

[0114] The second acquisition module 402 is used to obtain information of each pixel in the first pixel set corresponding to the first stroke;

[0115] The processing module 403 is used to remove the first stroke from the first signature image based on information of each pixel in the first pixel set to obtain a second signature image; wherein the second signature image is used to update the signature image in the target database; the target database includes at least one of an optical character recognition word library and a training database of a signature integrity recognition model.

[0116] Optionally, the information of each pixel includes a pixel value of each pixel. In one embodiment, the processing module 403 includes a third acquisition module and a first execution module; the third acquisition module is used to obtain the background pixel value of the first signature image; and the first execution module is used to change the pixel value of each pixel in the first pixel set to the background pixel value to obtain the second signature image.

[0117] In one embodiment, the first acquisition module 401 includes a first acquisition submodule and a second execution module; the first acquisition submodule is used to acquire each target pixel in the first signature image whose pixel value is within a target range; the target range is determined based on the color channel attributes and background pixel values of the first signature image; the second execution module is used to use a region growing algorithm to group each target pixel based on the similarity between each target pixel to obtain a pixel set.

[0118] In one embodiment, the second execution module is further configured to select an i-th pixel from each target pixel according to the pixel arrangement order of the first signature image; when the access state of the i-th pixel is a to-be-accessed state, using a region growing algorithm, based on the similarity between the i-th pixel and other pixels in each target pixel, divide the i-th pixel and the j-th pixel into the same group; wherein the j-th pixel is a pixel among other pixels whose similarity to the i-th pixel is greater than a preset value; update the access state of the i-th pixel and the j-th pixel to a visited state; update i to i+1, and return to the step of selecting the i-th pixel from each target pixel until the target pixels are grouped to obtain a pixel set; when the access state of the i-th pixel is a visited state, update i to i+1, and return to the step of selecting the i-th pixel from each target pixel.

[0119] In one embodiment, the second acquisition module 402 is also used to obtain information of each pixel in the second pixel set corresponding to the second stroke; the processing module 403 is also used to remove the second stroke from the first signature image based on the information of each pixel in the second pixel set to obtain a third signature image.

[0120] In one embodiment, the above-mentioned signature generation device 400 also includes a fourth acquisition module and a third execution module; the fourth acquisition module is used to obtain the target signature image whose signature integrity is to be identified; the third execution module is used to input the target signature image into the trained signature integrity recognition model to obtain the signature integrity recognition result of the target signature image.

[0121] In one embodiment, the signature generation device 400 further includes a fifth acquisition module and a fourth execution module; the fifth acquisition module is used to acquire a training data set, wherein the training data set includes multiple training samples, each training sample includes a second signature image and a signature integrity label result corresponding to the second signature image; the fourth execution module is used to use the training data set to train a preset signature integrity recognition model until a training stop condition is met, thereby obtaining a trained signature integrity recognition model.

[0122] The specific implementation of the signature generation device is basically the same as the specific embodiment of the above-mentioned signature generation method, and will not be repeated here.

[0123] See also Figure 5 The present application also provides an electronic device 500, which includes a memory 501 and a processor 502. The memory 501 stores a computer program, and the processor 502 implements the above-mentioned signature generation method when executing the computer program. The electronic device 500 can be any smart terminal, including a tablet computer and an in-vehicle computer.

[0124] See also Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0125] The processor 601 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0126] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called by the processor 601 to execute the signature generation method of the embodiments of this application.

[0127] Input / output interface 603, used to implement information input and output;

[0128] Communication interface 604, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0129] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );

[0130] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .

[0131] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned signature generation method is implemented.

[0132] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0133] An embodiment of the present application also provides a computer program product, which is stored in a storage medium and implements the above-mentioned signature generation method when the computer program product is executed by at least one processor.

[0134] The signature generation method, device, electronic device, storage medium and program product provided in the embodiments of the present application can accurately determine the pixel sets corresponding to each stroke in the first signature image by obtaining each target pixel whose pixel value is within a target range in the first signature image, and using a region growing algorithm to group each target pixel based on the similarity between each target pixel. Further, by obtaining information of each pixel in the first pixel set corresponding to the first stroke and changing the pixel value of each pixel in the first pixel set to a background pixel value, the first stroke is removed from the first signature image to obtain a second signature image. This can improve the efficiency and effect of generating incomplete signatures based on the pixel sets corresponding to each stroke, so that the target database obtained by updating the incomplete signature generated by the present application can improve the accuracy of recognizing signature characters using optical character recognition technology in the field of financial technology, and / or the accuracy of recognizing incomplete signatures of leasing business documents using a signature integrity recognition model, so as to ensure that the signatures of leasing business documents are legally effective.

[0135] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0136] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0138] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0139] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0140] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0141] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods, such as 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.

[0142] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.

[0145] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A signature generation method, characterized in that: include: Obtaining pixel sets corresponding to respective strokes in the first signature image; Obtaining information of each pixel in a first pixel set corresponding to the first stroke; Based on information of each pixel in the first pixel set, the first stroke is removed from the first signature image to obtain a second signature image; wherein the second signature image is used to update the signature image in a target database; the target database includes at least one of an optical character recognition word library and a training database of a signature integrity recognition model.

2. The signature generation method according to claim 1, wherein: The information of each pixel includes a pixel value of each pixel; The removing the first stroke from the first signature image based on information of each pixel in the first pixel set to obtain a second signature image includes: Obtaining background pixel values of the first signature image; The pixel value of each pixel in the first pixel set is changed to the background pixel value to obtain the second signature image.

3. The signature generation method according to claim 1, wherein: The step of obtaining pixel sets corresponding to respective strokes in the first signature image includes: Acquire target pixels in the first signature image whose pixel values are within a target range; the target range is determined based on color channel attributes and background pixel values of the first signature image; The target pixels are grouped based on the similarity between the target pixels using a region growing algorithm to obtain the pixel set.

4. The signature generation method according to claim 3, wherein: The method of using a region growing algorithm to group target pixels based on similarities between target pixels to obtain the pixel set includes: According to the pixel arrangement order of the first signature image, select the i-th pixel from each target pixel; i is a positive integer; When the access state of the i-th pixel is the pending access state, the i-th pixel and the j-th pixel are divided into the same group based on the similarity between the i-th pixel and other pixels in each target pixel using the region growing algorithm; wherein the j-th pixel is a pixel among the other pixels whose similarity with the i-th pixel is greater than a preset value; the access state of the i-th pixel and the j-th pixel is updated to the visited state; i is updated to i+1, and the step of selecting the i-th pixel from each target pixel is returned to be executed until each target pixel is grouped to obtain the pixel set; When the access state of the i-th pixel is the visited state, i is updated to i+1, and the step of selecting the i-th pixel from each target pixel is returned to be executed.

5. The signature generation method according to claim 1, wherein: After obtaining pixel sets corresponding to respective strokes in the first signature image, the signature generation method further includes: Obtaining information of each pixel in a second pixel set corresponding to a second stroke; Based on information of each pixel in the second pixel set, the second stroke is removed from the first signature image to obtain a third signature image.

6. The signature generation method according to claim 1, wherein: After obtaining the second signature image, the signature generation method further includes: Obtaining a target signature image whose signature integrity is to be identified; Inputting the target signature image into the trained signature integrity recognition model to obtain a signature integrity recognition result of the target signature image; Before inputting the target signature image into the trained signature integrity recognition model to obtain a signature integrity recognition result of the target signature image, the signature generation method further includes: Acquire a training data set, wherein the training data set includes a plurality of training samples, each of the training samples includes the second signature image and a signature integrity label result corresponding to the second signature image; The preset signature integrity recognition model is trained using the training data set until a training stop condition is met, thereby obtaining the trained signature integrity recognition model.

7. A signature generation device, characterized in that: include: A first acquisition module, a second acquisition module and a processing module; The first acquisition module is used to acquire pixel sets corresponding to each stroke in the first signature image; The second acquisition module is used to acquire information of each pixel in the first pixel set corresponding to the first stroke; The processing module is used to remove the first stroke from the first signature image based on information of each pixel in the first pixel set to obtain a second signature image; wherein the second signature image is used to update the signature image in the target database; the target database includes at least one of an optical character recognition word library and a training database of a signature integrity recognition model.

8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the signature generation method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the signature generation method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product is stored in a storage medium, and when the computer program product is executed by at least one processor, the signature generation method according to any one of claims 1 to 6 is implemented.