[go: up one dir, main page]

CN114840830B - Authentication method, device, computer equipment and storage medium - Google Patents

Authentication method, device, computer equipment and storage medium

Info

Publication number
CN114840830B
CN114840830B CN202110049447.8A CN202110049447A CN114840830B CN 114840830 B CN114840830 B CN 114840830B CN 202110049447 A CN202110049447 A CN 202110049447A CN 114840830 B CN114840830 B CN 114840830B
Authority
CN
China
Prior art keywords
image
sample
candidate
processing parameters
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110049447.8A
Other languages
Chinese (zh)
Other versions
CN114840830A (en
Inventor
胡一凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110049447.8A priority Critical patent/CN114840830B/en
Publication of CN114840830A publication Critical patent/CN114840830A/en
Application granted granted Critical
Publication of CN114840830B publication Critical patent/CN114840830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The application relates to an identity verification method, an identity verification device, computer equipment and a storage medium. The method comprises the steps of obtaining a certificate video obtained by carrying out video acquisition on a target certificate, screening target video frames meeting image definition conditions from the certificate video, extracting a first face image and a second face image corresponding to the target certificate from the target video frames, wherein the image size of the first face image is smaller than that of the second face image, obtaining at least one group of target image processing parameters, carrying out image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image, comparing each third face image with the second face image to obtain corresponding image comparison results, and determining the identity verification result of the target certificate according to the image comparison results. The method can accurately verify the identity of the target certificate.

Description

Identity verification method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an identity verification method, an identity verification device, a computer device, and a storage medium.
Background
With the development of computer technology, personal information is at risk of being stolen and embezzled by others, so various ways of verifying the authenticity of personal certificates appear, such as comparing the face in the certificate image with the face stored in advance, and the like, and providing corresponding services for users passing the identity verification, thereby ensuring the safety of user information.
However, the conventional authentication method is often based on pre-stored face information of the user, but for the user without pre-stored face information, the authenticity of the user certificate image cannot be identified.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an authentication method, apparatus, computer device, and storage medium that can accurately authenticate the authenticity of a document image.
A method of identity verification, the method comprising:
Acquiring a certificate video obtained by video acquisition of a target certificate, and screening out a target video frame meeting the clear condition of an image from the certificate video;
Extracting a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than that of the second face image;
acquiring at least one group of target image processing parameters, and respectively carrying out image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image;
and comparing each third face image with the second face image to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result.
In one embodiment, the method further comprises:
Acquiring sample certificate images, and determining sample categories to which each sample certificate image belongs respectively;
Extracting a first sample face image and a second sample face image from the sample certificate image, wherein the image size of the first sample face image is smaller than that of the second sample face image;
Acquiring a plurality of groups of candidate image processing parameters, and respectively carrying out image enhancement processing on the first sample face image based on each group of candidate image processing parameters to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters;
Comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result;
And screening at least one group of target image processing parameters from the plurality of groups of candidate image processing parameters based on the sample image comparison result and the sample category.
In one embodiment, the obtaining multiple sets of candidate image processing parameters, and performing image enhancement processing on the first sample face image based on each set of candidate image processing parameters, to obtain a third sample face image corresponding to each set of candidate image processing parameters, includes:
Determining current candidate image processing parameters corresponding to the current iteration from a sample parameter set, and acquiring standby image processing parameters screened by the previous iteration;
Respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters;
The screening at least one set of target image processing parameters from the multiple sets of candidate image processing parameters based on the sample image comparison result and the sample category includes:
For each group of image processing parameters in the current iteration, generating a characteristic curve according to a corresponding sample comparison result and a corresponding sample class, determining a corresponding characteristic area based on the characteristic curve, and screening standby image processing parameters meeting an area matching condition in the current iteration based on the characteristic area;
Selecting candidate image processing parameters which do not participate in iterative computation from the sample parameter set as current candidate image processing parameters corresponding to the next iteration, and taking standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration;
Returning to the step of respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters, continuing to execute until all candidate image processing parameters in the sample parameter set are traversed, stopping, and screening out image processing parameters meeting area matching conditions in the last iteration based on the characteristic area obtained in the last iteration;
and taking the image processing parameters meeting the area matching condition in the last iteration as target image processing parameters.
An authentication apparatus, the apparatus comprising:
The acquisition module is used for acquiring a certificate video obtained by carrying out video acquisition on a target certificate, and screening out a target video frame meeting the image definition condition from the certificate video;
The extraction module is used for extracting a first face image and a second face image corresponding to the target certificate from the target video frame, and the image size of the first face image is smaller than that of the second face image;
the image enhancement module is used for acquiring at least one group of target image processing parameters, and respectively carrying out image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image;
And the comparison module is used for comparing each third face image with the second face image respectively to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
Acquiring a certificate video obtained by video acquisition of a target certificate, and screening out a target video frame meeting the clear condition of an image from the certificate video;
Extracting a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than that of the second face image;
acquiring at least one group of target image processing parameters, and respectively carrying out image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image;
and comparing each third face image with the second face image to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Acquiring a certificate video obtained by video acquisition of a target certificate, and screening out a target video frame meeting the clear condition of an image from the certificate video;
Extracting a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than that of the second face image;
acquiring at least one group of target image processing parameters, and respectively carrying out image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image;
and comparing each third face image with the second face image to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result.
The identity verification method, the identity verification device, the computer equipment and the storage medium screen out target video frames meeting the image definition condition from the certificate video containing the target certificate so as to obtain clear video frames, thereby obtaining clear target certificates. And extracting a first face image and a second face image corresponding to the target certificate from the target video frame to obtain the first face image and the second face image in the target certificate. The image size of the first face image is smaller than that of the second face image, so that the first face image is more easily influenced by light rays and angles during video acquisition, the first face image is subjected to image enhancement processing through at least one group of target image processing parameters, the influence of the angles, light rays and the like of video acquisition on the first face image is removed, and at least one image enhancement processed third face image is obtained. And comparing each third face image after removing the influence of the angle, light and the like of video acquisition on the first face image with the second face image to obtain image comparison results of the third face image and the second face image corresponding to different target image processing parameters, thereby obtaining image comparison results of different third face images obtained by different image enhancement modes and the same second face image. According to the image comparison results of the different third face images and the same second face image, whether the two face images in the target certificate are face images of the same user or not can be accurately identified, and therefore authenticity of the target certificate can be identified, and identity verification of the target certificate can be achieved.
A method of training an image recognition model, the method comprising:
Acquiring sample certificate images, and determining sample categories to which each sample certificate image belongs respectively;
Extracting a first sample face image and a second sample face image from the sample certificate image, wherein the image size of the first sample face image is smaller than that of the second sample face image;
Respectively carrying out image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters;
Comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result;
training the image recognition model to be trained based on the sample image comparison result and the sample category until the training stopping condition is reached, so as to obtain a trained target image recognition model, wherein the trained target image recognition model comprises at least one group of target image processing parameters for carrying out identity verification on a target certificate.
A training apparatus for an image recognition model, the apparatus comprising:
The sample acquisition module is used for acquiring sample certificate images and determining sample categories to which each sample certificate image belongs respectively;
the face extraction module is used for extracting a first sample face image and a second sample face image from the sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image;
the processing module is used for respectively carrying out image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters;
the comparison result obtaining module is used for respectively comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result;
The training module is used for training the image recognition model to be trained based on the sample image comparison result and the sample category until the training stopping condition is reached, so as to obtain a trained target image recognition model, wherein the trained target image recognition model comprises at least one group of target image processing parameters for carrying out identity verification on a target certificate.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
Acquiring sample certificate images, and determining sample categories to which each sample certificate image belongs respectively;
Extracting a first sample face image and a second sample face image from the sample certificate image, wherein the image size of the first sample face image is smaller than that of the second sample face image;
Respectively carrying out image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters;
Comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result;
training the image recognition model to be trained based on the sample image comparison result and the sample category until the training stopping condition is reached, so as to obtain a trained target image recognition model, wherein the trained target image recognition model comprises at least one group of target image processing parameters for carrying out identity verification on a target certificate.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Acquiring sample certificate images, and determining sample categories to which each sample certificate image belongs respectively;
Extracting a first sample face image and a second sample face image from the sample certificate image, wherein the image size of the first sample face image is smaller than that of the second sample face image;
Respectively carrying out image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters;
Comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result;
training the image recognition model to be trained based on the sample image comparison result and the sample category until the training stopping condition is reached, so as to obtain a trained target image recognition model, wherein the trained target image recognition model comprises at least one group of target image processing parameters for carrying out identity verification on a target certificate.
In the training method, the training device, the computer equipment and the storage medium of the image recognition model, in the embodiment, the first sample face image and the second sample face image are extracted from the sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image, so that the first sample face image is more easily influenced by light rays and angles during image acquisition. And respectively carrying out image enhancement processing on the first sample face image through each group of target image processing parameters in the image recognition model to be trained so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image and obtain each third sample face image subjected to image enhancement processing with different degrees. After the interference generated by angles, light rays and the like is eliminated, each third sample face image is respectively compared with the corresponding second sample face image to obtain a corresponding sample image comparison result, and the target image processing parameters with the best image enhancement effect can be screened out from multiple groups of image processing parameters based on the difference between the sample image comparison result and the sample category. The identity of the target certificate is verified through the trained image recognition model, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved. The trained image recognition model has high recognition precision and high calculation speed, and can improve the efficiency of identity verification of the target certificate.
Drawings
FIG. 1 is a diagram of an application environment for an authentication method in one embodiment;
FIG. 2 is a flow chart of an authentication method in one embodiment;
FIG. 3 is a schematic view of an interface for calculating a lateral tilt angle in one embodiment;
FIG. 4 is a schematic diagram of a face key point detection result in another embodiment;
FIG. 5 is an application scenario of authentication in one embodiment;
FIG. 6 is a flowchart illustrating steps for determining target image processing parameters in one embodiment;
FIG. 7 is a flow chart of a training method of an image recognition model in one embodiment;
FIG. 8 is a flowchart illustrating steps for obtaining a third sample face image corresponding to each set of candidate image processing parameters, respectively, in one embodiment;
FIG. 9 is a flow diagram of image enhancement processing performed by a set of candidate image processing parameters of an image recognition model in one embodiment;
FIG. 10 is a schematic diagram of a test flow of an image recognition model in one embodiment;
FIG. 11 is a block diagram of an authentication device in one embodiment;
FIG. 12 is a block diagram of a training apparatus for image recognition models in one embodiment;
Fig. 13 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The present application relates to the field of artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) technology, wherein artificial intelligence is a theory, method, technique and application system that utilizes a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision. The scheme provided by the embodiment of the application relates to an artificial intelligence identity verification method, and is specifically described by the following embodiments.
The identity verification method provided by the application can be applied to an identity verification system shown in figure 1. As shown in fig. 1, the authentication system includes a terminal 110 and a server 120. In one embodiment, both the terminal 110 and the server 120 may individually perform the authentication method provided in the embodiment of the present application. Terminal 110 and server 120 may also cooperate to perform the authentication method provided in embodiments of the present application. When the terminal 110 and the server 120 cooperate to perform the authentication method provided in the embodiment of the present application, the terminal 110 acquires a document video obtained by video capturing of a target document, and sends the document video to the server 120. The server 120 screens out target video frames satisfying the image sharpness condition from the certificate video, and extracts a first face image 112 and a second face image 114 corresponding to the target certificate from the target video frames, and the image size of the first face image 112 is smaller than the image size of the second face image 114. The server 120 obtains at least one set of target image processing parameters, and performs image enhancement processing on the first face image based on each set of target image processing parameters, so as to obtain at least one third face image. The server 120 compares each third face image with the second face image to obtain a corresponding image comparison result, and determines an identity verification result of the target certificate according to the image comparison result. The server 120 returns the authentication result of the target certificate to the terminal 110.
The terminal 110 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The terminal 110 and the server 120 may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
In one embodiment, as shown in fig. 2, an authentication method is provided, which is described by taking as an example that the method is applied to a computer device in fig. 1 (the computer device may be a terminal or a server in fig. 1 in particular), and includes the following steps:
Step S202, obtaining a certificate video obtained by video acquisition of a target certificate, and screening target video frames meeting the image definition condition from the certificate video.
The target certificate is a certificate for representing the identity of the user, such as a resident identification card, a harbor and australia pass or a temporary residence card corresponding to each different region. The certificate video is a video obtained by video acquisition of a target certificate, and the target certificate can be stably displayed in a stationary manner in the video acquisition process, can be turned over for display and the like. The target certificate can be specifically at least one of tilting up and down, tilting left and right and tilting up and down when being displayed in a flipping way. When the target certificate keeps stationary, the corresponding video acquisition equipment can also keep stationary, or the acquisition angle is changed in the process of acquiring the video, and the like, and the embodiment of the application is not limited to the stationary video acquisition equipment.
The image definition condition refers to a preset condition related to the definition degree of an image, and comprises a certificate definition condition. The document clarity condition can be characterized by the inclination angle of the document.
In one embodiment, the image sharpness condition may further include a face sharpness condition, which may be characterized by a degree of blur of the face image.
Specifically, the computer device may obtain a document video resulting from video capture of the target document. When the computer equipment is a server, the computer equipment can acquire the certificate video uploaded by the terminal, and also can acquire the stored certificate video in the server, wherein the stored certificate video is obtained by the terminal in advance carrying out video acquisition on the target certificate.
In the case that the computer device is a terminal, the terminal may acquire the certificate video previously acquired from the local or acquire the certificate video acquired through video acquisition from a third party terminal.
In this embodiment, the terminal may perform video acquisition on the target certificate through the camera, to obtain a corresponding certificate video. Further, in the video acquisition process, at least one of up-down overturn or left-right overturn can be performed on the target certificate so as to obtain a corresponding certificate video.
After obtaining the certificate video, the computer equipment determines whether the candidate video frames meet the image definition condition according to each candidate video frame in the certificate video, and takes the video frames meeting the image definition condition as target video frames.
Further, in the case that the image sharpness condition is a certificate sharpness condition, candidate video frames satisfying the certificate sharpness condition are acquired from the certificate video as target video frames. And under the condition that the image definition condition is the face definition condition, acquiring candidate video frames meeting the face definition condition from the certificate video as target video frames. Under the condition that the image definition conditions comprise the certificate definition conditions and the face definition conditions, candidate video frames meeting both the certificate definition conditions and the face definition conditions are collected from the certificate video as target video frames.
In one embodiment, the computer device may extract a preset number of candidate video frames from the credential video. The method for extracting the candidate video frames from the certificate video comprises the steps of determining video duration of the certificate video, determining candidate moments for extracting candidate video frames of each frame based on the video duration and the preset number of the certificate video, and extracting the video frames from each candidate moment in the certificate video to obtain the preset number of the candidate video frames. For example, if 5 candidate video frames are extracted from a certificate video with a duration of 50 seconds, then video frames can be extracted every 10 seconds, and 10, 20, 30, 40, and 50 seconds of candidate video frames can be obtained.
In one embodiment, the computer device may obtain a document video obtained by video capturing of the target document, and screen the document video for a first face image that satisfies the image sharpness condition. Further, the computer device may determine whether the first face images in each candidate video frame in the credential video satisfy the image sharpness condition, thereby screening out each first face image that satisfies the image sharpness condition.
Step S204, a first face image and a second face image corresponding to the target certificate are extracted from the target video frame, and the image size of the first face image is smaller than that of the second face image.
Specifically, the target certificate contains a first face image and a second face image. The image size of the first face image is smaller than the image size of the second face image. For each frame of target video frame, the computer device may perform target face detection on the target video frame to segment out a first face image and a second face image in the target video frame.
Step S206, at least one group of target image processing parameters are obtained, and image enhancement processing is performed on the first face image based on each group of target image processing parameters, so as to obtain at least one third face image.
The image enhancement processing is a processing method of sharpening a blurred image or enhancing a feature of a region of interest and suppressing a feature of a region other than the region of interest. The image processing parameter is a parameter for performing enhancement processing on an image.
The target image processing parameters may include at least one of a de-striping parameter, a sharpening parameter, a de-white noise parameter, a de-fog parameter. The de-striping parameter is used to remove striping from the image, the sharpening parameter is used to enhance the contrast of the image, and the de-white noise parameter is used to remove white noise from the image. The defogging parameter is used to remove the fogging effect in the image. Contrast refers to the degree of contrast of the drawn image. White noise is noise having equal noise energy in each of the frequency bands of equal bandwidth over a wide frequency range.
Specifically, the computer equipment acquires at least one group of target image processing parameters, and performs image enhancement processing on the first face image through the target image processing parameters aiming at each group of acquired target image processing parameters to obtain a third face image corresponding to the target image processing parameters, so as to obtain a third face image respectively corresponding to each group of target image processing parameters.
When the target image processing parameters comprise at least two processing sub-parameters, performing image enhancement processing on the first face image according to the processing sequence corresponding to each processing sub-parameter. And regarding the processing sub-parameters in the same group of target image processing parameters, taking the image processed by the last processing sub-parameter as the object processed by the next processing sub-parameter. For example, the set of target image processing parameters includes a striping parameter, a sharpening parameter, and a white noise removing parameter, where the striping parameter is used to perform striping processing on the first face image, the sharpening parameter is used to perform sharpening processing on the image obtained after the striping processing, and the white noise removing parameter is used to perform white noise removing processing on the image obtained after the sharpening parameter processing, so as to obtain a third face image corresponding to the set of target image processing parameters.
And step S208, comparing each third face image with the second face image to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result.
The image comparison result comprises at least one of similarity and difference between the third face image and the second face image respectively. The authentication result includes authentication pass and authentication fail.
Specifically, for each third face image, the computer device calculates a similarity between the third face image and the second face image, and the similarity is used as an image comparison result. And when the similarity is larger than a preset similarity threshold, judging that the identity verification of the target certificate passes. And when the similarity is smaller than or equal to a preset similarity threshold, judging that the identity verification of the target certificate fails. For example, the preset similarity threshold is 0.65. And verifying that the target certificate is a real certificate, namely the first face image and the second face image in the target image are face images of the same person. The verification failure indicates that the target document is a counterfeit document, i.e., the first face image and the second face image in the target image are not face images of the same person.
In one embodiment, the computer device compares each similarity to a preset similarity threshold, and determines that the authentication result of the target document is authentication pass when each similarity is greater than the preset similarity threshold.
In one embodiment, the computer device compares each similarity to a preset similarity threshold, and determines that the authentication result of the target document is authentication pass when there is a specified number of similarities that are all greater than the preset similarity threshold.
In one embodiment, for each third face image, the computer device calculates a degree of difference between the third face image and the second face image, and uses the degree of difference as an image comparison result. Further, the computer equipment compares each difference with a preset difference threshold, and when each difference is smaller than the preset difference threshold, the identity verification result of the target certificate is determined to be verification passing.
In one embodiment, the computer device compares each degree of difference with a preset degree of difference threshold, and determines that the authentication result of the target document is authentication pass when the specified number of degrees of difference are smaller than the preset degree of difference threshold.
In the identity verification method, the target video frames meeting the image definition conditions are screened from the certificate video containing the target certificate, so that the clear video frames are obtained, and the clear target certificate is obtained. And extracting a first face image and a second face image corresponding to the target certificate from the target video frame to obtain the first face image and the second face image in the target certificate. The image size of the first face image is smaller than that of the second face image, so that the first face image is more easily influenced by light rays and angles during video acquisition, the first face image is subjected to image enhancement processing through at least one group of target image processing parameters, the influence of the angles, light rays and the like of video acquisition on the first face image is removed, and at least one image enhancement processed third face image is obtained. And comparing each third face image after removing the influence of the angle, light and the like of video acquisition on the first face image with the second face image to obtain image comparison results of the third face image and the second face image corresponding to different target image processing parameters, thereby obtaining image comparison results of different third face images obtained by different image enhancement modes and the same second face image. According to the image comparison results of the different third face images and the same second face image, whether the two face images in the target certificate are face images of the same user or not can be accurately identified, and therefore authenticity of the target certificate can be identified, and identity verification of the target certificate can be achieved.
In one embodiment, the first face image is a stereoscopic face image, and the selecting a target video frame from the document video that meets the image sharpness condition includes:
Extracting more than one frame of candidate video frames from the certificate video, respectively detecting target certificates in the candidate video frames to determine certificate inclination angles corresponding to the target certificates in the candidate video frames, screening standby video frames meeting the certificate definition conditions from the candidate video frames based on the certificate inclination angles, detecting stereoscopic face images corresponding to the target certificates in the standby video frames to determine face ambiguities corresponding to the stereoscopic face images in the standby video frames, and screening target video frames meeting the face definition conditions from the standby video frames based on the face ambiguities.
The face ambiguity is used for representing the definition degree of the face image, and the smaller the face ambiguity is, the clearer the face image is.
Specifically, the target certificate includes a first face image and a second face image. The first face image is a stereoscopic image, and the second face image is a planar face image. The stereo face image is easily affected by light rays, acquisition angles and the like, and the detected face images at different angles have different definition.
The image definition conditions include a certificate definition condition and a face definition condition. The certificate clear condition is represented by the inclination angle of the certificate, and the human face clear condition is represented by the ambiguity of the human face image.
The computer device may extract more than one frame of candidate video frames from the credential video, e.g., the computer device may extract a preset number of candidate video frames from the credential video. For each frame of candidate video frames, the computer device may detect a corresponding tilt angle of the candidate video frame in the credential video, and use the tilt angle of the candidate video frame in the credential video as the credential tilt angle corresponding to the target credential in the candidate video frame. The computer device may determine whether the document tilt angle satisfies the document definition condition and use the candidate video frames satisfying the document definition condition as alternate video frames.
For each alternate video frame, the computer device may perform face blur detection on the stereoscopic face image in the alternate video frame, i.e., the first face image, to determine the face blur of the stereoscopic face image in the alternate video frame. The computer device may determine whether the face ambiguity satisfies a face definition condition, and take the alternate video frame satisfying the face definition condition as the target video frame.
In one embodiment, the credential sharpness condition includes screening out a first preset number of video frames from small to large based on the tilt angle. After the computer equipment determines the certificate inclination angles corresponding to the candidate video frames respectively, screening the first preset number of certificate inclination angles from small to large from the certificate inclination angles, and taking the candidate video frames corresponding to the screened certificate inclination angles as standby video frames.
The face definition condition comprises that a second preset number of video frames are screened from small to large based on the face ambiguity. The computer equipment can determine the face ambiguity corresponding to the stereoscopic face image in each standby video frame, screen the face ambiguity of a second preset number from small to large from each face ambiguity, and take the standby video frame corresponding to the screened face ambiguity as the target video frame. The smaller the face ambiguity, the clearer the various parts of the face.
In one embodiment, the credential sharpness condition includes a tilt angle threshold and the face sharpness condition includes a face sharpness threshold. The computer device may compare the individual document tilt angle to a tilt angle threshold, and when the document tilt angle is less than or equal to the tilt angle threshold, the computer device may use the candidate video frame with the document tilt angle less than or equal to the tilt angle threshold as a standby video frame.
In one embodiment, when there are no candidate video frames for which the document tilt angle is less than or equal to the tilt angle threshold, a predetermined number of candidate video frames with the smallest tilt angle are selected as the standby video frames.
The computer device may determine a face ambiguity corresponding to the stereoscopic face image in each alternate video frame, compare the respective face ambiguities to a face ambiguity threshold, and when the face ambiguity is less than or equal to the face ambiguity threshold, the computer device uses the alternate video frame having a face ambiguity less than or equal to the face ambiguity threshold as a candidate video frame.
It can be understood that the document definition condition and the face definition condition do not limit the sequence of judgment, the computer equipment extracts more than one frame of candidate video frames from the document video, detects three-dimensional face images corresponding to the target document in each candidate video frame to determine the face ambiguity corresponding to the three-dimensional face images in each candidate video frame, screens standby video frames meeting the face definition condition from the candidate video frames based on the face ambiguity, detects the target document in each standby video frame to determine the document inclination angle corresponding to the target document in each standby video frame, and screens target video frames meeting the document definition condition from the standby video frames based on the document inclination angle.
In one embodiment, the first face image and the second face image are both stereoscopic face images. In a similar manner, the computer device may determine whether the first face image and the second face image satisfy the credential sharpness condition and the face sharpness condition, respectively. The computer device takes the same candidate video frame where the first video frame and the second video frame which simultaneously meet the certificate definition condition and the face definition condition are located as a target video frame.
In this embodiment, the stereoscopic face image is easily affected by light and an acquisition angle, and the degrees of sharpness of the detected face images are different under different inclination angles, so that whether the target certificate is sharp or not can be judged through the inclination angle of the target certificate in the certificate video and the face ambiguity of the stereoscopic face image, and therefore the video frames corresponding to the stereoscopic face images in the state that all parts in the certificate video are in sharpness can be screened.
In one embodiment, detecting the target certificate in each candidate video frame to determine a certificate inclination angle corresponding to the target certificate in each candidate video frame includes:
And for each candidate video frame, respectively determining the boundary included angle formed by the corresponding candidate boundary area and the preset boundary area, and taking the boundary included angle as the certificate inclination angle corresponding to the target certificate in the corresponding candidate video frame.
Specifically, for each extracted candidate video frame, the computer device detects a target certificate in the candidate video frame, so as to partition a candidate boundary area where the target certificate is located from the candidate video frame, thereby obtaining a candidate boundary area corresponding to the target certificate in each candidate video frame. Further, the computer device may perform target detection on the candidate video frame to obtain a candidate boundary region of the target document in the candidate video frame.
The computer device may calculate a boundary angle formed by each candidate boundary region and a preset boundary region, and use the boundary angle as a document inclination angle corresponding to the target document in the corresponding candidate video frame.
Further, a lateral boundary region and a longitudinal boundary region of the boundary region are preset. The computer device may calculate the boundary angle formed by the same candidate boundary region and the lateral boundary region, and the boundary angle formed by the same candidate boundary region and the longitudinal boundary region. According to the same processing mode, the boundary included angles formed by each candidate boundary region and the transverse boundary region and the longitudinal boundary region respectively can be calculated, so that two certificate inclination angles corresponding to each candidate boundary region respectively can be obtained.
In this embodiment, for each frame of candidate video frame, the boundary included angle formed by the corresponding candidate boundary region and the preset boundary region is determined, where the candidate boundary region is the region where the target document is located in the candidate video frame, and then the boundary included angle can accurately represent the inclination angle of the target document in the document video.
In one embodiment, the certificate inclination angle comprises a transverse inclination angle and a longitudinal inclination angle, the preset boundary area comprises a transverse boundary area and a longitudinal boundary area, and for each frame of candidate video frame, the boundary included angle formed by the corresponding candidate boundary area and the preset boundary area is respectively determined, and the boundary included angle is used as the certificate inclination angle corresponding to the target certificate in the corresponding candidate video frame, and the method comprises the following steps:
And for each frame of the candidate video frame, calculating the transverse inclination angle between the candidate boundary region and the transverse boundary region and the longitudinal inclination angle between the candidate boundary region and the longitudinal boundary region based on the boundary length information and the corresponding projection information of the corresponding candidate boundary region.
Wherein the length information of the candidate boundary region includes a lateral boundary length and a longitudinal boundary length forming the candidate boundary region, such as a length and a width of the candidate boundary region.
Specifically, the document inclination angle includes a lateral inclination angle and a longitudinal inclination angle, and the preset boundary region includes a lateral boundary region and a longitudinal boundary region. The computer may obtain length information for the target document, determine length information for the candidate boundary region in the corresponding candidate video frame based on the length information for the target document, and. The length information of the target document refers to the actual lateral boundary length and the longitudinal boundary length of the target document, such as the actual length and width of the target document.
For example, the computer device performs an entity measurement on the target document to obtain the length and width of the target document, and uses the length and width of the target document as the length information of the target document. The computer equipment performs video acquisition on the target certificate to obtain a certificate video, and the computer equipment can determine the length information of the target certificate in the video through the length information of the target certificate and the acquisition multiplying power of video acquisition.
The computer device may determine a lateral projected area corresponding to each candidate bounding area when the lateral bounding area is tilted, and determine a longitudinal projected area corresponding to the candidate bounding area when the longitudinal bounding area is tilted. The computer device may detect projection information of the lateral projection region and projection information of the longitudinal projection region. And the computer calculates the transverse inclination angle between the candidate boundary region and the transverse projection region according to the length information of the candidate boundary region and the projection information of the corresponding transverse projection region. The lateral tilt angle between the candidate boundary region and the lateral projection region is taken as the lateral tilt angle between the candidate boundary region and the lateral boundary region. And the computer calculates the longitudinal inclination angle between the candidate boundary region and the longitudinal projection region according to the length information of the candidate boundary region and the projection information of the corresponding longitudinal projection region. The longitudinal inclination angle between the candidate boundary region and the longitudinal projection region is taken as the longitudinal inclination angle between the candidate boundary region and the longitudinal boundary region.
In the same manner, the computer may calculate the lateral tilt angle formed by each candidate bounding region with the lateral bounding region, and the longitudinal tilt angle formed with the longitudinal bounding region.
FIG. 3 is a schematic diagram of an interface for calculating the lateral tilt angle in one embodiment. As shown in fig. 3 (a), the length information of the target document S302 is the actual target document S302, and includes a length w 1 and a width h 1. Fig. 3 (b) is a candidate boundary region S304 in a candidate video frame in the document video, where the length information of the candidate boundary region S304 includes a length w 2 and a width h 2, and the candidate boundary region is similar to the target document, that is:
The computer device determines the lateral projection area S306 corresponding to the candidate border area S304 when the lateral border area is inclined, and the computer device may detect the projection information of the lateral projection area S306, i.e. the length and width d of the lateral projection area S306. The computer device calculates the included angle α of h 2 and d as the lateral tilt angle between the candidate bounding region S304 and the lateral bounding region. The included angle α is calculated as follows:
In this embodiment, the projection information of the target document in the lateral boundary region and the longitudinal boundary region when the target document is tilted is detected, and the tilt angle formed by the candidate boundary region and the lateral boundary region can be accurately calculated based on the length information of the candidate boundary region and the projection information of the target document in the lateral boundary region. Based on the length information of the candidate boundary region and the projection information of the longitudinal boundary region, the inclination angle formed by the candidate boundary region and the longitudinal boundary region can be accurately calculated, so that two inclination angles of the same candidate boundary region in different directions are used as conditions for screening target video frames, and the target video frames corresponding to clearer target certificates can be screened.
In one embodiment, detecting the stereoscopic face image corresponding to the target certificate in each standby video frame to determine the face ambiguity corresponding to the stereoscopic face image in each standby video frame, includes:
Respectively detecting three-dimensional face images corresponding to the target certificates in each standby video frame to obtain face key point detection results in each standby video frame; and determining the face ambiguity corresponding to each standby video frame based on the face key point detection result in each standby video frame.
In particular, the computer device may perform face detection on each alternate video frame to determine a stereoscopic face image in each alternate video frame that corresponds to the target document. The computer equipment respectively detects the face key points of the three-dimensional face image, and the computer equipment obtains a face key point detection result based on the face key points corresponding to the three-dimensional face image. The face key point detection result includes key points of each part of the detected face, for example, at least one of key points of a left eye, a right eye, a nose, a mouth and a hairline.
For each frame of standby video frame, the computer equipment can acquire the gray value of each face key point in the stereoscopic face image of the standby video frame, calculate the gradient value of each face key point based on the gray value of each face key point, and normalize the gradient value of each face key point. The computer equipment can take the sum of gradient value products of the key points of the faces after normalization processing as corresponding face ambiguity.
In one embodiment, the computer device may obtain weights corresponding to the key points of the different parts, and use the sum of products of the gradient values of the key points after normalization processing and the corresponding weights as the corresponding face ambiguity.
In this embodiment, the face key point detection is performed on the stereoscopic face image, and based on the face key point detection result, the blur change of the image can be reflected from each part of the face. In addition, only the key points of each part of the human face are used for calculating the blurring degree, the calculated amount can be reduced, the gradient value is sensitive to blurring, and the gradient value of the key points can be used for accurately calculating the blurring degree of the image.
Fig. 4 is a schematic diagram of a face key point detection result in one embodiment. As shown in fig. 4 (a), the key points of the left eye, the right eye, the nose, the mouth, and the hairline in the stereoscopic face image can be acquired. As shown in fig. 4 (a), the key points of the right eye, the nose, the mouth, and the hairline can be acquired. As shown in fig. 4 (c), the key point of the right eye can be acquired. As shown in fig. 4 (d), key points of each part of the face cannot be acquired. The ambiguities (a) < (b) < (c) < (d) in fig. 4 can be determined based on the gradient values of the keypoints.
In one embodiment, each group of target image processing parameters comprises processing sub-parameters corresponding to at least one image processing mode, and the processing of the first face image based on each group of target image processing parameters to obtain at least one third face image comprises the following steps:
And for each group of target image processing parameters, carrying out image enhancement processing on the first face image in sequence according to the corresponding processing sub-parameters and the corresponding image processing modes respectively until a corresponding third face image is obtained, wherein the plurality of image processing modes comprise at least one mode of stripping, sharpening and removing white noise.
The striping may be implemented by a striping parameter, and the image processing mode corresponding to the striping parameter may be wavelet transform, but is not limited thereto. The striping parameters may include a wavelet transform type and a number of wavelet transforms. The wavelet transform extracts information of interest from an image signal by a local transform between a spatial domain and a frequency domain, or a local transform between a temporal domain and a frequency domain. The wavelet transform types include HAAR WAVELET, SYMLETS WAVELETS, daubechies Wavelets, and the like, but are not limited thereto. Further, daubechies Wavelets is also divided into various wavelets, such as db1, db2. SYMLETS WAVELETS is also divided into a variety of wavelets, such as sym1, sym2,.. symN.
The number of times of wavelet transform refers to the depth of wavelet decomposition, and the number of times of wavelet transform may be 1 time, 2 times, 3 times, or the like, but is not limited thereto. Different wavelet transform times have different processing modes, for example, when the wavelet transform times are 1, the wavelet is first forward transformed once, one piece of low-frequency information and 3 pieces of high-frequency sub-bands are decomposed, the low-frequency information is average information, and the 3 pieces of high-frequency sub-bands are horizontal, vertical and diagonal sub-bands. When the number of times of wavelet transformation is 2, the wavelet is first forward transformed once to decompose one low frequency information and 3 high frequency sub-bands, namely horizontal, vertical and diagonal sub-bands. The diagonal subband includes regular noise such as streak and white noise, etc., then decomposed again on the low frequency information, the horizontal and vertical subband images are zeroed after two transforms, and then transformed into a noiseless image with two inverse wavelet transforms.
Sharpening refers to enhancing the contrast effect of an image, and can be achieved by a histogram equalization mode, but is not limited to this. Histogram equalization is to assign different weights to image areas of different saturation and brightness for histogram equalization. After the image equalization process, the histogram of the image is flat, i.e. each gray level has the same frequency of occurrence, and the image becomes clearer because the gray levels have a uniform probability distribution.
The image processing method corresponding to the white noise removal can be mean filtering, but is not limited thereto.
Specifically, each set of target image processing parameters includes at least one processing sub-parameter corresponding to each image processing mode. For example, the striping parameters corresponding to the striping process, the sharpening parameters corresponding to the sharpening process, and the white noise removal parameters corresponding to the white noise removal. The stripping process may include removing at least one of horizontal, vertical, diagonal strips.
Aiming at each group of acquired target image processing parameters, the computer equipment can acquire processing sub-parameters in the target image processing parameters, and correspondingly process the first face image according to the image processing mode and the processing sequence corresponding to each processing sub-parameter. And regarding each processing sub-parameter in the same group of target image processing parameters, taking the image processed by the last processing sub-parameter as the object processed by the next processing sub-parameter.
In one embodiment, the image processing mode corresponding to the striping parameter is wavelet transform, the image processing mode corresponding to the sharpening parameter is histogram equalization, and the processing mode corresponding to the white noise removing parameter is mean filtering. For example, the set of target image processing parameters includes three processing sub-parameters, namely a striping parameter, a sharpening parameter, and a white noise removal parameter. The computer equipment can perform striping processing on the first face image through a wavelet transformation mode corresponding to the striping parameters, perform sharpening processing on the image obtained after the striping processing through a histogram equalization mode corresponding to the sharpening parameters, and perform white noise removal processing on the image obtained after the sharpening parameters through a mean value filtering mode corresponding to the white noise removal parameters to obtain a third face image corresponding to the set of target image processing parameters.
In this embodiment, for each set of target processing parameters, the first face image is sequentially processed such as striping, sharpening, and white noise removing according to the image processing modes corresponding to the processing sub-parameters in each set of target image processing parameters, so as to obtain a third face image after striping, sharpening, and white noise removing. And if the processing sub-parameters of the striping, sharpening and white noise removal of each third face image are different, the degrees of the striping, sharpening and white noise removal of each third face image are different, so that a plurality of third face images with different image enhancement processing degrees are obtained.
In one embodiment, comparing each third face image with the second face image to obtain a corresponding image comparison result, and determining an identity verification result of the target certificate according to the image comparison result, including:
And determining the maximum value in the similarity, and determining the identity verification result of the target certificate as verification passing when the maximum value is larger than a preset similarity threshold value.
Specifically, for each third face image, the computer device calculates the similarity between the third face image and the second face image, and obtains each similarity. The computer device may determine a maximum value of the respective degrees of similarity, and compare the degree of similarity corresponding to the maximum value with a preset degree of similarity threshold. And when the maximum value is larger than a preset similarity threshold value, determining that the authentication result of the target certificate is authentication passing.
In this embodiment, the similarity between each third face image after the image enhancement processing and the second face image is calculated, so that the identity verification result of the target certificate can be accurately determined based on the comparison result of the maximum similarity and the preset similarity threshold.
In one embodiment, the first face image is a three-dimensional face image, and the method further comprises the steps of obtaining multi-frame video frames to be compared corresponding to different visual angles from the certificate video;
the identity verification result of the target certificate is determined according to the image comparison result, including the identity verification result of the target certificate is determined according to the image comparison result and the angle comparison result.
Specifically, the computer equipment obtains video frames to be compared corresponding to the target certificate when the target certificate is inclined to different degrees from the certificate video, for example, obtains video frames corresponding to the target certificate inclined by 10 degrees, 15 degrees and 30 degrees in the certificate video, and obtains the video frames to be compared.
The computer device may perform target face detection on each frame of video to be compared to determine a stereoscopic face image in each frame of video to be compared. The computer equipment can compare the three-dimensional face images to obtain corresponding angle comparison results. Further, the computer device may calculate a degree of similarity or a degree of difference between the respective stereoscopic face images.
And the computer equipment determines the identity verification result of the target certificate according to the image comparison result and the angle comparison result. Further, the computer equipment obtains a first verification result of the target certificate according to the image comparison result, and obtains a second verification result of the target certificate according to the angle comparison result. And when the first verification result and the second verification result are the same, judging that the identity verification of the target certificate is successful. And when the first verification result and the second verification result are different, judging that the identity verification of the target certificate fails.
In this embodiment, the detected stereoscopic face images under different viewing angles have larger changes, and multiple frames of video frames to be compared of different viewing angles in the certificate video are acquired to compare the stereoscopic face images under different viewing angles, so as to determine the similarity or difference between the stereoscopic face images under different viewing angles. The low similarity or large difference indicates that the three-dimensional face image may be obtained by fusing a plurality of different face images, and the three-dimensional face image is a forged face image. Based on the similarity or the difference between the three-dimensional face images under different visual angles, whether the three-dimensional face images are fake faces or not can be identified, and therefore accuracy of identity verification of the target certificate is improved. By combining the image comparison result and the angle comparison result, the identity of the target certificate can be verified in two different modes, so that the accuracy of the identity verification is further improved, and the safety of user information is further improved.
As shown in fig. 5, an application scenario for authentication in one embodiment is illustrated.
The front end collects the certificate video through an SDK (software development kit) and sends the certificate video to the background. And the background uses the identity verification method in each embodiment to carry out identity verification on the target certificate in the certificate video, so as to obtain an identity verification result. The background returns the authentication result to the front end. The front end performs corresponding based on the authentication result, and when the authentication result is successful, the user is allowed to perform corresponding service processing. And when the authentication result is authentication failure, rejecting the user to perform any business processing or prompting that the target certificate is abnormal.
For example, if the user needs to transact business at a bank, the identity card of the user is verified by the identity verification method in each embodiment, and if the verification is successful, the user is allowed to transact relevant banking business, such as transacting a banking account, banking card, modifying personal information, querying personal information, and the like.
In one embodiment, as shown in fig. 6, the method further comprises:
step S602, obtaining sample certificate images and determining sample categories to which each sample certificate image belongs respectively.
Wherein the sample classes include a positive class and a negative class. The positive class indicates that the sample document image is a real document image, that is, the first sample face image and the second sample face image in the sample document image are face images of the same person. The negative class indicates that the sample document image is a counterfeit document image, i.e., the first sample face image and the second sample face image in the sample document image are not face images of the same person.
Specifically, the computer device may obtain a sample document video resulting from video acquisition of the sample document. The computer device may extract each sample video frame from the sample document video and segment the sample document image from each sample video frame to obtain each sample document image. The first sample face image in the sample certificate can be a real face image or a fake face image.
Step S604, a first sample face image and a second sample face image are extracted from the sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image.
Specifically, the sample certificate image comprises a first sample face image and a second sample face image. The image size of the first face image is smaller than the image size of the second face image. For each sample video frame, the computer device may perform face detection on the sample video frame to segment a first sample face image and a second sample face image in the sample video frame.
In one embodiment, the first sample face image is a stereoscopic face image and the second sample face image is a planar face image.
In one embodiment, the first and second sample face images are both stereoscopic face images.
Step S606, a plurality of groups of candidate image processing parameters are obtained, and image enhancement processing is respectively carried out on the first sample face image based on each group of candidate image processing parameters, so as to obtain a third sample face image respectively corresponding to each group of candidate image processing parameters.
Specifically, a computer device obtains a plurality of sets of candidate image processing parameters, the plurality of sets referring to at least two sets. And performing image enhancement processing on the first sample face image through the candidate image processing parameters aiming at each acquired set of candidate image processing parameters to obtain a third sample face image corresponding to the set of candidate image processing parameters, thereby obtaining the third sample face image respectively corresponding to each set of candidate image processing parameters.
In one embodiment, each set of image processing parameters includes a plurality of processing sub-parameters, each corresponding to a respective image processing mode. For each group of candidate image processing parameters, the computer equipment acquires each processing sub-parameter in the candidate image processing parameters, and performs image enhancement processing on the first face image according to the processing sequence corresponding to each processing sub-parameter. And regarding each processing sub-parameter in the same group of candidate image processing parameters, taking the image processed by the last processing sub-parameter as the object processed by the next processing sub-parameter until a third sample face image processed by the image processing mode corresponding to the last processing sub-parameter is obtained.
Step S608, comparing each third sample face image with the corresponding second sample face image, to obtain a corresponding sample image comparison result.
The sample image comparison result comprises at least one of similarity and difference between the third sample face image and the second sample face image.
Specifically, for each third sample face image, the computer device calculates a similarity between the third sample face image and the second sample face image, the similarity being a sample image comparison result.
In one embodiment, for each third sample face image, the computer device calculates a degree of difference between the third sample face image and the second sample face image, taking the degree of difference as a sample image comparison result.
Step S610, at least one group of target image processing parameters is selected from a plurality of groups of candidate image processing parameters based on the sample image comparison result and the sample category.
Specifically, the computer device generates a characteristic curve according to each sample comparison result and the corresponding sample category, and determines a corresponding characteristic area based on the characteristic curve. The computer equipment screens out candidate image processing parameters meeting the area matching condition from a plurality of groups of candidate image processing parameters based on the characteristic area as target image processing parameters.
The characteristic curve may be a ROC curve (receiver operating characteristic curve, subject working characteristic curve), also known as a sensitivity curve (SENSITIVITY CURVE). The working characteristic curve of the subject is a graph formed by taking false positive probability (False positive rate, FPR for short) as a horizontal axis and true positive probability (True positive rate, TPR for short) as a vertical axis, and is drawn by different results obtained by different judging standards under specific stimulation conditions of the subject.
Sample document images are classified into positive (positive) or negative (negative) classes. For one classification, there are 4 cases in which a sample document image of a positive class is predicted as a positive class, that is, true Positive (TP) class, a sample document image of a negative class is predicted as a positive class, that is, false Positive (FP) class, a sample document image of a negative class is predicted as a negative class, that is, true Negative (TN) class, and a sample document image of a positive class is predicted as a negative class, that is, false negative (FALSE NEGATIVE FN) class.
The true positive probability TPR refers to the ratio of the number of true classes TP to the number of sample document images of all positive classes, and the calculation formula is tpr=tp/(tp+fn). The false positive probability FPR refers to the ratio of the number of sample document images identified as positive but actually negative to the number of sample document images of all negative, and the calculation formula is fpr=fp/(fp+tn). The feature Area may be an AUC Area (Area under ROC Curve).
In one embodiment, for each set of candidate image processing parameters, the computer device determines respective sample image comparison results corresponding to each set of candidate image processing parameters. For example, 3 groups of image processing parameters and 100 sample certificate images are used, each group of image processing parameters respectively carries out image enhancement processing on a first sample face image in 100 sample certificate processing, and 100 sample image comparison results respectively corresponding to each group of image processing parameters are used. The computer equipment calculates false positive probability and true positive probability corresponding to each set of candidate image processing parameters according to the comparison result of each sample image corresponding to each set of candidate image processing parameters and the corresponding sample category. In the same manner, the computer device may obtain a false positive probability and a true positive probability for each set of candidate image processing parameters. And drawing an ROC curve according to the false positive probability and the true positive probability.
The computer device calculates the feature area contained under each feature curve according to the drawn feature curves. The computer device may select, from the plurality of feature areas, a candidate image processing parameter corresponding to a feature area greater than the area threshold as the target image processing parameter, resulting in at least one set of target image processing parameters.
In one embodiment, the computer device may screen a preset number of feature areas from a plurality of feature areas from large to small, and use each set of candidate image processing parameters corresponding to the preset number of feature areas as the target image processing parameters.
In this embodiment, a first sample face image and a second sample face image are extracted from a sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image, so that the first sample face image is more easily affected by light and angles during image acquisition, and image enhancement processing is performed on the first sample face image through each group of target image processing parameters, so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image, and obtain each third sample face image after image enhancement processing with different degrees. After the interference generated by angles, light rays and the like is eliminated, each third sample face image is respectively compared with the corresponding second sample face image to obtain a corresponding sample image comparison result, and at least one group of target image processing parameters with the best interference effect generated by the angles and the light rays can be screened out from multiple groups of candidate image processing parameters based on the difference between the sample image comparison result and the sample category. The identity of the target certificate is verified through the target image processing parameters, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved.
In one embodiment, obtaining multiple sets of candidate image processing parameters, and performing image enhancement processing on the first sample face image based on each set of candidate image processing parameters, to obtain a third sample face image corresponding to each set of candidate image processing parameters, including:
Determining current candidate image processing parameters corresponding to the current iteration from a sample parameter set, and acquiring standby image processing parameters screened by the previous iteration;
Respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters;
Based on the sample image comparison result and the sample category, at least one group of target image processing parameters is selected from a plurality of groups of candidate image processing parameters, including:
for each group of image processing parameters in the current iteration, generating a characteristic curve according to a corresponding sample image comparison result and a corresponding sample class, determining a corresponding characteristic area based on the characteristic curve, and screening standby image processing parameters meeting an area matching condition in the current iteration based on the characteristic area;
Selecting candidate image processing parameters which do not participate in iterative computation from a sample parameter set, taking the candidate image processing parameters as current candidate image processing parameters corresponding to the next iteration, and taking standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration;
Returning to the step of respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the image processing parameters of each group, continuing to execute until all candidate image processing parameters in the sample parameter set are traversed, stopping, and screening out the image processing parameters meeting the area matching condition in the last iteration based on the characteristic area obtained in the last iteration;
and taking the image processing parameters meeting the area matching condition in the last iteration as target image processing parameters.
There are multiple sets of candidate image processing parameters in the sample parameter set, and the computer device may perform image enhancement processing on the first sample face image using a preset number of sets of candidate image processing parameters per iteration. Such as, but not limited to, 10, 15, 20 groups. The method comprises the steps of iterating for the first time, acquiring a preset number of candidate image processing parameters from a sample parameter set by computer equipment, respectively carrying out image enhancement processing on first sample face images to obtain sample image comparison results corresponding to each set of candidate image processing parameters, generating a characteristic curve by the computer equipment based on each set of sample image comparison results and corresponding sample categories, determining a corresponding characteristic area based on the characteristic curve, and screening standby image processing parameters meeting area matching conditions from each set of candidate image processing parameters used for iterating for the first time based on the characteristic area.
And starting from the second iteration, acquiring standby image processing parameters screened in the previous iteration, and acquiring current candidate image processing parameters from the sample set so as to perform the next iteration processing. The sum of the number of groups of the spare image processing parameters and the number of groups of the current candidate image processing parameters is a preset number of groups.
And respectively carrying out image enhancement processing on the first sample face image according to the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the image processing parameters of each group. The sets of image processing parameters include current candidate image processing parameters and alternate image processing parameters.
For each set of image processing parameters, the computer device determines respective sample image comparison results corresponding to each set of image processing parameters. And the computer equipment calculates false positive probability and true positive probability corresponding to each group of image processing parameters according to the comparison result of each sample image corresponding to each group of image processing parameters and the corresponding sample category. And drawing and obtaining the corresponding characteristic curves of each group based on the false positive probability and the true positive probability corresponding to each group of image processing parameters. And calculating corresponding characteristic areas according to the characteristic curves to obtain the corresponding characteristic areas of each group. The computer equipment can screen out a preset number of characteristic areas from a plurality of characteristic areas from large to small, and each group of image processing parameters corresponding to the preset number of characteristic areas is used as standby image processing parameters. For example, three sets of image processing parameters corresponding to the largest 3 feature areas are selected as the standby image processing parameters.
And the computer equipment acquires candidate image processing parameters which do not participate in iterative computation from the sample set and takes the candidate image processing parameters as current candidate image processing parameters corresponding to the next iteration. And taking the standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration, wherein the sum of the group number of the standby image processing parameters and the group number of the current candidate image processing parameters is a preset group number.
After obtaining the current candidate image processing parameters and the standby image processing parameters corresponding to the next iteration, the computer equipment returns to carry out image enhancement processing on the first sample face image respectively based on the current candidate image processing parameters and the standby image processing parameters, and the step of obtaining third sample face images respectively corresponding to each group of image processing parameters is continuously executed. The computer equipment can screen out a preset number of characteristic areas from a plurality of characteristic areas from large to small, and each group of image processing parameters corresponding to the preset number of characteristic areas is used as standby image processing parameters of the next iteration.
And according to the iterative processing, stopping after traversing all candidate image processing parameters in the sample parameter set, screening out a preset number of characteristic areas from large to small based on the characteristic areas obtained in the last iteration, and taking each group of image processing parameters corresponding to the preset number of characteristic areas as target image processing parameters.
In this embodiment, the feature area corresponding to each set of image processing parameters calculated in each iteration is used, and the image processing parameters meeting the area matching condition in the current iteration are screened out based on the feature area, so that each set of image processing parameters with the best image enhancement processing effect in the current iteration can be screened out. And selecting candidate image processing parameters which do not participate in iterative computation and each group of image processing parameters which are selected in the previous iteration from the sample parameter set, and continuing to perform the next iteration computation, wherein each group of image processing parameters with the best image enhancement processing effect can be selected in each iteration computation. Based on the traversal of each group of candidate image processing parameters in the sample parameter set, each group of image processing parameters can be continuously screened through traversal iteration until the traversal is finished, and each group of image processing parameters with the best image enhancement processing effect is automatically screened.
In one embodiment, as shown in fig. 7, a training method of an image recognition model is provided, and the method is applied to a computer device in fig. 1 (the computer device may be a terminal or a server in fig. 1 specifically) for explanation, and includes the following steps:
Step S702, sample certificate images are acquired, and sample categories to which each sample certificate image belongs are determined.
Wherein the sample classes include a positive class and a negative class. The positive class indicates that the sample document image is a real document image, that is, the first sample face image and the second sample face image in the sample document image are face images of the same person. The negative class indicates that the sample document image is a counterfeit document image, i.e., the first sample face image and the second sample face image in the sample document image are not face images of the same person.
Specifically, the computer device may obtain a sample document video resulting from video acquisition of the sample document. The computer device may extract each sample video frame from the sample document video and segment the sample document image from each sample video frame to obtain each sample document image. The first sample face image in the sample certificate can be a real face image or a fake face image.
In one embodiment, 100 video of credentials acquired under different circumstances may be acquired for training. The computer equipment can mark the key points of the face of the first sample in the certificate video, as shown in fig. 4, the key points of each part of the face, such as the key points of the left eye, the key points of the right eye, the key points of the nose, the key points of the mouth, the key points of the hairline and the like, are marked so as to facilitate the subsequent detection of the face ambiguity of the first sample face image through the key points of the face.
Step S704, extracting a first sample face image and a second sample face image from the sample document image, wherein the image size of the first sample face image is smaller than the image size of the second sample face image.
Specifically, the sample certificate image comprises a first sample face image and a second sample face image. The image size of the first face image is smaller than the image size of the second face image. For each sample video frame, the computer device may perform face detection on the sample video frame to segment a first sample face image and a second sample face image in the sample video frame.
In one embodiment, the first sample face image is a stereoscopic face image and the second sample face image is a planar face image.
In one embodiment, the first and second sample face images are both stereoscopic face images.
Step S706, performing image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained, so as to obtain a third sample face image corresponding to each group of candidate image processing parameters.
Specifically, the computer device inputs the first sample face image, the second sample image, and the corresponding sample class into an image recognition model to be trained. And the image recognition model to be trained carries out image enhancement processing on the first sample face image through each group of candidate image processing parameters to obtain a third sample face image corresponding to each group of candidate image processing parameters.
In one embodiment, each set of image processing parameters includes a plurality of processing sub-parameters, each corresponding to a respective image processing mode. And aiming at each group of candidate image processing parameters, the image recognition model to be trained carries out image enhancement processing on the first face image according to the processing sequence corresponding to each processing sub-parameter based on each processing sub-parameter in each group of candidate image processing parameters. And regarding each processing sub-parameter in the same group of candidate image processing parameters, taking the image processed by the last processing sub-parameter as the object processed by the next processing sub-parameter until a third sample face image processed by the image processing mode corresponding to the last processing sub-parameter is obtained.
Step S708, comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result.
The sample image comparison result comprises at least one of similarity and difference between the third sample face image and the second sample face image.
Specifically, for each third sample face image, the image recognition model to be trained calculates the similarity between the third sample face image and the second sample face image, and the similarity is used as a sample image comparison result.
In one embodiment, for each third sample face image, the image recognition model to be trained calculates the degree of difference between the third sample face image and the second sample face image, and uses the degree of difference as a sample image comparison result.
Step S710, training an image recognition model to be trained based on the sample image comparison result and the sample category until the training stopping condition is reached, so as to obtain a trained target image recognition model, wherein the trained target image recognition model comprises at least one group of target image processing parameters for carrying out identity verification on the target certificate.
Specifically, the computer equipment generates a characteristic curve corresponding to each group of candidate image processing parameters according to each sample comparison result and corresponding sample category corresponding to each group of candidate image processing parameters. The computer device calculates a feature area corresponding to each set of candidate image processing parameters based on the feature curves corresponding to each set of candidate image processing parameters. The computer device screens out candidate image processing parameters meeting the area matching condition from a plurality of candidate image processing parameters based on the feature area.
The computer equipment acquires candidate image processing parameters from the sample parameter set, takes the screened candidate image processing parameters and the candidate image processing parameters from the sample parameter set as the image processing parameters of the next training of the image recognition model, and continues the training. Stopping after traversing all candidate image processing parameters in the sample parameter set, and taking the candidate image processing parameters acquired from the sample parameter set for the last time and the candidate image processing parameters screened out last time as the image processing parameters of the last training of the image recognition model. And screening out the image processing parameters meeting the area matching condition from a plurality of groups of candidate image processing parameters based on the feature area corresponding to each group of image processing parameters obtained in the last training, and obtaining a trained image recognition model.
The computer device may select, from the plurality of feature areas, an image processing parameter corresponding to a feature area greater than the area threshold as the target image processing parameter, resulting in at least one set of target image processing parameters.
In one embodiment, the computer device may screen a preset number of feature areas from a plurality of feature areas from large to small, and use each set of image processing parameters corresponding to the preset number of feature areas as the target image processing parameters.
In this embodiment, the first sample face image and the second sample face image are extracted from the sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image, so that the first sample face image is more easily affected by light and angles during image acquisition. And respectively carrying out image enhancement processing on the first sample face image through each group of target image processing parameters in the image recognition model to be trained so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image and obtain each third sample face image subjected to image enhancement processing with different degrees. After the interference generated by angles, light rays and the like is eliminated, each third sample face image is respectively compared with the corresponding second sample face image to obtain a corresponding sample image comparison result, and the target image processing parameters with the best image enhancement effect can be screened out from multiple groups of image processing parameters based on the difference between the sample image comparison result and the sample category. The identity of the target certificate is verified through the trained image recognition model, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved. The trained image recognition model has high recognition precision and high calculation speed, and can improve the efficiency of identity verification of the target certificate.
In one embodiment, as shown in fig. 8, performing image enhancement processing on the first sample face image by using each set of candidate image processing parameters in the image recognition model to be trained, to obtain a third sample face image corresponding to each set of candidate image processing parameters, including:
step S802, determining current candidate image processing parameters corresponding to the current iteration from a sample parameter set in the image recognition model to be trained, and acquiring standby image processing parameters screened by the previous iteration.
Specifically, there are multiple sets of candidate image processing parameters in the sample parameter set, and each iteration of the image recognition model may use a preset number of candidate image processing parameters to perform image enhancement processing on the first sample face image. Such as, but not limited to, 10, 15, 20 groups. The method comprises the steps of performing first iteration, obtaining a preset number of candidate image processing parameters from a sample parameter set by an image recognition model to be trained, performing image enhancement processing on first sample face images to obtain sample image comparison results corresponding to each set of candidate image processing parameters, generating a characteristic curve by the image recognition model to be trained based on each set of sample image comparison results and corresponding sample types, determining corresponding characteristic areas based on the characteristic curves, and screening standby image processing parameters meeting area matching conditions from the candidate image processing parameters used in the first iteration based on the characteristic areas.
And starting from the second iteration, acquiring standby image processing parameters screened in the previous iteration, and acquiring current candidate image processing parameters from the sample set so as to perform the next iteration processing. The sum of the number of groups of the spare image processing parameters and the number of groups of the current candidate image processing parameters is a preset number of groups.
Step S804, based on the current candidate image processing parameters and the standby image processing parameters, respectively performing image enhancement processing on the first sample face image to obtain third sample face images respectively corresponding to the image processing parameters of each group.
Specifically, the image recognition model respectively carries out image enhancement processing on the first sample face image according to the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the image processing parameters of each group. The sets of image processing parameters include current candidate image processing parameters and alternate image processing parameters.
Training the image recognition model to be trained based on the sample image comparison result and the sample category until reaching the training stop condition, obtaining a trained target image recognition model, comprising:
Step S806, for each group of image processing parameters in the current iteration, generating a characteristic curve according to the corresponding sample comparison result and the corresponding sample category, determining a corresponding characteristic area based on the characteristic curve, and screening standby image processing parameters meeting the area matching condition in the current iteration based on the characteristic area.
Specifically, for each set of image processing parameters, the image recognition model determines respective sample image comparison results corresponding to each set of image processing parameters. And acquiring a plurality of recognition thresholds, and aiming at each recognition threshold, obtaining a prediction category of each sample certificate image by the image recognition model according to the comparison result of each sample image corresponding to each group of image processing parameters and the recognition threshold, wherein the prediction category refers to that the sample certificate image is a real certificate image or a fake certificate image. And calculating the false positive probability and the true positive probability corresponding to each group of image processing parameters under the recognition threshold according to the prediction category and the corresponding sample category of each sample certificate image corresponding to each group of image processing parameters. And according to the same processing mode, obtaining false positive probability and true positive probability which are respectively corresponding to each group of image processing parameters under each recognition threshold value.
And taking the false positive probability and the true positive probability of the same group of image processing parameters under one recognition threshold as a coordinate, thereby obtaining the corresponding coordinates of the same group of image processing parameters under each recognition threshold, and drawing the corresponding characteristic curves of the group of image processing parameters based on each coordinate. According to the same processing mode, the characteristic curve corresponding to each group of image processing parameters can be obtained.
And calculating corresponding characteristic areas according to the characteristic curves to obtain the corresponding characteristic areas of each group. The image recognition model can screen out a preset number of characteristic areas from a plurality of characteristic areas from large to small, and each group of image processing parameters corresponding to the preset number of characteristic areas is used as standby image processing parameters. For example, three sets of image processing parameters corresponding to the largest 3 feature areas are selected as the standby image processing parameters.
Step S808, selecting candidate image processing parameters which do not participate in iterative computation from the sample parameter set as current candidate image processing parameters corresponding to the next iteration, and taking the standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration.
Specifically, the image recognition model acquires candidate image processing parameters which do not participate in iterative computation from a sample set, and the candidate image processing parameters are used as current candidate image processing parameters corresponding to the next iteration. And taking the standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration, wherein the sum of the group number of the standby image processing parameters and the group number of the current candidate image processing parameters is a preset group number.
Step S810, returning to the step of respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the image processing parameters of each group, and continuing to execute until training is stopped after all candidate image processing parameters in the sample parameter set are traversed to obtain a trained target image recognition model.
After the image recognition model obtains the current candidate image processing parameters and the standby image processing parameters corresponding to the next iteration, returning to the step of respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters, and continuing to execute. The image recognition model for each iteration can screen out a preset number of characteristic areas from a plurality of characteristic areas from large to small, and each group of image processing parameters corresponding to the preset number of characteristic areas is used as standby image processing parameters for the next iteration.
And according to the iterative processing, stopping after traversing all candidate image processing parameters in the sample parameter set, screening out a preset number of characteristic areas from large to small based on the characteristic areas obtained in the last iteration, and taking each group of image processing parameters corresponding to the preset number of characteristic areas as target image processing parameters.
In this embodiment, the feature area corresponding to each set of image processing parameters calculated by each iteration of the image recognition model is used, and the image processing parameters meeting the area matching condition in the current iteration are screened out based on the feature area, so that each set of image processing parameters with the best image enhancement processing effect in the current iteration can be screened out. And selecting candidate image processing parameters which do not participate in iterative computation and each group of image processing parameters which are selected in the previous iteration from the sample parameter set, and continuing to perform the next iteration computation, wherein each group of image processing parameters with the best image enhancement processing effect can be selected in each iteration computation. Based on the traversal of each group of candidate image processing parameters in the sample parameter set, each group of image processing parameters can be continuously screened through traversal iteration until the traversal is finished, and the image recognition model can automatically screen each group of image processing parameters with the best image enhancement processing effect. The identity of the target certificate is verified through each group of target image processing parameters in the trained image recognition model, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved.
The false recognition rate FAR and the reject rate FRR of the target image recognition model and the image recognition model of other modes on the same test set are compared as follows, and the test set is a first-generation identity card and a second-generation identity card of the area a:
Therefore, the trained target image recognition model is quite stable, and the false recognition rate FAR and the rejection rate FRR tested on a plurality of test sets are less than 5%, so that the effect of the target image recognition model is greatly improved compared with that of the image recognition model in other modes.
FIG. 9 is a flow diagram of image enhancement processing for a set of candidate image processing parameters of an image recognition model, in one embodiment.
In step S902, the computer device extracts a first sample face image and a second sample face image from each sample certificate image, where the image size of the first sample face image is smaller than the image size of the second sample face image, and the first sample face image is a three-dimensional face image.
In step S904, for each first sample face image, the image recognition model performs wavelet transform processing on the red channel, the green channel, and the blue channel of the first sample face image, respectively, so as to remove the stripes in the first face image. The wavelet transform process is implemented by using a wavelet transform function and the number of wavelet transforms.
In step S906, the image recognition model performs sharpening processing on the striped image through DHE (Dynamic Histogram Equalization) algorithm to improve the contrast of the image.
In step S908, the image recognition model removes white noise from the image with improved contrast through the white noise removing parameter, so as to obtain the third sample face image in step S910, thereby obtaining the third sample face image corresponding to each first sample face image.
In step S912, the image recognition model compares each third sample face image with the corresponding second sample face image to obtain each similarity in step S914.
Step S916, drawing a characteristic curve corresponding to the group of image processing parameters based on each similarity, and calculating the characteristic area under the characteristic curve.
FIG. 10 is a schematic diagram of a test flow of an image recognition model in one embodiment.
Step S1002, the computer device may perform video acquisition on the target document to obtain a corresponding document video. The target certificate contains a large-size face image and a small-size face image, namely a large face and a small face.
Step S1004, screening 15 frames of candidate video frames from the certificate video, and executing step S1006, namely, dividing each frame of candidate video frame and calculating the inclination angle, and screening the standby video frames meeting the certificate definition condition from the 15 frames of candidate video frames based on the inclination angle.
Step S1008, performing face ambiguity judgment on the small face in the standby video frame. And screening target video frames meeting the face definition condition from the standby video frames based on the face ambiguity.
Step S1010, performing target face detection on the screened target video frames, and dividing small faces in the target video frames.
Step S1012, performing image enhancement processing on the small faces through each group of target image processing parameters in the trained image recognition model, and obtaining the small faces after each group of image enhancement processing.
Step S1014, comparing the small faces after the image enhancement processing with the corresponding large faces respectively to obtain contrast scores, and realizing the test of the image recognition model based on the contrast scores.
In one embodiment, the computer device may use the real certificate video of 300 real certificates and the counterfeit certificate video of 50 face-changing certificates for testing.
In one embodiment, there is provided an authentication method including:
And (S1) acquiring sample certificate images, determining sample categories to which each sample certificate image belongs respectively, and extracting a first sample face image and a second sample face image from the sample certificate images, wherein the image size of the first sample face image is smaller than that of the second sample face image, and the first sample face image is a three-dimensional face image.
And step (S2), respectively carrying out image enhancement processing on the first sample face image through each group of candidate image processing parameters in the image recognition model to be trained, and obtaining a third sample face image respectively corresponding to each group of candidate image processing parameters.
And step (S3), comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result.
And step (S4), generating a characteristic curve according to the corresponding sample comparison result and the corresponding sample category, determining a corresponding characteristic area based on the characteristic curve, and screening three groups of standby image processing parameters meeting the area matching condition from large to small based on the characteristic area.
And step (S5) determining current candidate image processing parameters corresponding to the current iteration from a sample parameter set in the image recognition model to be trained, acquiring standby image processing parameters screened by the previous iteration, and respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the groups of image processing parameters.
And step (S6), for each group of image processing parameters in the current iteration, generating a characteristic curve according to the corresponding sample comparison result and the corresponding sample category, determining the corresponding characteristic area based on the characteristic curve, and screening standby image processing parameters meeting the area matching condition in the current iteration based on the characteristic area.
And step (S7), selecting candidate image processing parameters which do not participate in iterative computation from the sample parameter set, taking the candidate image processing parameters as current candidate image processing parameters corresponding to the next iteration, and taking standby image processing parameters screened by the current iteration as standby image processing parameters required by the next iteration.
And (S8) returning to the step of respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to the image processing parameters of each group, and continuing to execute until training is stopped after all candidate image processing parameters in the sample parameter set are traversed to obtain a trained target image recognition model.
And step (S9), obtaining a certificate video obtained by video acquisition of the target certificate, inputting the certificate video into a target image recognition model, and extracting more than one frame of candidate video frames from the certificate video by the target image recognition model.
And step (S10), the target image recognition model detects target certificates in each candidate video frame respectively, and candidate boundary areas comprising the target certificates are segmented from the candidate video frames.
And step (S11), for each frame of candidate video frame, acquiring the length information of the corresponding candidate boundary region and the corresponding projection information when the corresponding candidate boundary region is inclined.
And step (S12), for each frame of candidate video frame, calculating the transverse inclination angle between the candidate boundary region and the transverse boundary region and the longitudinal inclination angle between the candidate boundary region and the longitudinal boundary region based on the boundary length information and the corresponding projection information of the corresponding candidate boundary region, and screening the standby video frames meeting the certificate definition condition from the candidate video frames based on the transverse inclination angle and the longitudinal inclination angle.
And step (S13), respectively detecting the three-dimensional face images corresponding to the target certificates in each standby video frame to obtain a face key point detection result in each standby video frame.
And step (S14) of determining the face ambiguity corresponding to each standby video frame based on the face key point detection result in each standby video frame, and screening target video frames meeting the face definition condition from the standby video frames based on the face ambiguity.
And step (S15), extracting a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than that of the second face image, and the first face image is a three-dimensional face image.
And step (S16), obtaining each group of target image processing parameters, wherein each group of target image processing parameters comprises processing sub-parameters corresponding to the three image processing modes. Three image processing modes are striping, sharpening and white noise removal.
And (S17) for each group of target image processing parameters, carrying out image enhancement processing on the first face image in sequence according to the corresponding processing sub-parameters and the corresponding image processing modes of the processing sub-parameters until a third face image corresponding to each group of target image processing parameters is obtained.
And (S18) calculating the similarity between each third face image and the second face image, and determining the maximum value in the similarity.
And step (S19) of acquiring multi-frame video frames to be compared corresponding to different visual angles from the certificate video, and comparing the three-dimensional face images in the multi-frame video frames to be compared to obtain the similarity between the three-dimensional face images.
And step (S20), when the maximum value is larger than a preset similarity threshold value and the similarity between the three-dimensional face images is larger than the preset similarity threshold value, determining that the identity verification result of the target certificate is verification passing.
And step (S21), when the maximum value is smaller than or equal to a preset similarity threshold value and at least one similarity among the three-dimensional face images is not larger than the preset similarity threshold value, determining that the identity verification result of the target certificate is verification passing.
In this embodiment, two face images exist in the certificate, the face image with a small image size is a three-dimensional face image, and the three-dimensional face image is a dynamic false identification point. The stereoscopic face image is susceptible to different light and angles when the document is tilted, resulting in unclear face images. And respectively carrying out image enhancement processing on the first sample face image through each group of target image processing parameters in the image recognition model to be trained so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image and obtain each third sample face image subjected to image enhancement processing with different degrees. After eliminating the interference generated by angles, light rays and the like, comparing each third sample face image with the corresponding second sample face image to obtain a corresponding sample image comparison result, generating a characteristic curve based on the sample image comparison result and the sample category to obtain a characteristic area, and screening a plurality of groups of candidate image processing parameters according to the characteristic area.
The characteristic area corresponding to each group of image processing parameters calculated by each iteration of the image recognition model is used, and the image processing parameters meeting the area matching condition in the current iteration are screened out based on the characteristic area, so that each group of image processing parameters with the best image enhancement processing effect in the current iteration can be screened out. And selecting candidate image processing parameters which do not participate in iterative computation and each group of image processing parameters which are selected in the previous iteration from the sample parameter set, and continuing to perform the next iteration computation, wherein each group of image processing parameters with the best image enhancement processing effect can be selected in each iteration computation. Based on the traversal of each group of candidate image processing parameters in the sample parameter set, each group of image processing parameters can be continuously screened through traversal iteration until the traversal is finished, and the image recognition model can automatically screen each group of image processing parameters with the best image enhancement processing effect.
In the practical application process, a target video frame with proper inclination angle and clear stereo face image of a target certificate is extracted from the certificate video through a trained target image recognition model. And carrying out image enhancement processing on the three-dimensional face images in the target video frame to different degrees through each group of target image processing parameters in the target image recognition model to obtain a plurality of processed third face images. According to the image comparison results of the different third face images and the same second face image, whether the two face images in the target certificate are face images of the same user or not can be accurately identified, and therefore authenticity of the target certificate can be identified, and identity verification of the target certificate can be achieved.
The application also provides an application scene, which applies the identity verification method. Specifically, the application of the authentication method in the application scene is as follows:
and acquiring a sample identity card video obtained by carrying out video acquisition on the sample identity card, and screening video frames with the transverse inclination angle and the longitudinal inclination angle smaller than 30 degrees from the sample identity card video. And screening sample video frames with clear parts of the human face from the screened video frames. The small face in the sample identity card is a three-dimensional face image.
And acquiring sample identity card images from the sample video frames, and determining real labels corresponding to the sample identity card images. The real label refers to whether the sample identity card image is a real identity card or a counterfeit identity card. And extracting a sample small face and a sample large face from the sample identity card image.
For 10 groups of candidate image processing parameters in an image recognition model to be trained, each group of candidate image processing parameters comprises a striping parameter, a sharpening parameter and a white noise removing parameter, the striping parameter comprises a wavelet transformation function and wavelet transformation times, and the striping parameter corresponds to wavelet transformation processing. The sharpening parameters correspond to histogram equalization and the whitening noise removal parameters correspond to mean filtering. I.e. the candidate image processing parameters may be [ p1, p2, p3, p4], where p1 refers to the different wavelet functions used in the wavelet transform. The number of p2 wavelet transforms, i.e., the depth of wavelet decomposition. p3 is the sharpening parameter and p4 is the whitening noise parameter. p1= [ db1, sym2, sym3, sym4, ], p2= [1,2,3,4, ], p3= [0.02,0.04,0.06, ], 0.48,0.5, p4= [ a, b, c, d, ], the candidate image processing parameters are combinations of different p1, p2, p3 and p 4.
And carrying out wavelet transformation processing on the sample small face through a wavelet transformation function and wavelet transformation times to obtain an image with stripes removed. And carrying out histogram equalization on the image with the stripes removed through sharpening parameters to obtain an image with enhanced contrast. And carrying out mean value filtering processing on the image with enhanced contrast through the white noise removing parameter to obtain the image with white noise removed. The image with white noise removed is the predicted small face.
The striping parameter, sharpening parameter and white noise parameter in each set of candidate image processing parameters are not identical, and the candidate image processing parameters are different.
And respectively comparing the predicted small faces corresponding to the 10 groups of candidate image processing parameters with the corresponding sample large faces to obtain each similarity. And when the similarity is larger than a preset similarity threshold, predicting that the sample identity card image corresponding to the similarity is a real identity card. And when the similarity is not greater than a preset similarity threshold, predicting that the sample identity card image corresponding to the similarity is a fake identity card.
The set identification threshold may be 0.5, 0.6, 0.65, 0.7. And determining the prediction type of the image recognition model to be trained on the sample identity card image when the recognition threshold value is respectively 0.5, 0.6, 0.65 and 0.7 for each similarity corresponding to a group of candidate image processing parameters, wherein the prediction type is the sample identity card image which is a real identity card or a fake identity card.
And when the recognition threshold value is 0.5, calculating the number FN of the false identity cards predicted by the image recognition model to be trained, the number TP of the true identity cards predicted by the true identity cards, the number TN of the false identity cards predicted by the false identity cards and the number FP of the true identity cards in each sample identity card image. Next, the true positive probability tpr=tp/(tp+fn), and the false positive probability fpr=fp/(fp+tn) are calculated. A coordinate is obtained based on the probability of false positives and the probability of true positives. According to the same processing mode, the coordinates when the recognition threshold is 0.6, 0.65 and 0.7 can be obtained respectively, so that 4 coordinates corresponding to the candidate image processing parameters are obtained. Based on the 4 coordinates, a coordinate system is constructed by taking the false positive probability as a horizontal axis and the true positive probability as a vertical axis, the 4 coordinates are determined in the coordinate system, and an ROC curve can be obtained by connecting the 4 coordinates, wherein the area under the ROC curve is the corresponding AUC area. Thereby, the ROC curve and the AUC area corresponding to the candidate image processing parameters can be obtained.
For the remaining 9 groups, the same treatment was followed to obtain the remaining 9 ROC curves and the corresponding 9 AUC areas. And selecting 3 largest AUC areas from the 10 AUC areas, thereby screening out 3 groups of candidate image processing parameters corresponding to the 3 largest AUC areas.
7 Sets of candidate image processing parameters are selected from the sample parameter set, and the 7 sets of candidate image processing parameters and the 3 screened sets of candidate image processing parameters are used as image processing parameters of the next iteration of the image recognition model.
According to the training mode of the gridding search, 7 groups of candidate image processing parameters are selected in the sample parameter set in each iteration until the candidate image processing parameters in the sample parameter set are selected, the last iteration is carried out, and 3 groups of candidate image processing parameters are selected from 10 AUC areas obtained in the last iteration to serve as target candidate image parameters. For example, the three sets of target candidate image parameters are [ p1=sym2, p2=1, p3=0.02, p4=a ], [ p1=sym3, p2=2, p3=0.04, p4=b ], [ p1=sym4, p2=2, p3=0.16, p4=c ].
In the practical application process, the identification card video of the user can be acquired, the identification card video is input into a target image recognition model, and the target image recognition model recognizes the identification card video to obtain the clearest small face and large face in a frame of video.
And respectively carrying out image enhancement processing on the small faces in the identity card video through 3 groups of target image processing parameters in the target image recognition model to obtain 3 small faces subjected to the image enhancement processing. And respectively calculating the similarity between each small face and each large face, and judging that the small face and the large face in the identity card are face images of the same person when the 3 similarities are all larger than 0.65, wherein the identity card is a real identity card.
When at least one similarity in the 3 similarities is not more than 0.65, judging that the small face and the large face in the identity card are not face images of the same person, and then the identity card is a fake identity card.
When the user needs to transact the related business of the bank, the bank can verify the identity card of the user through the processing mode of the embodiment, and when the identity card of the user passes the verification, namely the identity card of the user is a real identity card, the user is allowed to transact the related business of the person, such as transacting the bank card, inquiring, modifying the bank reservation information and the like. When the authentication of the user identity card fails, namely the user identity card is a fake identity card, the user is not allowed to transact any business, and the staff of the bank is notified.
The identity verification method of the embodiment is applied to the business handling of the bank, can accurately identify whether the identity card of the user needing to handle the bank business is real, can avoid illegal molecules from using other people information, and can illegally acquire other people information and property, thereby ensuring the safety of the user information and property in the bank and the safety of business handling.
It can be appreciated that the identity verification method in this embodiment can be applied to any certificate with two face images, and can be applied to any scene where identity card verification is required, and is not limited to banks. For example, the identification card identification of stations, airports and hotels, the identification of the identification card image uploaded when registering the information of the individual, and the like can be adopted.
It should be understood that, although the steps in the flowcharts of fig. 2, 5-10 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps of fig. 2, 5-10 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 11, there is provided an authentication apparatus 1100, which may be a software module or a hardware module, or a combination of both, forming part of a computer device, and specifically includes an acquisition module 1102, an extraction module 1104, an image enhancement module 1106, and an alignment module 1108, where:
And the acquisition module 1102 is used for acquiring a certificate video obtained by video acquisition of the target certificate and screening target video frames meeting the image definition condition from the certificate video.
And an extracting module 1104, configured to extract, from the target video frame, a first face image and a second face image corresponding to the target certificate, where an image size of the first face image is smaller than an image size of the second face image.
The image enhancement module 1106 is configured to obtain at least one set of target image processing parameters, and perform image enhancement processing on the first face image based on each set of target image processing parameters, so as to obtain at least one third face image.
And the comparison module 1108 is configured to compare each of the third face images with the second face image respectively to obtain a corresponding image comparison result, and determine an identity verification result of the target certificate according to the image comparison result.
In this embodiment, a target video frame satisfying the image definition condition is selected from the document video including the target document, so as to obtain a clear video frame, thereby obtaining a clear target document. And extracting a first face image and a second face image corresponding to the target certificate from the target video frame to obtain the first face image and the second face image in the target certificate. The image size of the first face image is smaller than that of the second face image, so that the first face image is more easily influenced by light rays and angles during video acquisition, the first face image is subjected to image enhancement processing through at least one group of target image processing parameters, the influence of the angles, light rays and the like of video acquisition on the first face image is removed, and at least one image enhancement processed third face image is obtained. And comparing each third face image after removing the influence of the angle, light and the like of video acquisition on the first face image with the second face image to obtain image comparison results of the third face image and the second face image corresponding to different target image processing parameters, thereby obtaining image comparison results of different third face images obtained by different image enhancement modes and the same second face image. According to the image comparison results of the different third face images and the same second face image, whether the two face images in the target certificate are face images of the same user or not can be accurately identified, and therefore authenticity of the target certificate can be identified, and identity verification of the target certificate can be achieved.
In one embodiment, the first face image is a stereoscopic face image, the obtaining module 1102 is further configured to extract more than one frame of candidate video frames from the certificate video, detect target certificates in each candidate video frame to determine a certificate inclination angle corresponding to the target certificate in each candidate video frame, screen standby video frames meeting a certificate definition condition from the candidate video frames based on the certificate inclination angle, detect stereoscopic face images corresponding to the target certificate in each standby video frame to determine face ambiguities corresponding to the stereoscopic face images in each standby video frame, and screen target video frames meeting the face definition condition from the standby video frames based on the face ambiguities.
In one embodiment, the stereoscopic face image is easily affected by light, acquisition angles and the like, and the definition degree of the detected face image is different under different inclination angles, so that whether the target certificate is clear or not can be judged through the inclination angle of the target certificate in the certificate video and the face ambiguity of the stereoscopic face image, and the video frames corresponding to the stereoscopic face image in the clear state of each part in the certificate video can be screened.
In one embodiment, the obtaining module 1102 is further configured to detect a target certificate in each candidate video frame, segment a candidate boundary area including the target certificate from the candidate video frames, and for each candidate video frame, determine a boundary angle formed by the corresponding candidate boundary area and a preset boundary area, and use the boundary angle as a certificate inclination angle corresponding to the target certificate in the corresponding candidate video frame.
In this embodiment, for each frame of candidate video frame, the boundary included angle formed by the corresponding candidate boundary region and the preset boundary region is determined, where the candidate boundary region is the region where the target document is located in the candidate video frame, and then the boundary included angle can accurately represent the inclination angle of the target document in the document video.
In one embodiment, the certificate inclination angle comprises a transverse inclination angle and a longitudinal inclination angle, the preset boundary area comprises a transverse boundary area and a longitudinal boundary area, the acquisition module 1102 is further configured to acquire length information of a corresponding candidate boundary area and corresponding projection information when the corresponding candidate boundary area is inclined for each frame of candidate video frame, and calculate the transverse inclination angle between the candidate boundary area and the transverse boundary area and the longitudinal inclination angle between the candidate boundary area and the longitudinal boundary area based on the boundary length information of the corresponding candidate boundary area and the corresponding projection information for each frame of candidate video frame.
In this embodiment, the projection information of the target document in the lateral boundary region and the longitudinal boundary region when the target document is tilted is detected, and the tilt angle formed by the candidate boundary region and the lateral boundary region can be accurately calculated based on the length information of the candidate boundary region and the projection information of the target document in the lateral boundary region. Based on the length information of the candidate boundary region and the projection information of the longitudinal boundary region, the inclination angle formed by the candidate boundary region and the longitudinal boundary region can be accurately calculated, so that two inclination angles of the same candidate boundary region in different directions are used as conditions for screening target video frames, and the target video frames corresponding to clearer target certificates can be screened.
In one embodiment, the obtaining module 1102 is further configured to detect three-dimensional face images corresponding to the target certificate in each standby video frame, respectively, to obtain a face key point detection result in each standby video frame, and determine a face ambiguity corresponding to each standby video frame, respectively, based on the face key point detection result in each standby video frame.
In this embodiment, the face key point detection is performed on the stereoscopic face image, and based on the face key point detection result, the blur change of the image can be reflected from each part of the face. In addition, only the key points of each part of the human face are used for calculating the blurring degree, the calculated amount can be reduced, the gradient value is sensitive to blurring, and the gradient value of the key points can be used for accurately calculating the blurring degree of the image.
In one embodiment, each set of target image processing parameters includes processing sub-parameters corresponding to at least one image processing mode, the image enhancement module 1106 is further configured to, for each set of target processing parameters, sequentially perform image enhancement processing on the first face image according to the corresponding processing sub-parameters and the corresponding image processing modes corresponding to the respective processing sub-parameters until a corresponding third face image is obtained, where the multiple image processing modes include at least one of striping, sharpening, and white noise removal.
In this embodiment, for each set of target processing parameters, the first face image is sequentially processed such as striping, sharpening, and white noise removing according to the image processing modes corresponding to the processing sub-parameters in each set of target image processing parameters, so as to obtain a third face image after striping, sharpening, and white noise removing. And if the processing sub-parameters of the striping, sharpening and white noise removal of each third face image are different, the degrees of the striping, sharpening and white noise removal of each third face image are different, so that a plurality of third face images with different image enhancement processing degrees are obtained.
In one embodiment, the comparison module 1108 is further configured to calculate a similarity between each of the third face images and the second face image, and determine a maximum value of the similarities, and determine that the authentication result of the target document is authentication passing when the maximum value is greater than a preset similarity threshold.
In this embodiment, the similarity between each third face image after the image enhancement processing and the second face image is calculated, so that the identity verification result of the target certificate can be accurately determined based on the comparison result of the maximum similarity and the preset similarity threshold.
In one embodiment, the first face image is a stereoscopic face image, and the apparatus further comprises an angle comparison module. The angle comparison module is used for acquiring multi-frame video frames to be compared corresponding to different visual angles from the certificate video, comparing the three-dimensional face images in the multi-frame video frames to be compared, and obtaining a corresponding angle comparison result;
the comparison module 1108 is further configured to determine an authentication result of the target document according to the image comparison result and the angle comparison result.
In this embodiment, the detected stereoscopic face images under different viewing angles have larger changes, and multiple frames of video frames to be compared of different viewing angles in the certificate video are acquired to compare the stereoscopic face images under different viewing angles, so as to determine the similarity or difference between the stereoscopic face images under different viewing angles. The low similarity or large difference indicates that the three-dimensional face image may be obtained by fusing a plurality of different face images, and the three-dimensional face image is a forged face image. Based on the similarity or the difference between the three-dimensional face images under different visual angles, whether the three-dimensional face images are fake faces or not can be identified, and therefore accuracy of identity verification of the target certificate is improved. By combining the image comparison result and the angle comparison result, the identity of the target certificate can be verified in two different modes, so that the accuracy of the identity verification is further improved, and the safety of user information is further improved.
In one embodiment, the apparatus further comprises an image processing parameter determination module. The image processing parameter determining module is used for obtaining sample certificate images and determining sample categories to which each sample certificate image belongs respectively, extracting first sample face images and second sample face images from the sample certificate images, wherein the image size of the first sample face images is smaller than that of the second sample face images, obtaining multiple groups of candidate image processing parameters, respectively carrying out image enhancement processing on the first sample face images based on each group of candidate image processing parameters to obtain third sample face images respectively corresponding to each group of candidate image processing parameters, respectively comparing each third sample face image with the corresponding second sample face images to obtain corresponding sample image comparison results, and screening at least one group of target image processing parameters from the multiple groups of candidate image processing parameters based on the sample image comparison results and the sample categories.
In this embodiment, a first sample face image and a second sample face image are extracted from a sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image, so that the first sample face image is more easily affected by light and angles during image acquisition, and image enhancement processing is performed on the first sample face image through each group of target image processing parameters, so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image, and obtain each third sample face image after image enhancement processing with different degrees. After the interference generated by angles, light rays and the like is eliminated, each third sample face image is respectively compared with the corresponding second sample face image to obtain a corresponding sample image comparison result, and at least one group of target image processing parameters with the best interference effect generated by the angles and the light rays can be screened out from multiple groups of candidate image processing parameters based on the difference between the sample image comparison result and the sample category. The identity of the target certificate is verified through the target image processing parameters, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved.
In one embodiment, the image processing parameter determining module is further used for determining current candidate image processing parameters corresponding to current iteration from a sample parameter set, acquiring standby image processing parameters screened by previous iteration, respectively carrying out image enhancement processing on a first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters, respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters, generating characteristic curves according to corresponding sample comparison results and corresponding sample categories for each group of image processing parameters in the current iteration, determining corresponding characteristic areas based on the characteristic curves, screening standby image processing parameters meeting area matching conditions in the current iteration based on the characteristic areas, selecting candidate image processing parameters which do not participate in iterative computation from the sample parameter set as the current candidate image processing parameters corresponding to the next iteration, returning to the standby image processing parameters required by the current iteration as the standby image processing parameters required by the next iteration, respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters, respectively carrying out image processing on the first sample face image until the corresponding to each group of image processing parameters meet the area matching conditions in the current iteration, continuously screening the candidate image processing parameters in the current iteration until the current candidate image processing parameters meet the area matching conditions, and finally carrying out the candidate image processing parameters in the iteration until the candidate image processing parameters are met.
In this embodiment, the feature area corresponding to each set of image processing parameters calculated in each iteration is used, and the image processing parameters meeting the area matching condition in the current iteration are screened out based on the feature area, so that each set of image processing parameters with the best image enhancement processing effect in the current iteration can be screened out. And selecting candidate image processing parameters which do not participate in iterative computation and each group of image processing parameters which are selected in the previous iteration from the sample parameter set, and continuing to perform the next iteration computation, wherein each group of image processing parameters with the best image enhancement processing effect can be selected in each iteration computation. Based on the traversal of each group of candidate image processing parameters in the sample parameter set, each group of image processing parameters can be continuously screened through traversal iteration until the traversal is finished, and each group of image processing parameters with the best image enhancement processing effect is automatically screened.
In one embodiment, as shown in fig. 12, there is provided an image recognition model training apparatus 1200, which may use a software module or a hardware module, or a combination of both, as a part of a computer device, and specifically includes a sample acquisition module 1202, a face extraction module 1204, a processing module 1206, and a comparison result obtaining module 1208, where:
The sample acquiring module 1202 is configured to acquire sample document images, and determine sample categories to which each of the sample document images respectively belong.
The face extraction module 1204 is configured to extract a first sample face image and a second sample face image from the sample document image, where an image size of the first sample face image is smaller than an image size of the second sample face image.
The processing module 1206 is configured to perform image enhancement processing on the first sample face image through each set of candidate image processing parameters in the image recognition model to be trained, so as to obtain a third sample face image corresponding to each set of candidate image processing parameters.
The comparison result obtaining module 1208 is configured to compare each third sample face image with the corresponding second sample face image, so as to obtain a corresponding sample image comparison result.
The training module 1210 is configured to train the image recognition model to be trained based on the sample image comparison result and the sample category, and stop until a training stop condition is reached, so as to obtain a trained target image recognition model, where the trained target image recognition model includes at least one set of target image processing parameters for performing identity verification on a target document.
In this embodiment, the first sample face image and the second sample face image are extracted from the sample certificate image, and the image size of the first sample face image is smaller than that of the second sample face image, so that the first sample face image is more easily affected by light and angles during image acquisition. And respectively carrying out image enhancement processing on the first sample face image through each group of target image processing parameters in the image recognition model to be trained so as to remove the influence of the angle, light and the like of image acquisition on the first sample face image and obtain each third sample face image subjected to image enhancement processing with different degrees. After the interference generated by angles, light rays and the like is eliminated, each third sample face image is respectively compared with the corresponding second sample face image to obtain a corresponding sample image comparison result, and the target image processing parameters with the best image enhancement effect can be screened out from multiple groups of image processing parameters based on the difference between the sample image comparison result and the sample category. The identity of the target certificate is verified through the trained image recognition model, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved. The trained image recognition model has high recognition precision and high calculation speed, and can improve the efficiency of identity verification of the target certificate.
In one embodiment, the processing module 1206 is further configured to determine a current candidate image processing parameter corresponding to the current iteration from a sample parameter set in the image recognition model to be trained, and obtain a standby image processing parameter screened by the previous iteration;
Respectively carrying out image enhancement processing on the first sample face image based on the current candidate image processing parameters and the standby image processing parameters to obtain third sample face images respectively corresponding to each group of image processing parameters;
The training module 1210 is further configured to, for each set of image processing parameters in the current iteration, generate a feature curve according to a corresponding sample comparison result and a corresponding sample class, determine a corresponding feature area based on the feature curve, screen out a standby image processing parameter meeting an area matching condition in the current iteration based on the feature area, select a candidate image processing parameter not involved in the iterative computation from the sample parameter set as a current candidate image processing parameter corresponding to the next iteration, and use the standby image processing parameter screened out by the current iteration as a standby image processing parameter required by the next iteration, return to perform image enhancement processing on the first sample face image based on the current candidate image processing parameter and the standby image processing parameter, and perform the step of obtaining a third sample face image corresponding to each set of image processing parameters until training is stopped after traversing all candidate image processing parameters in the sample parameter set, thereby obtaining a trained target image recognition model.
In this embodiment, the feature area corresponding to each set of image processing parameters calculated by each iteration of the image recognition model is used, and the image processing parameters meeting the area matching condition in the current iteration are screened out based on the feature area, so that each set of image processing parameters with the best image enhancement processing effect in the current iteration can be screened out. And selecting candidate image processing parameters which do not participate in iterative computation and each group of image processing parameters which are selected in the previous iteration from the sample parameter set, and continuing to perform the next iteration computation, wherein each group of image processing parameters with the best image enhancement processing effect can be selected in each iteration computation. Based on the traversal of each group of candidate image processing parameters in the sample parameter set, each group of image processing parameters can be continuously screened through traversal iteration until the traversal is finished, and the image recognition model can automatically screen each group of image processing parameters with the best image enhancement processing effect. The identity of the target certificate is verified through each group of target image processing parameters in the trained image recognition model, so that the authenticity of the target certificate can be accurately identified, and the accuracy of the identity verification is improved.
For specific limitations on the authentication device and the training device of the image recognition model, reference may be made to the above limitations on the authentication method and the training method of the image recognition model, and details thereof are not repeated here. The above-mentioned authentication device, each module in the training device of the image recognition model may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 13. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured 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, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing authentication data and training data of the image recognition model. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements an authentication method, a training method for an image recognition model.
It will be appreciated by those skilled in the art that the structure shown in FIG. 13 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (23)

1.一种图像识别模型的训练方法,其特征在于,所述方法包括:1. A training method for an image recognition model, characterized in that the method comprises: 获取样本证件图像,并确定各所述样本证件图像分别所属的样本类别;Acquire sample ID images, and determine the sample categories to which each of the sample ID images belongs; 从所述样本证件图像中提取出第一样本人脸图像和第二样本人脸图像,所述第一样本人脸图像的图像尺寸小于所述第二样本人脸图像的图像尺寸;Extracting a first sample face image and a second sample face image from the sample ID image, wherein the image size of the first sample face image is smaller than the image size of the second sample face image; 在每次迭代中,通过待训练的图像识别模型中的多组候选图像处理参数分别对所述第一样本人脸图像进行图像增强处理,得到与每组候选图像处理参数分别对应的第三样本人脸图像;In each iteration, the first sample face images are respectively enhanced using multiple sets of candidate image processing parameters in the image recognition model to be trained to obtain third sample face images corresponding to each set of candidate image processing parameters; 将各所述第三样本人脸图像分别与相应的第二样本人脸图像进行比对,得到对应的样本图像比对结果;Comparing each of the third sample facial images with the corresponding second sample facial image to obtain a corresponding sample image comparison result; 对于当次迭代中的各组图像处理参数,根据相应的样本比对结果和相应的样本类别生成特征曲线,并基于所述特征曲线确定对应的特征面积,并基于特征面积筛选出当次迭代中满足面积匹配条件的备用图像处理参数;For each set of image processing parameters in the current iteration, a characteristic curve is generated according to the corresponding sample comparison results and the corresponding sample categories, and the corresponding characteristic area is determined based on the characteristic curve, and the spare image processing parameters that meet the area matching condition in the current iteration are screened out based on the characteristic area; 利用当次迭代筛选出的备用图像处理参数和样本集中还未参与迭代的候选图像处理参数确定下次迭代的多组候选图像处理参数,继续迭代,直至所述样本集中候选图像处理参数均参与迭代时停止,得到训练好的目标图像识别模型;所述训练好的目标图像识别模型中包括至少一组的目标图像处理参数,以用于对目标证件进行身份验证。The multiple groups of candidate image processing parameters for the next iteration are determined using the spare image processing parameters screened out in the current iteration and the candidate image processing parameters in the sample set that have not yet participated in the iteration, and the iteration is continued until all the candidate image processing parameters in the sample set participate in the iteration, thereby obtaining a trained target image recognition model; the trained target image recognition model includes at least one group of target image processing parameters for identity verification of the target document. 2.根据权利要求1所述的方法,其特征在于,所述在每次迭代中,通过待训练的图像识别模型中的多组候选图像处理参数分别对所述第一样本人脸图像进行图像增强处理,得到与每组候选图像处理参数分别对应的第三样本人脸图像,包括:2. The method according to claim 1, characterized in that in each iteration, the first sample face image is subjected to image enhancement processing respectively by using multiple groups of candidate image processing parameters in the image recognition model to be trained to obtain a third sample face image corresponding to each group of candidate image processing parameters, comprising: 若是首次迭代,从待训练的图像识别模型中的样本参数集中,获取预设组数的候选图像处理参数,分别对第一样本人脸图像进行图像增强处理,获得每组候选图像处理参数分别对应的第三样本人脸图像;If it is the first iteration, a preset number of groups of candidate image processing parameters are obtained from the sample parameter set in the image recognition model to be trained, and image enhancement processing is performed on the first sample face image respectively to obtain a third sample face image corresponding to each group of candidate image processing parameters; 若是第二次起的迭代,从待训练的图像识别模型中的样本参数集中,确定当前迭代所对应的当前候选图像处理参数,并获取通过前次迭代筛选出的备用图像处理参数;If it is the second iteration or later, determine the current candidate image processing parameters corresponding to the current iteration from the sample parameter set in the image recognition model to be trained, and obtain the spare image processing parameters selected by the previous iteration; 基于所述当前候选图像处理参数和所述备用图像处理参数,分别对所述第一样本人脸图像进行图像增强处理,得到与各组图像处理参数分别对应的第三样本人脸图像;Based on the current candidate image processing parameters and the backup image processing parameters, respectively perform image enhancement processing on the first sample face images to obtain third sample face images corresponding to each set of image processing parameters; 所述利用当次迭代筛选出的备用图像处理参数和样本集中还未参与迭代的候选图像处理参数确定下次迭代的多组候选图像处理参数,继续迭代,直至所述样本集中候选图像处理参数均参与迭代时停止,得到训练好的目标图像识别模型,包括:The method uses the spare image processing parameters screened out in the current iteration and the candidate image processing parameters in the sample set that have not participated in the iteration to determine multiple groups of candidate image processing parameters for the next iteration, and continues iterating until all the candidate image processing parameters in the sample set participate in the iteration, thereby obtaining a trained target image recognition model, including: 从所述样本参数集中选择未参与迭代计算的候选图像处理参数,作为下次迭代所对应的当前候选图像处理参数,并将当前迭代筛选出的备用图像处理参数作为下一次迭代所需的备用图像处理参数;Selecting candidate image processing parameters that have not participated in the iterative calculation from the sample parameter set as current candidate image processing parameters corresponding to the next iteration, and using the spare image processing parameters screened out in the current iteration as spare image processing parameters required for the next iteration; 返回所述基于所述当前候选图像处理参数和所述备用图像处理参数,分别对所述第一样本人脸图像进行图像增强处理,得到与各组图像处理参数分别对应的第三样本人脸图像的步骤继续执行,直至遍历所述样本参数集中的所有候选图像处理参数后停止训练,得到训练好的目标图像识别模型。The step of performing image enhancement processing on the first sample face image based on the current candidate image processing parameters and the backup image processing parameters to obtain a third sample face image corresponding to each group of image processing parameters is returned and continued until all candidate image processing parameters in the sample parameter set are traversed and the training is stopped to obtain a trained target image recognition model. 3.一种身份验证方法,其特征在于,所述方法包括:3. An identity authentication method, characterized in that the method comprises: 获取对目标证件进行视频采集所得到的证件视频,并从所述证件视频中筛选出满足图像清晰条件的目标视频帧;Acquire a certificate video obtained by performing video capture on the target certificate, and filter out a target video frame that meets the image clarity condition from the certificate video; 从所述目标视频帧中提取出与所述目标证件对应的第一人脸图像和第二人脸图像,所述第一人脸图像的图像尺寸小于所述第二人脸图像的图像尺寸;Extracting a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than the image size of the second face image; 获取训练好的目标图像识别模型中至少一组的目标图像处理参数,并基于各组目标图像处理参数分别对所述第一人脸图像进行图像增强处理,得到至少一张的第三人脸图像;所述目标图像识别模型通过如权利要求1或2所述的图像识别模型的训练方法训练获得;Obtain at least one set of target image processing parameters in a trained target image recognition model, and perform image enhancement processing on the first face image based on each set of target image processing parameters to obtain at least one third face image; the target image recognition model is obtained by training using the image recognition model training method according to claim 1 or 2; 将每个所述第三人脸图像分别与所述第二人脸图像进行比对,得到对应的图像比对结果,并根据所述图像比对结果确定所述目标证件的身份验证结果。Each of the third facial images is compared with the second facial image to obtain a corresponding image comparison result, and the identity verification result of the target certificate is determined based on the image comparison result. 4.根据权利要求3所述的方法,其特征在于,所述第一人脸图像为立体人脸图像,所述从所述证件视频中筛选出满足图像清晰条件的目标视频帧,包括:4. The method according to claim 3, wherein the first face image is a three-dimensional face image, and the step of selecting a target video frame that meets the image clarity condition from the ID video comprises: 从所述证件视频中抽取多于一帧的候选视频帧;Extracting more than one candidate video frame from the document video; 对各所述候选视频帧中的目标证件分别进行检测,以确定各所述候选视频帧中的目标证件所对应的证件倾斜角度;Detecting the target certificate in each of the candidate video frames respectively to determine the certificate tilt angle corresponding to the target certificate in each of the candidate video frames; 基于所述证件倾斜角度,从所述候选视频帧中筛选满足证件清晰条件的备用视频帧;Based on the tilt angle of the document, selecting a spare video frame that meets the document clarity condition from the candidate video frames; 对各所述备用视频帧中与所述目标证件对应的立体人脸图像进行检测,以确定各所述备用视频帧中立体人脸图像分别对应的人脸模糊度;Detecting the 3D face image corresponding to the target certificate in each of the spare video frames to determine the face blurriness corresponding to the 3D face image in each of the spare video frames; 基于所述人脸模糊度,从所述备用视频帧中筛选出满足人脸清晰条件的目标视频帧。Based on the face blurriness, a target video frame that meets the face clarity condition is selected from the spare video frames. 5.根据权利要求4所述的方法,其特征在于,所述对各所述候选视频帧中的目标证件分别进行检测,以确定各所述候选视频帧中的目标证件所对应的证件倾斜角度,包括:5. The method according to claim 4, characterized in that the detecting the target certificate in each of the candidate video frames respectively to determine the certificate tilt angle corresponding to the target certificate in each of the candidate video frames comprises: 对各所述候选视频帧中的目标证件分别进行检测,从所述候选视频帧中分割出包括有目标证件的候选边界区域;Detecting the target certificate in each of the candidate video frames respectively, and segmenting a candidate boundary region including the target certificate from the candidate video frames; 对于每帧候选视频帧,分别确定相应的候选边界区域与预设边界区域所形成的边界夹角,并将所述边界夹角作为相应候选视频帧中的目标证件所对应的证件倾斜角度。For each candidate video frame, a boundary angle formed by a corresponding candidate boundary area and a preset boundary area is determined respectively, and the boundary angle is used as a document tilt angle corresponding to the target document in the corresponding candidate video frame. 6.根据权利要求5所述的方法,其特征在于,所述证件倾斜角度包括横向倾斜角度和纵向倾斜角度,所述预设边界区域包括横向边界区域和纵向边界区域;所述对于每帧候选视频帧,分别确定相应的候选边界区域与预设边界区域所形成的边界夹角,并将所述边界夹角作为相应候选视频帧中的目标证件所对应的证件倾斜角度,包括:6. The method according to claim 5, characterized in that the document tilt angle includes a horizontal tilt angle and a vertical tilt angle, and the preset boundary area includes a horizontal boundary area and a vertical boundary area; for each candidate video frame, determining the boundary angle formed by the corresponding candidate boundary area and the preset boundary area, and using the boundary angle as the document tilt angle corresponding to the target document in the corresponding candidate video frame, comprises: 对于每帧候选视频帧,均获取相应的候选边界区域的长度信息,以及相应候选边界区域倾斜时所对应的投影信息;For each candidate video frame, length information of the corresponding candidate boundary region and projection information corresponding to the tilt of the corresponding candidate boundary region are obtained; 对于每帧候选视频帧,均基于相应的候选边界区域的边界长度信息和对应的投影信息,计算所述候选边界区域与所述横向边界区域之间的横向倾斜角度,以及所述候选边界区域与所述纵向边界区域之间的纵向倾斜角度。For each candidate video frame, the horizontal tilt angle between the candidate boundary region and the horizontal boundary region, and the vertical tilt angle between the candidate boundary region and the vertical boundary region are calculated based on the boundary length information of the corresponding candidate boundary region and the corresponding projection information. 7.根据权利要求4所述的方法,其特征在于,所述对各所述备用视频帧中与所述目标证件对应的立体人脸图像进行检测,以确定各所述备用视频帧中立体人脸图像分别对应的人脸模糊度,包括:7. The method according to claim 4, characterized in that the step of detecting the 3D face image corresponding to the target document in each of the spare video frames to determine the face blurriness corresponding to the 3D face image in each of the spare video frames comprises: 对各所述备用视频帧中与所述目标证件对应的立体人脸图像分别进行检测,得到各所述备用视频帧中的人脸关键点检测结果;Detecting the 3D face images corresponding to the target certificate in each of the spare video frames respectively to obtain the face key point detection results in each of the spare video frames; 基于各所述备用视频帧中的人脸关键点检测结果,确定各所述备用视频帧分别对应的人脸模糊度。Based on the facial key point detection results in each of the backup video frames, the facial blurriness corresponding to each of the backup video frames is determined. 8.根据权利要求3所述的方法,其特征在于,每组目标图像处理参数包括至少一种图像处理方式各自所对应的处理子参数;所述基于各组目标图像处理参数分别对所述第一人脸图像进行图像增强处理,得到至少一张的第三人脸图像,包括:8. The method according to claim 3, wherein each set of target image processing parameters includes processing sub-parameters corresponding to at least one image processing method; and performing image enhancement processing on the first face image based on each set of target image processing parameters to obtain at least one third face image comprises: 对于每组目标图像处理参数,基于相应的处理子参数,并按照各个处理子参数分别对应的图像处理方式,依次对所述第一人脸图像进行图像增强处理,直至得到相对应的第三人脸图像;多种所述图像处理方式包括去条纹、锐化、去白噪声中的至少一种方式。For each set of target image processing parameters, based on the corresponding processing sub-parameters and in accordance with the image processing methods corresponding to the respective processing sub-parameters, the first face image is sequentially enhanced until a corresponding third face image is obtained; the multiple image processing methods include at least one of stripe removal, sharpening, and white noise removal. 9.根据权利要求3所述的方法,其特征在于,所述将每个所述第三人脸图像分别与所述第二人脸图像进行比对,得到对应的图像比对结果,并根据所述图像比对结果确定所述目标证件的身份验证结果,包括:9. The method according to claim 3, characterized in that the step of comparing each of the third facial images with the second facial image to obtain corresponding image comparison results, and determining the identity verification result of the target certificate according to the image comparison results, comprises: 计算每个所述第三人脸图像分别与所述第二人脸图像之间的相似度;Calculating the similarity between each of the third facial images and the second facial image; 确定所述相似度中的最大值,当所述最大值大于预设相似度阈值时,确定所述目标证件的身份验证结果为验证通过。A maximum value among the similarities is determined, and when the maximum value is greater than a preset similarity threshold, the identity authentication result of the target certificate is determined to be verification passed. 10.根据权利要求3所述的方法,其特征在于,所述第一人脸图像为立体人脸图像,所述方法还包括:10. The method according to claim 3, wherein the first face image is a three-dimensional face image, and the method further comprises: 从所述证件视频中获取对应于不同视角的多帧待比较视频帧;Acquire multiple video frames to be compared corresponding to different viewing angles from the document video; 对所述多帧待比较视频帧中的立体人脸图像进行比对,得到对应的角度比较结果;Comparing the three-dimensional face images in the multiple video frames to be compared to obtain corresponding angle comparison results; 所述根据所述图像比对结果确定所述目标证件的身份验证结果,包括:Determining the identity verification result of the target certificate according to the image comparison result includes: 根据所述图像比对结果和所述角度比较结果,确定所述目标证件的身份验证结果。The identity verification result of the target certificate is determined according to the image comparison result and the angle comparison result. 11.一种图像识别模型的训练装置,其特征在于,所述装置包括:11. A training device for an image recognition model, characterized in that the device comprises: 样本获取模块,用于获取样本证件图像,并确定各所述样本证件图像分别所属的样本类别;A sample acquisition module, used to acquire sample ID images and determine the sample category to which each of the sample ID images belongs; 人脸提取模块,用于从所述样本证件图像中提取出第一样本人脸图像和第二样本人脸图像,所述第一样本人脸图像的图像尺寸小于所述第二样本人脸图像的图像尺寸;A face extraction module, used to extract a first sample face image and a second sample face image from the sample ID image, wherein the image size of the first sample face image is smaller than the image size of the second sample face image; 处理模块,用于在每次迭代中,通过待训练的图像识别模型中的多组候选图像处理参数分别对所述第一样本人脸图像进行图像增强处理,得到与每组候选图像处理参数分别对应的第三样本人脸图像;A processing module, configured to perform image enhancement processing on the first sample face image respectively by using a plurality of groups of candidate image processing parameters in the image recognition model to be trained in each iteration, so as to obtain a third sample face image corresponding to each group of candidate image processing parameters; 比对结果获得模块,用于将各所述第三样本人脸图像分别与相应的第二样本人脸图像进行比对,得到对应的样本图像比对结果;A comparison result obtaining module, used to compare each of the third sample face images with the corresponding second sample face image to obtain a corresponding sample image comparison result; 筛选模块,用于对于当次迭代中的各组图像处理参数,根据相应的样本比对结果和相应的样本类别生成特征曲线,并基于所述特征曲线确定对应的特征面积,并基于特征面积筛选出当次迭代中满足面积匹配条件的备用图像处理参数;A screening module, for generating a characteristic curve for each set of image processing parameters in the current iteration according to the corresponding sample comparison results and the corresponding sample categories, determining the corresponding characteristic area based on the characteristic curve, and screening out the spare image processing parameters that meet the area matching condition in the current iteration based on the characteristic area; 迭代模块,用于利用当次迭代筛选出的备用图像处理参数和样本集中还未参与迭代的候选图像处理参数确定下次迭代的多组候选图像处理参数,继续迭代,直至所述样本集中候选图像处理参数均参与迭代时停止,得到训练好的目标图像识别模型;所述训练好的目标图像识别模型中包括至少一组的目标图像处理参数,以用于对目标证件进行身份验证。An iteration module is used to determine multiple groups of candidate image processing parameters for the next iteration using the spare image processing parameters screened out in the current iteration and the candidate image processing parameters in the sample set that have not yet participated in the iteration, and continue iterating until all the candidate image processing parameters in the sample set participate in the iteration, thereby obtaining a trained target image recognition model; the trained target image recognition model includes at least one group of target image processing parameters for identity verification of the target certificate. 12.根据权利要求11所述的图像识别模型的训练装置,其特征在于,所述处理模块还用于:若是首次迭代,从待训练的图像识别模型中的样本参数集中,获取预设组数的候选图像处理参数,分别对第一样本人脸图像进行图像增强处理,获得每组候选图像处理参数分别对应的第三样本人脸图像;若是第二次起的迭代,从待训练的图像识别模型中的样本参数集中,确定当前迭代所对应的当前候选图像处理参数,并获取通过前次迭代筛选出的备用图像处理参数;基于所述当前候选图像处理参数和所述备用图像处理参数,分别对所述第一样本人脸图像进行图像增强处理,得到与各组图像处理参数分别对应的第三样本人脸图像;12. The training device for an image recognition model according to claim 11 is characterized in that the processing module is also used for: if it is the first iteration, obtaining a preset number of groups of candidate image processing parameters from the sample parameter set in the image recognition model to be trained, performing image enhancement processing on the first sample face image respectively, and obtaining third sample face images corresponding to each group of candidate image processing parameters respectively; if it is the second iteration and above, determining the current candidate image processing parameters corresponding to the current iteration from the sample parameter set in the image recognition model to be trained, and obtaining the spare image processing parameters screened out by the previous iteration; performing image enhancement processing on the first sample face image respectively based on the current candidate image processing parameters and the spare image processing parameters, and obtaining third sample face images corresponding to each group of image processing parameters respectively; 所述迭代模块还用于从所述样本参数集中选择未参与迭代计算的候选图像处理参数,作为下次迭代所对应的当前候选图像处理参数,并将当前迭代筛选出的备用图像处理参数作为下一次迭代所需的备用图像处理参数;返回所述基于所述当前候选图像处理参数和所述备用图像处理参数,分别对所述第一样本人脸图像进行图像增强处理,得到与各组图像处理参数分别对应的第三样本人脸图像的步骤继续执行,直至遍历所述样本参数集中的所有候选图像处理参数后停止训练,得到训练好的目标图像识别模型。The iteration module is also used to select candidate image processing parameters that do not participate in the iterative calculation from the sample parameter set as current candidate image processing parameters corresponding to the next iteration, and use the spare image processing parameters screened out in the current iteration as the spare image processing parameters required for the next iteration; return the step of performing image enhancement processing on the first sample face image based on the current candidate image processing parameters and the spare image processing parameters, respectively, to obtain a third sample face image corresponding to each group of image processing parameters, and continue to execute until all candidate image processing parameters in the sample parameter set are traversed and the training is stopped to obtain a trained target image recognition model. 13.一种身份验证装置,其特征在于,所述装置包括:13. An identity verification device, characterized in that the device comprises: 获取模块,用于获取对目标证件进行视频采集所得到的证件视频,并从所述证件视频中筛选出满足图像清晰条件的目标视频帧;An acquisition module is used to acquire a certificate video obtained by performing video acquisition on a target certificate, and filter out a target video frame that meets the image clarity condition from the certificate video; 提取模块,用于从所述目标视频帧中提取出与所述目标证件对应的第一人脸图像和第二人脸图像,所述第一人脸图像的图像尺寸小于所述第二人脸图像的图像尺寸;An extraction module, configured to extract a first face image and a second face image corresponding to the target certificate from the target video frame, wherein the image size of the first face image is smaller than the image size of the second face image; 图像增强模块,用于获取训练好的目标图像识别模型中至少一组的目标图像处理参数,并基于各组目标图像处理参数分别对所述第一人脸图像进行图像增强处理,得到至少一张的第三人脸图像;所述目标图像识别模型通过如权利要求11或12所述的图像识别模型的训练装置训练获得;An image enhancement module, used to obtain at least one group of target image processing parameters in a trained target image recognition model, and perform image enhancement processing on the first face image based on each group of target image processing parameters to obtain at least one third face image; the target image recognition model is obtained by training with the image recognition model training device according to claim 11 or 12; 比对模块,用于将每个所述第三人脸图像分别与所述第二人脸图像进行比对,得到对应的图像比对结果,并根据所述图像比对结果确定所述目标证件的身份验证结果。The comparison module is used to compare each of the third facial images with the second facial image to obtain corresponding image comparison results, and determine the identity verification result of the target document according to the image comparison results. 14.根据权利要求13所述的身份验证装置,其特征在于,所述第一人脸图像为立体人脸图像,所述获取模块还用于从所述证件视频中抽取多于一帧的候选视频帧;对各所述候选视频帧中的目标证件分别进行检测,以确定各所述候选视频帧中的目标证件所对应的证件倾斜角度;基于所述证件倾斜角度,从所述候选视频帧中筛选满足证件清晰条件的备用视频帧;对各所述备用视频帧中与所述目标证件对应的立体人脸图像进行检测,以确定各所述备用视频帧中立体人脸图像分别对应的人脸模糊度;基于所述人脸模糊度,从所述备用视频帧中筛选出满足人脸清晰条件的目标视频帧。14. The identity authentication device according to claim 13 is characterized in that the first facial image is a three-dimensional facial image, and the acquisition module is also used to extract more than one candidate video frame from the certificate video; the target certificate in each of the candidate video frames is detected respectively to determine the certificate tilt angle corresponding to the target certificate in each of the candidate video frames; based on the certificate tilt angle, the spare video frames that meet the certificate clarity condition are selected from the candidate video frames; the three-dimensional facial image corresponding to the target certificate in each of the spare video frames is detected to determine the facial blurriness corresponding to the three-dimensional facial image in each of the spare video frames; based on the facial blurriness, the target video frames that meet the facial clarity condition are selected from the spare video frames. 15.根据权利要求14所述的身份验证装置,其特征在于,所述获取模块还用于对各所述候选视频帧中的目标证件分别进行检测,从所述候选视频帧中分割出包括有目标证件的候选边界区域;对于每帧候选视频帧,分别确定相应的候选边界区域与预设边界区域所形成的边界夹角,并将所述边界夹角作为相应候选视频帧中的目标证件所对应的证件倾斜角度。15. The identity authentication device according to claim 14 is characterized in that the acquisition module is also used to detect the target certificate in each of the candidate video frames respectively, and segment the candidate boundary area including the target certificate from the candidate video frame; for each candidate video frame, the boundary angle formed by the corresponding candidate boundary area and the preset boundary area is determined respectively, and the boundary angle is used as the certificate tilt angle corresponding to the target certificate in the corresponding candidate video frame. 16.根据权利要求15所述的身份验证装置,其特征在于,所述证件倾斜角度包括横向倾斜角度和纵向倾斜角度,所述预设边界区域包括横向边界区域和纵向边界区域;所述获取模块还用于对于每帧候选视频帧,均获取相应的候选边界区域的长度信息,以及相应候选边界区域倾斜时所对应的投影信息;对于每帧候选视频帧,均基于相应的候选边界区域的边界长度信息和对应的投影信息,计算所述候选边界区域与所述横向边界区域之间的横向倾斜角度,以及所述候选边界区域与所述纵向边界区域之间的纵向倾斜角度。16. The identity authentication device according to claim 15 is characterized in that the inclination angle of the certificate includes a horizontal inclination angle and a vertical inclination angle, and the preset boundary area includes a horizontal boundary area and a vertical boundary area; the acquisition module is also used to obtain the length information of the corresponding candidate boundary area for each frame of candidate video frame, and the projection information corresponding to the corresponding candidate boundary area when the candidate boundary area is tilted; for each frame of candidate video frame, the horizontal inclination angle between the candidate boundary area and the horizontal boundary area, and the vertical inclination angle between the candidate boundary area and the vertical boundary area are calculated based on the boundary length information and the corresponding projection information of the corresponding candidate boundary area. 17.根据权利要求14所述的身份验证装置,其特征在于,所述获取模块还用于对各所述备用视频帧中与所述目标证件对应的立体人脸图像分别进行检测,得到各所述备用视频帧中的人脸关键点检测结果;基于各所述备用视频帧中的人脸关键点检测结果,确定各所述备用视频帧分别对应的人脸模糊度。17. The identity authentication device according to claim 14 is characterized in that the acquisition module is also used to detect the three-dimensional face image corresponding to the target document in each of the backup video frames respectively, and obtain the face key point detection results in each of the backup video frames; based on the face key point detection results in each of the backup video frames, determine the face blurriness corresponding to each of the backup video frames. 18.根据权利要求13所述的身份验证装置,其特征在于,每组目标图像处理参数包括至少一种图像处理方式各自所对应的处理子参数;所述图像增强模块还用于对于每组目标图像处理参数,基于相应的处理子参数,并按照各个处理子参数分别对应的图像处理方式,依次对所述第一人脸图像进行图像增强处理,直至得到相对应的第三人脸图像;多种所述图像处理方式包括去条纹、锐化、去白噪声中的至少一种方式。18. The identity authentication device according to claim 13 is characterized in that each set of target image processing parameters includes processing sub-parameters corresponding to at least one image processing method; the image enhancement module is also used to perform image enhancement processing on the first face image in turn for each set of target image processing parameters, based on the corresponding processing sub-parameters and according to the image processing methods corresponding to each processing sub-parameter, until a corresponding third face image is obtained; the multiple image processing methods include at least one of de-striation, sharpening, and de-white noise. 19.根据权利要求13所述的身份验证装置,其特征在于,所述比对模块还用于计算每个所述第三人脸图像分别与所述第二人脸图像之间的相似度;确定所述相似度中的最大值,当所述最大值大于预设相似度阈值时,确定所述目标证件的身份验证结果为验证通过。19. The identity authentication device according to claim 13 is characterized in that the comparison module is also used to calculate the similarity between each of the third facial images and the second facial image respectively; determine the maximum value of the similarities, and when the maximum value is greater than a preset similarity threshold, determine that the identity authentication result of the target document is verified passed. 20.根据权利要求13所述的身份验证装置,其特征在于,所述第一人脸图像为立体人脸图像,所述装置还包括:20. The identity authentication device according to claim 13, wherein the first face image is a three-dimensional face image, and the device further comprises: 角度比较模块,用于从所述证件视频中获取对应于不同视角的多帧待比较视频帧;对所述多帧待比较视频帧中的立体人脸图像进行比对,得到对应的角度比较结果;An angle comparison module is used to obtain multiple frames of video frames to be compared corresponding to different viewing angles from the document video; compare the stereoscopic face images in the multiple frames of video frames to be compared to obtain corresponding angle comparison results; 所述比对模块还用于根据所述图像比对结果和所述角度比较结果,确定所述目标证件的身份验证结果。The comparison module is also used to determine the identity verification result of the target certificate based on the image comparison result and the angle comparison result. 21.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至10中任一项所述的方法。21. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the method according to any one of claims 1 to 10 when executing the computer program. 22.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至10中任一项所述的方法。22. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 10 when executed by a processor. 23.一种计算机程序产品,包括计算机指令,其特征在于,所述计算机指令被处理器执行时实现权利要求1至10中任一项所述的方法。23. A computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
CN202110049447.8A 2021-01-14 2021-01-14 Authentication method, device, computer equipment and storage medium Active CN114840830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110049447.8A CN114840830B (en) 2021-01-14 2021-01-14 Authentication method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110049447.8A CN114840830B (en) 2021-01-14 2021-01-14 Authentication method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114840830A CN114840830A (en) 2022-08-02
CN114840830B true CN114840830B (en) 2025-07-15

Family

ID=82561206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110049447.8A Active CN114840830B (en) 2021-01-14 2021-01-14 Authentication method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114840830B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516739A (en) * 2019-08-27 2019-11-29 阿里巴巴集团控股有限公司 Certificate identification method, device and equipment
CN110751041A (en) * 2019-09-19 2020-02-04 平安科技(深圳)有限公司 Certificate authenticity verification method, system, computer device and readable storage medium
CN111461034A (en) * 2020-04-06 2020-07-28 邱秀莲 Face recognition method and system
CN112084936A (en) * 2020-09-08 2020-12-15 济南博观智能科技有限公司 Face image preprocessing method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117801A (en) * 2018-08-20 2019-01-01 深圳壹账通智能科技有限公司 Method, apparatus, terminal and the computer readable storage medium of recognition of face
CN111401344B (en) * 2020-06-04 2020-09-29 腾讯科技(深圳)有限公司 Face recognition method and device and training method and device of face recognition system
CN111898520B (en) * 2020-07-28 2024-08-09 腾讯科技(深圳)有限公司 Certificate authenticity identification method and device, computer readable medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516739A (en) * 2019-08-27 2019-11-29 阿里巴巴集团控股有限公司 Certificate identification method, device and equipment
CN110751041A (en) * 2019-09-19 2020-02-04 平安科技(深圳)有限公司 Certificate authenticity verification method, system, computer device and readable storage medium
CN111461034A (en) * 2020-04-06 2020-07-28 邱秀莲 Face recognition method and system
CN112084936A (en) * 2020-09-08 2020-12-15 济南博观智能科技有限公司 Face image preprocessing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114840830A (en) 2022-08-02

Similar Documents

Publication Publication Date Title
Zhang et al. Unsupervised learning-based framework for deepfake video detection
US11200405B2 (en) Facial verification method and apparatus based on three-dimensional (3D) image
CN110852160B (en) Image-based biometric identification system and computer-implemented method
US20200184187A1 (en) Feature extraction and matching for biometric authentication
US8064653B2 (en) Method and system of person identification by facial image
Dagnes et al. Occlusion detection and restoration techniques for 3D face recognition: a literature review
US20180034852A1 (en) Anti-spoofing system and methods useful in conjunction therewith
CN109766785B (en) Method and device for liveness detection of human face
CN105956572A (en) In vivo face detection method based on convolutional neural network
CN111339897B (en) Living body identification method, living body identification device, computer device, and storage medium
CN105243376A (en) Living body detection method and device
Lin et al. Convolutional neural networks for face anti-spoofing and liveness detection
CN113614731A (en) Authentication verification using soft biometrics
Kim et al. Generalized facial manipulation detection with edge region feature extraction
Yeh et al. Face liveness detection based on perceptual image quality assessment features with multi-scale analysis
Nguyen et al. Face presentation attack detection based on a statistical model of image noise
KR102318051B1 (en) Method for examining liveness employing image of face region including margin in system of user identifying
CN114840830B (en) Authentication method, device, computer equipment and storage medium
Al-Fehani et al. Recent advances in digital image and video forensics, anti-forensics and counter anti-forensics
Srivastava et al. A machine learning and IoT-based anti-spoofing technique for liveness detection and face recognition
HK40069371A (en) Identity verification method and apparatus, computer device, and storage medium
HK40069371B (en) Identity verification method and apparatus, computer device, and storage medium
Wadhwa et al. FA-Net: A Deep Face Anti-Spoofing Framework using Optical Maps
KR102881298B1 (en) Deepfake detection system and method using ai-based temporal facial feature analysis
Priyanka et al. Genuine selfie detection algorithm for social media using image quality measures

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40069371

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant