A living body recognition method, apparatus and electronic device
By obtaining the coordinates of key points in the depth image and calculating the parallelism of the plane normal, the liveness detection algorithm is optimized, which solves the problem of poor accuracy in depth image liveness detection, improves detection accuracy and reduces computational resource requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the accuracy of liveness detection using depth images is poor, especially when the distance to the depth camera is too close or too far, or when the light is too strong or too weak. Errors in the image depth information can lead to liveness detection failure.
By acquiring the coordinate information of multiple key points in the depth image, at least two target planes are calculated, and the parallelism between these planes is used to determine whether the image is an attack image or a live image. The parallelism of the plane normals is used to determine the image type, thereby reducing the amount of computation and optimizing the liveness detection algorithm.
It improves the accuracy of liveness detection, effectively resists screen replay attacks and image re-capture attacks, expands the application range of depth cameras, and reduces computing resource requirements.
Smart Images

Figure CN115731589B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a liveness detection method, apparatus, and electronic device. Background Technology
[0002] Facial recognition smart terminals have been widely used in various fields. At the same time, the security of these terminals is facing increasing challenges, with effective resistance to attacks becoming a hot topic in the industry. In current identity verification and facial recognition scenarios, information needs to be collected through cameras to determine whether the current user is a real person or an attacker. Compared to monocular natural images, depth images can capture distance information about the face, offering better detection of forgery methods such as screen displays. However, depth image information contains errors, which can lead to failures in liveness detection.
[0003] In the industry, deep learning-based model prediction methods are commonly used for depth map liveness detection. Typical steps include first acquiring the RGBD image of the target, normalizing the data for face dimensions to obtain a normalized depth map, and then using a deep learning model to process the depth image to obtain the liveness detection result.
[0004] In practical applications, distances that are too close or too far from the depth camera, or light levels that are too strong or too weak, can cause errors in the depth information of the image, leading to failure in liveness detection. Meanwhile, with the development of edge computing and artificial intelligence (AI) chips, more and more related calculations are being performed on the terminal AI chip. Reducing the computational load of liveness detection would save more computing resources for AI chips. Summary of the Invention
[0005] This invention provides a liveness detection method, apparatus, and electronic device to address the problem of poor detection accuracy when using depth images for liveness detection in the prior art.
[0006] To address the aforementioned technical problems, the embodiments of the present invention provide the following technical solutions:
[0007] This invention provides a liveness detection method, comprising:
[0008] Obtain the coordinate information of multiple key points in the depth image to be detected;
[0009] Based on the coordinate information of the multiple key points, at least two target planes are obtained;
[0010] Based on the parallelism between the at least two target planes, determine whether the depth image is an attack image or a live image.
[0011] Optionally, in the liveness detection method, the coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value.
[0012] The process of obtaining at least two target planes based on the coordinate information of the multiple key points includes:
[0013] The depth values of the key points are preprocessed;
[0014] Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined.
[0015] Optionally, in the liveness detection method, determining whether the depth image is an attack image or a liveness image based on the parallelism between the at least two target planes includes:
[0016] Based on the at least two target planes, determine the normal of each of the target planes;
[0017] Determine whether the two normals in the normals of each target plane are parallel;
[0018] When the two normals are parallel, the depth image is determined to be an attack image;
[0019] When the two normals are not parallel, the depth image is determined to be a live image.
[0020] Optionally, in the liveness detection method, determining whether two normals in the normals of each target plane are parallel includes:
[0021] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0022] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0023] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0024] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0025] Optionally, in the liveness detection method, determining the parallelism between the two normals based on their normal vector coordinates includes:
[0026] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0027] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0028] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0029] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0030] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0031] Optionally, in the liveness detection method, obtaining the coordinate information of multiple key points in the depth image to be detected includes:
[0032] The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
[0033] Optionally, in the liveness detection method, the preprocessing of the depth values of the key points includes:
[0034] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0035] This invention also provides an electronic device, including a processor, wherein:
[0036] The processor is used to acquire the coordinates of multiple key points in the depth image;
[0037] The processor is also configured to obtain at least two target planes based on the coordinates of the plurality of key points;
[0038] The processor is further configured to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes.
[0039] Optionally, in the electronic device, the coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value;
[0040] The processor is specifically used for:
[0041] The depth values of the key points are preprocessed;
[0042] Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined.
[0043] Optionally, in the electronic device, the processor is specifically used for:
[0044] Based on the at least two target planes, determine the normal of each of the target planes;
[0045] Determine whether the two normals in the normals of each target plane are parallel;
[0046] When the two normals are parallel, the depth image is determined to be an attack image;
[0047] When the two normals are not parallel, the depth image is determined to be a live image.
[0048] Optionally, in the electronic device, the processor is specifically used for:
[0049] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0050] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0051] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0052] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0053] Optionally, in the electronic device, the processor is specifically used for:
[0054] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0055] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0056] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0057] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0058] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0059] Optionally, in the electronic device, the processor is specifically used for:
[0060] The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
[0061] Optionally, in the electronic device, the processor is specifically used for:
[0062] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0063] This invention also provides a liveness detection device, comprising:
[0064] The acquisition module is used to acquire the coordinates of multiple key points in the depth image;
[0065] The calculation module is used to obtain at least two target planes based on the coordinates of the multiple key points;
[0066] A determination module is used to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes.
[0067] Optionally, in the liveness detection device, the coordinate information includes the horizontal and vertical coordinates of the key points on the shooting screen and the depth value.
[0068] The computing module includes:
[0069] The preprocessing unit is used to preprocess the depth values of the key points;
[0070] The first determining unit is used to determine at least two target planes based on the horizontal and vertical coordinates of the plurality of key points on the shooting screen and the pre-processed depth values.
[0071] Optionally, in the aforementioned liveness detection device, the determining module includes:
[0072] The second determining unit is used to determine the normal of each of the at least two target planes;
[0073] The third determining unit is used to determine whether two normals in the normals of each target plane are parallel;
[0074] The fourth determining unit is used to determine that the depth image is an attack image when the two normals are parallel.
[0075] The fifth determining unit is used to determine that the depth image is a live image when the two normals are not parallel.
[0076] Optionally, in the aforementioned liveness detection device, the third determining unit is specifically used for:
[0077] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0078] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0079] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0080] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0081] Optionally, in the aforementioned liveness detection device, the third determining unit is specifically used for:
[0082] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0083] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0084] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0085] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0086] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0087] Optionally, in the liveness detection device, the acquisition module includes:
[0088] The acquisition unit is used to acquire the coordinate information of multiple key points in the depth image to be detected through an RGBD camera.
[0089] Optionally, in the aforementioned liveness detection device, the preprocessing unit is specifically used for:
[0090] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0091] This invention also provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the liveness detection method as described in any of the preceding embodiments.
[0092] This invention also provides a readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, it implements the liveness detection method as described in any of the preceding claims.
[0093] The beneficial effects of this invention are:
[0094] The present invention obtains at least two target planes based on the coordinate information of multiple key points in the depth image to be detected, and determines whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes. This can optimize the liveness detection algorithm for depth images, improve the accuracy of liveness detection, and resist screen playback attacks or re-photographed image attacks. Attached Figure Description
[0095] Figure 1 A flowchart illustrating the liveness detection method provided in an embodiment of the present invention;
[0096] Figure 2 This is a schematic diagram illustrating the specific process of the liveness detection method provided in this embodiment of the invention;
[0097] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention;
[0098] Figure 4 This is a schematic diagram of the structure of the liveness detection device provided in an embodiment of the present invention;
[0099] Figure 5 This is a schematic diagram illustrating the structure of an electronic device provided in another embodiment of the present invention. Detailed Implementation
[0100] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0101] To address the issue of poor accuracy in liveness detection when using depth images, this invention provides a liveness detection method. By obtaining at least two target planes based on the coordinate information of multiple key points in the depth image to be detected, and determining whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes, this method can optimize the liveness detection algorithm for depth images, improve the accuracy of liveness detection, and resist screen playback attacks or re-enactment image attacks.
[0102] like Figure 1 As shown, this invention provides a liveness detection method, which includes:
[0103] Step S101: Obtain the coordinate information of multiple key points in the depth image to be detected.
[0104] It should be noted that the liveness detection method provided in this embodiment of the invention is applied to an electronic device, which may optionally be a smart terminal for face recognition.
[0105] In this embodiment of the invention, the coordinate information of multiple key points in the depth image to be detected is obtained. When performing liveness recognition through a face, preferably, the coordinate information of five key points in the depth image of the face is obtained. The five key points are two eyes, one nose and two corners of the mouth.
[0106] Step S102: Based on the coordinate information of the multiple key points, obtain at least two target planes.
[0107] In this embodiment of the invention, when performing liveness detection through a face, three of the coordinate information of five key points are selected to obtain two target planes. That is, three different key points are selected from the five key points and connected, and the coordinate information of the three key points is used to calculate and obtain two target planes.
[0108] It should be noted that among the three key points corresponding to each target plane, at least one key point is different.
[0109] Step S103: Determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes.
[0110] In this embodiment of the invention, after determining two target planes, it is determined whether the two target planes are parallel, and the attributes of the depth image are judged, that is, whether the depth image is an attack image or a live image.
[0111] In this embodiment of the invention, at least two target planes are obtained based on the coordinate information of multiple key points in the depth image to be detected, and the depth image is determined to be an attack image or a live image based on the parallelism between the at least two target planes. This can optimize the liveness detection algorithm for depth images, improve the accuracy of liveness detection, and resist screen playback attacks or re-photographed image attacks.
[0112] Optionally, in the liveness detection method, the coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value.
[0113] The process of obtaining at least two target planes based on the coordinate information of the multiple key points includes:
[0114] The depth values of the key points are preprocessed;
[0115] Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined.
[0116] In this embodiment of the invention, depth value error is determined, and the depth value is preprocessed. Based on the preprocessed depth value of the key points and the horizontal and vertical coordinates of the key points on the shooting screen, two target planes are calculated.
[0117] Optionally, in the liveness detection method, determining whether the depth image is an attack image or a liveness image based on the parallelism between the at least two target planes includes:
[0118] Based on the at least two target planes, determine the normal of each of the target planes;
[0119] Determine whether the two normals in the normals of each target plane are parallel;
[0120] When the two normals are parallel, the depth image is determined to be an attack image;
[0121] When the two normals are not parallel, the depth image is determined to be a live image.
[0122] In this embodiment of the invention, three key points are selected from five key points and connected by a line. Two planes are calculated based on the coordinates. The equation satisfied by the key points of the first plane is:
[0123] a1x + b1y + c1z + d1 = 0
[0124] Where a1, b1, c1, and d1 are coefficients, and a1, b1, and c1 are not all zero at the same time; x is the x-coordinate of each key point corresponding to the first plane; y is the y-coordinate of each key point corresponding to the first plane; and z is the depth value of each key point corresponding to the first plane.
[0125] Based on the plane equations described above, the normal vector of the first plane is determined as follows:
[0126] The equation satisfied by the key points of another plane is:
[0127] a²x + b²y + c²z + d² = 0
[0128] Where a2, b2, c2, and d2 are coefficients, and a2, b2, and c2 are not all zero at the same time; x is the x-coordinate of each key point corresponding to the second plane; y is the y-coordinate of each key point corresponding to the second plane; and z is the depth value of each key point corresponding to the second plane.
[0129] Based on the plane equations described above, the normal vector of the second plane is determined as follows:
[0130] Based on the obtained coordinates of the two normal vectors, it is determined whether the two normals are parallel. If the two normals are parallel, the depth image is determined, which means the user to be identified is an attack image. If the two normals are not parallel, the depth image is determined, which means the user to be identified is a live image.
[0131] Optionally, in the liveness detection method, determining whether two normals in the normals of each target plane are parallel includes:
[0132] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0133] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0134] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0135] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0136] In this embodiment of the invention, the parallelism between the two normals is determined based on the normal vector coordinates of the two normals. To avoid calculation errors, a preset error range is set, and the parallelism between the normals of the two planes is calculated within this error range. This is then used to judge the depth image, which represents the user to be identified.
[0137] When the parallelism between two normals is less than or equal to a preset value, the two normals are determined to be parallel, and the depth image is determined to be a live image. When the parallelism between two normals is greater than a preset value, the two normals are determined to be non-parallel, and the depth image is determined to be an attack image.
[0138] Optionally, in the liveness detection method, determining the parallelism between the two normals based on their normal vector coordinates includes:
[0139] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0140] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0141] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0142] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0143] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0144] In this embodiment of the invention, the parallelism between the two normals is calculated using the following formula, with a preset value of 0.3%.
[0145] θ1=|(a1-a2) / a1|+|(b1-b2) / b1|+|(c1-c2) / c1|
[0146] θ2=|(a1-a2) / a2|+|(b1-b2) / b2|+|(c1-c2) / c2|
[0147] Where a1 is the x-coordinate of the first normal of the first plane, b1 is the y-coordinate of the first normal of the first plane, c1 is the depth value corresponding to the first normal of the first plane, a2 is the x-coordinate of the second normal of the second plane, b2 is the y-coordinate of the second normal of the second plane, c2 is the depth value of the second normal of the second plane, θ1 is the first parallelism, and θ2 is the second parallelism.
[0148] According to the following formula, the maximum value of the first parallelism and the second parallelism is determined to be the parallelism between the first normal and the second normal.
[0149] θ = max(θ1, θ2)
[0150] Where θ1 is the first parallelism, θ2 is the second parallelism, and θ is the parallelism between the first normal and the second normal.
[0151] When θ≤0.3%, it indicates that the two planes are parallel, and the depth image is the attack image.
[0152] When θ > 0.3%, it indicates that the two planes are not parallel, and the depth image is a live image.
[0153] Optionally, in the liveness detection method, obtaining the coordinate information of multiple key points in the depth image to be detected includes:
[0154] The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
[0155] In this embodiment of the invention, when performing liveness detection on a face, the key points of the detected face on the screen and the depth values corresponding to the key points are obtained through an RGBD camera.
[0156] Optionally, in the liveness detection method, the preprocessing of the depth values of the key points includes:
[0157] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0158] In this embodiment of the invention, during the preprocessing of the depth values of key points, for parts where the depth information is discontinuous or lost, normalization compensation estimation is performed using neighboring pixels.
[0159] The following is combined Figure 2 This section details the process of liveness detection.
[0160] The system acquires the coordinates and depth values of key points on a face using an RGBD camera, assesses depth value errors, preprocesses the depth values, connects three of the five key points, calculates two planes based on the coordinates of the key points, determines the normals of the two planes, and judges whether the resulting plane normals are parallel within a certain error range, thereby determining whether the user's attributes indicate an attack or a liveness detection.
[0161] In this embodiment of the invention, depth information errors are determined by analyzing key point coordinates and depth values. Furthermore, by connecting key points and determining whether the resulting plane normals are parallel, the system can distinguish between live and tampered images. By optimizing the depth image liveness detection algorithm, detection accuracy is improved.
[0162] This invention improves detection accuracy by optimizing the depth image liveness detection algorithm. It effectively expands the usable range and scenarios of depth cameras, enhancing detection accuracy. It also effectively resists screen playback and re-enhancing attacks. Instead of relying on deep learning models, it uses a planar normal method for liveness detection, significantly reducing computational load and saving computational resources.
[0163] like Figure 3 As shown, this embodiment of the invention also provides an electronic device, including a processor 310, wherein:
[0164] The processor 310 is used to acquire the coordinates of multiple key points in the depth image;
[0165] The processor 310 is further configured to obtain at least two target planes based on the coordinates of the plurality of key points;
[0166] The processor 310 is further configured to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes.
[0167] In this embodiment of the invention, at least two target planes are obtained based on the coordinate information of multiple key points in the depth image to be detected, and the depth image is determined to be an attack image or a live image based on the parallelism between the at least two target planes. This can optimize the liveness detection algorithm for depth images, improve the accuracy of liveness detection, and resist screen playback attacks or re-photographed image attacks.
[0168] Optionally, in the electronic device, the coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value;
[0169] The processor 310 is specifically used for:
[0170] The depth values of the key points are preprocessed;
[0171] Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined.
[0172] Optionally, in the electronic device, the processor 310 is specifically used for:
[0173] Based on the at least two target planes, determine the normal of each of the target planes;
[0174] Determine whether the two normals in the normals of each target plane are parallel;
[0175] When the two normals are parallel, the depth image is determined to be an attack image;
[0176] When the two normals are not parallel, the depth image is determined to be a live image.
[0177] Optionally, in the electronic device, the processor 310 is specifically used for:
[0178] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0179] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0180] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0181] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0182] Optionally, in the electronic device, the processor 310 is specifically used for:
[0183] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0184] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0185] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0186] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0187] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0188] Optionally, in the electronic device, the processor 310 is specifically used for:
[0189] The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
[0190] Optionally, in the electronic device, the processor 310 is specifically used for:
[0191] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0192] It should be noted that the electronic device provided in the embodiments of the present invention is an electronic device capable of performing the above-described liveness detection method. Therefore, all embodiments of the above-described liveness detection method are applicable to the electronic device and can achieve the same or similar technical effects.
[0193] like Figure 4 As shown, this embodiment of the invention also provides a liveness detection device, comprising:
[0194] The acquisition module 410 is used to acquire the coordinates of multiple key points in the depth image;
[0195] The calculation module 420 is used to obtain at least two target planes based on the coordinates of the plurality of key points;
[0196] The determination module 430 is used to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes.
[0197] In this embodiment of the invention, at least two target planes are obtained based on the coordinate information of multiple key points in the depth image to be detected, and the depth image is determined to be an attack image or a live image based on the parallelism between the at least two target planes. This can optimize the liveness detection algorithm for depth images, improve the accuracy of liveness detection, and resist screen playback attacks or re-photographed image attacks.
[0198] Optionally, in the liveness detection device, the coordinate information includes the horizontal and vertical coordinates of the key points on the shooting screen and the depth value.
[0199] The computing module 420 includes:
[0200] The preprocessing unit is used to preprocess the depth values of the key points;
[0201] The first determining unit is used to determine at least two target planes based on the horizontal and vertical coordinates of the plurality of key points on the shooting screen and the pre-processed depth values.
[0202] Optionally, in the aforementioned liveness detection device, the determining module 430 includes:
[0203] The second determining unit is used to determine the normal of each of the at least two target planes;
[0204] The third determining unit is used to determine whether two normals in the normals of each target plane are parallel;
[0205] The fourth determining unit is used to determine that the depth image is an attack image when the two normals are parallel.
[0206] The fifth determining unit is used to determine that the depth image is a live image when the two normals are not parallel.
[0207] Optionally, in the aforementioned liveness detection device, the third determining unit is specifically used for:
[0208] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0209] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0210] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0211] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0212] Optionally, in the aforementioned liveness detection device, the third determining unit is specifically used for:
[0213] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0214] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0215] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0216] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0217] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0218] Optionally, in the liveness detection device, the acquisition module 410 includes:
[0219] The acquisition unit is used to acquire the coordinate information of multiple key points in the depth image to be detected through an RGBD camera.
[0220] Optionally, in the aforementioned liveness detection device, the preprocessing unit is specifically used for:
[0221] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0222] It should be noted that the liveness detection device provided in the embodiments of the present invention is a device capable of performing the above-described liveness detection method. Therefore, all embodiments of the above-described liveness detection method are applicable to this device and can achieve the same or similar technical effects.
[0223] This invention also provides an electronic device, such as... Figure 5 As shown, it includes: a processor 501; and a memory 503 connected to the processor 501 via a bus interface 502. The memory 503 is used to store programs and data used by the processor 501 when performing operations. The processor 501 calls and executes the programs and data stored in the memory 503.
[0224] The transceiver 504 is connected to the bus interface 502 and is used to receive and send data under the control of the processor 501. Specifically, the processor 501 executes the following procedures:
[0225] Obtain the coordinate information of multiple key points in the depth image to be detected;
[0226] Based on the coordinate information of the multiple key points, at least two target planes are obtained;
[0227] Based on the parallelism between the at least two target planes, determine whether the depth image is an attack image or a live image.
[0228] Optionally, the coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value;
[0229] The processor 501 is specifically used for:
[0230] The depth values of the key points are preprocessed;
[0231] Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined.
[0232] Optionally, the processor 501 is specifically used for:
[0233] Based on the at least two target planes, determine the normal of each of the target planes;
[0234] Determine whether the two normals in the normals of each target plane are parallel;
[0235] When the two normals are parallel, the depth image is determined to be an attack image;
[0236] When the two normals are not parallel, the depth image is determined to be a live image.
[0237] Optionally, the processor 501 is specifically used for:
[0238] The parallelism between two normals is determined by the coordinates of their normal vectors.
[0239] When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel.
[0240] When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel.
[0241] The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
[0242] Optionally, the processor 501 is specifically used for:
[0243] The first parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the first abscissa, the difference between the first and second ordinates divided by the absolute value of the first ordinate, and the difference between the first and second depth values divided by the absolute value of the first depth.
[0244] The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value.
[0245] The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism.
[0246] Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal.
[0247] The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
[0248] Optionally, the processor 501 is specifically used for:
[0249] The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
[0250] Optionally, the processor 501 is specifically used for:
[0251] For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points.
[0252] Among them, Figure 5 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 501) and memory (memory 503). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 504 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. Processor 501 is responsible for managing the bus architecture and general processing, and memory 503 can store data used by processor 501 during operation.
[0253] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing the relevant hardware to implement them. The program includes instructions to perform some or all of the steps of the above methods; and the program can be stored in a readable storage medium, which can be any form of storage medium.
[0254] This invention also provides a readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, it implements the liveness detection method as described in any of the preceding claims.
[0255] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0256] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can be physically comprised separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or in the form of hardware plus software functional units.
[0257] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions that cause a computer device (which may be a personal computer, server, or network device, etc.) to execute some steps of the transmission and reception methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0258] The above describes the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also within the scope of protection of the present invention.
Claims
1. A liveness detection method, characterized in that, include: Obtain the coordinate information of multiple key points in the depth image to be detected; Based on the coordinate information of the multiple key points, at least two target planes are obtained; Based on the parallelism between the at least two target planes, determine whether the depth image is an attack image or a live image; The coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value; The process of obtaining at least two target planes based on the coordinate information of the multiple key points includes: The depth values of the key points are preprocessed; Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined; The preprocessing of the depth values of the key points includes: For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points. The step of determining whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes includes: Based on the at least two target planes, determine the normal of each of the target planes; Determine whether the two normals in the normals of each target plane are parallel; When the two normals are parallel, the depth image is determined to be an attack image; When the two normals are not parallel, the depth image is determined to be a live image; The step of determining whether two normals in the normals of each target plane are parallel includes: The parallelism between two normals is determined by the coordinates of their normal vectors. When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel. When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel. The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
2. The liveness detection method according to claim 1, characterized in that, Determining the parallelism between two normals based on their normal vector coordinates includes: The first parallelism is obtained by summing the difference between the first and second horizontal coordinates divided by the absolute value of the first horizontal coordinate, the difference between the first and second vertical coordinates divided by the absolute value of the first vertical coordinate, and the difference between the first and second depth values divided by the absolute value of the first depth value. The second parallelism is obtained by summing the difference between the first and second abscissas divided by the absolute value of the second abscissa, the difference between the first and second ordinates divided by the absolute value of the second ordinate, and the difference between the first and second depth values divided by the absolute value of the second depth value. The parallelism between the two normals is determined by the value of the first parallelism and the second parallelism. Wherein, the first abscissa is the abscissa of the first normal among the two normals, the first ordinate is the ordinate of the first normal, and the first depth value is the depth value of the first normal. The second abscissa is the abscissa of the second normal among the two normals, the second ordinate is the ordinate of the second normal, and the second depth value is the depth value of the second normal.
3. The liveness detection method according to claim 1, characterized in that, The process of obtaining the coordinate information of multiple key points in the depth image to be detected includes: The coordinate information of multiple key points in the depth image to be detected is obtained by using an RGBD camera.
4. An electronic device, comprising a processor, characterized in that: The processor is used to acquire the coordinates of multiple key points in the depth image; The processor is also configured to obtain at least two target planes based on the coordinates of the plurality of key points; The processor is further configured to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes; Specifically, the processor is used for: The depth values of the key points are preprocessed; Based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values, at least two target planes are determined; Specifically, the processor is used for: For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points. Specifically, the processor is used for: Based on the at least two target planes, determine the normal of each of the target planes; Determine whether the two normals in the normals of each target plane are parallel; When the two normals are parallel, the depth image is determined to be an attack image; When the two normals are not parallel, the depth image is determined to be a live image; Specifically, the processor is used for: The parallelism between two normals is determined by the coordinates of their normal vectors. When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel. When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel. The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
5. A liveness detection device, characterized in that, include: The acquisition module is used to acquire the coordinates of multiple key points in the depth image; The calculation module is used to obtain at least two target planes based on the coordinates of the multiple key points; A determination module is used to determine whether the depth image is an attack image or a live image based on the parallelism between the at least two target planes; The coordinate information includes the horizontal and vertical coordinates of the key point on the shooting screen and the depth value; The computing module includes: The preprocessing unit is used to preprocess the depth values of the key points; The first determining unit is used to determine at least two target planes based on the horizontal and vertical coordinates of the multiple key points on the shooting screen and the pre-processed depth values. Specifically, the preprocessing unit is used for: For key points with discontinuous depth values or lost depth information, normalization compensation estimation is performed based on the neighboring points of the key points. The determining module includes: The second determining unit is used to determine the normal of each of the at least two target planes; The third determining unit is used to determine whether two normals in the normals of each target plane are parallel; The fourth determining unit is used to determine that the depth image is an attack image when the two normals are parallel. The fifth determining unit is used to determine that the depth image is a live image when the two normals are not parallel. Specifically, the third determining unit is used for: The parallelism between two normals is determined by the coordinates of their normal vectors. When the parallelism between the two normals is less than or equal to a preset value, the two normals are determined to be parallel. When the parallelism between the two normals is greater than a preset value, it is determined that the two normals are not parallel. The normal vector coordinates are obtained from the coordinates of three key points corresponding to the target plane.
6. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the liveness detection method as described in any one of claims 1 to 3.
7. A readable storage medium, characterized in that, The readable storage medium stores a program that, when executed by a processor, implements the liveness detection method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and device for seeking evidence of image tampering
CN107025647A
Two-planar position adjusting method, device and system based on parallelism
CN108375352A
Living body detection method and device and corresponding electronic equipment
CN111783501A