Certificate identification method and device, equipment and storage medium
Through the methods of extracting certificate elements and identifying categories, and combining the initial identification results, certificate identification is solved, and the problem of low efficiency in certificate identification in the existing technology is achieved, and more efficient and accurate certificate identification is achieved.
Patent Information
- Application Number
- CN202411064955.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-13
AI Technical Summary
The existing certificate identification system is not efficient and mainly relies on character comparison technology. Failure to effectively identify the form of certificates may lead to unnecessary disputes and risks.
The methods of document element extraction, initial identification and category identification are adopted, and the identification of documents are extracted and category identification are extracted through the preset document identification model, and the identification of documents is identified in combination with the initial identification results to improve the identification efficiency and accuracy.
It improves the efficiency and accuracy of document identification, can identify the categories of documents, reduces labor costs, and significantly improves business efficiency.
Smart Images

Figure CN119128625A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a document identification method, device, equipment and storage medium. Background Art
[0002] In modern daily business processing, document identification is an indispensable task. For example, banks need to make comprehensive authenticity judgments on the ID photos submitted by users and the eligibility of the photos taken, including detecting photocopying, tampering, forgery and other forms of fraud. At present, this work usually relies on a large number of human resources for manual identification, which is not only time-consuming and labor-intensive, but also costly. Therefore, using computer technology to automate this process will greatly reduce labor costs and significantly improve business efficiency. However, most current document identification systems only rely on character matching technology to extract and match information on documents. This method has low identification efficiency and often ignores the formal judgment of the document type, such as whether it is a photocopy, photocopy, temporary document or tampered forgery. Due to the lack of formal identification function, these systems may cause a series of unnecessary disputes and risks in subsequent business. Therefore, how to improve the efficiency of document identification has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of this application is to provide a document identification method, device, equipment and storage medium, aiming to solve the technical problem of low efficiency of existing document identification.
[0004] To achieve the above purpose, the present application proposes a document identification method, which includes:
[0005] Extract the elements of the certificate to be identified and obtain the extraction result;
[0006] Performing a preliminary identification on the document to be identified based on the extraction result to obtain a preliminary identification result;
[0007] When the initial recognition result is qualified, the document to be recognized is classified by using a preset document authentication model to obtain a classification recognition result output by the preset document authentication model;
[0008] The document to be identified is authenticated according to the category identification result and the initial identification result to obtain an authentication result.
[0009] Optionally, the step of performing document authentication on the document to be identified according to the category identification result and the initial identification result to obtain an authentication result includes:
[0010] Determining whether the document to be identified is a qualified document according to the category identification result;
[0011] When the document to be identified is a qualified document, determining the current identification accuracy;
[0012] When the recognition accuracy is accurate recognition, the identification result of the document to be identified is determined according to the category recognition result and the initial recognition result.
[0013] Optionally, the step of determining the identification result of the document to be identified according to the category identification result and the initial identification result includes:
[0014] Determining a category score according to the category identification result;
[0015] Determining an initial recognition score according to the initial recognition result;
[0016] Determine the target certificate score according to the category score and the initial recognition score;
[0017] The target document score is compared with a preset document recognition threshold to obtain an identification result of the document to be identified.
[0018] Optionally, the preset certificate authentication model includes a backbone network and a distance measurement module;
[0019] The step of performing category identification on the to-be-identified certificate by using a preset certificate authentication model to obtain a category identification result output by the preset certificate authentication model comprises:
[0020] Extracting features of the document to be identified according to the backbone network to obtain a feature vector;
[0021] Determine the category distance between the document to be identified and the center of each category prototype based on the distance measurement module and the feature vector;
[0022] A category recognition result is determined according to the category distance.
[0023] Optionally, before the step of performing category identification on the to-be-identified certificate by using a preset certificate authentication model to obtain a category identification result output by the preset certificate authentication model, the step further includes:
[0024] Obtain category training data corresponding to each category;
[0025] Dividing the category training data into a support set and a query set;
[0026] The initial classification model is trained based on the support set and the query set to obtain a preset document authentication model.
[0027] Optionally, the step of training the initial classification model based on the support set and the query set to obtain a preset document authentication model includes:
[0028] Determine mapping information corresponding to the support set according to the backbone network of the initial classification model;
[0029] Determine a prototype representation corresponding to the support set according to the mapping information;
[0030] Determine a query set feature vector corresponding to the query set according to the backbone network of the initial classification model;
[0031] Determine the Euclidean distance between the query set feature vector and the prototype representation based on the distance measurement module of the initial classification model;
[0032] Determine a cross entropy loss based on the Euclidean distance and the label corresponding to the support set;
[0033] The initial classification model is trained based on the cross entropy loss and target loss function to obtain a preset document authentication model.
[0034] Optionally, the step of performing preliminary identification on the document to be identified based on the extraction result to obtain a preliminary identification result includes:
[0035] Performing information verification on the document to be identified based on the extraction result to obtain an information verification result;
[0036] When the information verification result is that the verification is passed, determining whether the document to be identified is a black and white image according to the extraction result;
[0037] When the document to be identified is not a black and white image, determining whether the elements of the document to be identified are complete according to the extraction result;
[0038] When the elements of the document to be identified are complete, determining whether the front and back of the document to be identified are in the same image according to the extraction result;
[0039] When the front and back sides of the document to be identified are not in the same image, the validity of the information of the document to be identified is determined according to the extraction result to obtain a preliminary identification result.
[0040] In addition, to achieve the above purpose, the present application also proposes a document identification device, the document identification device comprising:
[0041] An element extraction module is used to extract the elements of the document to be identified and obtain the extraction result;
[0042] An initial recognition module, used to perform initial recognition on the document to be recognized based on the extraction result to obtain an initial recognition result;
[0043] A category identification module, used to identify the category of the document to be identified by using a preset document authentication model when the initial identification result is qualified, and obtain a category identification result output by the preset document authentication model;
[0044] The certificate identification module is used to perform certificate identification on the certificate to be identified according to the category identification result and the initial identification result to obtain an identification result.
[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a certificate identification device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the certificate identification method described above.
[0046] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the certificate authentication method described above are implemented.
[0047] The present application extracts document elements from the document to be identified to obtain an extraction result; performs a preliminary identification on the document to be identified based on the extraction result to obtain a preliminary identification result; when the preliminary identification result is qualified, performs category identification on the document to be identified through a preset document authentication model to obtain a category identification result output by the preset document authentication model; performs document authentication on the document to be identified based on the category identification result and the preliminary identification result to obtain an authentication result. Since the present application first performs a preliminary identification on the document and then performs category identification on the document, an authentication result is obtained based on the category identification result and the preliminary identification result. Compared with the existing method based only on manual identification or only on character recognition, the above method of the present application can improve the efficiency of document authentication and can identify the category of the document. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] Figure 1 A flowchart of the first embodiment of the method for identifying application documents is provided;
[0051] Figure 2A flow chart of the second embodiment of the method for identifying application documents;
[0052] Figure 3 A schematic diagram of the initial identification process of the document identification method provided in Example 2 of the present application;
[0053] Figure 4 This is a schematic diagram of the module structure of the certificate identification device according to the embodiment of the present application;
[0054] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the document identification method in the embodiment of the present application.
[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0058] The main solution of the embodiment of the present application is: to extract document elements from the document to be identified and obtain an extraction result; to perform initial identification on the document to be identified based on the extraction result and obtain an initial identification result; when the initial identification result is qualified, to perform category identification on the document to be identified through a preset document authentication model and obtain a category identification result output by the preset document authentication model; to perform document authentication on the document to be identified based on the category identification result and the initial identification result and obtain an authentication result.
[0059] Since the present application first performs preliminary identification on the certificate and then performs category identification on the certificate, the identification result is obtained based on the category identification result and the preliminary identification result. Compared with the existing method of manual identification or character recognition only, the above method of the present application can improve the identification efficiency of the certificate and can identify the category of the certificate.
[0060] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a certificate identification device, etc. The following takes the certificate identification device as an example to illustrate this embodiment and the following embodiments.
[0061] Based on this, the present application embodiment provides a method for document identification, referring to Figure 1 , Figure 1This is a flow chart of the first embodiment of the document identification method of this application.
[0062] In this embodiment, the certificate identification method includes steps S10 to S40:
[0063] Step S10, extracting elements of the document to be identified to obtain an extraction result;
[0064] It should be noted that the extraction of document elements from the document to be identified may be to extract information on the document to be identified using optical character recognition (OCR) technology. For example, when the document to be identified is an ID card, the extraction result includes information such as the ID card number, name, validity period, gender, address, etc. When the document to be identified is a bank card, the extraction result includes information such as the card number and bank name.
[0065] Step S20, performing preliminary recognition on the document to be recognized based on the extraction result to obtain a preliminary recognition result;
[0066] It should be noted that the initial identification of the document to be identified based on the extraction result may be to verify the validity of the document to be identified based on the extraction result. For example, when the document to be identified is an identity card, the initial identification of the document to be identified based on the extraction result includes verification of the validity period, identity card number, and whether the identity account number matches the date of birth and gender, and calculates the matching score. The initial identification result includes whether the identification result is successful or failed and the matching score, that is, the initial identification score.
[0067] Step S30, when the initial recognition result is qualified, classifying the document to be recognized by using a preset document authentication model to obtain a class recognition result output by the preset document authentication model;
[0068] It should be noted that the preset certificate authentication model can be a neural network model that is pre-trained with sample data and can identify the category of the certificate to be identified and the corresponding category score. The category recognition result includes the category of the certificate to be identified output by the preset certificate authentication model and the category score corresponding to the certificate to be identified. Among them, the possible categories of the certificate to be identified include 1. authentic and qualified certificates, 2. screen copies / screenshots, 3. photocopies, 4. tampered forgeries, 5. temporary identity documents, 6. unqualified certificates (such as obstructions, reflections, incomplete border display, etc.), 7. electronic identity cards.
[0069] Step S40, performing document authentication on the document to be identified according to the category identification result and the initial identification result to obtain an authentication result.
[0070] It should be noted that the document identification is performed on the document to be identified based on the category identification result and the initial identification result, and the identification result obtained can be that when the category identification result shows that the document to be identified is a real and qualified document, the document to be identified is determined to be a valid document. The initial identification result is a successful identification. If the current identification accuracy is high, precise identification continues. At this time, the target score is determined based on the category score in the category identification result and the initial identification score in the initial identification result, and the target score is compared with the preset identification score. If the target score is greater than the preset identification score, the identification result is a successful identification. Otherwise, the identification result is an identification failure, and the document is invalid.
[0071] Furthermore, in order to obtain an accurate certificate identification result, the step S40 may include: judging whether the certificate to be identified is a qualified certificate according to the category identification result;
[0072] When the document to be identified is a qualified document, determining the current identification accuracy;
[0073] When the recognition accuracy is accurate recognition, the identification result of the document to be identified is determined according to the category recognition result and the initial recognition result.
[0074] It should be noted that the qualified certificate is a genuine and qualified original certificate. The recognition accuracy may include precise recognition and general recognition. It may be determined according to different usage scenarios and user requirements. The determination of the identification result of the certificate to be recognized based on the category recognition result and the initial recognition result may be to determine the category score based on the category recognition result;
[0075] Determining an initial recognition score according to the initial recognition result;
[0076] Determine the target certificate score according to the category score and the initial recognition score;
[0077] The target document score is compared with a preset document recognition threshold to obtain an identification result of the document to be identified.
[0078] It should be noted that the category score is the recognition score output by the preset document authentication model. The initial recognition score is the initial recognition score obtained by performing feature extraction through optical character recognition (OCR) technology and performing initial recognition on the document to be identified based on the extraction result. The target document score determined according to the category score and the initial recognition score can be composed of the two decimal places of the initial recognition score and the two decimal places of the category score. For example, the initial recognition score is 0.57, and the category score is 0.78. Then the target document score is 0.57+0.0078=0.5778. The preset document recognition threshold can be a pre-set threshold used to determine the document authentication result. If the target document score is greater than the preset document recognition threshold, the authentication result is that the document to be identified is authentic and valid, otherwise, the authentication result is that the document to be identified is invalid.
[0079] In this embodiment, the document elements are extracted from the document to be identified to obtain an extraction result; based on the extraction result, the document to be identified is initially identified to obtain an initial identification result; when the initial identification result is qualified, the document to be identified is classified by a preset document authentication model to obtain a category identification result output by the preset document authentication model; the document to be identified is authenticated according to the category identification result and the initial identification result to obtain an authentication result. Since this embodiment first performs an initial identification on the document and then performs category identification on the document, an authentication result is obtained according to the category identification result and the initial identification result. Compared with the existing method based only on manual identification or only on character recognition, the above method of this embodiment can improve the authentication efficiency of the document and can identify the category of the document.
[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 A flow chart of the second embodiment of the document identification method of the present application is provided; the preset document authentication model includes a backbone network and a distance measurement module, and the step S30 further includes steps S301 to S303:
[0081] Step S301: extracting features of the document to be identified according to the backbone network to obtain a feature vector;
[0082] It should be noted that the backbone network F adopts the basic structure of a convolutional neural network, which is composed of several stacked convolution blocks, each of which contains a convolution operation, an activation function, and a pooling operation. Specifically, the convolution operation is performed using a convolution kernel of size 3*3 and a step size of 1. The activation function is shown in the following formula, specifically the ReLU activation function, and the pooling operation selects the maximum pooling method.
[0083] f(x)=max(0,x)
[0084] Among them, f(x) is used to represent the activation function, and x is used to represent the input of the activation function.
[0085] In the specific implementation, in this embodiment, the backbone network of the preset document authentication model is first used to extract features of the document to be identified to obtain a feature vector with a length of 1600.
[0086] Step S302: determining the category distance between the document to be identified and the center of each category prototype based on the distance measurement module and the feature vector;
[0087] It should be noted that the prototype centers of each category may be the prototype centers of each category determined based on the sample data corresponding to each category during the training process of the preset document authentication model. The category distance between the document to be identified and the prototype center of each category determined based on the distance measurement module and the feature vector may be determined by the following distance formula to determine the category distance between the feature vector corresponding to the document to be identified and the prototype center of each category:
[0088]
[0089] Among them, n is used to represent the dimension of the feature vector, which can be 1600. x is used to represent the feature vector corresponding to the document to be identified, y is used to represent the center of the category prototype, and d(x,y) is used to represent the category distance between the feature vector corresponding to the document to be identified and the center of the category prototype.
[0090] Step S303: determining a category recognition result according to the category distance.
[0091] It should be noted that determining the category recognition result according to the category distance may be determining, according to the category distance, which category prototype center has the shortest category distance with the feature vector corresponding to the document to be identified, that is, determining which category the document to be identified belongs to.
[0092] Furthermore, in order to accurately identify the category of the document to be identified, before step S301, the method further includes: obtaining category training data corresponding to each category;
[0093] Dividing the category training data into a support set and a query set;
[0094] The initial classification model is trained based on the support set and the query set to obtain a preset document authentication model.
[0095] It should be noted that the acquisition of the category training data corresponding to each category may be to obtain the sample data corresponding to the above 7 categories, i.e., the category training data. The division of the category training data into a support set and a query set may be to divide the data in each category into a support set and a query set, which may be 20% as the support set and 80% as the query set. The support set is used to determine the prototype representation P of the sample data of the category in the shallow space. i The training of the initial classification model based on the support set and the query set to obtain the preset document authentication model may be to determine the prototype representation P of the sample data corresponding to the support set in the shallow space according to the support set. i Then, the distance between the query set and the prototype representation is determined, and the predicted category corresponding to the query set sample data is determined according to the distance, and the initial classification model is trained according to the predicted category and the true category of the query set sample data to obtain a preset document authentication model. The initial classification model can be a neural network model or a classifier.
[0096] Furthermore, the step of training the initial classification model based on the support set and the query set to obtain a preset document authentication model includes:
[0097] Determine mapping information corresponding to the support set according to the backbone network of the initial classification model;
[0098] Determine a prototype representation corresponding to the support set according to the mapping information;
[0099] Determine a query set feature vector corresponding to the query set according to the backbone network of the initial classification model;
[0100] Determine the Euclidean distance between the query set feature vector and the prototype representation based on the distance measurement module of the initial classification model;
[0101] Determine a cross entropy loss based on the Euclidean distance and the label corresponding to the support set;
[0102] The initial classification model is trained based on the cross entropy loss and target loss function to obtain a preset document authentication model.
[0103] It should be noted that, unlike traditional neural network training, this embodiment performs training in units of episodes in each round (epoch). Each episode is defined as N-Class-K-Sample. N-Class represents the number of categories of training samples, and K-Sample represents how many samples of each category are taken for training. Taking actual training as an example, this embodiment adopts 7-Class-30-Sample, which means that in the training process of each episode, 30 samples are sampled from 7 categories of training data for training.
[0104] After sampling the corresponding training data in each episode, each type of sample data is divided into a support set and a query set. The support set is used to calculate the prototype representation of the network, and the query set is used to evaluate the prototype representation of the network and thus calculate the loss function. Specifically, S i and Q i denote the support set and query set of category i respectively, The number of samples in the support set (|S i |) is 5, the number of query set samples (|Q i |) is 25. Specifically, the support set samples After inputting the backbone network F of the initial classification model, the corresponding mapping information will be obtained For each category, the average value of its mapping is calculated, which is the prototype representation P of the category in the shallow space. i , the specific formula is:
[0105]
[0106] Get the prototype representation P corresponding to the support set of each category i After that, the query set sample Q i Input network F, get mapping F(Q i ), which is the query set feature vector, and then calculate the query set feature vector and the prototype center P i The Euclidean distance d(F(Q i ),P i ). The distance is passed through the softmax function and the cross entropy loss is calculated with the label. The cross entropy loss is calculated using the following formula:
[0107]
[0108] in, It is used to characterize the probability that the query set sample belongs to the k category, and k' is used to characterize each category.
[0109] The objective loss function can be calculated by the following formula:
[0110]
[0111] Among them, Loss is used to represent the loss value, y is used to represent the label value, and N is used to represent the number of categories of training samples.
[0112] The initial classification model is trained based on the cross entropy loss and the target loss function to obtain the preset document authentication model. The model can be based on a certain amount of category training data, and the convolutional neural network is trained using the Adam optimizer, and the target loss function is calculated to update the network parameters. Through continuous iterative cycle training, each type of sample will eventually get a good prototype representation in the shallow space. Based on these trained prototypes, feature extraction and Euclidean distance calculation are performed on the samples input to the network, and they are classified into the category closest to the prototype center to complete the identification of the document form. At the same time, the predicted category score is output.
[0113] Furthermore, in order to improve the efficiency of document identification, the step S20 includes: performing information verification on the document to be identified based on the extraction result to obtain an information verification result;
[0114] When the information verification result is that the verification is passed, determining whether the document to be identified is a black and white image according to the extraction result;
[0115] When the document to be identified is not a black and white image, determining whether the elements of the document to be identified are complete according to the extraction result;
[0116] When the elements of the document to be identified are complete, determining whether the front and back of the document to be identified are in the same image according to the extraction result;
[0117] When the front and back sides of the document to be identified are not in the same image, the validity of the information of the document to be identified is determined according to the extraction result to obtain a preliminary identification result.
[0118] It should be noted that you can refer to Figure 3 , Figure 3A schematic diagram of the initial identification process of the document identification method provided in Example 2 of the present application. The information verification of the document to be identified based on the extraction result can be based on the document elements in the extraction result to verify the validity period, the ID card number, and the ID card number and the date of birth and gender. Specifically, the document element extraction can be performed based on OCR recognition, and the score can be calculated based on the identification of the key elements of the document, the validity period verification, the ID card number verification, and whether the ID card number matches the date of birth and gender, that is, the initial identification score. By judging whether the image is a black and white picture, whether the elements are complete, whether the front and back elements are in the same image (it is impossible to take a normal photo of the front and back at the same time), and whether the start and end dates of the validity period of the document are separated (the start and end dates of normal document photos are connected together, and the start and end dates of some electronic ID cards are separated), a part of unqualified document photos can be filtered. Since each business party has different requirements for the qualification of the document, the business party can flexibly set the threshold to determine whether the document is qualified. In addition, OCR recognition cannot guarantee 100% correctness, and threshold judgment can also give the system a certain fault tolerance space. Therefore, after passing the initial OCR recognition, the certificate is authenticated based on a small sample network (i.e., the preset certificate authentication model). For forged documents, tampered documents, screen photos, screenshots, temporary ID cards, ID card copies, electronic ID cards, unqualified documents (incomplete borders, occlusion of non-text areas, reflections in non-text areas), etc., OCR technology cannot effectively authenticate certificates, and image samples for these situations are difficult to obtain. The small sample network can solve these problems very well. The accuracy of model training and testing can reach more than 90%. Furthermore, according to the recognition accuracy of the business party, the category score and the initial recognition score are used for threshold verification to obtain the final certificate authentication result.
[0119] This embodiment can complete the training of the network model when the number of samples is limited. Compared with the traditional large sample learning method, small sample learning can better cope with the problem of limited number of samples in actual scenarios. And this embodiment has high generalization and accuracy: by using small sample learning, this embodiment can achieve good results in testing and show high generalization in actual business contexts. Even with only a small number of samples, this embodiment can accurately identify certificates of different types and forms. Since high generalization can be achieved using a small amount of data, this embodiment can greatly reduce the cost of sample collection and annotation. The network model can be trained by using less sample data, thereby saving time, manpower and resource investment. This embodiment can also improve the efficiency of identification: certificate identification based on a small sample network can quickly and accurately identify certificates, thereby improving the efficiency of identification. This can significantly improve operational efficiency and customer experience for businesses that require a large number of certificate identifications.
[0120] This embodiment extracts features of the document to be identified based on the backbone network to obtain a feature vector; determines the category distance between the document to be identified and the center of each category prototype based on the distance measurement module and the feature vector; and determines the category identification result based on the category distance. Based on the OCR technology document authentication, this embodiment performs category identification on the document to be identified through a preset document authentication model, which makes up for the defect that OCR technology cannot authenticate in form, and solves the problem of training and deploying a document authentication network when the number of samples is limited.
[0121] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the document identification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0122] This application also provides a document identification device, please refer to Figure 4 , the document identification device comprises:
[0123] The element extraction module 10 is used to extract the elements of the document to be identified and obtain the extraction result;
[0124] The initial recognition module 20 is used to perform initial recognition on the document to be recognized based on the extraction result to obtain an initial recognition result;
[0125] A category identification module 30 is used to identify the category of the document to be identified by using a preset document authentication model when the initial identification result is qualified, and obtain a category identification result output by the preset document authentication model;
[0126] The certificate identification module 40 is used to perform certificate identification on the certificate to be identified according to the category identification result and the initial identification result to obtain an identification result.
[0127] In this embodiment, the document elements are extracted from the document to be identified to obtain an extraction result; based on the extraction result, the document to be identified is initially identified to obtain an initial identification result; when the initial identification result is qualified, the document to be identified is classified by a preset document authentication model to obtain a category identification result output by the preset document authentication model; the document to be identified is authenticated based on the category identification result and the initial identification result to obtain an authentication result. Since this embodiment first performs an initial identification on the document and then performs category identification on the document, an authentication result is obtained based on the category identification result and the initial identification result. Compared with the existing method based only on manual identification or only on character recognition, the above method of this embodiment can improve the efficiency of document authentication and can identify the category of the document.
[0128] The document identification device provided by the present application adopts the document identification method in the above embodiment, which can solve the technical problem of low efficiency of existing document identification. Compared with the prior art, the beneficial effects of the document identification device provided by the present application are the same as the beneficial effects of the document identification method provided by the above embodiment, and other technical features in the document identification device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0129] The present application provides a certificate identification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the certificate identification method in the above-mentioned embodiment one.
[0130] Reference below Figure 5 , which shows a schematic diagram of the structure of a certificate identification device suitable for implementing the embodiment of the present application. The certificate identification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The document identification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0131] like Figure 5As shown, the certificate identification device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the certificate identification device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the document identification device to communicate wirelessly or wired with other devices to exchange data. Although the document identification device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0132] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0133] The document identification device provided by the present application adopts the document identification method in the above embodiment, which can solve the technical problem of low efficiency of existing document identification. Compared with the prior art, the beneficial effects of the document identification device provided by the present application are the same as the beneficial effects of the document identification method provided by the above embodiment, and other technical features in the document identification device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0134] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0136] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the certificate authentication method in the above-mentioned embodiment.
[0137] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0138] The computer-readable storage medium may be included in the certificate authentication device; or may exist independently without being assembled into the certificate authentication device.
[0139] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the certificate authentication device, the certificate authentication device executes the certificate authentication method.
[0140] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0143] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned certificate identification method, and can solve the technical problem of low efficiency of existing certificate identification. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the certificate identification method provided by the above-mentioned embodiment, and will not be described in detail here.
[0144] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A document identification method, characterized in that: The document identification method comprises the following steps: Extract the elements of the certificate to be identified and obtain the extraction result; Performing a preliminary identification on the document to be identified based on the extraction result to obtain a preliminary identification result; When the initial recognition result is qualified, the document to be recognized is classified by using a preset document authentication model to obtain a classification recognition result output by the preset document authentication model; The document to be identified is authenticated according to the category identification result and the initial identification result to obtain an authentication result.
2. The document identification method according to claim 1, characterized in that: The step of performing document identification on the document to be identified according to the category identification result and the initial identification result to obtain an identification result comprises: Determining whether the document to be identified is a qualified document according to the category identification result; When the document to be identified is a qualified document, determining the current identification accuracy; When the recognition accuracy is accurate recognition, the identification result of the document to be identified is determined according to the category recognition result and the initial recognition result.
3. The document identification method according to claim 2, characterized in that: The step of determining the identification result of the document to be identified according to the category identification result and the initial identification result comprises: Determining a category score according to the category identification result; Determining an initial recognition score according to the initial recognition result; Determine the target certificate score according to the category score and the initial recognition score; The target document score is compared with a preset document recognition threshold to obtain an identification result of the document to be identified.
4. The document identification method according to claim 1, characterized in that: The preset certificate authentication model includes a backbone network and a distance measurement module; The step of performing category identification on the to-be-identified certificate by using a preset certificate authentication model to obtain a category identification result output by the preset certificate authentication model comprises: Extracting features of the document to be identified according to the backbone network to obtain a feature vector; Determine the category distance between the document to be identified and the center of each category prototype based on the distance measurement module and the feature vector; A category recognition result is determined according to the category distance.
5. The document identification method according to claim 4, characterized in that: Before the step of performing category identification on the to-be-identified certificate by using a preset certificate authentication model to obtain a category identification result output by the preset certificate authentication model, the step further includes: Obtain category training data corresponding to each category; Dividing the category training data into a support set and a query set; The initial classification model is trained based on the support set and the query set to obtain a preset document authentication model.
6. The document identification method according to claim 5, characterized in that: The step of training the initial classification model based on the support set and the query set to obtain a preset document authentication model includes: Determine mapping information corresponding to the support set according to the backbone network of the initial classification model; Determine a prototype representation corresponding to the support set according to the mapping information; Determine a query set feature vector corresponding to the query set according to the backbone network of the initial classification model; Determine the Euclidean distance between the query set feature vector and the prototype representation based on the distance measurement module of the initial classification model; Determine a cross entropy loss based on the Euclidean distance and the label corresponding to the support set; The initial classification model is trained based on the cross entropy loss and target loss function to obtain a preset document authentication model.
7. The document identification method according to any one of claims 1 to 6, characterized in that: The step of performing preliminary identification on the document to be identified based on the extraction result to obtain a preliminary identification result comprises: Performing information verification on the document to be identified based on the extraction result to obtain an information verification result; When the information verification result is that the verification is passed, determining whether the document to be identified is a black and white image according to the extraction result; When the document to be identified is not a black and white image, determining whether the elements of the document to be identified are complete according to the extraction result; When the elements of the document to be identified are complete, determining whether the front and back of the document to be identified are in the same image according to the extraction result; When the front and back sides of the document to be identified are not in the same image, the validity of the information of the document to be identified is determined according to the extraction result to obtain a preliminary identification result.
8. A document identification device, characterized in that: The document identification device comprises: An element extraction module is used to extract the elements of the document to be identified and obtain the extraction result; An initial recognition module, used to perform initial recognition on the document to be recognized based on the extraction result to obtain an initial recognition result; A category identification module, used to identify the category of the document to be identified by using a preset document authentication model when the initial identification result is qualified, and obtain a category identification result output by the preset document authentication model; The certificate identification module is used to perform certificate identification on the certificate to be identified according to the category identification result and the initial identification result to obtain an identification result.
9. A document identification device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the document authentication method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the document identification method according to any one of claims 1 to 7 are implemented.
