Identity authentication method, device and equipment
By preprocessing face images and document images and identifying differences in pixel values, the problem of identity authentication security under deep forgery technology is solved, and accurate identification and prevention of forged images are achieved.
Patent Information
- Application Number
- CN202410776108.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-14
AI Technical Summary
It is difficult for existing identity authentication technology to accurately identify forged face images and forged document images generated by deep forgery technology, leading to an increase in the risk of identity fraud and the inability to effectively guarantee the security of identity authentication.
By preprocessing the target user's face image and document image, extract face attribute information at the same location, generate identity authentication results, and identify potential deep forgery technology usage based on pixel value differences.
Effectively identify and prevent identity fraud using forged face images and document images, and improve the security and accuracy of identity authentication.
Smart Images

Figure CN118711232A
Abstract
Description
Technical Field
[0001] The present application relates to the field of identity verification technology, and in particular to an identity authentication method, device and equipment. Background Art
[0002] Deepfake technology can refer to artificial intelligence technology that uses neural network technology to learn user image samples or user video samples, thereby splicing the user's voice, facial expressions and body movements into false content. Among deepfake technologies, the most common method is artificial intelligence (AI) face-changing technology, which makes it possible to tamper with or generate highly realistic and difficult-to-distinguish user audio and video content, and observers often cannot distinguish the authenticity with the naked eye.
[0003] Based on this, how to accurately identify users who use forged facial images and forged ID images to commit identity fraud in order to ensure the security of identity authentication has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of this specification provide an identity authentication method, device and equipment, which can accurately identify situations where users use forged facial images and forged ID images to commit identity fraud, so as to ensure the security of identity authentication.
[0005] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0006] An identity authentication method provided in an embodiment of this specification includes:
[0007] Acquire a first user face image of the target user collected during the identity authentication process;
[0008] Acquire a first ID facial image of the target user from the ID image of the target user;
[0009] Preprocessing the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent;
[0010] An identity authentication result for the target user is generated based on the difference in pixel values at the same position between the second user face image and the second ID face image.
[0011] An identity authentication device provided in an embodiment of this specification includes:
[0012] A first acquisition module is used to acquire a first user face image of a target user collected during the identity authentication process;
[0013] A second acquisition module, used to acquire a first ID facial image of the target user from the ID image of the target user;
[0014] a preprocessing module, configured to preprocess the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent;
[0015] A generation module is used to generate an identity authentication result for the target user according to the difference in pixel values at the same position in the second user face image and the second ID face image.
[0016] An identity authentication device provided in an embodiment of this specification includes:
[0017] at least one processor; and,
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0020] Acquire a first user face image of the target user collected during the identity authentication process;
[0021] Acquire a first ID facial image of the target user from the ID image of the target user;
[0022] Preprocessing the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent;
[0023] An identity authentication result for the target user is generated based on the difference in pixel values at the same position between the second user face image and the second ID face image.
[0024] At least one embodiment provided in this specification can achieve the following beneficial effects:
[0025] By preprocessing the first user facial image and the first ID facial image of the target user to obtain the second user facial image and the second ID facial image with consistent types of facial attribute information reflected at the same position, and by generating an identity authentication result for the target user based on the difference in pixel values at the same position in the second user facial image and the second ID facial image, it is possible to effectively identify situations in which users use forged facial images and forged ID images to commit identity fraud, thereby ensuring the security of identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 A flowchart of an identity authentication method provided in an embodiment of this specification;
[0028] Figure 2 A schematic diagram of a face alignment principle provided in an embodiment of this specification;
[0029] Figure 3 A schematic diagram of a difference image generation scenario provided in an embodiment of this specification;
[0030] Figure 4 The embodiments of this specification provide corresponding to Figure 1 A swimlane flow diagram of the identity authentication method in ;
[0031] Figure 5 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of an identity authentication device;
[0032] Figure 6 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of an identity authentication device. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.
[0034] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0035] In the prior art, as the threshold of deep fake technology is lowered, some people have begun to use deep fake technology to generate fake user face images, and use the generated fake user face images to make fake certificates containing face images, so that the user face images and certificate face images used by the above-mentioned people in the identity authentication process also have high consistency in pixel granularity. However, since the existing identity authentication model is often based on the fake user face images and fake certificate images with high consistency provided by the above-mentioned people, the wrongly identified person can pass the identity authentication, and thus it is impossible to accurately identify the user's use of deep fake technology to commit identity fraud during the identity authentication process. There is a risk of abuse of deep fake technology, and the security of identity authentication during business operations cannot be guaranteed.
[0036] In order to solve the defects in the prior art, this solution provides the following embodiments:
[0037] Figure 1 The following is a flowchart of an identity authentication method provided in an embodiment of this specification. From a program perspective, the execution subject of the process can be a device that performs identity verification, or an application installed on the device that performs identity verification. Figure 1 As shown, the process may include the following steps:
[0038] Step 102: Acquire a first user face image of the target user collected during the identity authentication process.
[0039] In the embodiments of this specification, when authenticating the target user, it is usually necessary to collect the target user's facial image in real time, and generate an authentication result for the target user by comparing the real-time collected user facial image with the ID facial image in the target user's ID.
[0040] Based on this, the first user face image in step 102 can be an image containing the face of the target user obtained by using the device to perform real-time image acquisition of the target user. It is understandable that some personnel may use technical means to crack the security protection program and identity authentication program in the device, thereby providing the forged user face image generated by the deep fake technology to the execution subject of step 102. At this time, the forged user face image also belongs to the first user face image of the target user collected during the identity authentication process. Alternatively, if the identity authentication process allows the first user face image of the target user obtained historically to be called from the database, it is also possible to obtain the first user face image without real-time image acquisition of the target user, and there is no specific limitation on this.
[0041] Step 104: Acquire a first ID facial image of the target user from the ID image of the target user.
[0042] In the embodiments of the present specification, it may be necessary to use a preset type of ID card of the user to generate an identity authentication result. Therefore, it is necessary to obtain an ID card image of the preset type of the target user, perform face recognition processing on the ID card image, and use the image within the recognized face area as the first ID card face image of the target user.
[0043] In actual applications, the preset types of certificates required for identity authentication can be set according to actual needs. For example, they can include: certificates issued by official agencies reflecting individual identity, work certificates, membership cards, etc., without specific limitations.
[0044] Step 106: Preprocess the first user facial image and the first ID facial image to obtain a second user facial image and a second ID facial image of the target user; wherein the type of facial attribute information reflected at the same position in the second user facial image and the second ID facial image is consistent.
[0045] In the embodiments of the present specification, since there is often a certain time interval between the time when the user's ID card is generated and the time when the user performs identity authentication, and the facial images taken of the same user under different lighting, angles, and expressions are often not completely consistent, there will often be differences in facial attribute information such as facial posture, expression, and makeup contained in the more credible user facial image and the ID facial image of the same user.
[0046] However, since the forged ID facial images used by some persons are obtained by processing the forged user facial images they use, the forged ID facial images used by the above persons are basically identical to the forged user facial images, with pixel-level consistency in posture, hairstyle, face shape, etc.
[0047] According to this feature, when authenticating the target user, the first user face image and the first ID face image of the target user can be preprocessed, so as to extract the second user face image and the second ID face image with consistent types of face attribute information reflected at the same position. The types of face attribute information may include but are not limited to: expression, glasses, hairstyle, posture (pitch, roll, yaw), apparatus, clothing, etc.
[0048] Step 108: Generate an identity authentication result for the target user based on the difference in pixel values at the same position between the second user face image and the second ID face image.
[0049] In the embodiment of this specification, since the type of facial attribute information reflected at the same position in the second user face image and the second ID face image is consistent, if the difference in pixel values at the same position in the second user face image and the second ID face image is small, it can be said that the part has pixel-level consistency. When the area with pixel-level consistency between the second user face image and the second ID face image is large, it can be generally considered that the risk of the target user using deep fake technology for identity authentication is high. If the area with pixel-level consistency between the second user face image and the second ID face image is small, it can be generally considered that the risk of the target user using deep fake technology for identity authentication is low. Therefore, according to the difference in pixel values at the same position in the second user face image and the second ID face image, an identity authentication result reflecting whether the target user has the risk of using deep fake technology for identity authentication can be generated, or an identity authentication result reflecting whether the target user is allowed to pass the identity authentication can be generated.
[0050] Figure 1 According to the method, a forged ID facial image is substantially identical to a forged user facial image and has pixel-level consistency in posture, hairstyle, face shape, etc., a first user facial image and a first ID facial image of a target user are preprocessed to obtain a second user facial image and a second ID facial image having consistent types of facial attribute information reflected at the same position, and a user facial image and an ID facial image used for identity authentication of the target user are identified based on the difference in pixel values at the same position in the second user facial image and the second ID facial image to determine whether the user facial image and the ID facial image used for identity authentication of the target user have pixel-level consistency, thereby effectively identifying the situation in which a user uses a forged facial image and a forged ID image to commit identity fraud, so as to ensure the security of identity authentication.
[0051] based on Figure 1 The method in this specification also provides some specific implementation plans of the method, which are described below.
[0052] During the identity authentication process, a video can often be captured for the target user, and the first user face image of the target user can be extracted from it. However, the user face postures in different video frames in the video may be different, but the face posture in the first ID face image of the target user is fixed. Therefore, the face image in the video frame with a face posture that is more consistent with the face posture in the first ID face image can be preferentially selected as the first user face image of the target user, thereby reducing interference factors and improving the accuracy of the identity authentication result.
[0053] Based on this, step 102: obtaining the first user face image of the target user collected during the identity authentication process may specifically include:
[0054] If the number of candidate user facial images of the target user collected during the identity authentication process is equal to 1, the candidate user facial image is determined as the first user facial image.
[0055] If the number of candidate user facial images of the target user collected during the identity authentication process is greater than 1, the candidate user facial image with the highest degree of consistency with the facial posture in the first ID facial image is determined as the first user facial image.
[0056] In the embodiments of the present specification, a facial attribute recognition algorithm can be used to determine the first posture information of the face in the first ID facial image; and the facial attribute recognition algorithm can be used to determine the second posture information of the face in each of the candidate user facial images; the degree of difference between each of the second posture information and the first posture information is calculated; and the candidate user facial image corresponding to the minimum value of the degree of difference is determined as the first user facial image.
[0057] In actual applications, if the difference between the second posture information corresponding to each candidate user face image of the target user and the first posture information corresponding to the first ID face image is greater than a preset threshold, it can be said that each candidate user face image collected for the target user this time is unqualified. Therefore, the first information reflecting that the identity authentication of the target user has not passed can be directly generated; or, the second information for prompting to collect the candidate user face image of the target user again can be generated, wherein the second information can prompt the target user to face the face image acquisition device with a specified posture, which is conducive to improving the experience of the target user. The candidate user face image with the highest degree of consistency with the face posture in the first ID face image should not be determined as the first user face image, which is conducive to ensuring the accuracy of the generated identity authentication result.
[0058] In the embodiment of this specification, step 106: preprocessing the first user face image and the first ID face image to obtain the second user face image and the second ID face image of the target user may specifically include:
[0059] Based on the same preset face template, face alignment processing is performed on the first user face image and the first ID face image to obtain a third user face image and a third ID face image of the target user.
[0060] An image corresponding to a preset area in the preset face template is extracted from the third user face image to obtain a second user face image of the target user.
[0061] An image corresponding to the preset area is extracted from the third ID facial image to obtain a second ID facial image of the target user.
[0062] In the embodiments of the present specification, face alignment processing can be used to align key points in a face image to a specific position to achieve standardization or better analysis and comparison effects. Therefore, the first user face image can be face aligned with a preset face template to obtain a third user face image, and the first ID face image can also be face aligned with the preset face template to obtain a third ID face image, so that the third user face image and the face area in the third ID face image can be aligned.
[0063] Since the first user's facial image may contain a large number of background areas, in order to align the facial area and the background area, an image corresponding to the same preset area in the preset facial template may be extracted from the third user's facial image and the third ID facial image to obtain the second user's facial image and the second ID facial image. At this time, the facial area and the background area in the second user's facial image and the second ID facial image are aligned, so that the type of facial attribute information reflected at the same position in the second user's facial image and the second ID facial image can be consistent.
[0064] For ease of understanding, a specific implementation principle of face alignment processing using a preset face template is provided herein.
[0065] Specifically, the performing face alignment processing on the first user face image and the first ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user may include:
[0066] A preset face template carrying reference coordinate data of multiple preset face key points is obtained.
[0067] Determine first coordinate data of the preset facial key points in the first user's facial image.
[0068] A first affine transformation relationship between the first user face image and the preset face template is determined based on the first coordinate data of the preset face key points and the reference coordinate data of the preset face key points.
[0069] Based on the first affine transformation relationship, face alignment processing is performed on the first user face image to obtain a third user face image of the target user.
[0070] Determine the second coordinate data of the preset facial key point in the first ID facial image.
[0071] A second affine transformation relationship between the first ID facial image and the preset facial template is determined based on the second coordinate data of the preset facial key points and the reference coordinate data of the preset facial key points.
[0072] Based on the second affine transformation relationship, face alignment processing is performed on the first ID facial image to obtain a third ID facial image of the target user.
[0073] In the embodiments of this specification, the preset face template can be obtained by statistically analyzing the position distribution of preset face key points in a large number of face images, based on which, the preset face template can contain reference coordinate data of multiple preset face key points. There can be multiple types of preset face key points, including but not limited to face key points located at the eyes, nose, mouth, eyebrows, ears, cheeks, etc., without specific limitation.
[0074] Affine transformation refers to the process of converting a two-dimensional coordinate system to another two-dimensional coordinate system. During the conversion process, the relative positions and attributes of the coordinate points do not change, which is a linear transformation. Based on this, the first user face image can be transformed into the coordinate system where the preset face template is located through affine transformation.
[0075] Since in practical applications, three points that are not on the same straight line can determine a plane, the first affine transformation relationship between the first user face image and the preset face template can be determined based on the reference coordinate data of at least three preset face key points that are not on the same straight line in the preset face template and the first coordinate data in the first user face image. And the position coordinates of each pixel point in the first user face image in the preset face template are determined according to the first affine transformation relationship, so as to generate a third user face image.
[0076] In practical applications, in order to further improve the face alignment effect, the first affine transformation relationship between the first user face image and the preset face template can be generated based on the reference coordinate data of all preset face key points in the preset face template and the first coordinate data in the first user face image to ensure the alignment effect of all preset face key points. This will not be elaborated here.
[0077] Based on the same principle, the second affine transformation relationship between the first ID card face image and the preset face template can also be determined, and then the second affine transformation relationship can be used to map the first ID card face image to the coordinate system where the preset face template is located, thereby obtaining the third ID card face image after face alignment, which will not be elaborated here.
[0078] Figure 2 A schematic diagram of a face alignment principle provided in an embodiment of this specification, such as Figure 2As shown, the preset face template 201 may include reference coordinate data of multiple preset face key points, wherein the preset face key points may include two eye tail key points O1 and O4, two eye corner key points O2 and O3, nose tip key point O5, and two mouth corner key points O6 and O7. When performing face alignment for the target face image 202 (for example, the first user face image and the first ID face image), the coordinate data of each preset face key point in the target face image can be determined, so that according to the corresponding relationship between the coordinate data of each preset face key point in the target face image 202 and the preset face template 201, the target face image 202 is mapped to the coordinate system where the preset face template 201 is located, and the face aligned image is obtained. It can be understood that the preset face template 201 is only an example of a preset face template displayed for the convenience of user understanding, and is not a specific limitation on the type of preset face key points and the relative position relationship between the preset face key points.
[0079] In actual applications, although the coordinates of the preset facial key points in the third user face image and the third ID face image are consistent, the sizes of the background areas in the third user face image and the third ID face image are often different, so that the types of facial attribute information reflected at the same position in the third user face image and the third ID face image may be different. Based on this, it is necessary to further extract two images with the same size of the background area and the same position of the facial images from the third user face image and the third ID face image, so as to serve as the second user face image and the second ID face image of the target user.
[0080] Specifically, extracting the image corresponding to the preset area in the preset face template from the third user face image to obtain the second user face image of the target user may include:
[0081] Determine third coordinate data of at least a portion of the preset facial key points in the third user's facial image.
[0082] According to the third coordinate data, a first face region in the third user face image having a position corresponding to the preset region is determined, wherein the preset region is a preset face region determined according to at least part of the preset face key points.
[0083] The image within the first face region of the third user face image is extracted to obtain the second user face image.
[0084] Correspondingly, extracting the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user may specifically include:
[0085] Determine fourth coordinate data of at least a portion of the preset facial key points in the third ID facial image.
[0086] A second face region in the third ID face image having a position corresponding to the preset region is determined according to the fourth coordinate data.
[0087] The image within the second face region of the third ID face image is extracted to obtain the second ID face image.
[0088] In an embodiment of the present specification, a preset area in a preset face template required for pixel-level consistency comparison can be preset, wherein the preset area can be a preset face area determined based on at least part of the preset face key points. For example, the preset area can be an area obtained by magnifying a quadrilateral consisting of two eye tail key points and two mouth corner key points by N times, wherein N can be set according to actual needs, for example, it can be 1.5 or 2. Alternatively, the preset area can be an area obtained by expanding the quadrilateral consisting of two eye tail key points and two mouth corner key points by M pixels to the upper side, N pixels to the lower side, Q pixels to the left side, and P pixels to the right side, wherein M, N, Q, and P can all be set according to actual needs, for example, M, N, Q, and P can be values between tens and hundreds, etc., and there is no specific limitation on this.
[0089] Since the third user facial image and the third ID facial image are obtained by performing image affine transformation based on the coordinate data of preset facial key points, under normal circumstances, the coordinate data of the preset facial key points in the third user facial image and the third ID facial image can be easily determined, and then the images within the preset areas in the third user facial image and the third ID facial image can be determined based on the coordinate data of these preset facial key points, so as to obtain the second user facial image and the second ID facial image having consistent facial attribute information reflected at the same position.
[0090] Since the facial images collected by current devices are usually color images, and color images are often multi-channel images, the pixel values of their pixels are often composed of multiple channel values, which brings inconvenience to judging the difference in pixel values at the same position in the user's facial image and the ID facial image.
[0091] Based on this, the first user face image and the first ID face image can both be color images.
[0092] Then, based on the same preset face template, performing face alignment processing on the first user face image and the first ID face image to obtain a third user face image and a third ID face image of the target user may specifically include:
[0093] Image channel conversion processing is performed on the first user face image and the first ID face image to generate a first single-channel user face image and a first single-channel ID face image of the same type.
[0094] Based on the same preset face template, face alignment processing is performed on the first single-channel user face image and the first single-channel document face image to obtain a third user face image and a third document face image of the target user.
[0095] Alternatively, extracting the image corresponding to the preset area in the preset face template from the third user face image to obtain the second user face image of the target user may specifically include:
[0096] An image channel conversion process is performed on the image corresponding to the preset area extracted from the third user face image to generate a second single-channel user face image of a preset type, thereby obtaining the second user face image.
[0097] The step of extracting the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user may specifically include:
[0098] An image channel conversion process is performed on the image corresponding to the preset area extracted from the third ID facial image to generate a second single-channel ID facial image of the preset type, thereby obtaining the second ID facial image.
[0099] In an embodiment of the present specification, if the first user facial image and the first ID facial image acquired in step 102 and step 104 are color images, but the second user facial image and the second ID facial image required for pixel value difference comparison are single-channel images, then in the process of generating the corresponding second user facial image and second ID facial image using the first user facial image and the first ID facial image, an image channel conversion process needs to be performed.
[0100] Specifically, before performing face alignment processing on the first user face image and the first ID face image, image channel conversion processing may be performed first, and then face alignment processing may be performed on the generated single-channel face image. Alternatively, face alignment processing may be performed on the first user face image and the first ID face image first to obtain a third user face image and a third ID face image; then, after performing image channel conversion processing on the third user face image and the third ID face image, the second user face image and the second ID face image may be extracted from the single-channel face image. Alternatively, after extracting an image in a preset area from the third user face image and the third ID face image, image channel conversion processing may be performed on the extracted image to use the obtained single-channel face image as the second user face image and the second ID face image, and there is no specific limitation on this.
[0101] In practical applications, there may be multiple ways to implement the image channel conversion process. For example, when the first user face image and the first ID face image are images in RGB color mode, the image channel conversion process may be a process of converting pixel values in a GRB image into grayscale values, or may be a process of converting pixel values in a GRB image into brightness values. Alternatively, the first user face image and the first ID face image may also be images in Lab color mode. In this case, the image channel conversion process may be a process of extracting the brightness component in the Lab color mode image. It can be seen that the pixel values contained in the first single-channel user face image, the first single-channel ID face image, the second single-channel user face image, and the second single-channel ID face image may be grayscale values or brightness values, etc., which are easy to compare. Of course, the image channel conversion processing can also be a color image under the CMYK color mode or other color models, and the image channel conversion processing can also include other implementation methods, and the types of pixel values contained in the first single-channel user face image, the first single-channel ID face image, the second single-channel user face image and the second single-channel ID face image can also be other types of values except grayscale values and brightness values, and there is no specific limitation on this.
[0102] In the embodiment of this specification, step 108: generating an identity authentication result for the target user according to the difference in pixel values at the same position between the second user face image and the second ID face image, may specifically include:
[0103] According to the degree of difference in pixel values in a target area having a positional correspondence between the second user face image and the second ID face image, target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image are determined to obtain the difference image.
[0104] An identity authentication result for the target user is generated according to the difference image.
[0105] In the embodiments of this specification, in order to facilitate the identification, statistics, and analysis of the pixel-level consistency at each position between the second user face image and the second ID face image, a difference image reflecting the pixel-level consistency at each position between the second user face image and the second ID face image can be generated based on the degree of difference in pixel values within a target area having a positional correspondence between the second user face image and the second ID face image. The pixel values at each position in the difference image can be used to characterize the degree of difference in pixel values at the corresponding position between the second user face image and the second ID face image.
[0106] Based on this, if it is determined from the difference image that the pixel-level consistency between the second user face image and the second ID face image is high, an identity authentication result reflecting that the target user has the risk of identity authentication using deep fake technology can be generated, or an identity authentication result reflecting that the target user is not allowed to pass the identity authentication can be generated. This will not be elaborated.
[0107] In the embodiments of this specification, a variety of implementations of generating difference images are provided, which are explained for ease of understanding.
[0108] Implementation method 1
[0109] Determining target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image according to the difference degree of pixel values in a target area having a positional correspondence relationship between the second user face image and the second document face image may specifically include:
[0110] If the target area contains only a single pixel, the absolute value of the difference between the pixel values in the target area having a positional correspondence between the second user face image and the second ID face image is determined as the target pixel value of the pixel in the specified area in the difference image. Or,
[0111] If the target area contains multiple pixels, then determine multiple pixel pairs in the target area that have a positional correspondence between the second user face image and the second ID face image; wherein one pixel pair contains a pixel in the second user face image and a pixel in the second ID face image, and there is a positional correspondence between the two pixels contained in the pixel pair.
[0112] The sum of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, or the average value of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, is determined as the target pixel value of at least part of the pixels in the designated area in the difference image.
[0113] In the embodiment of the present specification, since the absolute value of the difference between the pixel values of two pixels can more accurately reflect the difference in pixel values between the two pixels, based on this, when comparing the pixel value differences in units of single pixels, the target area can be made to contain only a single pixel, and the absolute value of the difference between the pixel values in the target area having a positional correspondence between the second user face image and the second ID face image is determined as the target pixel value of the pixels in the designated area corresponding to the target area in the difference image.
[0114] When combining multiple pixel points to compare the regional pixel value differences, the target area can include multiple pixel points. At this time, the target area with a positional correspondence between the second user face image and the second ID face image can include multiple pixel pairs with a positional correspondence. At this time, the target pixel value of all pixels, center point pixels or specified positions (for example, corner points) in the specified area corresponding to the target area in the difference image can be determined based on the sum of the absolute values or the average value of the differences between the pixel values of each pixel pair.
[0115] For ease of understanding, Figure 3 This is a schematic diagram of a difference image generation scenario provided in an embodiment of this specification. Figure 3 As shown, region 303 in the second user face image 301 and region 304 in the second ID face image 302 have a positional correspondence, and the face attribute information reflected by pixels at the same position is consistent, so region 303 and region 304 can be used as target regions. Assuming that the difference image 305 has the same size as the second user face image 301 and the second ID face image 302, region 306 in the difference image 305 can be a designated region corresponding to the target region.
[0116] Figure 3 Region 303 and region 304 in the difference image 305 contain 9 pixel pairs, and assuming that the absolute values of the differences between the pixel values of each pixel pair are 10, 100, 50, 30, 10, 30, 80, 30, and 20 respectively, (10+100+50+30+10+30+80+30+20) / 9=40 can be used as the target pixel value of each pixel in region 306 in the difference image 305, or it can also be used as the target pixel value of the center point pixels or at least some of the corner point pixels in region 306, which is not elaborated here.
[0117] It is understandable that the size of the difference image, the second user face image, and the second ID face image may also be consistent ( Figure 3 (not shown), therefore, the number of pixels contained in the designated area in the difference image and the target area having a positional correspondence in the second user face image and the second ID face image may also be inconsistent, so that the average value or the sum of the absolute values of the differences in the pixel values of the pixel pairs in the target area can be set according to actual needs, and there is no specific limitation on which pixel points in the designated area in the difference image can determine the target pixel values.
[0118] Based on the difference image generation method provided in one implementation, correspondingly, generating the identity authentication result for the target user according to the difference image may include:
[0119] It is determined whether the number of pixels whose pixel values are greater than or equal to a first threshold in the difference image reaches a first number, and a first determination result is obtained.
[0120] If the first judgment result indicates that the number of pixels whose pixel values in the difference image are greater than or equal to the first threshold reaches a first number, then generating result information indicating that the target user has failed identity authentication; or,
[0121] The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
[0122] In the embodiment of this specification, the larger the value of the target pixel value in the difference image in the implementation method 1, the worse the pixel-level consistency of the area with a positional correspondence between the second user face image and the second ID face image. Therefore, according to actual needs, a first threshold for characterizing the significant difference at the pixel level can be set, that is, if the target pixel value of a certain pixel point in the difference image is greater than or equal to the first threshold, the corresponding area in the second user face image and the second ID face image corresponding to the pixel point can belong to the area with significant pixel-level differences. Based on this, when the number of pixels with pixel values greater than or equal to the first threshold contained in the difference image reaches a first number, result information indicating that the target user has not passed the identity authentication can be generated. If the number of pixels with pixel values greater than or equal to the first threshold contained in the difference image does not reach the first number, result information indicating that the target user has passed the identity authentication can be generated, or, in combination with other identity authentication methods, result information indicating whether the target user can pass the identity authentication can be comprehensively generated, which is conducive to improving the accuracy and security of identity authentication.
[0123] In practical applications, the pixel-level consistency of the core face area has a greater impact on the identity authentication result. Therefore, preset weights can be set for the pixels in different areas of the difference image, and the sum of the number of pixels in each area whose pixel values are greater than or equal to the first threshold and the weighted value of the preset weight is used as the comprehensive number of pixels in the difference image whose pixel values are greater than or equal to the first threshold. If the comprehensive number reaches the first number, result information indicating that the target user has failed the identity authentication can be generated.
[0124] Among them, the preset weight of any area in the difference image is usually proportional to the importance of the target area in the second user face image and the second ID face image corresponding to the area for face recognition. For example, if the target area in the second user face image and the second ID face image corresponding to a certain area in the difference image is a core face area such as eyes, nose, and mouth, the preset weight of the area can be set larger. If the target area in the second user face image and the second ID face image corresponding to a certain area in the difference image is a non-core face area such as hair, clothing, surrounding environment, etc., the preset weight of the area can be set smaller, which will not be elaborated.
[0125] In the embodiments of this specification, image classification may refer to an image processing method that distinguishes targets of different categories based on different features reflected in the image information. It uses a computer to perform quantitative analysis on an image and classifies the image or each pixel or region in the image into one of several categories to replace human visual interpretation. Since image classification technology can learn knowledge from a large amount of sample data, it has good accuracy. Based on this, the principle in implementation method one can also be used to generate difference image samples, and by setting label data reflecting whether the user sample can pass identity authentication for the difference image sample, the pre-trained classification model trained using the difference image sample can obtain result information indicating whether the target user has not passed identity authentication based on the input difference image, which will not be elaborated on.
[0126] Implementation method 2
[0127] The step of determining target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image according to the degree of difference in pixel values in a target area having a positional correspondence relationship between the second user face image and the second document face image may specifically include:
[0128] If the target area contains only a single pixel, the absolute value of the difference between the pixel values in the target area having a position corresponding relationship between the second user face image and the second ID face image is calculated to obtain a first absolute value.
[0129] If the first absolute value is greater than or equal to the second threshold, the target pixel value of the pixels in the designated area in the difference image is set to a first preset pixel value for identifying a significant difference area.
[0130] If the first absolute value is less than a second threshold, setting the target pixel value of the pixels in the specified area in the difference image to a second preset pixel value for identifying a non-significant difference area; or
[0131] If the target area contains multiple pixels, then determine multiple pixel pairs in the target area that have a positional correspondence between the second user face image and the second ID face image; wherein one pixel pair contains a pixel in the second user face image and a pixel in the second ID face image, and there is a positional correspondence between the two pixels contained in the pixel pair.
[0132] The absolute value of the difference between the pixel values of two pixels in each of the pixel pairs is calculated to obtain a second absolute value.
[0133] If the number of the second absolute values that are greater than or equal to the third threshold reaches a second number, the target pixel values of at least some pixels in the designated area in the difference image are set to first preset pixel values for identifying a significant difference area.
[0134] If the number of the second absolute values that are greater than or equal to the third threshold does not reach a second number, the target pixel values of at least some pixels in the designated area in the difference image are set to second preset pixel values for identifying an insignificantly different area.
[0135] In the embodiment of the present specification, a first preset pixel value for identifying a significant difference area and a second preset pixel value for identifying a non-significant difference area can be pre-set. By assigning the first preset pixel value or the second preset pixel value to the pixel points in the difference image, it is easy to intuitively distinguish between the significant difference area and the non-significant difference area in the difference image.
[0136] Specifically, if the target area contains only a single pixel point, if the absolute value of the difference between the pixel values in the target area having a positional correspondence between the second user face image and the second ID face image is greater than or equal to a second threshold, it can be indicated that the pixels at the target area have significant differences, thereby enabling the target pixel value of the pixels at the specified area corresponding to the target area in the difference image to be set to the first preset pixel value, otherwise, the target pixel value needs to be set to the second preset pixel value.
[0137] If the target area contains multiple pixels, based on the same principle, it can be determined whether the absolute value of the difference between the pixel values of each pixel pair in the target area with a positional correspondence between the second user's face image and the second ID face image is greater than or equal to the third threshold value. If so, it can be indicated that the pixel pair has a significant difference. At this time, considering whether each pixel pair in the target area has a significant difference, when the number of pixel pairs with significant differences reaches the second number, the target pixel value of all pixels, center point pixels or corner point pixels in the specified area corresponding to the target area in the difference image can be set to the first preset pixel value. Otherwise, the target pixel value needs to be set to the second preset pixel value, which will not be elaborated.
[0138] Based on the difference image generation method provided in the second implementation method, correspondingly, generating the identity authentication result for the target user according to the difference image may specifically include:
[0139] It is determined whether the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, and a second determination result is obtained.
[0140] If the second judgment result indicates that the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, then generating result information indicating that the target user has failed identity authentication; or
[0141] The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
[0142] In the embodiment of the present specification, it is possible to simply determine whether to allow the target user to pass the identity authentication based on whether the number of pixels with the first preset pixel value representing the significant difference area in the difference image reaches the third number. Alternatively, preset weights may be set for the pixels in different areas of the difference image to determine whether the sum of the number of pixels with the first preset pixel value representing the significant difference area contained in each area and the weighted value of the preset weight reaches the third number. If so, result information indicating that the target user has not passed the identity authentication may be generated.
[0143] Of course, a pre-trained classification model can also be trained using the difference image samples to process the difference image, thereby deciding whether to allow the target user to pass the identity authentication. However, in this case, the difference image samples required for model training need to be generated in a manner consistent with the generation principle of the difference image in the second implementation method, which will not be described in detail.
[0144] In the embodiment of this specification, if the target area contains multiple pixels, then Figure 1 The method may also include:
[0145] Using a preset sliding window and a preset step size, sliding sampling is performed from the starting positions having a positional correspondence between the second user face image and the second ID face image to obtain a target area having a positional correspondence between the second user face image and the second ID face image.
[0146] In the embodiments of the present specification, since the size, resolution, etc. of the second user facial image and the second ID facial image are usually consistent, the same sampling window can be used to traverse the second user facial image and the second ID facial image according to the same sampling strategy, and the image area within the sampling window at the same time is used as the target area with a positional correspondence between the second user facial image and the second ID facial image, which is convenient and quick.
[0147] Figure 4 The embodiments of this specification provide corresponding to Figure 1 A swimlane flow diagram of the identity authentication method in . Figure 4 As shown, the identity authentication process may involve execution entities such as an identity authentication device and a target user.
[0148] During the facial image acquisition stage, the target user can cooperate in performing the identity authentication operation so that the identity authentication device can obtain the first user facial image of the target user collected during the identity authentication process, and the identity authentication device can also obtain the first ID facial image of the target user from the target user's ID image.
[0149] In the face image comparison stage, the identity authentication device can obtain a preset face template carrying reference coordinate data of multiple preset face key points. According to the first coordinate data of the preset face key points in the first user face image and the reference coordinate data of the preset face key points, the first affine transformation relationship between the first user face image and the preset face template is determined; based on the first affine transformation relationship, face alignment processing is performed on the first user face image to obtain the third user face image of the target user. Image channel conversion processing is performed on the image corresponding to the preset area in the preset face template extracted from the third user face image to generate a single-channel user face image of a preset type as the second user face image of the target user.
[0150] Based on the same principle, the identity authentication device can also determine the second affine transformation relationship between the first ID face image and the preset face template according to the second coordinate data of the preset face key points in the first ID face image and the reference coordinate data of the preset face key points; based on the second affine transformation relationship, perform face alignment processing on the first ID face image to obtain the third ID face image of the target user; perform image channel conversion processing on the image extracted from the third ID face image and corresponding to the preset area in the preset face template to generate a single-channel user face image of a preset type as the second ID face image of the target user.
[0151] Subsequently, the identity authentication device can determine the target pixel values of at least some pixels in a specified area corresponding to the target area in the difference image based on the degree of difference in pixel values in the target area having a positional correspondence between the second user face image and the second ID face image, and obtain the difference image.
[0152] The identity authentication device can determine whether the number of pixels that meet the preset conditions contained in the difference image reaches a specified number based on the pixel values of each pixel in the difference image, so as to obtain result information indicating whether the target user has failed the identity authentication; wherein the preset condition can be: the pixel value is greater than a threshold, or the pixel value is a preset pixel value used to identify a significant difference area. Alternatively, the identity authentication device can also process the difference image using a pre-trained classification model to obtain result information indicating whether the target user has failed the identity authentication, which is convenient and quick.
[0153] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 5 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of an identity authentication device. Figure 5 As shown, the device may include:
[0154] The first acquisition module 502 is used to acquire a first user face image of the target user collected during the identity authentication process.
[0155] The second acquisition module 504 is used to acquire the first ID facial image of the target user from the ID image of the target user.
[0156] The preprocessing module 506 is used to preprocess the first user facial image and the first ID facial image to obtain the second user facial image and the second ID facial image of the target user; wherein the type of facial attribute information reflected at the same position in the second user facial image and the second ID facial image is consistent.
[0157] The generating module 508 is used to generate an identity authentication result for the target user according to the difference in pixel values at the same position between the second user face image and the second ID face image.
[0158] based on Figure 5 The present specification also provides some specific implementation schemes of the device, which are described below.
[0159] Optionally, the first acquisition module may include:
[0160] The first acquisition unit is configured to determine the candidate user facial image as the first user facial image if the number of candidate user facial images of the target user collected during the identity authentication process is equal to 1.
[0161] The second acquisition unit is used to determine the candidate user face image with the highest degree of consistency with the face posture in the first ID face image as the first user face image if the number of candidate user face images of the target user collected during the identity authentication process is greater than 1.
[0162] Optionally, the preprocessing module may include:
[0163] The face alignment processing unit is used to perform face alignment processing on the first user face image and the first ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user.
[0164] The first extraction unit is used to extract an image corresponding to a preset area in the preset face template from the third user face image to obtain a second user face image of the target user.
[0165] The second extraction unit is used to extract the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user.
[0166] Optionally, the face alignment processing unit may include:
[0167] The acquisition subunit is used to acquire a preset face template carrying reference coordinate data of a plurality of preset face key points.
[0168] The first determining subunit is used to determine the first coordinate data of the preset facial key points in the first user's facial image.
[0169] The second determining subunit is used to determine a first affine transformation relationship between the first user face image and the preset face template according to the first coordinate data of the preset face key points and the reference coordinate data of the preset face key points.
[0170] The first face alignment subunit is used to perform face alignment processing on the first user face image based on the first affine transformation relationship to obtain a third user face image of the target user.
[0171] The third determination subunit is used to determine the second coordinate data of the preset facial key point in the first ID facial image.
[0172] The fourth determining subunit is used to determine the second affine transformation relationship between the first ID facial image and the preset facial template according to the second coordinate data of the preset facial key points and the reference coordinate data of the preset facial key points.
[0173] The second face alignment subunit is used to perform face alignment processing on the first ID face image based on the second affine transformation relationship to obtain a third ID face image of the target user.
[0174] Optionally, the preset area may be a preset face area determined based on at least some preset face key points.
[0175] Correspondingly, the first extraction unit may be specifically used for:
[0176] Determine third coordinate data of at least a portion of the preset facial key points in the third user's facial image.
[0177] A first face region in the third user face image having a position corresponding to the preset region is determined according to the third coordinate data.
[0178] The image within the first face region of the third user face image is extracted to obtain the second user face image.
[0179] The second extraction unit may be specifically used for:
[0180] Determine fourth coordinate data of at least a portion of the preset facial key points in the third ID facial image.
[0181] A second face region in the third ID face image having a position corresponding to the preset region is determined according to the fourth coordinate data.
[0182] The image within the second face region of the third ID face image is extracted to obtain the second ID face image.
[0183] Optionally, the first user face image and the first ID face image may both be color images.
[0184] Correspondingly, the face alignment processing unit may specifically include:
[0185] A first channel conversion subunit is used to perform image channel conversion processing on the first user face image and the first ID face image to generate a first single-channel user face image and a first single-channel ID face image of the same type;
[0186] A third face alignment subunit is configured to perform face alignment processing on the first single-channel user face image and the first single-channel ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user; or
[0187] The first extraction unit may specifically include:
[0188] The second channel conversion subunit is used to perform image channel conversion processing on the image corresponding to the preset area extracted from the third user face image, generate a second single-channel user face image of a preset type, and obtain the second user face image.
[0189] The second extraction unit may specifically include:
[0190] The third channel conversion subunit is used to perform image channel conversion processing on the image corresponding to the preset area extracted from the third ID face image, generate a second single-channel ID face image of the preset type, and obtain the second ID face image.
[0191] Optionally, the generating module may include:
[0192] A determination unit is used to determine the target pixel values of at least some pixels in a specified area corresponding to the target area in the difference image based on the degree of difference in pixel values in the target area having a positional correspondence between the second user face image and the second ID face image, so as to obtain the difference image.
[0193] The authentication result generating unit is used to generate an identity authentication result for the target user according to the difference image.
[0194] Optionally, the determining unit may include:
[0195] a fifth determining subunit, configured to determine, if the target area contains only a single pixel, an absolute value of a difference between pixel values in the target area having a positional correspondence between the second user face image and the second ID face image as a target pixel value for the pixel in the designated area in the difference image; or
[0196] The sixth determination subunit is used to determine multiple pixel pairs in the target area that have a positional correspondence between the second user face image and the second ID face image if the target area contains multiple pixels; wherein one pixel pair contains a pixel in the second user face image and a pixel in the second ID face image, and there is a positional correspondence between the two pixels contained in the pixel pair.
[0197] The seventh determination subunit is used to determine the sum of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, or the average value of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, as the target pixel value of at least part of the pixels in the specified area in the difference image.
[0198] Optionally, the authentication result generating unit may be specifically used to:
[0199] It is determined whether the number of pixels whose pixel values are greater than or equal to a first threshold in the difference image reaches a first number, and a first determination result is obtained.
[0200] If the first judgment result indicates that the number of pixels whose pixel values in the difference image are greater than or equal to the first threshold reaches a first number, then generating result information indicating that the target user has failed identity authentication; or,
[0201] The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
[0202] Optionally, the determining unit may include:
[0203] The first calculation subunit is used to calculate the absolute value of the difference between the pixel values in the target area having a position corresponding relationship between the second user face image and the second ID face image if the target area only contains a single pixel, so as to obtain a first absolute value.
[0204] The first setting subunit is configured to set the target pixel value of the pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area if the first absolute value is greater than or equal to a second threshold.
[0205] A second setting subunit is configured to set the target pixel value of the pixels in the specified area in the difference image to a second preset pixel value for identifying a non-significant difference area if the first absolute value is less than a second threshold; or
[0206] An eighth determination subunit is used to determine multiple pixel pairs in the target area that have a positional correspondence between the second user face image and the second ID face image if the target area contains multiple pixels; wherein one of the pixel pairs contains a pixel in the second user face image and a pixel in the second ID face image, and there is a positional correspondence between the two pixels contained in the pixel pair.
[0207] The second calculation subunit is used to calculate the absolute value of the difference between the pixel values of two pixels in each of the pixel pairs to obtain a second absolute value.
[0208] The third setting subunit is configured to set the target pixel value of at least part of the pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area if the number of the second absolute values that are greater than or equal to a third threshold reaches a second number.
[0209] and a fourth setting subunit, configured to set the target pixel value of at least part of the pixels in the designated area in the difference image to a second preset pixel value for identifying a non-significant difference area if the number of the second absolute values that are greater than or equal to the third threshold value does not reach a second number.
[0210] Optionally, the authentication result generating unit may be specifically used to:
[0211] It is determined whether the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, and a second determination result is obtained.
[0212] If the second judgment result indicates that the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, then generating result information indicating that the target user has failed identity authentication; or
[0213] The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
[0214] Optionally, if the target area may include multiple pixels, the device may further include:
[0215] A sampling module is used to use a preset sliding window to perform sliding sampling from the starting positions with a positional correspondence between the second user face image and the second ID face image according to a preset step size, so as to obtain a target area with a positional correspondence between the second user face image and the second ID face image.
[0216] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0217] Figure 6 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of an identity authentication device. Figure 6 As shown, the device 600 may include:
[0218] at least one processor 610; and,
[0219] A memory 630 is communicatively connected to the at least one processor; wherein,
[0220] The memory 630 stores instructions 620 executable by the at least one processor 610. The instructions are executed by the at least one processor 610 to enable the at least one processor 610 to:
[0221] Obtain a first user face image of the target user collected during the identity authentication process.
[0222] A first ID facial image of the target user is obtained from the ID image of the target user.
[0223] The first user face image and the first ID face image are preprocessed to obtain a second user face image and a second ID face image of the target user; wherein the type of facial attribute information reflected at the same position in the second user face image and the second ID face image is consistent.
[0224] An identity authentication result for the target user is generated based on the difference in pixel values at the same position between the second user face image and the second ID face image.
[0225] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. Figure 6 As for the device shown, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0226] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0227] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0228] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0229] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0230] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0231] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0232] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0233] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0234] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0235] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0236] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0237] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0238] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0239] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0240] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An identity authentication method, comprising: Acquire a first user face image of the target user collected during the identity authentication process; Acquire a first ID facial image of the target user from the ID image of the target user; Preprocessing the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent; An identity authentication result for the target user is generated based on the difference in pixel values at the same position between the second user face image and the second ID face image.
2. The method according to claim 1, wherein obtaining the first user face image of the target user collected during the identity authentication process specifically comprises: If the number of candidate user facial images of the target user collected during the identity authentication process is equal to 1, determining the candidate user facial image as the first user facial image; If the number of candidate user facial images of the target user collected during the identity authentication process is greater than 1, the candidate user facial image with the highest degree of consistency with the facial posture in the first ID facial image is determined as the first user facial image.
3. The method according to claim 1, wherein the preprocessing of the first user face image and the first ID face image to obtain the second user face image and the second ID face image of the target user comprises: Based on the same preset face template, performing face alignment processing on the first user face image and the first ID face image to obtain a third user face image and a third ID face image of the target user; Extracting an image corresponding to a preset area in the preset face template from the third user face image to obtain a second user face image of the target user; An image corresponding to the preset area is extracted from the third ID facial image to obtain a second ID facial image of the target user.
4. The method according to claim 3, wherein the step of performing face alignment processing on the first user face image and the first ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user specifically comprises: Obtaining a preset face template carrying reference coordinate data of a plurality of preset face key points; Determine first coordinate data of the preset facial key points in the first user's facial image; Determining a first affine transformation relationship between the first user face image and the preset face template according to the first coordinate data of the preset face key points and the reference coordinate data of the preset face key points; Based on the first affine transformation relationship, performing face alignment processing on the first user face image to obtain a third user face image of the target user; Determine second coordinate data of the preset facial key point in the first ID facial image; Determining a second affine transformation relationship between the first ID facial image and the preset facial template according to the second coordinate data of the preset facial key points and the reference coordinate data of the preset facial key points; Based on the second affine transformation relationship, face alignment processing is performed on the first ID facial image to obtain a third ID facial image of the target user.
5. The method according to claim 4, wherein the preset area is a preset face area determined based on at least part of the preset face key points; and extracting an image corresponding to the preset area in the preset face template from the third user face image to obtain the second user face image of the target user, specifically comprising: Determine third coordinate data of at least a portion of the preset facial key points in the third user's facial image; Determine, according to the third coordinate data, a first face region in the third user face image that has a positional correspondence with the preset region; Extracting the image within the first face region in the third user face image to obtain the second user face image; The step of extracting the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user specifically includes: Determine fourth coordinate data of at least a portion of the preset facial key points in the facial image of the third ID card; Determine, according to the fourth coordinate data, a second face region in the third ID face image that has a position corresponding to the preset region; The image within the second face region of the third ID face image is extracted to obtain the second ID face image.
6. The method according to claim 3, wherein the first user face image and the first ID face image are both color images; The step of performing face alignment processing on the first user face image and the first ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user specifically includes: Performing image channel conversion processing on the first user face image and the first ID face image to generate a first single-channel user face image and a first single-channel ID face image of the same type; Based on the same preset face template, face alignment processing is performed on the first single-channel user face image and the first single-channel ID face image to obtain a third user face image and a third ID face image of the target user; or, The step of extracting an image corresponding to a preset area in the preset face template from the third user face image to obtain a second user face image of the target user specifically includes: Performing image channel conversion processing on the image corresponding to the preset area extracted from the third user face image to generate a second single-channel user face image of a preset type, thereby obtaining the second user face image; The step of extracting the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user specifically includes: An image channel conversion process is performed on the image corresponding to the preset area extracted from the third ID facial image to generate a second single-channel ID facial image of the preset type, thereby obtaining the second ID facial image.
7. The method according to claim 1, wherein generating an identity authentication result for the target user according to the difference in pixel values at the same position between the second user face image and the second ID face image, specifically comprises: Determine target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image according to the degree of difference in pixel values in a target area having a positional correspondence between the second user face image and the second ID face image, and obtain the difference image; An identity authentication result for the target user is generated according to the difference image.
8. The method according to claim 7, wherein the determining, based on the degree of difference in pixel values in a target area having a positional correspondence between the second user face image and the second ID face image, target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image comprises: If the target area contains only a single pixel, the absolute value of the difference between the pixel values in the target area having a positional correspondence between the second user face image and the second ID face image is determined as the target pixel value of the pixel in the designated area in the difference image; or, If the target area includes a plurality of pixels, then determining a plurality of pixel pairs in the target area having a positional correspondence relationship between the second user face image and the second ID face image; wherein one of the pixel pairs includes a pixel in the second user face image and a pixel in the second ID face image, and the two pixels included in the pixel pair have a positional correspondence relationship; The sum of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, or the average value of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, is determined as the target pixel value of at least part of the pixels in the designated area in the difference image.
9. The method according to claim 8, wherein generating an identity authentication result for the target user according to the difference image specifically comprises: Determine whether the number of pixels whose pixel values are greater than or equal to a first threshold in the difference image reaches a first number, and obtain a first determination result; If the first judgment result indicates that the number of pixels in the difference image whose pixel values are greater than or equal to the first threshold reaches a first number, generating result information indicating that the target user has failed identity authentication; or, The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
10. The method according to claim 7, wherein the target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image are determined according to the degree of difference in pixel values in a target area having a positional correspondence between the second user face image and the second ID face image, specifically comprising: If the target area contains only a single pixel, then the absolute value of the difference between the pixel values in the target area having a positional correspondence between the second user face image and the second ID face image is calculated to obtain a first absolute value; If the first absolute value is greater than or equal to a second threshold, setting the target pixel value of the pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area; If the first absolute value is less than a second threshold, setting the target pixel value of the pixels in the designated area in the difference image to a second preset pixel value for identifying a non-significant difference area; or, If the target area includes a plurality of pixels, then determining a plurality of pixel pairs in the target area having a positional correspondence relationship between the second user face image and the second ID face image; wherein one of the pixel pairs includes a pixel in the second user face image and a pixel in the second ID face image, and the two pixels included in the pixel pair have a positional correspondence relationship; Calculating the absolute value of the difference between the pixel values of two pixels in each of the pixel pairs to obtain a second absolute value; If the number of the second absolute values that are greater than or equal to the third threshold reaches a second number, setting the target pixel values of at least some pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area; If the number of the second absolute values that are greater than or equal to the third threshold does not reach a second number, the target pixel values of at least some pixels in the designated area in the difference image are set to second preset pixel values for identifying an insignificantly different area.
11. The method according to claim 10, wherein generating an identity authentication result for the target user according to the difference image comprises: determining whether the number of pixels whose pixel values are the first preset pixel values contained in the difference image reaches a third number, and obtaining a second determination result; If the second judgment result indicates that the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, then generating result information indicating that the target user has failed identity authentication; or, The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein the pre-trained classification model is pre-trained using difference image samples, the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples, and the type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
12. The method according to claim 8 or 10, wherein if the target area includes a plurality of pixels, the method further comprises: Using a preset sliding window and a preset step size, sliding sampling is performed from the starting positions having a positional correspondence between the second user face image and the second ID face image to obtain a target area having a positional correspondence between the second user face image and the second ID face image.
13. An identity authentication device, comprising: A first acquisition module is used to acquire a first user face image of a target user collected during the identity authentication process; A second acquisition module, used to acquire a first ID facial image of the target user from the ID image of the target user; a preprocessing module, configured to preprocess the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent; A generation module is used to generate an identity authentication result for the target user according to the difference in pixel values at the same position in the second user face image and the second ID face image.
14. The device according to claim 13, wherein the first acquisition module comprises: a first acquiring unit, configured to determine the candidate user facial image as the first user facial image if the number of candidate user facial images of the target user collected during the identity authentication process is equal to 1; The second acquisition unit is used to determine the candidate user face image with the highest degree of consistency with the face posture in the first ID face image as the first user face image if the number of candidate user face images of the target user collected during the identity authentication process is greater than 1.
15. The device according to claim 13, wherein the pre-processing module comprises: A face alignment processing unit, configured to perform face alignment processing on the first user face image and the first ID face image based on the same preset face template, to obtain a third user face image and a third ID face image of the target user; A first extraction unit, configured to extract an image corresponding to a preset area in the preset face template from the third user face image, to obtain a second user face image of the target user; The second extraction unit is used to extract the image corresponding to the preset area from the third ID facial image to obtain the second ID facial image of the target user.
16. The apparatus according to claim 15, wherein the face alignment processing unit comprises: An acquisition subunit, used to acquire a preset face template carrying reference coordinate data of a plurality of preset face key points; A first determining subunit, used to determine first coordinate data of the preset facial key points in the first user's facial image; A second determining subunit, configured to determine a first affine transformation relationship between the first user face image and the preset face template according to the first coordinate data of the preset face key points and the reference coordinate data of the preset face key points; A first face alignment subunit is configured to perform face alignment processing on the first user face image based on the first affine transformation relationship to obtain a third user face image of the target user; A third determining subunit, used to determine second coordinate data of the preset facial key point in the first ID facial image; A fourth determining subunit, configured to determine a second affine transformation relationship between the first ID facial image and the preset facial template according to the second coordinate data of the preset facial key points and the reference coordinate data of the preset facial key points; The second face alignment subunit is used to perform face alignment processing on the first ID face image based on the second affine transformation relationship to obtain a third ID face image of the target user.
17. The device according to claim 16, wherein the preset area is a preset face area determined based on at least part of the preset face key points; The first extraction unit is specifically used for: Determine third coordinate data of at least a portion of the preset facial key points in the third user's facial image; Determine, according to the third coordinate data, a first face region in the third user face image that has a positional correspondence with the preset region; Extracting the image within the first face region in the third user face image to obtain the second user face image; The second extraction unit is specifically used for: Determine fourth coordinate data of at least a portion of the preset facial key points in the facial image of the third ID card; Determine, according to the fourth coordinate data, a second face region in the third ID face image that has a position corresponding to the preset region; The image within the second face region of the third ID face image is extracted to obtain the second ID face image.
18. The device according to claim 15, wherein the first user face image and the first ID face image are both color images; The face alignment processing unit specifically includes: A first channel conversion subunit is used to perform image channel conversion processing on the first user face image and the first ID face image to generate a first single-channel user face image and a first single-channel ID face image of the same type; A third face alignment subunit is configured to perform face alignment processing on the first single-channel user face image and the first single-channel ID face image based on the same preset face template to obtain a third user face image and a third ID face image of the target user; or The first extraction unit specifically includes: A second channel conversion subunit is used to perform image channel conversion processing on the image corresponding to the preset area extracted from the third user face image, generate a second single-channel user face image of a preset type, and obtain the second user face image; The second extraction unit specifically includes: The third channel conversion subunit is used to perform image channel conversion processing on the image corresponding to the preset area extracted from the third ID face image, generate a second single-channel ID face image of the preset type, and obtain the second ID face image.
19. The apparatus according to claim 13, wherein the generating module comprises: a determining unit, configured to determine target pixel values of at least some pixels in a designated area corresponding to the target area in the difference image according to a degree of difference in pixel values in a target area having a positional correspondence between the second user face image and the second document face image, so as to obtain the difference image; The authentication result generating unit is used to generate an identity authentication result for the target user according to the difference image.
20. The apparatus according to claim 19, wherein the determining unit comprises: a fifth determining subunit, configured to determine, if the target area contains only a single pixel, an absolute value of a difference between pixel values in the target area having a positional correspondence between the second user face image and the second document face image as a target pixel value for the pixel in the designated area in the difference image; or, a sixth determining subunit, configured to determine, if the target area includes a plurality of pixels, a plurality of pixel pairs in the target area having a positional correspondence between the second user face image and the second ID face image; wherein one of the pixel pairs includes a pixel in the second user face image and a pixel in the second ID face image, and the two pixels included in the pixel pair have a positional correspondence; The seventh determination subunit is used to determine the sum of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, or the average value of the absolute values of the difference between the pixel values of two pixels in each of the pixel pairs, as the target pixel value of at least part of the pixels in the specified area in the difference image.
21. The device according to claim 20, wherein the authentication result generating unit is specifically configured to: Determine whether the number of pixels whose pixel values are greater than or equal to a first threshold in the difference image reaches a first number, and obtain a first determination result; If the first judgment result indicates that the number of pixels whose pixel values in the difference image are greater than or equal to the first threshold reaches a first number, then generating result information indicating that the target user has failed identity authentication; or, The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein, The pre-trained classification model is obtained by pre-training using difference image samples, and the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples. The type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
22. The apparatus according to claim 19, wherein the determining unit comprises: a first calculation subunit, configured to calculate an absolute value of a difference between pixel values in the target area having a positional correspondence between the second user face image and the second ID face image if the target area contains only a single pixel, to obtain a first absolute value; a first setting subunit, configured to set a target pixel value of pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area if the first absolute value is greater than or equal to a second threshold; a second setting subunit, configured to set the target pixel value of the pixels in the designated area in the difference image to a second preset pixel value for identifying a non-significant difference area if the first absolute value is less than a second threshold; or, an eighth determination subunit, configured to determine, if the target area includes a plurality of pixels, a plurality of pixel pairs in the target area having a position correspondence relationship between the second user face image and the second ID face image; wherein one of the pixel pairs includes a pixel in the second user face image and a pixel in the second ID face image, and the two pixels included in the pixel pair have a position correspondence relationship; a second calculation subunit, configured to calculate an absolute value of a difference between pixel values of two pixels in each of the pixel pairs to obtain a second absolute value; a third setting subunit, configured to set the target pixel value of at least part of the pixels in the designated area in the difference image to a first preset pixel value for identifying a significant difference area if the number of the second absolute values that are greater than or equal to a third threshold reaches a second number; and a fourth setting subunit, configured to set the target pixel value of at least part of the pixels in the designated area in the difference image to a second preset pixel value for identifying a non-significant difference area if the number of the second absolute values that are greater than or equal to the third threshold value does not reach a second number.
23. The apparatus according to claim 22, wherein the authentication result generating unit is specifically configured to: determining whether the number of pixels whose pixel values are the first preset pixel values contained in the difference image reaches a third number, and obtaining a second determination result; If the second judgment result indicates that the number of pixels whose pixel values in the difference image are the first preset pixel values reaches a third number, then generating result information indicating that the target user has failed identity authentication; or The difference image is processed using a pre-trained classification model to obtain result information indicating whether the target user has failed identity authentication; wherein, The pre-trained classification model is obtained by pre-training using difference image samples, and the difference image samples are generated based on the difference in pixel values at the same position between the user face image samples and the ID face image samples. The type of facial attribute information reflected at the same position between the user face image samples and the ID face image samples is consistent.
24. The device according to claim 20 or 22, if the target area includes a plurality of pixels, the device further comprises: A sampling module is used to use a preset sliding window to perform sliding sampling from the starting positions with a positional correspondence between the second user face image and the second ID face image according to a preset step size, so as to obtain a target area with a positional correspondence between the second user face image and the second ID face image.
25. An identity authentication device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Acquire a first user face image of the target user collected during the identity authentication process; Acquire a first ID facial image of the target user from the ID image of the target user; Preprocessing the first user face image and the first ID face image to obtain a second user face image and a second ID face image of the target user; wherein the type of face attribute information reflected at the same position in the second user face image and the second ID face image is consistent; An identity authentication result for the target user is generated based on the difference in pixel values at the same position between the second user face image and the second ID face image.
Citation Information
Patent Citations
Human face anti-counterfeiting method and device based on images
CN107742112A
Face-changing video tampering detection method and face-changing video tampering detection system based on illumination direction consistency
CN110807396A
Face replacement method and device based on three-dimensional reconstruction
CN112734890A
Face identity authentication system with interactive living body detection and method thereof
CN116152936A
Identity authentication method and apparatus, and storage medium
WO2018192406A1
