Liveness detection methods, equipment, readable storage media, and computer program products

CN113903084BActive Publication Date: 2026-05-26WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WEBANK (CHINA)
Filing Date
2021-10-13
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The low accuracy of liveness detection in existing technologies is mainly due to the inaccurate estimation of depth information in face images by neural network models, resulting in low liveness detection precision.

Method used

By focusing and capturing images of key regions of the face to be detected, the focused face image and target focus parameters are obtained. The sharpness map and target focus parameters are then fused to generate a depth map of the target face, which is then used for liveness detection.

Benefits of technology

It improves the accuracy of facial depth information prediction and enhances the accuracy of liveness detection, overcoming the problem of low liveness detection accuracy caused by inaccurate depth information prediction by neural network models in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113903084B_ABST
    Figure CN113903084B_ABST
Patent Text Reader

Abstract

This application discloses a liveness detection method, device, readable storage medium, and program product, applied to a liveness detection device. The liveness detection method includes: focusing and capturing images of key regions of a face to be detected to obtain focused face images corresponding to each key region and corresponding target focus parameters; acquiring a sharpness map corresponding to each focused face image, and fusing the sharpness map and the target focus parameters to obtain a target face depth map corresponding to the face to be detected; and performing liveness detection on the face to be detected based on the target face depth map to obtain a liveness detection result. This application solves the technical problem of low accuracy in liveness detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of facial recognition technology, and in particular to a liveness detection method, device, readable storage medium, and program product. Background Technology

[0002] With the continuous development of facial recognition technology, liveness detection has become an indispensable part of the facial recognition process. Currently, the depth information of a face image is typically estimated using a neural network model. Then, focused images of different regions of the face are captured based on this depth information, and the image quality of these focused images is used to determine whether the subject is alive. However, since captured face images only contain two-dimensional facial feature information, while facial depth information is three-dimensional, the process of estimating the depth information of a face image using a neural network model is essentially an attempt to estimate the three-dimensional feature information of the face based on its two-dimensional features. Therefore, the accuracy of estimating facial depth information using a neural network model is not high, which in turn affects the accuracy of liveness detection. Summary of the Invention

[0003] The main objective of this application is to provide a liveness detection method, device, readable storage medium, and program product, aiming to solve the technical problem of low accuracy in liveness detection in the prior art.

[0004] To achieve the above objectives, this application provides a liveness detection method, which is applied to a liveness detection device, and the liveness detection method includes:

[0005] Focus and capture images of each key region of the face to be detected to obtain focused face images and corresponding target focus parameters for each key region.

[0006] Obtain the sharpness map corresponding to each of the focused face images, and fuse each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected;

[0007] Based on the target face depth map, liveness detection is performed on the face to be detected to obtain the liveness detection result.

[0008] Optionally, the sharpness map includes at least one grayscale value, the target face depth map includes at least one face depth feature value, and the step of fusing each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected includes:

[0009] Obtain the grayscale values ​​of each of the aforementioned resolution images at the same target location;

[0010] Based on the gray values ​​at the target location, the target focus parameters corresponding to each of the clarity maps are weighted and fused to obtain the face depth feature value at the target location in the target face depth map.

[0011] Optionally, the step of weightedly fusing the target focus parameters corresponding to each of the clarity maps based on the gray values ​​at the target location to obtain the face depth feature value at the target location in the target face depth map includes:

[0012] Based on the magnitude of each gray value at the target location, calculate the weight value of the target focusing parameter corresponding to each gray value;

[0013] Based on the weight values, the target focusing parameters are weighted and aggregated to obtain the facial depth feature value at the target location.

[0014] Optionally, the step of focusing and capturing images of key regions of the face to be detected to obtain focused face images corresponding to each key region and corresponding target focus parameters includes:

[0015] By adjusting the camera focal length parameters, each of the key regions is focused and photographed to obtain the initial focused face image and the corresponding target focus parameters for each key region.

[0016] Obtain the coordinates of facial key points corresponding to each of the initial focused face images, and then perform image alignment on each of the initial focused face images based on the coordinates of each of the facial key points to obtain each of the focused face images.

[0017] Optionally, before the step of focusing and capturing images of each key region of the face to be detected to obtain a focused face image corresponding to each key region and the corresponding target focus parameters, the liveness detection method further includes the following steps:

[0018] Facial landmark detection is performed on the face to be detected to obtain facial landmark information;

[0019] Based on the facial key point information, the face to be detected is divided into focus candidate regions to obtain each key region.

[0020] Optionally, the step of performing liveness detection on the face to be detected based on the target face depth map to obtain the liveness detection result includes:

[0021] Based on a preset image classification model, the depth map of the target face is classified to obtain the image classification result;

[0022] Based on the image classification results, it is determined whether the face to be detected is a live face, and the liveness detection result is obtained.

[0023] Optionally, the step of obtaining the sharpness map corresponding to each of the focused face images includes:

[0024] Calculate the second-order gradient map corresponding to the focused face image;

[0025] Gaussian filtering is applied to the second-order gradient map to obtain the sharpness map corresponding to the focused face image.

[0026] This application also provides a liveness detection device, which is a virtual device and is applied to a liveness detection equipment. The liveness detection device includes:

[0027] The focusing and shooting module is used to focus and shoot each key region of the face to be detected, so as to obtain the focused face image corresponding to each key region and the corresponding target focusing parameters.

[0028] The fusion module is used to acquire the sharpness map corresponding to each of the focused face images, and fuse each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected;

[0029] The liveness detection module is used to perform liveness detection on the face to be detected based on the target face depth map, and obtain the liveness detection result.

[0030] Optionally, the sharpness map includes at least one grayscale value, the target face depth map includes at least one face depth feature value, and the fusion module is further configured to:

[0031] Obtain the grayscale values ​​of each of the aforementioned resolution images at the same target location;

[0032] Based on the gray values ​​at the target location, the target focus parameters corresponding to each of the clarity maps are weighted and fused to obtain the face depth feature value at the target location in the target face depth map.

[0033] Optionally, the fusion module is further configured to:

[0034] Based on the magnitude of each gray value at the target location, calculate the weight value of the target focusing parameter corresponding to each gray value;

[0035] Based on the weight values, the target focusing parameters are weighted and aggregated to obtain the facial depth feature value at the target location.

[0036] Optionally, the focusing and shooting module is further used for:

[0037] By adjusting the camera focal length parameters, each of the key regions is focused and photographed to obtain the initial focused face image and the corresponding target focus parameters for each key region.

[0038] Obtain the coordinates of facial key points corresponding to each of the initial focused face images, and then perform image alignment on each of the initial focused face images based on the coordinates of each of the facial key points to obtain each of the focused face images.

[0039] Optionally, the liveness detection device is further used for:

[0040] Facial landmark detection is performed on the face to be detected to obtain facial landmark information;

[0041] Based on the facial key point information, the face to be detected is divided into focus candidate regions to obtain each key region.

[0042] Optionally, the liveness detection module is further configured to:

[0043] Based on a preset image classification model, the depth map of the target face is classified to obtain the image classification result;

[0044] Based on the image classification results, it is determined whether the face to be detected is a live face, and the liveness detection result is obtained.

[0045] Optionally, the fusion module is further configured to:

[0046] Calculate the second-order gradient map corresponding to the focused face image;

[0047] Gaussian filtering is applied to the second-order gradient map to obtain the sharpness map corresponding to the focused face image.

[0048] This application also provides a liveness detection device, which is a physical device. The liveness detection device includes: a memory, a processor, and a program of the liveness detection method stored in the memory and executable on the processor. When the program of the liveness detection method is executed by the processor, it can implement the steps of the liveness detection method as described above.

[0049] This application also provides a readable storage medium storing a program for implementing a liveness detection method, wherein when the program for the liveness detection method is executed by a processor, it implements the steps of the liveness detection method as described above.

[0050] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the liveness detection method described above.

[0051] This application provides a liveness detection method, device, readable storage medium, and program product. Compared to existing technologies that rely on neural network models to predict the depth information of facial images, then perform focused shooting based on the depth information to obtain focused images of different regions of the face, and further use the image quality of the focused images to determine whether the object is alive, this application first performs focused shooting on each key region of the face to be detected, obtaining focused facial images corresponding to each key region and corresponding target focus parameters, obtaining a sharpness map corresponding to each focused facial image, and then combining the sharpness map and the target focus parameters... The data fusion process yields a target face depth map corresponding to the face to be detected. This achieves the goal of directly calculating the depth information of the face to be detected based on the distribution of target focus parameters in different key regions of the face image and the distribution of sharpness in each focused face image. The distribution of target focus parameters and the distribution of sharpness in each focused face image both reflect the three-dimensional feature information of the face to a certain extent, thus achieving the goal of calculating the face depth map based on the three-dimensional feature information of the face. Compared with the method of estimating the three-dimensional feature information of the face based on the two-dimensional feature information of the face, this improves the accuracy of face depth information prediction. Furthermore, based on the target face depth map, liveness detection is performed on the face to be detected to obtain liveness detection results. This achieves the goal of performing liveness detection based on more accurate face depth information, overcoming the technical deficiency of existing technologies where the accuracy of face depth information prediction using neural network models is not high, thus affecting the accuracy of liveness detection and improving the accuracy of liveness detection. Attached Figure Description

[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This is a flowchart illustrating the first embodiment of the liveness detection method of this application;

[0055] Figure 2 This is a schematic diagram showing the distribution of facial key points in the liveness detection method of this application.

[0056] Figure 3 This is a schematic diagram showing the distribution of the key regions described in the liveness detection method of this application;

[0057] Figure 4 This is a flowchart illustrating the second embodiment of the liveness detection method of this application;

[0058] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the liveness detection method in the embodiments of this application.

[0059] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0060] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0061] This application provides a liveness detection method. In the first embodiment of the liveness detection method of this application, referring to... Figure 1 The liveness detection method includes:

[0062] Step S10: Focus and capture images of each key region of the face to be detected to obtain focused face images and corresponding target focus parameters for each key region.

[0063] In this embodiment of the application, it should be noted that the key area includes, but is not limited to, the nose tip area, eye area, eyebrow area, lip area, and cheek area of ​​the face to be detected, and the target focus parameter is the focal length of the camera when focusing and shooting.

[0064] In one possible implementation of this application, while keeping other camera parameters constant, the camera focal length parameter is adjusted to focus and capture images of each key region of the face to be detected, obtaining focused facial images corresponding to each key region, and the target focus parameters used to capture each focused facial image are taken as the target focus parameters. It should be noted that the focusing and capturing process involves continuously adjusting the camera focal length parameter to capture the image with the clearest corresponding key region. The final focused facial image obtained is the facial image captured when the corresponding key region is clearest; the camera focal length parameter at this point is the target focus parameter.

[0065] The step of focusing and capturing images of key regions of the face to be detected to obtain focused face images corresponding to each key region and corresponding target focus parameters includes:

[0066] Step S11: By adjusting the camera focal length parameters, focus and capture images of each of the key regions to obtain the initial focused face image and the corresponding target focus parameters for each key region.

[0067] In one possible implementation of this application, the camera focal length parameter is adjusted, and the clarity of the corresponding key area is detected. If clear, the key area is photographed to obtain an initial focused face image corresponding to the key area, and the camera focal length parameter when the camera photographed the initial focused face image is used as the target focus parameter; if not clear, the process returns to the step of adjusting the camera focal length parameter.

[0068] Step S12: Obtain the coordinates of the facial key points corresponding to each of the initial focused face images, and then perform image alignment on each of the initial focused face images based on the coordinates of each of the facial key points to obtain each of the focused face images.

[0069] In one possible implementation of this application, the coordinates of each of the initial focused face images at the same facial key point are obtained to obtain the coordinates of each facial key point. One coordinate is selected from the coordinates of each facial key point as a reference coordinate. Based on the difference between the coordinates of the other facial key points and the reference coordinate, the pixel coordinates in the initial focused face images corresponding to the coordinates of the other facial key points are aligned with the pixel coordinates in the initial focused face image corresponding to the reference coordinate. Both the aligned other initial focused face images and the initial focused face image are then used as the focused face image.

[0070] Prior to the step of focusing and capturing images of key regions of the face to be detected to obtain focused face images corresponding to each key region and corresponding target focus parameters, the liveness detection method further includes the following steps:

[0071] Step A10: Perform facial landmark detection on the face to be detected to obtain facial landmark information;

[0072] In one possible implementation of this application, a globally focused image is captured of the face to be detected. Face detection is then performed on the globally focused image. If the face detection passes, facial landmark detection is performed on the globally focused image to obtain facial landmark information. If the face detection fails, the face to be detected is determined not to be the target face, and a message indicating that face recognition failed is output.

[0073] Step A20: Based on the facial key point information, divide the face to be detected into focus candidate regions to obtain each key region.

[0074] In this embodiment of the application, it should be noted that the facial key point information includes the coordinates of the facial key points.

[0075] In one possible implementation of this application, based on the coordinates of each facial key point, a focus candidate region is divided for the face to be detected, thereby obtaining each key region, wherein, Figure 2 This is a schematic diagram showing the distribution of the facial key points. Figure 3 The diagram shows the distribution of the key regions, where points 1 to 68 are facial key points, and each selected area is a key region.

[0076] Step S20: Obtain the sharpness map corresponding to each of the focused face images, and fuse each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected;

[0077] In this embodiment, it should be noted that the sharpness map is a pixel value matrix composed of the gray values ​​corresponding to the pixels. The gray values ​​are used to represent the sharpness of the corresponding pixels. The larger the gray value, the higher the sharpness of the pixel.

[0078] In one possible implementation of this application, the grayscale value corresponding to the pixel in each of the focused face images is calculated to obtain a sharpness map corresponding to each of the focused face images. Based on the magnitude of the grayscale value at the same pixel position in each of the sharpness maps, the target focus parameters corresponding to each of the sharpness maps are weighted and fused to obtain the face depth feature value at each same pixel position. Then, based on the positional arrangement rule of each of the same pixel positions, the face depth feature values ​​are combined into a matrix to obtain the target face depth map.

[0079] The step of obtaining the sharpness map corresponding to each of the focused face images includes:

[0080] Step S21: Calculate the second-order gradient map corresponding to the focused face image;

[0081] Step S22: Perform Gaussian filtering on the second-order gradient map to obtain the sharpness map corresponding to the focused face image.

[0082] In one possible implementation of this application, the second-order gradient value of each pixel in the focused face image is calculated to obtain a second-order gradient map. Gaussian filtering is then applied to the second-order gradient map to obtain a sharpness map corresponding to the focused face image. Optionally, the second-order gradient value of the image can be calculated based on the Laplacian operator.

[0083] Step S30: Based on the target face depth map, perform liveness detection on the face to be detected to obtain the liveness detection result.

[0084] In one possible implementation of this application, features are extracted from the target face depth map according to a preset feature extraction model to obtain output face depth features. The feature similarity between the output face depth features and the target face depth features is calculated, and based on the feature similarity, liveness detection is performed on the face to be detected to obtain a liveness detection result. The target face depth features are face depth features obtained by extracting features from real face depth information.

[0085] In one possible implementation of this application, the step of performing liveness detection on the face to be detected based on the feature similarity to obtain the liveness detection result includes:

[0086] If the feature similarity is greater than a preset feature similarity threshold, the face to be detected is determined to be a live face, and the liveness detection result is "liveness detection passed"; if the feature similarity is not greater than the preset feature similarity threshold, the face to be detected is determined to be a non-live face, and the liveness detection result is "liveness detection failed".

[0087] The step of performing liveness detection on the face to be detected based on the target face depth map to obtain the liveness detection result includes:

[0088] Step S31: Classify the depth map of the target face according to the preset image classification model to obtain the image classification result;

[0089] Step S32: Based on the image classification result, determine whether the face to be detected is a live face, and obtain the liveness detection result.

[0090] In this embodiment, it should be noted that the preset image classification model can be a binary classification model or a multi-class classification model.

[0091] In one possible implementation of this application, the depth map of the target face is binary-classified according to a preset image classification model to obtain a binary classification label. If the binary classification label is a preset target binary classification label, the face to be detected is determined to be a live face, and the liveness detection result is "liveness detection passed"; if the binary classification label is not a predicted target binary classification label, the face to be detected is determined to be a non-live face, and the liveness detection result is "liveness detection failed".

[0092] This application provides a liveness detection method. Compared to existing technologies that rely on neural network models to predict the depth information of face images, then perform focused shooting based on the depth information to obtain focused images of different regions of the face, and further use the image quality of the focused images to determine whether the object is alive, this application first performs focused shooting on each key region of the face to be detected, obtaining focused face images corresponding to each key region and corresponding target focus parameters, obtaining a sharpness map corresponding to each focused face image, and fusing each sharpness map and each target focus parameter to obtain a liveness detection method. The target face depth map corresponding to the face to be detected achieves the goal of directly calculating the depth information of the face to be detected based on the distribution of target focus parameters in different key regions of the face image and the distribution of sharpness of each focused face image. The distribution of target focus parameters and the distribution of sharpness of each focused face image both reflect the three-dimensional feature information of the face to a certain extent, thus achieving the goal of calculating the face depth map based on the three-dimensional feature information of the face. Compared with the method of estimating the three-dimensional feature information of the face based on the two-dimensional feature information of the face, this improves the accuracy of face depth information prediction. Furthermore, based on the target face depth map, liveness detection is performed on the face to be detected to obtain liveness detection results. This achieves the goal of liveness detection based on more accurate face depth information, overcoming the technical deficiency of existing technologies where the accuracy of face depth information prediction through neural network models is not high, thus affecting the accuracy of liveness detection and improving the accuracy of liveness detection.

[0093] Furthermore, referring to Figure 4 In another embodiment of this application, the sharpness map includes at least one grayscale value, and the target face depth map includes at least one face depth feature value. The step of fusing each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected includes:

[0094] Step B10: Obtain the grayscale value of each of the resolution images at the same target location;

[0095] Step B20: Based on the gray values ​​at the target location, the target focus parameters corresponding to each of the clarity maps are weighted and fused to obtain the face depth feature value at the target location in the target face depth map.

[0096] In this embodiment, it should be noted that the target position is the position of the pixel in the sharpness map, that is, the pixel position.

[0097] In one possible implementation of this application, grayscale values ​​of each of the resolution images at the same target location are obtained. Then, for each grayscale value at the same target location, the proportion of each grayscale value in the total grayscale values ​​is calculated to obtain the weight value corresponding to each grayscale value at the same target location. Based on each weight value, the target focus parameters are weighted and fused to obtain the face depth feature value at the target location. The face depth feature values ​​are arranged into a matrix according to the arrangement of each target location to obtain the target face depth map.

[0098] The step of weightedly fusing the target focus parameters corresponding to each of the clarity maps based on the gray values ​​at the target location to obtain the face depth feature value at the target location in the target face depth map includes:

[0099] Step B21: Calculate the weight value of the target focusing parameter corresponding to each gray value based on the magnitude of each gray value at the target location;

[0100] In one possible implementation of this application, each grayscale value at the target position is input into a preset exponential function to obtain the exponential function value corresponding to each grayscale value. Then, the ratio of each exponential function value to the sum of all the exponential function values ​​is calculated to obtain the weight value of the target focusing parameter corresponding to each grayscale value.

[0101] In one possible implementation of this application, the weight value is calculated as follows:

[0102]

[0103] Among them, W i (x, y) represents the weight value corresponding to the grayscale value at the i-th target position with coordinates (x, y), p i (x, y) represents the gray value at the i-th target position with coordinates (x, y), and n represents the number of gray values ​​at the target position with coordinates (x, y).

[0104] Step B22: Based on the weight values, the target focus parameters are weighted and aggregated to obtain the face depth feature value at the target location.

[0105] In the embodiments of this application, it should be noted that the weighted aggregation methods include weighted summation and weighted average, etc.

[0106] In one possible implementation of this application, the face depth feature value is calculated by weighted aggregation of the target focus parameters as follows:

[0107]

[0108] Where p(x, y) is the face depth feature value at the target location with coordinates (x, y), and W i (x, y) represents the weight value corresponding to the grayscale value at the i-th target position with coordinates (x, y), f i Let be the target focus parameter corresponding to the gray value at the i-th target position with coordinates (x, y).

[0109] It should be noted that because different parts of the face have different depths, different focal lengths (target focus parameters) are needed for focusing and shooting areas of different depths. Therefore, each target focus parameter reflects facial depth information; that is, the distribution of each target focus parameter contains facial depth information. However, because there are areas with drastic depth changes within the face, directly obtaining facial depth based on each target focus parameter results in low accuracy. In this embodiment, the target focus parameters are weighted and fused based on the grayscale values ​​of multiple focused facial images of different areas at the same pixel location. Therefore, even if the target focus parameters corresponding to a focused facial image in an area with drastic depth changes are not optimal, it will not have a significant impact on the calculation of the facial depth map, making the calculation of the facial depth map more stable and accurate.

[0110] This application provides a method for calculating a target face depth map. First, the grayscale values ​​of each sharpness map at the same target location are obtained. Based on these grayscale values, the target focus parameters corresponding to each sharpness map are weighted and fused to obtain the face depth feature value at the target location in the target face depth map. In other words, based on the grayscale values ​​of the same pixel location in each focused face image, each target focus parameter is fused into a face depth feature value corresponding to each pixel location, thus obtaining the target face depth. This method avoids directly estimating the face depth based on the magnitude distribution of each target focus parameter. Therefore, even if the target focus parameters corresponding to a region with drastic depth changes in a focused face image are not optimal, it will not significantly affect the calculation of the face depth map. This makes the calculation of the face depth map more stable and accurate, resulting in higher accuracy and stability for liveness detection based on the more accurate and stable face depth.

[0111] Reference Figure 5 , Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.

[0112] like Figure 5As shown, the liveness detection device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0113] Optionally, the liveness detection device may also include a rectangular user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The rectangular user interface may include a display screen and an input submodule such as a keyboard. Optionally, the rectangular user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0114] Those skilled in the art will understand that Figure 5 The liveness detection device structure shown does not constitute a limitation on the liveness detection device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0115] like Figure 5 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, and a liveness detection program. The operating system is a program that manages and controls the hardware and software resources of the liveness detection device, supporting the execution of the liveness detection program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the liveness detection system.

[0116] exist Figure 5 In the liveness detection device shown, the processor 1001 is used to execute the liveness detection program stored in the memory 1005 to implement the steps of the liveness detection method described in any of the above claims.

[0117] The specific implementation of the liveness detection device in this application is basically the same as the embodiments of the liveness detection method described above, and will not be repeated here.

[0118] This application embodiment also provides a liveness detection device, which is applied to a liveness detection equipment, and the liveness detection device includes:

[0119] The focusing and shooting module is used to focus and shoot each key region of the face to be detected, so as to obtain the focused face image corresponding to each key region and the corresponding target focusing parameters.

[0120] The fusion module is used to acquire the sharpness map corresponding to each of the focused face images, and fuse each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected;

[0121] The liveness detection module is used to perform liveness detection on the face to be detected based on the target face depth map, and obtain the liveness detection result.

[0122] Optionally, the sharpness map includes at least one grayscale value, the target face depth map includes at least one face depth feature value, and the fusion module is further configured to:

[0123] Obtain the grayscale values ​​of each of the aforementioned resolution images at the same target location;

[0124] Based on the gray values ​​at the target location, the target focus parameters corresponding to each of the clarity maps are weighted and fused to obtain the face depth feature value at the target location in the target face depth map.

[0125] Optionally, the fusion module is further configured to:

[0126] Based on the magnitude of each gray value at the target location, calculate the weight value of the target focusing parameter corresponding to each gray value;

[0127] Based on the weight values, the target focusing parameters are weighted and aggregated to obtain the facial depth feature value at the target location.

[0128] Optionally, the focusing and shooting module is further used for:

[0129] By adjusting the camera focal length parameters, each of the key regions is focused and photographed to obtain the initial focused face image and the corresponding target focus parameters for each key region.

[0130] Obtain the coordinates of facial key points corresponding to each of the initial focused face images, and then perform image alignment on each of the initial focused face images based on the coordinates of each of the facial key points to obtain each of the focused face images.

[0131] Optionally, the liveness detection device is further used for:

[0132] Facial landmark detection is performed on the face to be detected to obtain facial landmark information;

[0133] Based on the facial key point information, the face to be detected is divided into focus candidate regions to obtain each key region.

[0134] Optionally, the liveness detection module is further configured to:

[0135] Based on a preset image classification model, the depth map of the target face is classified to obtain the image classification result;

[0136] Based on the image classification results, it is determined whether the face to be detected is a live face, and the liveness detection result is obtained.

[0137] Optionally, the fusion module is further configured to:

[0138] Calculate the second-order gradient map corresponding to the focused face image;

[0139] Gaussian filtering is applied to the second-order gradient map to obtain the sharpness map corresponding to the focused face image.

[0140] The specific implementation of the live body detection device in this application is basically the same as the embodiments of the above-described live body detection method, and will not be repeated here.

[0141] This application provides a readable storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the liveness detection method described above.

[0142] The specific implementation of the readable storage medium in this application is basically the same as the embodiments of the above-described liveness detection method, and will not be repeated here.

[0143] This application provides a computer program product, which includes one or more computer programs. The one or more computer programs can be executed by one or more processors to implement the steps of the liveness detection method described above.

[0144] The specific implementation of the computer program product in this application is basically the same as the embodiments of the above-described liveness detection method, and will not be repeated here.

[0145] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. A method of detecting living matter, characterized by, The liveness detection method includes: Focus and capture images of each key region of the face to be detected to obtain focused face images and corresponding target focus parameters for each key region. Obtain the sharpness map corresponding to each of the focused face images, and fuse each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected; Based on the target face depth map, liveness detection is performed on the face to be detected to obtain the liveness detection result; Wherein, the sharpness map includes at least one grayscale value, the target face depth map includes at least one face depth feature value, and the step of fusing each of the sharpness maps and each of the target focus parameters to obtain the target face depth map corresponding to the face to be detected includes: Obtain the grayscale values ​​of each of the aforementioned resolution images at the same target location; Based on the magnitude of each gray value at the target location, calculate the weight value of the target focusing parameter corresponding to each gray value; Based on the weight values, the target focusing parameters are weighted and aggregated to obtain the face depth feature value at the target location; The step of obtaining the sharpness map corresponding to each of the focused face images includes: Calculate the second-order gradient map corresponding to the focused face image; Gaussian filtering is applied to the second-order gradient map to obtain the sharpness map corresponding to the focused face image.

2. The liveness detection method as described in claim 1, characterized in that, The step of focusing and capturing images of key regions of the face to be detected to obtain focused face images and corresponding target focus parameters for each key region includes: By adjusting the camera focal length parameters, each of the key regions is focused and photographed to obtain the initial focused face image and the corresponding target focus parameters for each key region. Obtain the coordinates of facial key points corresponding to each of the initial focused face images, and then perform image alignment on each of the initial focused face images based on the coordinates of each of the facial key points to obtain each of the focused face images.

3. The liveness detection method as described in claim 1, characterized in that, Before the step of focusing and capturing images of key regions of the face to be detected to obtain focused face images corresponding to each key region and corresponding target focus parameters, the liveness detection method further includes the following steps: Facial landmark detection is performed on the face to be detected to obtain facial landmark information; Based on the facial key point information, the face to be detected is divided into focus candidate regions to obtain each key region.

4. The liveness detection method as described in claim 1, characterized in that, The step of performing liveness detection on the face to be detected based on the target face depth map to obtain the liveness detection result includes: Based on a preset image classification model, the depth map of the target face is classified to obtain the image classification result; Based on the image classification results, it is determined whether the face to be detected is a live face, and the liveness detection result is obtained.

5. A liveness detection device, characterized in that, The liveness detection device includes: a memory, a processor, and a program stored in the memory for implementing the liveness detection method. The memory is used to store the program for implementing the liveness detection method; The processor is configured to execute a program that implements the liveness detection method to perform the steps of the liveness detection method as described in any one of claims 1 to 4.

6. A readable storage medium, characterized in that, The readable storage medium stores a program for implementing a liveness detection method, which is executed by a processor to implement the steps of the liveness detection method as described in any one of claims 1 to 4.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the liveness detection method as described in any one of claims 1 to 4.