Document verification method, device, computer equipment and medium based on image recognition
By segmenting and identifying the ID image, the problem of forging ID numbers bypassing verification in traditional ID verification is solved, and higher verification accuracy is achieved.
Patent Information
- Application Number
- CN202010574904.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-22
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-06-22
AI Technical Summary
In traditional document verification methods, when anti-counterfeiting verification is performed through document numbers, there is a risk that the forged document number is bypassed by the system verification, resulting in low accuracy of the anti-counterfeiting verification.
Using the ID verification method based on image recognition, the ID image to be verified is obtained, and the verification result is finally generated by obtaining the image of the ID area to be verified.
Through image segmentation and identification processing, the accuracy of document verification is improved and the risk of forging document verification is reduced.
Smart Images

Figure CN111709413B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a document verification method, apparatus, computer equipment and medium based on image recognition. Background Art
[0002] With the rapid development of economy and the continuous improvement of living standards, buying insurance is not only a way of financial management, but also an effective way to avoid risks and establish a personal protection system. Before issuing an insurance policy, the system needs to conduct anti-counterfeiting verification on the object information of the insured.
[0003] In a traditional manner, the server verifies the authenticity of the obtained document image by performing anti-counterfeiting verification on the document number in the obtained document image.
[0004] However, for users who are aware of the rules or characteristics of ID number generation, they can bypass the system verification by PSing the ID number, making the accuracy of anti-counterfeiting verification low. Summary of the invention
[0005] Based on this, it is necessary to provide a document verification method, device, computer equipment and medium based on image recognition that can improve the accuracy of anti-counterfeiting verification in order to address the above technical problems.
[0006] A document verification method based on image recognition, the method comprising:
[0007] Obtain the image of the document to be verified;
[0008] Segment the image of the certificate to be verified to obtain multiple certificate area images;
[0009] Obtaining position information of each document area image on the document image to be verified, and determining the area type to which each document area image belongs according to the obtained position information;
[0010] Determine the processing method corresponding to each document area image according to the area type to which each document area image belongs, and perform recognition processing on each document area image respectively through each processing method to obtain the recognition processing result of each document area image;
[0011] A verification result of the document image to be verified is generated according to the recognition processing results of the multiple document area images of the document image to be verified.
[0012] In one embodiment, according to the region type to which each document region image belongs, a processing method corresponding to each document region image is determined, and each document region image is respectively recognized and processed by each processing method to obtain a recognition processing result of each document region image, including:
[0013] Performing text recognition on each document area image to obtain a first recognition processing result corresponding to each document area image;
[0014] Performing image recognition on each document region image to obtain a second recognition processing result of each document region image;
[0015] The first recognition processing result and the second recognition processing result of each document area image are counted to obtain the recognition processing result of each document area image.
[0016] In one embodiment, text recognition is performed on each document region image to obtain a first recognition processing result corresponding to each document region image, including:
[0017] Perform text recognition on each document area image to obtain the text content in each document area image;
[0018] According to the region type of each certificate region image, respectively obtain the generation rules of the text content in each certificate region image;
[0019] It is determined whether the text contents obtained by the text recognition conform to the generation rule of the text contents in the document area image, so as to obtain the first recognition processing result corresponding to each document area image.
[0020] In one embodiment, performing image recognition on each document region image to obtain a second recognition processing result of each document region image includes:
[0021] Perform image recognition on each document area image to obtain image features of text content in each document area image;
[0022] A second recognition processing result corresponding to each document area image is obtained according to each image feature.
[0023] In one embodiment, before segmenting the document image to be verified to obtain a plurality of document region images, the method further includes:
[0024] Identify the type of the document to be verified and obtain the type of the document to be verified;
[0025] The document image to be verified is segmented to obtain multiple document area images, including:
[0026] The image of the document to be verified is segmented by using a pre-trained image segmentation model corresponding to the document type to obtain multiple segmented document area images.
[0027] In one embodiment, before segmenting the document image to be verified to obtain multiple region images, the method further includes:
[0028] Adjusting the acquired document image to be verified to a preset size to obtain a document image to be verified that meets the preset size requirement;
[0029] The document image to be verified is segmented to obtain multiple document area images, including:
[0030] The document image to be verified that meets the preset size requirements is segmented to obtain multiple document area images.
[0031] In one embodiment, each document region image is identified and processed by various processing methods, including:
[0032] By using the processing method corresponding to each document area image, the identification processing of each document area image is performed in parallel;
[0033] At least one of the certificate image to be verified, each certificate area image, position information of each certificate area image on the certificate image to be verified, the area type to which each certificate area image belongs, the recognition processing result of each certificate area image, and the verification result of the certificate image to be verified is stored in the blockchain.
[0034] A document verification device based on image recognition, the device comprising:
[0035] The module for acquiring the image of the certificate to be verified is used to acquire the image of the certificate to be verified;
[0036] A segmentation processing module is used to segment the image of the certificate to be verified to obtain multiple certificate area images;
[0037] The region type determination module is used to obtain the position information of each document region image on the document image to be verified, and determine the region type to which each document region image belongs according to the obtained position information;
[0038] The recognition processing module is used to determine the processing method corresponding to each certificate area image according to the area type to which each certificate area image belongs, and to perform recognition processing on each certificate area image respectively through each processing method to obtain the recognition processing result of each certificate area image;
[0039] The verification result generating module is used to generate the verification result of the document image to be verified according to the recognition processing results of multiple document area images of the document image to be verified.
[0040] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0041] A computer-readable storage medium stores a computer program, which implements the steps of any of the above methods when executed by a processor.
[0042] The above-mentioned document verification method, device, computer equipment and storage medium based on image recognition obtain the document image to be verified, and segment the document image to be verified to obtain multiple document area images, then obtain the position information of each document area image on the document image to be verified, and determine the area type of each document area image according to the obtained position information, and further determine the processing method corresponding to each document area image according to the area type of each document area image, and respectively perform recognition processing on each document area image through each processing method to obtain the recognition processing result of each document area image, and then generate the verification result of the document image to be verified. Therefore, by segmenting the image to be verified into multiple document area images, and then classifying the areas to which they belong, and then obtaining the corresponding processing method for recognition processing, the accuracy of recognition processing can be improved, and then the accuracy of verification can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is an application scenario diagram of a document verification method based on image recognition in one embodiment;
[0044] Figure 2 A schematic diagram of a flow chart of a document verification method based on image recognition in one embodiment;
[0045] Figure 3 A schematic diagram of the structure of a document image to be identified in one embodiment;
[0046] Figure 4 is a structural block diagram of a document verification device based on image recognition in one embodiment;
[0047] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The document verification method based on image recognition provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. In this embodiment, the service terminal 102 collects the image of the document to be verified and uploads it to the server 104. After the server 104 obtains the image of the document to be verified, it segments the image of the document to be verified to obtain multiple document area images. Further, the server 104 obtains the position information of each document area image on the document image to be verified, and determines the area type to which each document area image belongs according to the obtained position information. Then the server 104 determines the processing method corresponding to each document area image according to the area type to which each document area image belongs, and performs recognition processing on each document area image respectively through each processing method to obtain the recognition processing result of each document area image. Then the server 104 generates the verification result of the document image to be verified according to the recognition processing results of multiple document area images of the document image to be verified. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0050] In one embodiment, Figure 2 As shown in FIG. , a document verification method based on image recognition is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0051] Step S202, obtaining the image of the document to be verified.
[0052] The document image to be verified may refer to a variety of standard images, including but not limited to identity cards, passports, military ID cards, Hong Kong and Macao return permits, Taiwan compatriots ID cards, driver's licenses, etc. In this embodiment, the server may be a photographed image, or various scanned images.
[0053] In this embodiment, the document image to be verified may be an image used for insurance verification. The insured person uploads the corresponding document image to be verified to the server through a corporate or personal terminal to perform insurance verification through the server.
[0054] Step S204, segmenting the document image to be verified to obtain a plurality of document region images.
[0055] The document area image refers to the partial image that constitutes the document image to be verified. Figure 3 For an ID card, the document area image may include a name area image, a gender area image, a date of birth area image, a document type area image, a document number area image, a portrait area image, and the like.
[0056] In this embodiment, the image to be verified may be segmented by an image segmentation model to obtain a plurality of document region images constituting the image to be verified.
[0057] Specifically, the image segmentation model can be a neural network model, an artificial intelligence AI model, etc., which is not limited in this application.
[0058] In this embodiment, various ID images have their own unique ID formats. The server can use ID images of various correct ID formats as training set images and verification set images to train and verify the image segmentation model to obtain a trained and verified image segmentation model.
[0059] Furthermore, the server may input the acquired document image to be verified into a trained and verified image segmentation model to perform identification and segmentation of the document area on the document image to be verified, so as to obtain a plurality of segmented document area images.
[0060] Step S206, obtaining the position information of each certificate area image on the certificate image to be verified, and determining the area type to which each certificate area image belongs according to the obtained position information.
[0061] As mentioned above, various ID images have unique ID formats, such as name, date of birth, ID number, etc., which all have corresponding fixed positions on the ID image.
[0062] In this embodiment, the server can determine the type of each document area image based on the position information of each document area image on the document image to be verified obtained during the segmentation process. Figure 3 Taking the ID card as an example, the ID number area image is at the bottom of the ID image to be verified, and its distance from the bottom edge of the ID image to be detected is fixed. For the name area image, its position in the ID image to be detected is the upper left position, with the upper left vertex as the origin, and its X coordinate and Y coordinate are both the coordinates with the smallest coordinate value.
[0063] Step S208, determining the processing method corresponding to each certificate area image according to the area type to which each certificate area image belongs, and performing recognition processing on each certificate area image respectively through each processing method to obtain the recognition processing result of each certificate area image.
[0064] Among them, the recognition processing method may include processing methods such as text recognition, image recognition or generation rules. Corresponding to different document area images, the corresponding recognition processing methods may be different, which may be single text recognition, image recognition or generation rules, or a recognition processing method composed of two or three of text recognition, image recognition or generation rules. For example, for the name area image, the corresponding recognition processing method may be text recognition plus image recognition, for the portrait area image, the corresponding recognition processing method may be only image recognition, or, for the document number area image, the corresponding recognition processing method may include a combination of text recognition plus number generation rules plus image recognition.
[0065] In this embodiment, the recognition processing result is the result of whether the document area image obtained after the document area image is recognized is true or false.
[0066] Specifically, the server can determine the recognition processing method corresponding to each certificate area image based on the association between each certificate area type and the recognition processing method, and then recognize and process each certificate area image through the determined recognition processing method, and output the corresponding recognition processing result.
[0067] Step S210: generating a verification result of the document image to be verified according to the recognition processing results of the multiple document area images of the document image to be verified.
[0068] Specifically, the server can obtain statistical results by counting the recognition processing results of all area images of the document image to be detected, and then judge the statistical results to generate a verification result of whether the document image to be verified is a real document image or a forged document image, so as to verify the document image to be verified.
[0069] In this embodiment, if the server determines that the recognition processing results of all the document area images of the document image to be verified are true, the server can generate a verification result for detecting that the document image is a real document image. If the server determines that among all the document area images of the document image to be verified, there is at least one document area image whose recognition processing result is false, the server can generate a verification result for detecting that the document image is a forged document image.
[0070] In the above-mentioned document verification method based on image recognition, the document image to be verified is obtained, and the document image to be verified is segmented to obtain multiple document area images, and then the position information of each document area image on the document image to be verified is obtained, and the area type of each document area image is determined according to the obtained position information, and further according to the area type of each document area image, the processing method corresponding to each document area image is determined, and each document area image is recognized and processed by each processing method, and the recognition processing result of each document area image is obtained, and then the verification result of the document image to be verified is generated. Therefore, by segmenting the image to be verified into multiple document area images, and then classifying the areas to which they belong, and then obtaining the corresponding processing method for recognition processing, the accuracy of recognition processing can be improved, and then the accuracy of verification can be improved.
[0071] In one of the embodiments, a processing method corresponding to each certificate area image is determined according to the area type to which each certificate area image belongs, and each certificate area image is recognized and processed by each processing method to obtain a recognition processing result of each certificate area image, which may include: performing text recognition on each certificate area image to obtain a first recognition processing result corresponding to each certificate area image; performing image recognition on each certificate area image to obtain a second recognition processing result of each certificate area image; and statistically calculating the first recognition processing result and the second recognition processing result of each certificate area image to obtain a recognition processing result of each certificate area image.
[0072] The first recognition processing result refers to the text recognition result obtained after performing text recognition on the document area image, and the second recognition processing result refers to the image recognition result obtained after performing image recognition on the document area image. In this embodiment, the first recognition processing result and the second recognition processing result may refer to the result of whether the document area image is true or false.
[0073] In this embodiment, the server may perform text recognition and image recognition on each document region image respectively to obtain a corresponding first recognition processing result and a corresponding second recognition processing result respectively.
[0074] Optionally, the server may perform text recognition and image recognition on each document area image in parallel, or may perform text recognition first and then image recognition, or may perform image recognition first and then text recognition, etc. This application does not impose any restrictions on this.
[0075] Furthermore, the server can determine the final recognition processing result of whether each document area image is true or false by statistically analyzing the first recognition processing result and the second recognition processing result. For example, if both the first recognition processing result and the second recognition processing result are true, then the document area image can be determined to be true; if at least one of the first recognition processing result and the second recognition processing result is false, then the document area image can be determined to be false.
[0076] In this embodiment, the server may perform text recognition and image recognition on the regional image through a neural network model, and may perform text recognition and image recognition on the regional image of each document through a single or neural network model.
[0077] In the above embodiment, text recognition and image recognition are performed on the document area image respectively, and the recognition processing result of the document area image is obtained based on the first recognition processing result and the second recognition processing result. Thus, the recognition processing result is obtained based on the combination of text recognition and image recognition, which can improve the accuracy of the recognition processing.
[0078] In one of the embodiments, text recognition is performed on each certificate area image to obtain a first recognition processing result corresponding to each certificate area image, which may include: performing text recognition on each certificate area image to obtain text content in each certificate area image; obtaining generation rules for text content in each certificate area image according to the area type to which each certificate area image belongs; and determining whether each text content obtained by text recognition conforms to the generation rules for text content in the certificate area image to obtain a first recognition processing result corresponding to each certificate area image.
[0079] The text content refers to the text field in the document area image, for example, "Name XXXX", "Citizen ID number 110102YYYYMMDD888X", etc.
[0080] The generation rules of text content refer to the generation rules of text fields. For example, for citizen identification numbers, the generation rules consist of 18 digits. The first 1 / 2 digits represent the province code, the first 3 / 4 digits represent the city code, the first 5 / 6 digits represent the district code, the 7th to 14th digits represent the date of birth, the 15th / 16th digits represent the local police station code, the 17th digit represents gender, an odd number represents male, an even number represents female, and the 18th digit is a check code, represented by 0-9, and 10 is represented by X.
[0081] In this embodiment, the server can identify the text content, and then obtain the generation rules of the text content of each certificate area image according to the area type to which the certificate area image belongs, and then judge the identified text content and generate a first recognition processing result.
[0082] Optionally, the server may also determine the text content of a certain document area image based on the text content of multiple document area images, and generate a first recognition processing result of the corresponding document area image. For example, for a citizen's identification number, the server may determine whether the corresponding number in the citizen's identification number complies with the generation rules of the corresponding text content based on the text recognition results such as the identified gender, place of birth, date of birth, etc.
[0083] In the above embodiment, by performing text recognition on each document area image to obtain the text content, then according to the area type to which each document area image belongs, the generation rules of the text content in each document area image are respectively obtained and judged, so that based on the generation rules of the text content, the text content can be accurately judged to improve the accuracy of the generated first recognition processing result.
[0084] In one embodiment, performing image recognition on each certificate area image to obtain a second recognition processing result for each certificate area image may include: performing image recognition on each certificate area image to obtain image features of the text content in each certificate area image; and obtaining a second recognition processing result corresponding to each certificate area image based on each image feature.
[0085] The image features refer to the image features of each text content in the regional image, for example, for the text content, whether the text is tilted, how many characters are there between texts, and so on.
[0086] Specifically, the server may identify each document area image and then obtain image features of text content in the document area image to obtain the corresponding second recognition processing result.
[0087] In the above embodiment, by performing image recognition, the image features of the text content are obtained, so that it is possible to accurately determine whether the image features of the text content have changed, thereby avoiding the generation of forged document images through PS or equivalent methods, thereby improving the accuracy of recognition.
[0088] In one of the embodiments, before segmenting the document image to be verified to obtain a plurality of document region images, the method may further include: identifying the document type of the document image to be verified to obtain the document type of the document image to be verified.
[0089] As mentioned above, the document image to be verified may refer to images of various different standard types of documents, including but not limited to identity cards, passports, military ID cards, Hong Kong and Macao Home Return Permits, Taiwan Compatriot ID Cards, driver's licenses, etc.
[0090] In this embodiment, before the server performs segmentation processing on the document image to be verified, it can identify and determine the document type through the document type recognition model. For example, for an ID card and a passport, the subject photo of the ID card is at the upper right position, while the subject photo of the passport is at the upper left position. The front image of the ID card includes the content of 7 different regions, while the front image of the passport includes the content of more than 7 different regions. Therefore, the document type of the document image to be verified can be determined based on these position information, quantity information, etc.
[0091] In this embodiment, segmenting the document image to be verified to obtain multiple document area images may include: segmenting the document image to be verified using a pre-trained image segmentation model corresponding to the document type to obtain multiple segmented document area images.
[0092] Furthermore, the server can select an image segmentation model corresponding to the document type according to the document type of the document image to be verified, and perform segmentation processing on the document image to be verified. For example, if the document image to be verified is an identity card, the identity card segmentation model for segmenting the identity card image is selected; if the document image to be verified is a passport, the passport segmentation model for segmenting the passport image is selected.
[0093] In the above embodiment, by identifying the type of the document image to be verified, and then selecting the corresponding image segmentation model to segment the document image to be verified, the image segmentation model can only segment the document image to be verified of one type of document, making the segmentation more targeted, improving the accuracy of recognition and segmentation, and reducing the learning difficulty of the model and improving the learning efficiency of the model.
[0094] In one of the embodiments, before segmenting the document image to be verified to obtain a plurality of region images, the method may further include: adjusting the acquired document image to be verified to a preset size to obtain a document image to be verified that meets the preset size requirement.
[0095] Specifically, the image of the document to be verified obtained by the server may be an image of different sizes, and the server may adjust the image of the document to be verified to a preset size, for example, the actual size of the document, for example, for an ID card, the preset size may be 85.6 mm×54.mm.
[0096] Alternatively, the server may also adjust the acquired document image to be processed to the input size required by the segmentation model, for example, 865*540, etc. In this embodiment, the size of the document image to be detected acquired by the server may be inconsistent with the size required by the image segmentation model, so the server may enlarge or reduce the document image to be detected so that the size of the document image to be verified is consistent with the preset size.
[0097] Optionally, the document image to be detected obtained by the server may be a tilted image. The server may perform a rotation process on the obtained document image to be verified to obtain a straightened document image to be processed.
[0098] In this embodiment, segmenting the document image to be verified to obtain a plurality of document region images may include segmenting the document image to be verified that meets a preset size requirement to obtain a plurality of document region images.
[0099] Specifically, the server may input the size-adjusted document image to be verified into a trained image segmentation model to output a plurality of document region images through the image segmentation model.
[0100] In the above embodiment, by adjusting the image size of the document image to be inspected and then performing a segmentation process, the adjusted document image to be processed can meet certain size requirements, thereby improving the accuracy of the segmentation process and further improving the accuracy of the verification.
[0101] In one embodiment, performing recognition processing on each document region image respectively by each processing method may include: performing recognition processing on each document region image in parallel by a processing method corresponding to each document region image.
[0102] Specifically, the server can perform recognition and processing on each corresponding ID area image in parallel through various recognition and processing methods. For example, each ID area image can be processed through the recognition and processing method of the corresponding name area image, gender area image, date of birth area image, ID type area image, and ID number area image.
[0103] In this embodiment, at least one of the certificate image to be verified, each certificate area image, position information of each certificate area image on the certificate image to be verified, the area type to which each certificate area image belongs, the recognition processing result of each certificate area image, and the verification result of the certificate image to be verified is stored in the blockchain.
[0104] Specifically, in order to further ensure the privacy and security of the data, the server can store the image of the document to be verified, the images of each document area, the location information of each document area image on the image of the document to be verified, the area type to which each document area image belongs, the recognition processing results of each document area image, and the verification results of the document image to be verified in the nodes of the block.
[0105] In this embodiment, the blockchain refers to a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block.
[0106] In this embodiment, the blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0107] In the above embodiment, by performing recognition processing on each document area image in parallel, the recognition processing process of multiple document area images of the same document image to be processed can be performed in parallel, thereby saving data processing time and improving recognition processing efficiency.
[0108] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0109] In one embodiment, Figure 4 As shown, a document verification device based on image recognition is provided, comprising: a document image acquisition module 100 to be verified, a segmentation processing module 200, a region type determination module 300, a recognition processing module 400 and a verification result generation module 500, wherein:
[0110] The module 100 for acquiring the image of the document to be verified is used to acquire the image of the document to be verified.
[0111] The segmentation processing module 200 is used to segment the document image to be verified to obtain a plurality of document region images.
[0112] The region type determination module 300 is used to obtain the position information of each document region image on the document image to be verified, and determine the region type to which each document region image belongs according to the obtained position information.
[0113] The recognition processing module 400 is used to determine the processing method corresponding to each certificate area image according to the area type to which each certificate area image belongs, and to perform recognition processing on each certificate area image respectively through each processing method to obtain the recognition processing result of each certificate area image.
[0114] The verification result generating module 500 is used to generate a verification result of the document image to be verified according to the recognition processing results of multiple document area images of the document image to be verified.
[0115] In one embodiment, the identification processing module 400 may include:
[0116] The first recognition processing result generating submodule is used to perform text recognition on each document area image to obtain a first recognition processing result corresponding to each document area image.
[0117] A second recognition processing result generating submodule, used for performing image recognition on each document region image to obtain a second recognition processing result of each document region image;
[0118] The third recognition processing result generating submodule is used to count the first recognition processing result and the second recognition processing result of each document area image to obtain the recognition processing result of each document area image.
[0119] In one embodiment, the first recognition processing result generating submodule may include:
[0120] The text content generating unit is used to perform text recognition on each certificate area image to obtain the text content in each certificate area image.
[0121] The generation rule acquisition unit is used to respectively acquire the generation rules corresponding to the text content in each certificate area image according to the area type to which each certificate area image belongs.
[0122] The judging unit is used to judge whether the text contents obtained by text recognition conform to the generation rule of the text contents in the document area image, so as to obtain the first recognition processing result corresponding to each document area image.
[0123] In one embodiment, the second recognition processing result generating submodule may include:
[0124] The image recognition unit is used to perform image recognition on each document area image to obtain image features of the text content in each document area image.
[0125] The second recognition result generating unit is used to obtain the second recognition processing result corresponding to each document area image according to each image feature.
[0126] In one embodiment, the above device may further include:
[0127] The certificate type determination module is used to identify the certificate type of the certificate image to be verified before the segmentation processing module 200 segments the certificate image to obtain multiple certificate area images to obtain the certificate type of the certificate image to be verified.
[0128] In this embodiment, the segmentation processing module 200 can be used to perform segmentation processing on the document image to be verified by using a pre-trained image segmentation model corresponding to the document type, so as to obtain a plurality of segmented document region images.
[0129] In one embodiment, the above device may further include:
[0130] The size adjustment module is used for the segmentation processing module 200 to segment the document image to be verified, and before obtaining multiple regional images, the acquired document image to be verified is adjusted to a preset size to obtain a document image to be verified that meets the preset size requirements.
[0131] In this embodiment, the segmentation processing module 200 is used to segment the document image to be verified that meets the preset size requirement to obtain a plurality of document region images.
[0132] In one embodiment, the recognition processing module 400 performs recognition processing on each document region image in parallel using a processing method corresponding to each document region image.
[0133] In this embodiment, at least one of the certificate image to be verified, each certificate area image, position information of each certificate area image on the certificate image to be verified, the area type to which each certificate area image belongs, the recognition processing result of each certificate area image, and the verification result of the certificate image to be verified is stored in the blockchain.
[0134] For the specific definition of the document verification device based on image recognition, please refer to the definition of the document verification method based on image recognition above, which will not be repeated here. Each module in the above-mentioned document verification device based on image recognition can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0135] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the image of the certificate to be verified, the image of the certificate area, the location information, the recognition and processing results of the certificate area image, and the verification results. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a certificate verification method based on image recognition is implemented.
[0136] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: obtaining an ID image to be verified; segmenting the ID image to be verified to obtain a plurality of ID area images; obtaining position information of each ID area image on the ID image to be verified, and determining the area type to which each ID area image belongs based on the obtained position information; determining a processing method corresponding to each ID area image based on the area type to which each ID area image belongs, and performing recognition processing on each ID area image respectively through each processing method to obtain a recognition processing result of each ID area image; generating a verification result of the ID image to be verified based on the recognition processing results of the plurality of ID area images of the ID image to be verified.
[0138] In one of the embodiments, when the processor executes the computer program, it determines the processing method corresponding to each certificate area image according to the area type to which each certificate area image belongs, and performs recognition processing on each certificate area image through each processing method to obtain the recognition processing result of each certificate area image, which may include: performing text recognition on each certificate area image to obtain a first recognition processing result corresponding to each certificate area image; performing image recognition on each certificate area image to obtain a second recognition processing result of each certificate area image; and counting the first recognition processing result and the second recognition processing result of each certificate area image to obtain the recognition processing result of each certificate area image.
[0139] In one of the embodiments, when the processor executes the computer program, text recognition is performed on each certificate area image to obtain a first recognition processing result corresponding to each certificate area image, which may include: performing text recognition on each certificate area image to obtain text content in each certificate area image; obtaining generation rules for text content in each certificate area image according to the area type to which each certificate area image belongs; and determining whether each text content obtained by text recognition conforms to the generation rules for text content in the certificate area image to obtain a first recognition processing result corresponding to each certificate area image.
[0140] In one of the embodiments, when the processor executes the computer program, it implements image recognition on each certificate area image to obtain a second recognition processing result for each certificate area image, which may include: performing image recognition on each certificate area image to obtain image features of the text content in each certificate area image; and obtaining a second recognition processing result corresponding to each certificate area image based on each image feature.
[0141] In one embodiment, when the processor executes the computer program, the image of the document to be verified is segmented, and before obtaining multiple document area images, the following steps may be implemented: the document type of the document image to be verified is identified to obtain the document type of the document image to be verified. When the processor executes the computer program, the image of the document to be verified is segmented to obtain multiple document area images, which may include: segmenting the document image to be verified by using a pre-trained image segmentation model corresponding to the document type to obtain multiple segmented document area images.
[0142] In one embodiment, when the processor executes the computer program, the image of the document to be verified is segmented, and before obtaining multiple regional images, the following steps may be implemented: adjusting the acquired image of the document to be verified to a preset size to obtain a document image to be verified that meets the preset size requirements. When the processor executes the computer program, the image of the document to be verified is segmented to obtain multiple document region images, which may include: segmenting the document image to be verified that meets the preset size requirements to obtain multiple document region images.
[0143] In one embodiment, when the processor executes the computer program, the recognition processing of each document region image can be realized by each processing method, which can include: the recognition processing of each document region image is performed in parallel by the processing method corresponding to each document region image. At least one of the document image to be verified, each document region image, the position information of each document region image on the document image to be verified, the region type to which each document region image belongs, the recognition processing result of each document region image, and the verification result of the document image to be verified is stored in the blockchain.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining an ID image to be verified; segmenting the ID image to be verified to obtain a plurality of ID area images; obtaining position information of each ID area image on the ID image to be verified, and determining the area type to which each ID area image belongs based on the obtained position information; determining a processing method corresponding to each ID area image based on the area type to which each ID area image belongs, and performing recognition processing on each ID area image respectively through each processing method to obtain a recognition processing result of each ID area image; generating a verification result of the ID image to be verified based on the recognition processing results of the plurality of ID area images of the ID image to be verified.
[0145] In one of the embodiments, when the computer program is executed by the processor, it is implemented to determine the processing method corresponding to each certificate area image according to the area type to which each certificate area image belongs, and identify and process each certificate area image respectively through each processing method to obtain the identification and processing results of each certificate area image, which may include: performing text recognition on each certificate area image to obtain a first identification and processing result corresponding to each certificate area image; performing image recognition on each certificate area image to obtain a second identification and processing result of each certificate area image; and counting the first identification and processing results and the second identification and processing results of each certificate area image to obtain the identification and processing results of each certificate area image.
[0146] In one of the embodiments, when the computer program is executed by the processor, text recognition is performed on each certificate area image to obtain a first recognition processing result corresponding to each certificate area image, which may include: performing text recognition on each certificate area image to obtain text content in each certificate area image; obtaining generation rules for text content in each certificate area image according to the area type to which each certificate area image belongs; and determining whether each text content obtained by text recognition conforms to the generation rules for text content in the certificate area image to obtain a first recognition processing result corresponding to each certificate area image.
[0147] In one of the embodiments, when the computer program is executed by the processor, image recognition is performed on each document area image to obtain a second recognition processing result for each document area image, which may include: performing image recognition on each document area image to obtain image features of the text content in each document area image; and obtaining a second recognition processing result corresponding to each document area image based on each image feature.
[0148] In one embodiment, when the computer program is executed by the processor, the image of the document to be verified is segmented, and before obtaining multiple document area images, the following steps may be implemented: the document type of the document image to be verified is identified to obtain the document type of the document image to be verified. When the computer program is executed by the processor, the image of the document to be verified is segmented to obtain multiple document area images, which may include: segmenting the image of the document to be verified by using a pre-trained image segmentation model corresponding to the document type to obtain multiple segmented document area images.
[0149] In one embodiment, when the computer program is executed by the processor, the image of the document to be verified is segmented, and before obtaining multiple regional images, the following steps may be implemented: adjusting the acquired image of the document to be verified to a preset size to obtain a document image to be verified that meets the preset size requirements. When the computer program is executed by the processor, the image of the document to be verified is segmented to obtain multiple document region images, which may include: segmenting the document image to be verified that meets the preset size requirements to obtain multiple document region images.
[0150] In one embodiment, when the computer program is executed by the processor, the recognition processing of each document region image is realized by each processing method, which may include: the recognition processing of each document region image is performed in parallel by the processing method corresponding to each document region image. At least one of the document image to be verified, each document region image, the position information of each document region image on the document image to be verified, the region type to which each document region image belongs, the recognition processing result of each document region image, and the verification result of the document image to be verified is stored in the blockchain.
[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0152] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A document verification method based on image recognition, characterized in that: The method comprises: Obtain the image of the document to be verified; Based on the position information of the object photo and the quantity information of the document area image, the document type of the document image to be verified is identified to obtain the document type of the document image to be verified; Selecting an image segmentation model corresponding to the document type; The image of the document to be verified is segmented by using a pre-trained image segmentation model corresponding to the document type to obtain a plurality of document area images; Acquire the position information of each of the certificate area images on the certificate image to be verified, and determine the area type to which each of the certificate area images belongs according to the acquired position information; Determine the processing method corresponding to each of the certificate area images according to the area type to which each of the certificate area images belongs, and perform recognition processing on each of the certificate area images respectively by using each of the processing methods to obtain recognition processing results of each of the certificate area images; Generating a verification result of the document image to be verified according to the recognition processing results of the multiple document area images of the document image to be verified; Before segmenting the document image to be verified to obtain a plurality of region images, the method further includes: Adjusting the acquired document image to be verified to a preset size to obtain a document image to be verified that meets the preset size requirement; The segmentation process of the document image to be verified to obtain a plurality of document area images includes: Segmenting the document image to be verified that meets the preset size requirement to obtain multiple document area images; The identification processing is performed on each of the document area images respectively by various processing methods to obtain the identification processing results of each of the document area images, including: Perform image recognition on each of the document area images to obtain a second recognition processing result of each of the document area images, wherein the image recognition includes how many characters are spaced between texts.
2. The method according to claim 1, characterized in that The method further includes: determining a processing method corresponding to each of the certificate area images according to the area type to which each of the certificate area images belongs, and performing recognition processing on each of the certificate area images by using each of the processing methods to obtain recognition processing results of each of the certificate area images. Performing text recognition on each of the document area images to obtain a first recognition processing result corresponding to each of the document area images; The first recognition processing result and the second recognition processing result of each of the document area images are counted to obtain the recognition processing result of each of the document area images.
3. The method according to claim 2, characterized in that The performing text recognition on each of the document area images to obtain a first recognition processing result corresponding to each of the document area images includes: Performing text recognition on each of the document area images to obtain text content in each of the document area images; According to the area type to which each of the certificate area images belongs, respectively obtaining generation rules corresponding to the text content in each of the certificate area images; It is determined whether the text contents obtained by text recognition conform to the generation rule of the text contents in the document area image, so as to obtain the first recognition processing result corresponding to each document area image.
4. The method according to claim 2, characterized in that: The performing image recognition on each of the document area images to obtain a second recognition processing result of each of the document area images includes: Performing image recognition on each of the document area images to obtain image features of the text content in each of the document area images; A second recognition processing result corresponding to each of the document area images is obtained according to each of the image features.
5. The method according to claim 1, characterized in that The identification processing of each of the document area images is performed by each processing method, including: Performing recognition processing on each of the document area images in parallel by using a processing method corresponding to each of the document area images; At least one of the document image to be verified, each document area image, position information of each document area image on the document image to be verified, the area type to which each document area image belongs, the recognition processing result of each document area image, and the verification result of the document image to be verified is stored in the blockchain.
6. A document verification device based on image recognition, characterized in that: The device comprises: The module for acquiring the image of the certificate to be verified is used to acquire the image of the certificate to be verified; The certificate type determination module is used to identify the certificate type of the certificate image to be verified based on the position information of the object photo and the number information of the certificate area image, and obtain the certificate type of the certificate image to be verified; and select an image segmentation model corresponding to the certificate type; A segmentation processing module, used to segment the image of the document to be verified by using a pre-trained image segmentation model corresponding to the document type, to obtain a plurality of document area images; A region type determination module, used for obtaining position information of each of the certificate region images on the certificate image to be verified, and determining the region type to which each of the certificate region images belongs according to the obtained position information; An identification processing module, used to determine the processing method corresponding to each of the certificate area images according to the area type to which each of the certificate area images belongs, and to perform identification processing on each of the certificate area images respectively through each of the processing methods to obtain the identification processing results of each of the certificate area images; A verification result generating module, used for generating a verification result of the document image to be verified according to the recognition processing results of the multiple document area images of the document image to be verified; A size adjustment module, used for adjusting the acquired document image to be verified to a preset size, so as to obtain a document image to be verified that meets the preset size requirement; The segmentation processing module is specifically used to segment the document image to be verified that meets the preset size requirement to obtain multiple document area images; The recognition processing module includes a second recognition processing result generating submodule, which is specifically used to perform image recognition on each of the document area images to obtain a second recognition processing result of each of the document area images, wherein image recognition includes how many characters are spaced between texts.
7. The device according to claim 6, characterized in that The identification processing module also includes: A first recognition processing result generating submodule, used for performing text recognition on each of the document area images to obtain a first recognition processing result corresponding to each of the document area images; The third recognition processing result generating submodule is used to count the first recognition processing result and the second recognition processing result of each of the document area images to obtain the recognition processing result of each of the document area images.
8. The device according to claim 7, characterized in that The first recognition processing result generating submodule comprises: A text content generating unit, used for performing text recognition on each of the certificate area images to obtain the text content in each of the certificate area images; A generation rule acquisition unit, used to respectively acquire generation rules corresponding to text content in each of the certificate area images according to the area type to which each of the certificate area images belongs; The judging unit is used to judge whether the text contents obtained by text recognition conform to the generation rule of the text contents in the document area image, so as to obtain the first recognition processing result corresponding to each document area image.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Identity card identification method
CN105701488A
Certificate authenticity verification method and device, computer device and storage medium
CN109446900A