Method, device, computer equipment and storage medium for issuing certificates based on face recognition
Through facial recognition-based live detection and personal certificate comparison, verification of certificate images, the problem of inefficient certificate application process is solved, and an efficient certificate application process is achieved without taking photos and queuing.
Patent Information
- Application Number
- CN201811187255.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-10-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2038-10-12
AI Technical Summary
The current certificate application process is inefficient, and users need to run back and forth and manually review, resulting in long queues and large manpower investment.
Using a face recognition method, by obtaining the ID image and the face image, performing live detection and personal certificate comparison, and calculating the feature similarity. If the preset threshold is reached, the verification will be passed and the image will be sent to the certificate making center to reduce manual review and Users are running around.
It improves the efficiency of applying for a certificate, reduces user waiting time and manpower investment in the certificate application center, and realizes a certificate application process without taking photos and queuing.
Smart Images

Figure CN109472208B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of face recognition, and more specifically, relates to a method, device, computer equipment and storage medium for issuing a certificate based on face recognition. Background Art
[0002] At present, when people apply for certificates, they first need to go to a photo studio to take a photo and print a photo receipt, and then go to the certificate issuing center; the staff of the certificate issuing center needs to review the photo receipt provided by the user, and if the review is passed, the certificate will be issued. This certificate application process requires users to run back and forth, and there are usually many people queuing at the certificate issuing center, and users have to wait in line for a long time, which is inefficient. In addition, the user's photo needs to be manually reviewed by the staff of the certificate issuing center, which requires manpower and time. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, computer equipment and storage medium for issuing a certificate based on face recognition to solve the problem of low efficiency in issuing a certificate.
[0004] A method for issuing a certificate based on face recognition, comprising:
[0005] Obtaining a certificate production request, and obtaining a certificate image according to the certificate production request;
[0006] Acquire the ID portrait feature according to the ID image;
[0007] Acquire a first face image, input the first face image into a preset liveness detection model, and obtain a liveness detection result;
[0008] If the result of the liveness detection is passed, obtaining a second face image;
[0009] Inputting the second facial image into a preset facial recognition model to obtain facial features of the second facial image, and using the facial features of the second facial image as features of the witness maker;
[0010] Calculate the similarity between the features of the portrait of the certificate and the features of the certificate maker to obtain feature similarity;
[0011] If the feature similarity reaches a preset first threshold, the certificate request is verified and the second face image is sent to the certificate production center.
[0012] A facial recognition-based card processing device, comprising:
[0013] The certificate image acquisition module is used to obtain a certificate production request and obtain a certificate image according to the certificate production request;
[0014] A certificate portrait feature acquisition module, used to acquire certificate portrait features according to the certificate image;
[0015] A liveness detection result acquisition module, used to acquire a first face image, input the first face image into a preset liveness detection model, and acquire a liveness detection result;
[0016] A second face image acquisition module, configured to acquire a second face image if the result of the liveness detection is passed;
[0017] A witness maker feature acquisition module, used to input the second facial image into a preset facial recognition model to acquire facial features of the second facial image, and use the facial features of the second facial image as witness maker features;
[0018] A feature similarity acquisition module is used to calculate the similarity between the feature of the portrait of the certificate and the feature of the certificate maker to obtain the feature similarity;
[0019] The verification result acquisition module is used to verify that the certificate request is passed and send the second facial image to the certificate production center if the feature similarity reaches a preset first threshold.
[0020] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for issuing a certificate based on face recognition are implemented.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned face recognition-based certificate issuance method.
[0022] The above-mentioned certificate issuance method, device, computer equipment and storage medium based on face recognition obtain a certificate issuance request, obtain a certificate image according to the certificate issuance request, and then obtain the certificate portrait features according to the certificate image; then obtain a first face image, input the first face image into a preset liveness detection model, and obtain the result of the liveness detection; if the result of the liveness detection is passed, obtain a second face image, and input the second face image into a preset face recognition model to obtain the face features of the second face image, and use the face features of the second face image as the features of the certificate maker; finally, calculate the similarity between the certificate portrait features and the features of the certificate maker to obtain the feature similarity. If the feature similarity reaches a preset first threshold, the certificate issuance request is verified and the second face image is sent to the certificate issuance center. Through liveness detection and person-ID comparison, it can be ensured that the ID image (second face image) meets the requirements for ID production, so that users can initiate a ID request through the client (mobile terminal) without having to go to a photo studio to take photos and get a photo receipt, or queue up in a ID hall. This reduces the running around and waiting time in the ID process, reduces the manpower investment of the ID center, and improves the efficiency of ID processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 It is a schematic diagram of an application environment of a method for issuing a certificate based on face recognition in one embodiment of the present invention;
[0025] Figure 2 It is a flow chart of a method for obtaining a certificate based on face recognition in one embodiment of the present invention;
[0026] Figure 3 is another flow chart of a method for obtaining a certificate based on face recognition in one embodiment of the present invention;
[0027] Figure 4 is another flow chart of a method for obtaining a certificate based on face recognition in one embodiment of the present invention;
[0028] Figure 5 is another flow chart of a method for obtaining a certificate based on face recognition in one embodiment of the present invention;
[0029] Figure 6 is another flow chart of a method for obtaining a certificate based on face recognition in one embodiment of the present invention;
[0030] Figure 7It is a principle block diagram of a certificate issuing device based on face recognition in one embodiment of the present invention;
[0031] Figure 8 It is a principle block diagram of a second face image acquisition module in a certificate issuing device based on face recognition in one embodiment of the present invention;
[0032] Fig. 9 It is a principle block diagram of a liveness detection result acquisition module in a certificate issuing device based on face recognition in one embodiment of the present invention;
[0033] Fig.10 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] The facial recognition-based card processing method provided in this application can be applied in Figure 1 In an application environment, the client communicates with the server through a network, the server obtains a certificate request through the client, obtains a certificate image according to the certificate request, and then obtains the certificate portrait feature according to the certificate image; then the server obtains a first face image through the client, inputs the first face image into a preset liveness detection model, obtains the result of the liveness detection, if the result of the liveness detection is passed, then obtains a second face image through the client, inputs the second face image into a preset face recognition model to obtain the face features of the second face image, and uses the face features of the second face image as the features of the certificate maker; then the similarity between the certificate portrait feature and the features of the certificate maker is calculated to obtain the feature similarity; finally, if the feature similarity reaches a preset first threshold, the certificate request is verified, and the verification result is returned to the client, and the second face image is sent to the certificate center. Among them, the client can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0036] Optionally, the facial recognition-based certificate issuance method provided in the present application can also be applied separately in a client, wherein the client can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, that is, the facial recognition-based certificate issuance method is applied in a separate client.
[0037] In one embodiment, if Figure 2 As shown, a method for issuing a certificate based on face recognition is provided, which is described by taking the method applied alone on a client as an example, and includes the following steps:
[0038] S10: Obtain a certificate production request, and obtain a certificate image according to the certificate production request.
[0039] Among them, the certificate making request refers to the request for making a certificate initiated by the certificate maker on the client side. For example, the certificate maker can initiate the certificate making request through the WeChat public account (client) of the certificate making center, or the certificate maker can initiate the certificate making request through the terminal device (client) at the certificate issuing office. In this embodiment, certificate making refers to making other certificates except the identity card, and the certificate image refers to the face image on the identity card. Optionally, the certificate image can be acquired through the shooting tool of the client side, for example, the face image on the identity card is captured by the camera of a mobile phone to obtain the certificate image; or the identity card image can be acquired first, and then the client acquires the certificate image by selecting the face image area on the identity card.
[0040] Specifically, the client obtains a certificate making request from the certificate maker; if the client receives the certificate making request, it obtains the permission of the client's shooting tool, and then opens the shooting tool to capture the document image.
[0041] In one embodiment, if Figure 3 As shown, step S10 may specifically include the following steps:
[0042] S11: Obtain identity card information according to the certificate production request.
[0043] The ID card information refers to the ID card number information. Optionally, the ID card information can be obtained by the client through the input of the certificate maker, or by the client collecting the ID card image and then extracting the ID card number area on the ID card.
[0044] Specifically, when the client obtains the certificate maker's certificate request, the client sends an instruction to input the ID number, so that the certificate maker enters the corresponding ID number, thereby obtaining the certificate maker's ID information. Optionally, when the client obtains the certificate maker's certificate request, the client opens a shooting tool to shoot the certificate maker's ID card, and then extracts the ID card number from the captured ID card image to obtain the certificate maker's ID card information. Optionally, the client can also obtain the certificate image that the certificate maker has taken in advance, that is, when the certificate maker's certificate request is obtained, the client obtains the certificate image uploaded by the certificate maker.
[0045] S12: Searching for a corresponding user face image from the national citizen identity information system based on the ID card information.
[0046] Specifically, the client connects to the National Citizen Identity Information System and searches the National Citizen Identity Information System for an ID number corresponding to the ID information based on the ID information obtained. If there is an ID number corresponding to the ID information, the image corresponding to the ID number in the National Citizen Identity Information System is obtained, that is, the user's face image.
[0047] S13: Obtain the user's face image as an ID image.
[0048] Specifically, if there is an ID card number corresponding to the ID card information in the National Citizen Identity Information System, the client obtains the user face image corresponding to the ID card number from the National Citizen Identity Information System and uses the user face image as the certificate image.
[0049] exist Figure 3 In the corresponding embodiment, the ID card information is obtained according to the certificate request, and the corresponding user face image is searched from the national citizen identity information system based on the ID card information; and then the user face image is obtained as the certificate image. The user face image is obtained from the national citizen identity information system as the certificate image, and the acquisition process is relatively simple, which improves the efficiency of obtaining the certificate image. At the same time, the image quality of the obtained certificate image is relatively high, which can improve the accuracy of subsequent person-to-certificate comparison.
[0050] S20: Acquire the ID portrait feature according to the ID image.
[0051] Among them, the ID portrait feature refers to the facial image feature in the ID image.
[0052] Specifically, after acquiring the document image, the client extracts a feature vector in the document image as the document portrait feature through an algorithm for extracting image features. Optionally, the algorithm for extracting the document portrait feature may be a scale-invariant feature transform (SIFT) feature extraction algorithm, a speeded-up robust feature (SURF) feature extraction algorithm, an ORB (Oriented FAST and Rotated BRIEF) feature extraction algorithm, a HOG (Histogram of Oriented Gridients) feature extraction algorithm, a local binary pattern (LBP, Local Binary Patterns) feature extraction algorithm, a Harr feature extraction algorithm, a wavelet feature extraction algorithm or an edge template extraction algorithm, or other feature extraction algorithms.
[0053] Optionally, the ID portrait feature extraction may be obtained by a preset face recognition model. Specifically, after obtaining the ID image, the client inputs the ID image into the preset face recognition model to obtain the face features of the ID image as the ID portrait feature. The algorithm for extracting features that can be used by the preset face recognition model is the same as the algorithm for extracting ID portrait features described above.
[0054] S30: Acquire a first face image, input the first face image into a preset liveness detection model, and obtain a liveness detection result.
[0055] The first face image refers to a user face image used for liveness detection, which can be acquired through a shooting tool of a client.
[0056] Specifically, the client obtains a first face image, and after obtaining the first face image, inputs the first face image into a preset liveness detection model; and determines whether the object corresponding to the first face image is a live body through the preset liveness detection model. If the object corresponding to the first face image is determined to be a live body, the client outputs a result of a liveness detection pass; if the object corresponding to the first face image is determined to be a non-live body, the client outputs a result of a liveness detection fail.
[0057] Optionally, the process of obtaining the preset liveness detection model can be: by pre-acquiring a liveness sample image of a human face, then annotating the liveness features of the human face in the liveness sample image of the human face, and inputting the annotated liveness sample image of the human face into the training model for training, thereby obtaining the preset liveness detection model. Among them, the training model is a model trained using a deep learning algorithm. The liveness feature of the human face refers to a feature indicating that the input face image is a live body, wherein the liveness feature of the human face can be specifically set according to actual needs. Optionally, the recognition result of the moiré pattern of the input image can be used as the liveness feature of the human face. It should be understood that if other users want to impersonate the user, they can impersonate the user through the user's photo or video. At this time, the client obtains the first face image, which is equivalent to reshooting the image, and a large number of moiré patterns will appear in the reshot image. Therefore, the preset liveness detection model can be trained by using the reshot sample image as a negative sample of the liveness feature of the human face, and by using the normal sample image as a positive sample of the liveness feature of the human face, so that the preset liveness detection model can judge whether the first face image input is live or not according to the recognition result of the moiré pattern. Optionally, the action completed according to the random prompt can also be used as a facial liveness feature. For example, if the randomly prompted action is closing the left eye, the detection area can be set to the image of the left eye closed as the positive sample image, and the image of the left eye open as the negative sample image, which are input into the training model for training, so that the preset liveness detection model can identify whether the first face image input is alive based on the action completed by the user.
[0058] S40: If the result of the liveness detection is passed, a second face image is obtained.
[0059] The second facial image refers to a facial image used for comparing a person with an ID card and producing an ID card. Optionally, the second facial image can also be collected and acquired through a shooting tool of the client.
[0060] Optionally, when collecting the second facial image, the client obtains shooting conditions such as shooting angle, lighting and clarity, and determines whether the preset certificate-making conditions are met. If the shooting conditions such as shooting angle, lighting and clarity cannot meet the preset certificate-making conditions for collecting facial images, a prompt message is sent to allow the witness to adjust and collect facial images. Among them, the unsatisfactory situation is, for example, that the angle of the witness's head is too low or too high during shooting, the ambient light is too bright or too dark, the pixel of the shooting tool is too low, and so on. When the shooting conditions such as shooting angle, lighting and clarity meet the preset certificate-making conditions, the facial image is collected again so that the collected facial image can meet the requirements of certificate making. Among them, the preset certificate-making conditions can be specifically set as needed, and are not limited here.
[0061] Specifically, if the client determines that the result of the liveness detection is passed, the client's shooting tool continues to be opened to obtain the face image of the witness maker again as the second face image.
[0062] S50: Input the second facial image into a preset facial recognition model to obtain facial features of the second facial image, and use the facial features of the second facial image as features of the witness maker.
[0063] Specifically, the client inputs the acquired second face image into a preset face recognition model, extracts a feature vector of the second face image as the feature of the person making the certificate, and compares it with the feature of the ID card. The feature extraction algorithm used by the preset face recognition model is the same as the algorithm for extracting the feature of the ID card.
[0064] S60: Calculate the similarity between the portrait feature of the certificate and the feature of the certificate maker to obtain feature similarity.
[0065] Optionally, a feature similarity calculation algorithm such as the Euclidean distance algorithm, the Manhattan distance algorithm, the Minkowski distance algorithm or the cosine similarity algorithm may be used to perform similarity calculation. For example, the feature similarity between the feature of the ID card portrait and the feature of the certificate maker may be obtained by the Euclidean distance algorithm:
[0066]
[0067] Among them, U is the feature of the witness, V is the feature of the ID card, sim(U,V) EDG is the feature similarity between U and V.
[0068] S70: If the feature similarity reaches a preset first threshold, the certificate request is verified and the second face image is sent to the certificate production center.
[0069] The preset first threshold value can be set according to the result of big data statistics. For example, after big data statistics, only when the feature similarity is above 85% can it be ensured that the certificate maker is the certificate holder himself, then 85% can be set as the preset first threshold value. Optionally, the face image through the person-to-certificate comparison can be used as a training sample of the preset face recognition model to obtain the feature similarity of the training sample, and finally the feature similarity obtained after a large number of sample training is used as the preset first threshold value.
[0070] Specifically, the feature similarity obtained in step S60 is compared with a preset first threshold value. If the obtained feature similarity is greater than or equal to the first threshold value, the result of the certificate request verification is output, and the obtained second face image is sent to the certificate production center for certificate production. The certificate production center refers to a data processing center used by the certificate production department to store and process certificate-related images.
[0071] It can be understood that there may be three situations for making a certificate based on the acquired second face image: (1) The confidence of the second face image is high, that is, the corresponding feature similarity is greater than the preset first threshold, and it can be directly used as the image for making a certificate; (2) The confidence of the second face image is average, that is, the corresponding feature similarity is close to the first threshold but does not reach the preset first threshold, and the certificate maker can go to the site for manual review, and then make a certificate after the review is passed; (3) The confidence of the second face image is low, that is, the corresponding feature similarity is much smaller than the preset first threshold, then the result of verification failure is output, and the certificate maker can collect the second face image again to submit for verification or end the certificate making process. Optionally, a threshold can be preset here. When the corresponding feature similarity is less than the threshold, the confidence of the second face image is determined to be low; when the corresponding feature similarity is greater than the threshold but less than the preset first threshold, the confidence of the second face image is determined to be average.
[0072] exist Figure 2In the corresponding embodiment, by obtaining a certificate request, obtaining a certificate image according to the certificate request, and then obtaining the certificate portrait feature according to the certificate image; then obtaining a first face image, inputting the first face image into a preset liveness detection model, and obtaining the result of the liveness detection; if the result of the liveness detection is passed, obtaining a second face image, and inputting the second face image into a preset face recognition model to obtain the face features of the second face image, and using the face features of the second face image as the features of the certificate maker; finally, calculating the similarity between the portrait features of the certificate and the features of the certificate maker to obtain the feature similarity, if the feature similarity reaches a preset first threshold, the certificate request is verified and passed and the second face image is sent to the certificate making center. Through liveness detection and person-to-certificate comparison, it can be ensured that the certificate image (second face image) meets the requirements of certificate making, so that the user can initiate a certificate making request through the client (mobile terminal), without having to go to a photo studio to take photos and get a photo receipt, and without having to queue up in the certificate making hall, reducing the running around and waiting time in the certificate making process, and also reducing the manpower input of the certificate making center, and improving the efficiency of certificate making.
[0073] In one embodiment, in step S40, a second face image is obtained, such as Figure 4 As shown, it may specifically include:
[0074] S41: Obtain the video to be identified.
[0075] The video to be identified refers to a video recorded of the witness for obtaining the second facial image, that is, the second facial image can be obtained by inputting a dynamic image.
[0076] Specifically, the client captures the video of the witness' head through a shooting tool of the client. Optionally, after a preset recording time has passed, or after the witness clicks to complete recording, the client obtains the video to be identified.
[0077] S42: Frame-dividing and normalizing the video to be identified to obtain an image to be identified.
[0078] Among them, frame processing refers to dividing the video to be identified according to a preset time to obtain at least one frame of the image to be processed. Optionally, the total number of frames and the overall time of the video to be identified can be obtained, and then the preset time is obtained by dividing the total number of frames by the overall time, and finally the video to be identified is divided according to the preset time to obtain each frame of the image to be processed. Normalization processing refers to converting the image to be processed into a corresponding unique standard form (the standard form image has invariant characteristics to affine transformations such as translation, rotation, and scaling) through a series of transformations. The normalization processing of the obtained image to be processed is because the image needs to be normalized before the features of the image to be processed can be extracted. Therefore, the pixels of the image to be processed after framing need to be normalized to a uniform pixel to obtain the image to be identified. Optionally, the normalization process is: first create a normalized image, such as an image of 260*260 pixels; then obtain the height and width information of the normalized image; then calculate the result of normalizing the image to be processed according to the normalized image, and replace the original pixel value of the image to be processed with the normalized result, and finally return the normalized image, which is the image to be recognized.
[0079] Specifically, the client performs frame division and normalization processing on the recorded video to be identified, and uses the image obtained after the processing as the image to be identified.
[0080] S43: Input the image to be recognized into the detection model of the head posture angle, and obtain the second face image according to the preset head angle value.
[0081] The head posture angle refers to the angle values of the pitch, yaw and roll of the witness's head. Optionally, the head posture angle detection model is a detection model trained by a deep learning algorithm, which can be used to identify the angle value of the posture angle of the witness's head posture through the input image to be identified. The preset head angle value refers to the head posture angle that meets the preset certificate making conditions.
[0082] Specifically, the client inputs the image to be identified into the detection model of the head posture angle, and if the input image to be identified meets the preset head angle value, the image to be identified is obtained as the second face image. Optionally, if there are more than two images to be identified that meet the preset head angle value, the first image to be identified that is obtained can be used as the second face image.
[0083] Furthermore, in the process of obtaining the video to be identified in step S41, the client sends correction information of the head angle, such as text prompt information or voice prompt information, so that the head of the witness maker is adjusted according to the preset head angle value. When the head posture angle meets the preset head angle value, the recording of the video to be identified is terminated.
[0084] It can be understood that in the process of acquiring the first facial image, the method and steps provided in this embodiment can also be used to acquire it.
[0085] exist Figure 4 In the corresponding embodiment, the video to be identified is obtained, the video to be identified is framed and normalized, the image to be identified is obtained, and finally the image to be identified is input into the detection model of the head posture angle, and the second face image is obtained according to the preset head angle value. The user can obtain the second face image by recording a video, which expands the form of obtaining the second face image; during the process of recording a video, the user only needs to have one head angle value that meets the preset value to obtain the second face image, without having to shoot multiple times for collection, which improves the efficiency of obtaining the second face image.
[0086] In one embodiment, in step S30, the first face image is input into a preset liveness detection model to obtain a liveness detection result, such as Figure 5 As shown, the following steps may be specifically included:
[0087] S31: Inputting the first face image into a preset liveness detection model to obtain face liveness features.
[0088] Specifically, the client inputs the first face image into the preset liveness detection model, and obtains the face liveness feature of the first face image according to the preset liveness detection model. Figure 2 The corresponding embodiments are the same and will not be described again. The face liveness feature refers to a feature indicating that the object corresponding to the input first face image is a live object.
[0089] S32: If the facial liveness feature meets the preset conditions, the result of the liveness detection is passed, wherein the preset conditions are at least one of the following three conditions: completing a preset facial movement, having at least one inherent liveness feature, or the infrared imaging meeting a preset body temperature distribution range.
[0090] Among them, completing the preset facial action means that the client sends the corresponding facial action instruction to instruct the witness to make the corresponding facial action, and then determines whether the witness is alive by using the preset liveness detection model based on whether the witness makes the corresponding facial action, such as prompting the witness to blink, turn the head to the left, or open the mouth. Intrinsic liveness features refer to features unique to living things. For example, the client can use the preset liveness detection model to detect whether the witness's eyes have rhythmic movements to determine whether the witness is alive. The rhythm of the eyes means that a normal person will blink regularly at regular intervals. For example, by collecting facial images at regular intervals, if the eyelid position changes at fixed time intervals, it means that the input facial image has eyeball rhythm, and it is determined to be alive. It can also be determined by recording a video whether the witness's eyes have rhythmic movements. Infrared imaging conforming to the preset body temperature distribution range means that the first face image is obtained by using the infrared imaging method, and then the temperature of the first face image obtained is determined to be a normal body temperature distribution by using the preset liveness detection model to determine whether the witness is alive.
[0091] Specifically, after acquiring the liveness features of the human face, the client makes a judgment according to the preset conditions, and outputs a result indicating that the liveness verification has passed if the acquired liveness features of the human face meet the preset conditions.
[0092] S33: If the facial liveness feature does not meet the preset conditions, the liveness detection result is failed.
[0093] Specifically, if the obtained face liveness features do not meet the preset conditions as determined by the preset liveness detection model, the client outputs the liveness detection result as failed. Optionally, when the liveness detection result is failed, the certificate maker's certificate request is rejected and the certificate making process ends; the certificate maker can also be asked to re-perform liveness detection, and then the subsequent certificate making process is carried out according to the liveness detection result.
[0094] exist Figure 5 In the corresponding embodiment, the first face image is input into the preset liveness detection model to obtain the face liveness feature; if the face liveness feature meets the preset conditions, the result of the liveness detection is passed; if the face liveness feature does not meet the preset conditions, the result of the liveness detection is failed. By performing liveness detection on the certificate maker, it is possible to avoid the situation where a fake user is used to make a certificate, ensure the user's information security, and ensure that the certificate is made for the user's true intention. Furthermore, through liveness detection, the user can meet the requirements for certificate making on the client (mobile terminal) and complete the relevant procedures for certificate making on the client, without having to go to the photo studio to take a photo and get a receipt, or queue up at the certificate issuing center, which reduces the time of running back and forth and waiting, and improves the efficiency of certificate issuing.
[0095] In one embodiment, after step S60, that is, after the step of calculating the similarity between the ID portrait feature and the ID maker feature to obtain the feature similarity, Figure 6 As shown, the following steps may be specifically included:
[0096] S81: If the feature similarity reaches a preset first threshold, the second face image is set as a positive sample image.
[0097] The specific setting method of the preset first threshold is as follows: Figure 2 The corresponding embodiments are the same, for example, it can be 80%, 85% or 90%, etc., which can be set according to the actual situation, and no specific limitation is made here. It can be understood that as people age, their faces will also change. Therefore, in order to improve the recognition accuracy of the preset face recognition model, in one embodiment, when setting the training samples of the preset face recognition model, face images of different ages can be used as training samples to obtain feature similarities at different ages. When setting the feature similarity, different settings are made according to different age groups.
[0098] Specifically, if the feature similarity reaches a preset first threshold, it can indicate that the certificate maker is consistent with the certificate, so the client can use the acquired second face image as a positive sample image for training a preset face recognition model.
[0099] S82: If the feature similarity is less than a preset second threshold, setting the second face image as a negative sample image.
[0100] Among them, the preset second threshold value can also be set according to the results of big data statistics. For example, according to big data statistics, if the feature similarity is less than 50%, it can be determined that the certificate maker does not match the certificate, and 50% is set as the preset second threshold value. If the feature similarity of the acquired second facial image is less than the preset second threshold value, the client uses the second facial image as a negative sample image for training the preset face recognition model. Optionally, when the feature similarity is greater than the preset second threshold value and less than the preset first threshold value, since it is impossible to determine whether the certificate maker matches the certificate, this part of the second facial image is not used as a positive sample image or a negative sample image.
[0101] S83: Inputting the positive sample image or the negative sample image into a preset face recognition model to update the preset face recognition model.
[0102] Specifically, the client inputs the positive sample image or negative sample image obtained according to step S81 or step S82 into the preset face recognition model, so that the preset face recognition model learns and updates the recognition model, and obtains the updated preset face recognition model, which can improve the recognition accuracy of the preset person recognition model. Optionally, the client can be set up in the service point of the certificate production center, and the certificate issuing personnel can perform manual monitoring when performing person-certificate comparison and liveness detection to ensure that the certificate issuer is the user himself and there is no behavior of impersonating the user to apply for a certificate by using video or the like; after the preset face recognition model reaches a certain recognition accuracy, the client can be promoted to mobile terminals such as mobile phones.
[0103] Optionally, a preset third threshold value may be set, wherein the preset third threshold value is greater than the preset first threshold value, for example, the preset third threshold value is set to 95%. When the feature similarity reaches the third threshold value, the second face image is saved to the certificate production center and used as a new certificate image, that is, as a new reference image for person-to-certificate comparison.
[0104] exist Figure 6 In the corresponding embodiment, if the feature similarity reaches a preset first threshold, the second face image is set as a positive sample image; if the feature similarity is less than a preset second threshold, the second face image is set as a negative sample image; and then the positive sample image or the negative sample image is input into the preset face recognition model to update the preset face recognition model. By setting a threshold to obtain positive and negative sample images, the preset face recognition model can improve the recognition accuracy. At the same time, when the accuracy of the preset face recognition model is low, it is set in the certificate processing center, combined with manual improvement of the recognition accuracy and then expanded to the mobile terminal, so that the face recognition-based certificate processing method of this embodiment can be quickly implemented, reducing the large number of face image sample inputs required in the early stage, and improving the efficiency of building the preset face recognition model.
[0105] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0106] In one embodiment, a facial recognition-based card issuing device is provided, and the facial recognition-based card issuing device corresponds to the facial recognition-based card issuing method in the above embodiment. Figure 7 As shown, the face recognition-based certificate issuing device includes a certificate image acquisition module 10, a certificate portrait feature acquisition module 20, a liveness detection result acquisition module 30, a second face image acquisition module 40, a certificate maker feature acquisition module 50, a feature similarity acquisition module 60 and a verification result acquisition module 70. The functional modules are described in detail as follows:
[0107] The certificate image acquisition module 10 is used to obtain a certificate production request and obtain a certificate image according to the certificate production request.
[0108] The ID portrait feature acquisition module 20 is used to acquire the ID portrait features according to the ID image.
[0109] The liveness detection result acquisition module 30 is used to acquire a first face image, input the first face image into a preset liveness detection model, and acquire a liveness detection result.
[0110] The second face image acquisition module 40 is used to acquire a second face image if the result of the liveness detection is passed.
[0111] The witness maker feature acquisition module 50 is used to input the second face image into a preset face recognition model to obtain the face features of the second face image, and use the face features of the second face image as the witness maker features.
[0112] The feature similarity acquisition module 60 is used to calculate the similarity between the feature of the portrait of the certificate and the feature of the certificate maker to obtain the feature similarity.
[0113] The verification result acquisition module 70 is used to verify that the certificate request is passed and send the second face image to the certificate production center if the feature similarity reaches a preset first threshold.
[0114] Furthermore, if Figure 8 As shown, the second face image acquisition module 40 includes a to-be-recognized video acquisition unit 41 , a to-be-recognized image acquisition unit 42 and a second face image acquisition unit 43 .
[0115] The to-be-recognized video acquisition unit 41 is used to acquire the to-be-recognized video.
[0116] The to-be-recognized image acquisition unit 42 is used to perform frame division and normalization processing on the to-be-recognized video to obtain the to-be-recognized image.
[0117] The second face image acquisition unit 43 is used to input the image to be recognized into the detection model of the head posture angle, and acquire the second face image according to the preset head angle value.
[0118] Furthermore, if Fig. 9 As shown, the living body detection result acquisition module 30 includes a living body feature acquisition unit 31, a first result acquisition unit 32 and a second result acquisition unit 33.
[0119] The living body feature acquisition unit 31 is used to input the first face image into a preset living body detection model to acquire the living body feature of the face.
[0120] The first result acquisition unit 32 is used to pass the liveness detection result if the liveness feature of the face meets the preset conditions, wherein the preset conditions are at least one of the following three conditions: completing a preset facial movement, having at least one inherent liveness feature, or the infrared imaging meeting a preset body temperature distribution range.
[0121] The second result obtaining unit 33 is used to determine that the result of the liveness detection is failed if the liveness feature of the face does not meet the preset conditions.
[0122] Furthermore, the face recognition-based certificate issuing device provided in the embodiment of the present invention also includes a recognition model updating module, wherein the recognition model updating module includes a positive sample image acquiring unit, a negative sample image acquiring unit and a model updating unit.
[0123] A positive sample image acquisition unit, configured to set the second face image as a positive sample image if the feature similarity reaches a preset first threshold;
[0124] A negative sample image acquisition unit, configured to set the second face image as a negative sample image if the feature similarity is less than a preset second threshold;
[0125] The model updating unit is used to input the positive sample image or the negative sample image into the preset face recognition model to update the preset face recognition model.
[0126] Furthermore, the certificate portrait feature acquisition module 20 includes an identity card information acquisition unit, a user face image acquisition unit and a certificate image acquisition unit.
[0127] The identity card information acquisition unit is used to acquire the identity card information according to the identity card production request.
[0128] The user face image acquisition unit is used to search for the corresponding user face image from the national citizen identity information system based on the identity card information.
[0129] The certificate image acquisition unit is used to acquire the user's face image as the certificate image.
[0130] For the specific definition of the certificate issuing device based on face recognition, please refer to the definition of the certificate issuing method based on face recognition above, which will not be repeated here. Each module in the above-mentioned certificate issuing device based on face 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.
[0131] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, a method for issuing a certificate based on face recognition is implemented.
[0132] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0133] Obtain a certificate production request, and obtain a certificate image according to the certificate production request;
[0134] Acquire the ID portrait feature according to the ID image;
[0135] Acquire a first face image, input the first face image into a preset liveness detection model, and obtain a liveness detection result;
[0136] If the result of the liveness detection is passed, a second face image is obtained;
[0137] Inputting the second facial image into a preset facial recognition model to obtain facial features of the second facial image, and using the facial features of the second facial image as features of the witness;
[0138] Calculate the similarity between the features of the ID card portrait and the features of the ID card maker to obtain the feature similarity;
[0139] If the feature similarity reaches a preset first threshold, the certificate request is verified and the second face image is sent to the certificate production center.
[0140] 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:
[0141] Obtain a certificate production request, and obtain a certificate image according to the certificate production request;
[0142] Acquire the ID portrait feature according to the ID image;
[0143] Acquire a first face image, input the first face image into a preset liveness detection model, and obtain a liveness detection result;
[0144] If the result of the liveness detection is passed, a second face image is obtained;
[0145] Inputting the second facial image into a preset facial recognition model to obtain facial features of the second facial image, and using the facial features of the second facial image as features of the witness;
[0146] Calculate the similarity between the features of the ID card portrait and the features of the ID card maker to obtain the feature similarity;
[0147] If the feature similarity reaches a preset first threshold, the certificate request is verified and the second face image is sent to the certificate production center.
[0148] 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).
[0149] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0150] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for issuing a certificate based on face recognition, characterized in that: include: Obtaining a certificate production request, and obtaining a certificate image according to the certificate production request; the certificate image is a face image on the identity card; the certificate production request refers to a request for producing other certificates except the identity card; Acquire the ID portrait feature according to the ID image; Acquire a first face image, input the first face image into a preset liveness detection model, and obtain a liveness detection result; If the result of the liveness detection is passed, a second face image is obtained; the second face image is a face image used for comparing the person with the certificate and making the certificate; Inputting the second facial image into a preset facial recognition model to obtain facial features of the second facial image, and using the facial features of the second facial image as features of the witness maker; Calculate the similarity between the features of the portrait of the certificate and the features of the certificate maker to obtain feature similarity; If the feature similarity reaches a preset first threshold, the certificate request is verified and the second face image is sent to the certificate production center.
2. The facial recognition-based card processing method according to claim 1, characterized in that: The obtaining of the second face image comprises: Get the video to be identified; Performing frame division and normalization processing on the video to be identified to obtain an image to be identified; The image to be recognized is input into a detection model of the head posture angle, and a second face image is obtained according to a preset head angle value.
3. The method for issuing a certificate based on face recognition as claimed in claim 1, characterized in that: The step of inputting the first face image into a preset liveness detection model to obtain a liveness detection result includes: Inputting the first face image into a preset liveness detection model to obtain face liveness features; If the facial liveness feature meets the preset conditions, the liveness detection result is passed, wherein the preset conditions are at least one of the following three conditions: completing a preset facial action, having at least one inherent liveness feature, or the infrared imaging meets the preset body temperature distribution range; If the facial liveness feature does not meet the preset condition, the result of the liveness detection is failure.
4. The method for issuing a certificate based on face recognition as claimed in claim 1, characterized in that: After the step of calculating the similarity between the features of the portrait of the certificate and the features of the certificate maker to obtain the feature similarity, the method further includes: If the feature similarity reaches a preset first threshold, setting the second face image as a positive sample image; If the feature similarity is less than a preset second threshold, setting the second face image as a negative sample image; The positive sample image or the negative sample image is input into the preset face recognition model to update the preset face recognition model.
5. The method for issuing a certificate based on face recognition as claimed in claim 1, characterized in that: Acquiring a certificate image according to the certificate production request includes: Obtaining identity card information according to the certificate making request; Based on the ID card information, searching for a corresponding user face image from the national citizen identity information system; The user's face image is obtained as an ID image.
6. A facial recognition-based card-issuing device, characterized in that: include: The certificate image acquisition module is used to obtain a certificate production request and obtain a certificate image according to the certificate production request; the certificate image is a face image on the identity card; the certificate production request refers to a request to produce other certificates except the identity card; A certificate portrait feature acquisition module, used to acquire certificate portrait features according to the certificate image; A liveness detection result acquisition module, used to acquire a first face image, input the first face image into a preset liveness detection model, and acquire a liveness detection result; A second face image acquisition module, used for acquiring a second face image if the result of the liveness detection is passed; the second face image is a face image used for comparing the person with the certificate and making the certificate; A witness maker feature acquisition module, used to input the second facial image into a preset facial recognition model to acquire facial features of the second facial image, and use the facial features of the second facial image as witness maker features; A feature similarity acquisition module is used to calculate the similarity between the feature of the portrait of the certificate and the feature of the certificate maker to obtain the feature similarity; The verification result acquisition module is used to verify that the certificate request is passed and send the second facial image to the certificate production center if the feature similarity reaches a preset first threshold.
7. The facial recognition-based card issuing device according to claim 6, characterized in that: The second face image acquisition module includes a to-be-recognized video acquisition unit, a to-be-recognized image acquisition unit, and a second face image acquisition unit; The to-be-identified video acquisition unit is used to acquire the to-be-identified video; The to-be-recognized image acquisition unit is used to perform frame segmentation and normalization processing on the to-be-recognized video to obtain the to-be-recognized image; The second face image acquisition unit is used to input the image to be recognized into the detection model of the head posture angle, and acquire the second face image according to a preset head angle value.
8. The facial recognition-based card issuing device according to claim 6, characterized in that: The living body detection result acquisition module includes a living body feature acquisition unit, a first result acquisition unit and a second result acquisition unit; The living body feature acquisition unit is used to input the first face image into a preset living body detection model to acquire the face living body feature; The first result acquisition unit is used to determine that the result of the liveness detection is passed if the face liveness feature meets a preset condition, wherein the preset condition is at least one of the following three conditions: completing a preset facial action, having at least one inherent liveness feature, or infrared imaging meeting a preset body temperature distribution range; The second result acquisition unit is used to determine that the result of the liveness detection is failed if the face liveness feature does not meet the preset condition.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for issuing a certificate based on face recognition as described in any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the facial recognition-based card issuance method as described in any one of claims 1 to 5 are implemented.
