Image-based living body detection method, device, electronic device and storage medium

By performing face detection on infrared images associated with RGB images and performing different live detection strategies, the low image quality problem caused by light changes in outdoor environments is solved, and more accurate live detection results are achieved and cost reduction.

CN114093035BActive Publication Date: 2025-04-25BEIJING UNISOUND INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111496910.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-04-25
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

In outdoor environments, extreme changes in light conditions lead to low image quality, which directly affects the accuracy of live detection. The prior art increases manufacturing costs to improve image quality.

Method used

By performing face detection on infrared images associated with RGB images, different live detection strategies are performed according to the detection results, including calling screen filters or obtaining face quality parameters and alignment results, and image similarity is calculated to determine live detection results.

Benefits of technology

More precise determination of whether there are live faces in RGB images in outdoor environments reduces detection costs and does not require additional accessories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114093035B_ABST
    Figure CN114093035B_ABST
Patent Text Reader

Abstract

The present application discloses an image-based liveness detection method, device, electronic device and storage medium. The method includes: obtaining a target RGB image to be subjected to liveness face detection, wherein the target RGB image carries a human face; detecting an infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a human face in the infrared image; obtaining a liveness detection strategy corresponding to the first detection result; performing liveness face detection based on the target RGB image and / or infrared image according to the detection operation indicated in the liveness detection strategy to obtain a liveness detection result. The method provided in the embodiment of the present application performs face detection on an infrared image associated with an RGB image, and executes different liveness detection strategies according to the detection results, thereby being able to more accurately determine whether there is a live face in an RGB image in an outdoor environment. Compared with the prior art, it is no longer necessary to add additional accessories, thereby reducing the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image-based living body detection method, device, electronic device and storage medium. Background Art

[0002] The liveness detection system based on binocular cameras can obtain two types of face images: infrared and ordinary RGB cameras. First, after face detection and alignment, the face target area image is obtained. Then the liveness detection task begins. The liveness task can rely only on the infrared face image features, or only on the RGB face image features, or both features can be used at the same time for judgment. After passing the liveness detection, the subsequent face recognition function is performed.

[0003] In order to control image quality, the general practices are: 1. Use higher-end cameras, such as wide dynamic cameras; 2. Use adaptive fill lights, sun visors and other supplementary accessories.

[0004] In an indoor environment with uniform and stable lighting, existing technologies generally have no major problems defending against paper printing, mobile phone screen attacks, etc. However, in outdoor environments, there are extremely variable lighting conditions, such as glare, dim light, and exposure. If low-quality images are directly sent to the liveness detection system, it is easy to cause misjudgment; if low-quality images are directly discarded, the recall rate will also drop significantly. At the same time, the use of high-end cameras or additional accessories will inevitably increase the manufacturing cost of the entire system. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an image-based living body detection method, device, electronic device and storage medium.

[0006] According to one aspect of an embodiment of the present application, there is provided an image-based living body detection method, comprising:

[0007] Acquire a target RGB image for live face detection, wherein the target RGB image carries a human face;

[0008] Detecting the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image;

[0009] Obtaining a liveness detection strategy corresponding to the first detection result;

[0010] According to the detection operation indicated in the liveness detection strategy, liveness face detection is performed based on the target RGB image and / or the infrared image to obtain a liveness detection result.

[0011] Furthermore, the step of obtaining a liveness detection strategy corresponding to the first detection result includes:

[0012] In the case where the first detection result indicates that there is no human face in the infrared image, the living body detection strategy corresponding to the first detection result includes: calling a screen filter to detect the infrared image;

[0013] or,

[0014] When the first detection result is used to indicate that a face exists in the infrared image, the living body detection strategy corresponding to the first detection result includes: obtaining the face quality of the infrared image, and the alignment result of the target RGB image and the infrared image.

[0015] Further, the detection operation indicated in the liveness detection strategy performs liveness face detection based on the target RGB image and / or the infrared image to obtain a liveness detection result, including:

[0016] When the first detection result indicates that there is no face in the infrared image, obtaining key face information in the target RGB image;

[0017] Calling a screen filter to crop the infrared image according to key face information in the target RGB image to obtain an infrared partial image;

[0018] Extracting image features of the infrared partial image, and determining the image type of the infrared partial image according to the image features;

[0019] In the case that the image type is a face type, an RGB liveness detector is called to perform liveness face detection on the target RGB image to obtain the liveness detection result.

[0020] Further, the detection operation indicated in the liveness detection strategy performs liveness face detection based on the target RGB image and / or the infrared image to obtain a liveness detection result, including:

[0021] When the first detection result indicates that a face exists in the infrared image, obtaining a face quality parameter of the infrared image and an alignment result between the target RGB image and the infrared image;

[0022] When the face quality parameter does not meet the preset quality parameter and / or the alignment result indicates that the alignment between the target RGB image and the infrared image fails, calculating the image similarity between the target RGB image and the infrared image;

[0023] When the image similarity is greater than or equal to a preset threshold, an infrared liveness detector is called to perform live face detection on the infrared image to obtain the liveness detection result.

[0024] Furthermore, the calculating the image similarity between the target RGB image and the infrared image includes:

[0025] The target RGB image is converted to obtain a grayscale RGB image corresponding to the target RGB image;

[0026] Extracting a first facial feature from the grayscale RGB image, and extracting a second facial feature from the infrared image;

[0027] The feature similarity between the first facial feature and the second facial feature is calculated, and the feature similarity is determined as the image similarity.

[0028] Furthermore, the method further comprises:

[0029] When the image similarity is less than a preset threshold, the absence of a living face in the target RGB image is determined as the living body detection result.

[0030] Furthermore, after performing live face detection on the infrared image to obtain the live detection result, the method further includes:

[0031] In a case where the liveness detection result is used to indicate that a live body exists in the infrared image, determining that a live human face exists in the infrared image as the liveness detection result;

[0032] When the liveness detection result is used to indicate that there is no live body in the infrared image, the target RGB image is sent to the RGB liveness detector, so that the RGB liveness detector continues to perform live face detection on the target RGB image to obtain the liveness detection result.

[0033] According to another aspect of the embodiment of the present application, there is also provided an image-based living body detection device, comprising:

[0034] An acquisition module is used to acquire a target RGB image to be subjected to live face detection, wherein the target RGB image carries a human face;

[0035] A detection module, used to detect the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image;

[0036] A query module, used to obtain a liveness detection strategy corresponding to the first detection result;

[0037] A processing module is used to perform live face detection based on the target RGB image and / or the infrared image according to the detection operation indicated in the live detection strategy to obtain a live detection result.

[0038] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.

[0039] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.

[0040] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.

[0041] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application performs face detection on the infrared image associated with the RGB image, and executes different liveness detection strategies according to the detection results, so as to more accurately determine whether there is a live face in the RGB image in an outdoor environment. Compared with the prior art, there is no need to add additional accessories, thereby reducing the detection cost. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 A flowchart of an image-based living body detection method provided in an embodiment of the present application;

[0045] Figure 2 A flowchart of an image-based living body detection method provided in another embodiment of the present application;

[0046] Figure 3 A block diagram of an image-based living body detection device provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0049] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0050] The embodiments of the present application provide an image-based liveness detection, device, electronic device, and storage medium. The method provided in the embodiments of the present invention can be applied to any required electronic device, for example, it can be a server, a terminal, and other electronic devices, which are not specifically limited here. For the convenience of description, they are referred to as electronic devices in the following.

[0051] According to one aspect of the embodiments of the present application, a method embodiment of an image-based living body detection method is provided. Figure 1 A flowchart of an image-based living body detection method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0052] Step S11, obtaining a target RGB image for live face detection, wherein the target RGB image carries a human face.

[0053] In the embodiment of the present application, the target RGB image is a color image obtained by detecting a living human face through a color camera, and the pixel values ​​of the image are represented by the color components of three channels: red (R), green (G) and blue (B).

[0054] Step S12: Detect the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image.

[0055] In an embodiment of the present application, the infrared image associated with the target RGB image is an image of the same detection object, the same photo, the same video, etc., taken at the same time and at the same angle as the above-mentioned RGB image.

[0056] In the embodiment of the present application, since the target RGB image carries a human face, it is necessary to detect the infrared image associated with it to determine whether there is a human face. Specifically, the infrared image associated with the target RGB image is input into the detection model, the detection model extracts the image features in the infrared image, matches the image features with the preset human face features, and obtains a first detection result. For example, if the similarity between the image features and the preset human face features is greater than a preset threshold, the first detection result indicates that there are human face features in the infrared image. If the similarity between the image features and the preset human face features is less than or equal to the preset threshold, the first detection result indicates that there are no human face features in the infrared image.

[0057] Step S13, obtaining a liveness detection strategy corresponding to the first detection result.

[0058] In an embodiment of the present application, step S13, obtaining a liveness detection strategy corresponding to the first detection result, includes: when the first detection result is used to indicate that there is no face in the infrared image, the liveness detection strategy corresponding to the first detection result includes: calling a screen filter to detect the infrared image.

[0059] In an embodiment of the present application, step S13, obtaining a liveness detection strategy corresponding to the first detection result, includes: when the first detection result is used to indicate the presence of a face in the infrared image, the liveness detection strategy corresponding to the first detection result includes: obtaining the face quality of the infrared image, and the alignment result of the target RGB image and the infrared image.

[0060] In the embodiment of the present application, different liveness detection strategies are adopted according to different first detection results, so as to ensure more accurate determination of whether there is a live face in the image.

[0061] Step S14: Perform live face detection based on the target RGB image and / or infrared image according to the detection operation indicated in the live detection strategy to obtain a live detection result.

[0062] In the embodiment of the present application, step S14, performing live face detection based on the target RGB image and / or infrared image according to the detection operation indicated in the liveness detection strategy to obtain a liveness detection result, includes the following steps A1-A4:

[0063] Step A1, when the first detection result is used to indicate that there is no face in the infrared image, obtain key face information in the target RGB image.

[0064] Step A2, calling the screen filter to crop the infrared image according to the key face information in the target RGB image to obtain an infrared partial image.

[0065] Step A3: extracting image features of the infrared partial image, and determining the image type of the infrared partial image according to the image features.

[0066] Step A4: when the image type is a face type, call the RGB liveness detector to perform liveness face detection on the target RGB image to obtain a liveness detection result.

[0067] In an embodiment of the present application, when the first detection result is used to indicate that there is no face in the infrared image, the face key information in the target RGB image is obtained according to the face detection algorithm, and the face key information includes: the coordinates of the face key points and the number of the face key points. Then, the infrared image is cropped according to the face key information through a screen filter to obtain an infrared partial image. Then, the infrared partial image is input into a preset detection model, and the preset detection model extracts the image features of the infrared partial image, and determines the image type of the infrared partial image based on the image features. When the image type belongs to the face type, the RGB liveness detector is called to perform live face detection on the target RGB image to obtain a liveness detection result.

[0068] In the embodiment of the present application, step S14, performing live face detection based on the target RGB image and / or infrared image according to the detection operation indicated in the liveness detection strategy to obtain a liveness detection result, includes the following steps B1-B3:

[0069] Step B1, when the first detection result is used to indicate that a face exists in the infrared image, obtain the face quality parameter of the infrared image and the alignment result of the target RGB image and the infrared image.

[0070] In the embodiment of the present application, when the first detection result is used to indicate that there is a face in the infrared image, a face quality parameter is determined based on the image features of the infrared image, and the face quality parameter may be a pixel value or a resolution of the infrared image. At the same time, the target RGB image and the infrared image are aligned according to the key points to obtain an alignment result.

[0071] Step B2: when the face quality parameter does not meet the preset quality parameter and / or the alignment result indicates that the alignment between the target RGB image and the infrared image fails, the image similarity between the target RGB image and the infrared image is calculated.

[0072] In the embodiment of the present application, step B2, calculating the image similarity between the target RGB image and the infrared image, includes the following steps B201-B203:

[0073] Step B201, obtaining a grayscale RGB image corresponding to the target RGB image obtained by converting the target RGB image.

[0074] Step B202, extracting a first facial feature from the grayscale RGB image, and extracting a second facial feature from the infrared image.

[0075] Step B203, calculating the feature similarity between the first facial feature and the second facial feature, and determining the feature similarity as the image similarity.

[0076] In the embodiment of the present application, if the face quality parameter does not meet the preset quality parameter (for example, the pixel value is less than the preset pixel value) and / or the alignment result indicates that the alignment between the target RGB image and the infrared image fails, the first face feature is extracted from the grayscale RGB image, and the second face feature is extracted from the infrared image, and then the similarity between the two features can be calculated using the Euclidean distance or the cosine distance. The final similarity is determined as the image similarity.

[0077] Step B3: when the image similarity is greater than or equal to a preset threshold, call the infrared liveness detector to perform live face detection on the infrared image to obtain a liveness detection result.

[0078] In an embodiment of the present application, the method further includes: when the image similarity is less than a preset threshold, determining that there is no living face in the target RGB image as a liveness detection result.

[0079] In an embodiment of the present application, preliminary results of live face detection can be obtained through face quality parameters and image alignment results. At the same time, in order to detect live faces more accurately, the similarity between the grayscale RGB image and the infrared image is calculated, which can further determine whether there is a live face in the target RGB image based on the preliminary results.

[0080] The method provided in the embodiment of the present application performs face detection on the infrared image associated with the RGB image, and executes different liveness detection strategies according to the detection results, so as to more accurately determine whether there is a live face in the RGB image in an outdoor environment. Compared with the existing technology, no additional accessories are needed, which reduces the detection cost. It has certain economical practicality and operability.

[0081] Figure 2 A flowchart of an image-based living body detection method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, after performing live face detection on the infrared image and obtaining the live detection result, the method further includes:

[0082] Step S21: when the liveness detection result is used to indicate that there is a live body in the infrared image, determining that there is a live face in the infrared image as the liveness detection result.

[0083] In an embodiment of the present application, when the liveness detection result is used to indicate the presence of a living body in an infrared image, a living face is displayed in both the target RGB image and the infrared image. Therefore, the presence of a living face in the infrared image can be directly determined as the liveness detection result.

[0084] Step S22, when the liveness detection result indicates that there is no liveness in the infrared image, the target RGB image is sent to the RGB liveness detector, so that the RGB liveness detector continues to perform liveness face detection on the target RGB image to obtain a liveness detection result.

[0085] In an embodiment of the present application, when the liveness detection result is used to indicate that there is no liveness in the infrared image, the target RGB image shows a live face, but the infrared image shows that there is no live face. Therefore, the RGB image is sent to the RGB liveness detector for secondary detection, effectively ensuring the accuracy of the final detection result.

[0086] Figure 3 This is a block diagram of an image-based living body detection device provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 3 As shown, the device comprises:

[0087] The acquisition module 31 is used to acquire a target RGB image to be subjected to live face detection, wherein the target RGB image carries a human face.

[0088] The detection module 32 is used to detect the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image.

[0089] The query module 33 is used to obtain the living body detection strategy corresponding to the first detection result.

[0090] The processing module 34 is used to perform live face detection based on the target RGB image and / or infrared image according to the detection operation indicated in the live detection strategy to obtain a live detection result.

[0091] In the embodiment of the present application, the query module 33 is used for, when the first detection result is used to indicate that there is no face in the infrared image, the living body detection strategy corresponding to the first detection result includes: calling a screen filter to detect the infrared image;

[0092] or,

[0093] In an embodiment of the present application, the query module 33 is used to, when the first detection result is used to indicate the presence of a face in the infrared image, the liveness detection strategy corresponding to the first detection result includes: obtaining the face quality of the infrared image, and the alignment result of the target RGB image and the infrared image.

[0094] In an embodiment of the present application, the processing module 34 is used to obtain key face information in the target RGB image when the first detection result indicates that there is no face in the infrared image; call the screen filter to crop the infrared image according to the key face information in the target RGB image to obtain an infrared partial image; extract image features of the infrared partial image, and determine the image type of the infrared partial image according to the image features; when the image type belongs to the face type, call the RGB liveness detector to perform live face detection on the target RGB image to obtain a liveness detection result.

[0095] In an embodiment of the present application, the processing module 34 is used to obtain the face quality parameter of the infrared image and the alignment result of the target RGB image and the infrared image when the first detection result is used to indicate that there is a face in the infrared image; when the face quality parameter does not meet the preset quality parameter and / or the alignment result is used to indicate that the alignment of the target RGB image and the infrared image fails, calculate the image similarity between the target RGB image and the infrared image; when the image similarity is greater than or equal to a preset threshold, call the infrared liveness detector to perform live face detection on the infrared image to obtain a liveness detection result.

[0096] In the embodiment of the present application, the processing module 34 is used to obtain the conversion of the target RGB image to obtain a grayscale RGB image corresponding to the target RGB image; extract the first facial feature from the grayscale RGB image, and extract the second facial feature from the infrared image; calculate the feature similarity between the first facial feature and the second facial feature, and determine the feature similarity as the image similarity.

[0097] In an embodiment of the present application, the image-based liveness detection device further includes: a determination module, configured to determine, when the image similarity is less than a preset threshold, that there is no live face in the target RGB image as a liveness detection result.

[0098] In an embodiment of the present application, the image-based liveness detection device also includes: a determination module and a processing module, which are used to determine the presence of a live face in the infrared image as a liveness detection result when the liveness detection result is used to indicate the presence of a live body in the infrared image; when the liveness detection result is used to indicate the absence of a live body in the infrared image, send the target RGB image to the RGB liveness detector, so that the RGB liveness detector continues to perform live face detection on the target RGB image to obtain a liveness detection result.

[0099] The present application also provides an electronic device, such as Figure 4 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0100] Memory 1503, used for storing computer programs;

[0101] The processor 1501 is used to implement the steps of the above embodiment when executing the computer program stored in the memory 1503.

[0102] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0103] The communication interface is used for communication between the above terminal and other devices.

[0104] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0105] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0106] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the image-based liveness detection method described in any of the above embodiments.

[0107] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the XXXX method described in any one of the above embodiments.

[0108] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk), etc.

[0109] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

[0110] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for detecting living things based on an image, characterized in that: include: Acquire a target RGB image for live face detection, wherein the target RGB image carries a human face; Detecting the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image; Obtaining a liveness detection strategy corresponding to the first detection result; Performing live face detection based on the target RGB image and / or the infrared image according to the detection operation indicated in the live detection strategy to obtain a live detection result; The acquiring the liveness detection strategy corresponding to the first detection result includes: In the case where the first detection result indicates that there is no human face in the infrared image, the living body detection strategy corresponding to the first detection result includes: calling a screen filter to detect the infrared image; or, In a case where the first detection result is used to indicate that a human face exists in the infrared image, the liveness detection strategy corresponding to the first detection result includes: obtaining the face quality of the infrared image and the alignment result of the target RGB image and the infrared image; The detection operation indicated in the liveness detection strategy performs liveness face detection based on the target RGB image and / or the infrared image to obtain a liveness detection result, including: When the first detection result indicates that there is no face in the infrared image, obtaining key face information in the target RGB image; Calling a screen filter to crop the infrared image according to key face information in the target RGB image to obtain an infrared partial image; Extracting image features of the infrared partial image, and determining the image type of the infrared partial image according to the image features; In the case that the image type is a face type, an RGB liveness detector is called to perform liveness face detection on the target RGB image to obtain the liveness detection result.

2. The method according to claim 1, characterized in that: The detection operation indicated in the liveness detection strategy performs liveness face detection based on the target RGB image and / or the infrared image to obtain a liveness detection result, including: When the first detection result indicates that a face exists in the infrared image, obtaining a face quality parameter of the infrared image and an alignment result between the target RGB image and the infrared image; When the face quality parameter does not meet the preset quality parameter and / or the alignment result indicates that the alignment between the target RGB image and the infrared image fails, calculating the image similarity between the target RGB image and the infrared image; When the image similarity is greater than or equal to a preset threshold, an infrared liveness detector is called to perform live face detection on the infrared image to obtain the liveness detection result.

3. The method according to claim 2, characterized in that The calculating the image similarity between the target RGB image and the infrared image includes: Obtaining a grayscale RGB image corresponding to the target RGB image obtained by converting the target RGB image; Extracting a first facial feature from the grayscale RGB image, and extracting a second facial feature from the infrared image; The feature similarity between the first facial feature and the second facial feature is calculated, and the feature similarity is determined as the image similarity.

4. The method according to claim 2, characterized in that: The method further comprises: When the image similarity is less than a preset threshold, the absence of a living face in the target RGB image is determined as the living body detection result.

5. The method according to claim 2, characterized in that: After performing live face detection on the infrared image to obtain the live detection result, the method further includes: In a case where the liveness detection result is used to indicate that a live body exists in the infrared image, determining that a live human face exists in the infrared image as the liveness detection result; When the liveness detection result indicates that there is no live body in the infrared image, the target RGB image is sent to the RGB liveness detector, so that the RGB liveness detector continues to perform live face detection on the target RGB image to obtain the liveness detection result.

6. An image-based living body detection device, characterized in that: include: An acquisition module is used to acquire a target RGB image to be subjected to live face detection, wherein the target RGB image carries a human face; A detection module, used to detect the infrared image associated with the target RGB image to obtain a first detection result, wherein the first detection result is used to indicate whether there is a face in the infrared image; A query module, used to obtain a liveness detection strategy corresponding to the first detection result; A processing module, configured to perform live face detection based on the target RGB image and / or the infrared image according to the detection operation indicated in the live detection strategy, and obtain a live detection result; The query module is used to: In the case where the first detection result indicates that there is no human face in the infrared image, the living body detection strategy corresponding to the first detection result includes: calling a screen filter to detect the infrared image; or, In a case where the first detection result is used to indicate that a human face exists in the infrared image, the liveness detection strategy corresponding to the first detection result includes: obtaining the face quality of the infrared image and the alignment result of the target RGB image and the infrared image; The processing module is used for: When the first detection result indicates that there is no face in the infrared image, obtaining key face information in the target RGB image; Calling a screen filter to crop the infrared image according to key face information in the target RGB image to obtain an infrared partial image; Extracting image features of the infrared partial image, and determining the image type of the infrared partial image according to the image features; In the case that the image type is a face type, an RGB liveness detector is called to perform liveness face detection on the target RGB image to obtain the liveness detection result.

7. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method steps of any one of claims 1 to 5 when executed.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the method steps of any one of claims 1 to 5 by running a program stored in a memory.

Citation Information

Patent Citations

  • Living body detection method and device applied to human face shielding scene

    CN111582238A