Face living body detection method and device, electronic equipment and storage medium

By using anchor box and interleaving filtering mechanism in the face live detection model, the detection process is optimized, and the problem of high computing resources consumption in the existing technology is solved, and the anti-counterfeiting attack performance and detection accuracy of the face recognition system are improved. .

CN119206834APending Publication Date: 2024-12-27TIANJIN YUGUANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411389122.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

When the existing facial live detection technology improves accuracy, the computing cost and resource consumption have increased significantly, resulting in insufficient anti-counterfeiting attack performance. It is necessary to improve system performance without increasing memory and computing resource consumption.

Method used

By inputting the detection image into the preset face live detection model, the anchor box is used to perform face detection and live data analysis, the target anchor box is selected, and secondary screening is performed based on the interleaving ratio, combining multiple anchors, Comprehensive judgment of live data in the dot box is made, and the detection process is optimized to improve robustness and anti-counterfeiting capabilities.

Benefits of technology

It realizes the anti-counterfeiting attack performance and detection accuracy of the face recognition system without increasing the consumption of computing resources, and improves the robustness of live detection and system response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206834A_ABST
    Figure CN119206834A_ABST
Patent Text Reader

Abstract

The invention discloses a human face living body detection method and device, electronic equipment and a storage medium, and relates to the technical field of image processing, and the disclosed human face living body detection method comprises the steps: inputting a detection image into a preset human face living body detection model, and obtaining human face detection data and human face living body data of each anchor point frame in the detection image; a first target anchor point frame is determined from the anchor point frames according to the face detection data, a target face detection result is determined according to the face detection data of the first target anchor point frame, and the target face detection result comprises the target face detection frame; according to a first intersection-to-union ratio between the target face detection frame and each anchor point frame, determining a second target anchor point frame from each anchor point frame; and determining a target face living body detection result according to the face living body data of the second target anchor point box. According to the invention, on the premise of not additionally increasing memory burden and computing resource consumption, the performance of the face recognition system in the aspect of anti-counterfeiting attack can be enhanced.
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 technology, and in particular to a method, device, electronic device and storage medium for detecting liveness of a face. Background Art

[0002] Face liveness detection technology is designed to verify the authenticity and biological activity of the user's identity. In view of the widespread popularity of face recognition technology and the continuous evolution of counterfeit technology, liveness detection technology is required to continuously upgrade its technical level and defense mechanism to resist higher-level counterfeit attacks that may occur in the future.

[0003] Current liveness detection focuses on multi-scale, multi-feature fusion and multi-modal fusion technologies. Although they have effectively improved the accuracy of liveness detection, they are also accompanied by a significant increase in computing costs, including an increase in algorithm complexity, resource consumption and response time.

[0004] In summary, how to enhance the performance of face recognition systems in anti-counterfeiting attacks without increasing memory burden and computing resource consumption has become a technical problem that needs to be solved urgently in this field. Summary of the invention

[0005] The main purpose of this application is to provide a face liveness detection method, device, electronic device and storage medium, aiming to enhance the performance of the face recognition system in anti-counterfeiting attacks without increasing the memory burden and computing resource consumption.

[0006] To achieve the above objectives, the present application proposes a method for detecting live faces, which includes:

[0007] Inputting the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image;

[0008] Determine a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determine a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame;

[0009] Determining a second target anchor point frame from each of the anchor point frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor point frames;

[0010] Determine the target face liveness detection result according to the face liveness data of the second target anchor point frame.

[0011] In one embodiment, before the step of inputting the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image, the step further includes:

[0012] Acquire a training data set, wherein the training data set includes a first image and a second image, the first image is annotated with a living body label, a face detection frame label, and a face key point position label, and the second image is annotated with a prosthesis label, a face detection frame label, and a face key point position label;

[0013] The initial neural network model is trained based on the training data set to obtain a trained face liveness detection model.

[0014] In one embodiment, the step of training the initial neural network model based on the training data set to obtain a trained face liveness detection model includes:

[0015] Generating each training anchor point frame on an input training image based on preset anchor point frame parameters, wherein the training image is the first image or the second image;

[0016] Calculating a second intersection-over-union ratio between each of the training anchor point frames and a training face detection frame of the training image, wherein the training face detection frame is determined based on the face detection frame label;

[0017] An effective training anchor point frame is determined in each of the training anchor point frames according to the second intersection-union ratio, and an initial neural network model is trained based on the effective training anchor point frame to obtain a trained face liveness detection model.

[0018] In one embodiment, the initial neural network model includes a living body detection branch, a face detection branch, and a face frame position detection branch;

[0019] The step of determining a valid training anchor point frame in each of the training anchor point frames according to the second intersection-to-union ratio, and training the initial neural network model based on the valid training anchor point frame to obtain a trained face liveness detection model includes:

[0020] Determine a training anchor point frame whose second intersection-over-union ratio is greater than a first preset threshold as a first valid training anchor point frame, and train the living body detection branch based on the first valid training anchor point frame;

[0021] Determine a training anchor point frame whose second intersection-over-union ratio is greater than a second preset threshold or less than a third preset threshold as a second valid training anchor point frame, and train the face detection branch based on the second valid training anchor point frame;

[0022] The training anchor point frame whose second intersection-over-union ratio is greater than a fourth preset threshold is determined as a third effective training anchor point frame, and the face frame position detection branch is trained based on the third effective training anchor point frame to obtain a trained face liveness detection model.

[0023] In one embodiment, the face detection data includes a face classification score and a face detection frame, and the step of determining a first target anchor point frame from each anchor point frame according to each face detection data includes:

[0024] Calculating a third intersection-over-union ratio between the face detection frames, and determining whether the face detection frames are repeated detection frames of the same face according to the third intersection-over-union ratio;

[0025] When each of the face detection frames is a repeated detection frame, selecting a first target anchor point frame with the highest face classification score from the anchor point frames corresponding to each of the face detection frames;

[0026] When there are detection frames of different faces in each of the face detection frames, first target anchor point frames are respectively determined for the different faces.

[0027] In one embodiment, the step of determining a second target anchor point frame from each of the anchor point frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor point frames comprises:

[0028] Calculating first intersection-over-union ratios between the target face detection frame and each of the anchor point frames in sequence;

[0029] An anchor point frame whose first intersection-over-union ratio is greater than a fifth preset threshold is determined as a second target anchor point frame.

[0030] In one embodiment, the step of determining the target face liveness detection result according to the face liveness data of the second target anchor point frame includes:

[0031] When the face liveness data in the second target anchor point frame are data of the same face, averaging the face liveness data to obtain target face liveness data;

[0032] When the facial liveness data of the second target anchor point frame is data of different faces, for a first face among the different faces, averaging the first facial liveness data to obtain target facial liveness data of the first face, wherein the first facial liveness data is the facial liveness data of the second target anchor point frame corresponding to the first face;

[0033] A target human face liveness detection result is determined according to the target human face liveness data.

[0034] In one embodiment, the step of determining a target face liveness detection result according to the target face liveness data includes:

[0035] Obtaining a face liveness score in the target face liveness data;

[0036] When the face liveness score exceeds a preset face liveness threshold, determining that the target face liveness detection result is liveness;

[0037] When the face liveness score does not exceed the face liveness threshold, it is determined that the target face liveness detection result is a fake.

[0038] In one embodiment, the step of determining the target face detection result according to the face detection data of the first target anchor point frame includes:

[0039] Obtaining a face classification score in the face detection data of the first target anchor point frame;

[0040] When the face classification score exceeds a preset face classification threshold, determining that the target face detection result is a normal face detection;

[0041] When the face classification score does not exceed the face classification threshold, it is determined that the target face detection result is that no face is detected.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a face liveness detection device, which includes:

[0043] A data generation module, used to input the detection image into a preset face liveness detection model to obtain face detection data and face liveness data for each anchor point frame in the detection image;

[0044] A face detection module, configured to determine a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determine a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame;

[0045] An anchor frame determination module, used to determine a second target anchor frame from each of the anchor frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor frames;

[0046] A face liveness detection module is used to determine a target face liveness detection result based on the face liveness data of the second target anchor point frame.

[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the face liveness detection method as described above.

[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the face liveness detection method as described above are implemented.

[0049] The present application proposes a face liveness detection method, which inputs a detection image into a preset face liveness detection model, which can identify face detection data and face liveness data in each anchor point frame area in the detection image, and then, by comprehensively analyzing the face detection data of each anchor point frame, screen out a first target anchor point frame, and determine a target face detection result based on the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame, and then, using a first intersection-and-union ratio between the target face detection frame and each anchor point frame as an evaluation criterion, select a second target anchor point frame that highly overlaps with the target face detection frame from each anchor point frame, and determine the target face liveness detection result based on the face liveness data of the second target anchor point frame.

[0050] In summary, the present application can quickly and accurately locate the faces in the detection image through the face detection and screening mechanism, and exclude non-faces or interference factors to ensure the accuracy of subsequent liveness detection. Then, the intersection and union ratio between the target face detection frame and the anchor point frame is used for secondary screening to avoid indiscriminate processing of the entire image, thereby effectively reducing the consumption of computing resources while ensuring the detection accuracy. At the same time, the liveness data of the faces of multiple related anchor points are combined for comprehensive judgment, which not only improves the robustness of liveness detection, but also effectively resists various anti-counterfeiting attack methods. In this way, the anti-counterfeiting attack performance of the face recognition system can be significantly improved by optimizing the detection process without increasing the additional memory burden and computing resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] 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.

[0052] 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 work.

[0053] Figure 1 A flowchart of the first embodiment of the face liveness detection method provided by the present applicant;

[0054] Figure 2 A schematic diagram of calculating the intersection-over-union ratio provided in Example 1 of the present applicant's method for liveness detection of human face;

[0055] Figure 3 A schematic diagram of a model application scenario provided in Example 2 of the present applicant's method for liveness detection of human face;

[0056] FIG. 4( a ) is a schematic diagram of a face detection frame annotation provided in Embodiment 3 of the face liveness detection method of the present application;

[0057] FIG4( b ) is a schematic diagram of the target face detection frame annotation provided in Example 3 of the face liveness detection method of the present application;

[0058] Figure 5 A schematic diagram of a detection image provided in Example 3 of the present applicant's method for detecting live faces;

[0059] Figure 6 This is a schematic diagram of the module structure of the face liveness detection device according to an embodiment of the present application;

[0060] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the face liveness detection method in the embodiment of the present application.

[0061] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0063] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0064] Current liveness detection focuses on multi-scale, multi-feature fusion and multi-modal fusion technologies. Although they have effectively improved the accuracy of liveness detection, they are also accompanied by a significant increase in computing costs, including an increase in algorithm complexity, resource consumption and response time.

[0065] An embodiment of the present application provides a solution, by inputting a detection image into a preset face liveness detection model, the model can identify the face detection data and face liveness data of each anchor point frame area in the detection image, and then, by comprehensively analyzing the face detection data of each anchor point frame, a first target anchor point frame is screened out, and a target face detection result is determined based on the face detection data of the first target anchor point frame, the target face detection result includes a target face detection frame, and then, using the first intersection-and-union ratio between the target face detection frame and each anchor point frame as an evaluation criterion, a second target anchor point frame that highly overlaps with the target face detection frame is selected from each anchor point frame, and the target face liveness detection result is determined based on the face liveness data of the second target anchor point frame.

[0066] In summary, it can be seen that the embodiment of the present application can quickly and accurately locate the face in the detection image through the face detection and screening mechanism, and exclude non-faces or interference factors, thereby ensuring the accuracy of subsequent liveness detection. Then, the intersection and union ratio between the target face detection frame and the anchor point frame is used for secondary screening, thereby avoiding indiscriminate processing of the entire image, thereby effectively reducing the consumption of computing resources while ensuring the detection accuracy. At the same time, a comprehensive judgment is made based on the face liveness data of multiple related anchor point frames, which not only improves the robustness of liveness detection, but also effectively resists various anti-counterfeiting attack methods. In this way, the anti-counterfeiting attack performance of the face recognition system can be significantly improved by optimizing the detection process without increasing the additional memory burden and computing resource consumption.

[0067] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a computer, a server, etc., or an electronic device capable of realizing the above functions, etc. The following takes a face liveness detection terminal as an example to illustrate this embodiment and the following embodiments.

[0068] Based on this, the present application embodiment provides a method for detecting liveness of a face, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the face liveness detection method of the present application.

[0069] In this embodiment, the face liveness detection method includes steps S10 to S40:

[0070] Step S10, inputting the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image;

[0071] It should be noted that the anchor box is a predefined reference box that may contain a target in target detection. It is used to preset areas in the image where targets may exist, so that subsequent target detection algorithms can perform more detailed processing and recognition of these areas. In target detection tasks, the category, number, location, and scale of targets are uncertain, and the anchor box provides a predefined way to help the algorithm find and recognize targets in these preset areas.

[0072] The detection image is input into the pre-trained face liveness detection model, which can handle both face detection and face liveness detection tasks. For each preset anchor box in the detection image, the model will obtain at least two categories of data: face detection data and face liveness data.

[0073] Among them, face detection data includes but is not limited to face classification score (the probability score indicating whether the anchor point box contains a face), face detection frame (a rectangular frame that accurately locates the face position) and optional face key points (such as the position coordinates of eyes, nose, mouth, etc.); face liveness data mainly refers to the face liveness score in the anchor point box, which is used to evaluate whether the face is a real face, rather than non-live forms such as photos and video playbacks.

[0074] In addition, in a feasible implementation, after obtaining the detection image, image preprocessing operations can be performed first, such as scaling it proportionally to the neural network input size (for example, 320x256), normalizing the image, subtracting the mean to remove the variance, normalizing the image pixel values ​​to between 0 and 1, etc., and then inputting the preprocessed detection image into the model for face liveness detection.

[0075] Step S20, determining a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determining a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame;

[0076] Based on the face detection data of each anchor point frame obtained, a first target anchor point frame is determined from each anchor point frame. The first target anchor point frame is preferably an anchor point frame with the highest face classification score. Then, a final target face detection result is determined based on the face detection data of the first target anchor point frame, that is, whether the detection image contains a face. When the target face detection result determines that the detection image contains a face, this result is presented in the form of marking the target face detection frame in the detection image. The result may also include information on facial key points.

[0077] Step S30, determining a second target anchor point frame from each of the anchor point frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor point frames;

[0078] It should be noted that the intersection over union (IOU) is an indicator to measure the degree of overlap between two regions, such as Figure 2 As shown, the intersection-to-union ratio may be a ratio of the intersection area of ​​two rectangular boxes (ie, BOX1 and BOX2 in the figure) to the union area of ​​the two rectangular boxes.

[0079] The intersection-over-union ratio between the determined target face detection frame and all anchor frames is calculated. By setting a threshold, the anchor frame whose IOU value with the target face detection frame reaches the threshold is screened out as the second target anchor frame. The second target anchor frame may contain an area similar to or identical to the target face.

[0080] Step S40: determining a target face liveness detection result according to the face liveness data of the second target anchor point frame.

[0081] Based on the face liveness data (mainly face liveness score) of the second target anchor point frame, a comprehensive analysis is performed to determine the final target face liveness detection result, that is, to determine whether the face in the detection image is real and alive.

[0082] In this way, in the embodiment of the present application, the face detection and screening mechanism can quickly and accurately locate the face in the detection image, and exclude non-faces or interference factors, thereby ensuring the accuracy of subsequent liveness detection. Then, the intersection and union ratio between the target face detection frame and the anchor point frame is used for secondary screening, thereby avoiding indiscriminate processing of the entire image, thereby effectively reducing the consumption of computing resources while ensuring detection accuracy. At the same time, a comprehensive judgment is made based on the face liveness data of multiple related anchor point frames, which not only improves the robustness of liveness detection, but also effectively resists various anti-counterfeiting attack methods. In this way, the anti-counterfeiting attack performance of the face recognition system can be significantly improved by optimizing the detection process without increasing the additional memory burden and computing resource consumption.

[0083] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 As shown, before step S10, steps A10 to A20 may also be included:

[0084] Step A10, obtaining a training data set, wherein the training data set includes a first image and a second image, the first image is annotated with a live body label, a face detection frame label, and a face key point position label, and the second image is annotated with a prosthesis label, a face detection frame label, and a face key point position label;

[0085] A training data set is collected, which includes two categories of images: first images and second images. The first images are labeled real face images. The labels marked on the real face images include live labels (indicating that the image is a real face), face detection frame labels (marking the specific location of the face), and face key point location labels (such as the coordinates of key parts such as eyes, nose, and mouth). The second images are also labeled non-live face images. The labels marked on the non-live face images include prosthesis labels (indicating that the image is not a real face), face detection frame labels, and face key point location labels. These labeled information provides supervision signals for model training.

[0086] Step A20: training the initial neural network model based on the training data set to obtain a trained face liveness detection model.

[0087] Based on the prepared training data set, the initial neural network model is trained to obtain a trained face liveness detection model. The initial neural network model can be a RetinaFace (single-stage dense face localization network) network structure, and a face liveness prediction branch is added to the RetinaFacehead (single-stage face detector) module of the model, or the model is replaced with a YOLO (YouOnlyLookOnce, an object detection algorithm based on a convolutional neural network) series detection algorithm or a FaceBox (face detector) and other detection algorithms.

[0088] In a feasible embodiment, step A20 may include steps A201 to A203:

[0089] Step A201, generating each training anchor point frame on an input training image based on preset anchor point frame parameters, wherein the training image is the first image or the second image;

[0090] On the input training image (whether it is the first image or the second image), multiple training anchor boxes are generated according to preset anchor box parameters (such as size, aspect ratio, etc.). These training anchor boxes cover the areas in the training image that may contain faces, providing a basis for the subsequent training process.

[0091] Step A202, calculating a second intersection-over-union ratio of each of the training anchor point frames and a training face detection frame of the training image, wherein the training face detection frame is determined based on the face detection frame label;

[0092] Step A203, determining a valid training anchor point frame in each of the training anchor point frames according to the second intersection-union ratio, and training the initial neural network model based on the valid training anchor point frame to obtain a trained face liveness detection model.

[0093] The second intersection-over-union ratio between each training anchor point frame and the real face detection frame determined based on the face detection frame label in the training image is calculated. Then, according to the calculated second intersection-over-union ratio, a valid training anchor point frame is determined in each training anchor point frame, and the initial neural network model is trained based on the valid training anchor point frame to obtain a trained face liveness detection model.

[0094] In a feasible embodiment, the initial neural network model includes a living body detection branch, a face detection branch and a face frame position detection branch; step A203 may include steps A2011 to A2033:

[0095] Step A2031, determining a training anchor point frame whose second intersection-over-union ratio is greater than a first preset threshold as a first valid training anchor point frame, and training the living body detection branch based on the first valid training anchor point frame;

[0096] According to the calculated second intersection-over-union ratio, different types of effective training anchor boxes are screened out under different threshold conditions and used to train different branches of the initial neural network model respectively.

[0097] For the liveness detection branch of the model, the training anchor point frame whose second intersection-over-union ratio is greater than the first preset threshold (such as 0.01) is determined as the first effective training anchor point frame, and the liveness detection branch is trained based on the first effective training anchor point frame and its corresponding label (liveness label or prosthesis label), so that the model can learn to distinguish the features of real faces from prosthetic faces.

[0098] It should also be noted that the thresholds used in this embodiment are all dynamic thresholds, which can be adaptively adjusted according to factors such as the size and shape of the detection frame to improve the recognition ability of detection in different scenes.

[0099] Step A2032, determining a training anchor point frame whose second IoU ratio is greater than a second preset threshold or less than a third preset threshold as a second valid training anchor point frame, and training the face detection branch based on the second valid training anchor point frame;

[0100] For the face detection branch of the model, the training anchor frame whose second intersection-over-union ratio is greater than the second preset threshold (such as 0.35) or less than the third preset threshold (such as 0.2) is determined as the second effective training anchor frame, wherein the anchor frame whose second intersection-over-union ratio is greater than the second preset threshold has different degrees of overlap with the real face detection frame, but may not completely match, and can be used as a positive sample for training, and the anchor frame whose second intersection-over-union ratio is less than the second preset threshold has a small overlap area with the real face detection frame or no overlap, and can be used as a negative sample for training. The face detection branch is trained based on these second effective training anchor frames and their corresponding face detection frame labels to improve the accuracy of the model in detecting faces.

[0101] Step A2033, determining the training anchor point frame whose second intersection-over-union ratio is greater than the fourth preset threshold as the third effective training anchor point frame, and training the face frame position detection branch based on the third effective training anchor point frame to obtain a trained face liveness detection model.

[0102] For the face frame position detection branch of the model, the training anchor frame whose second intersection-over-union ratio is greater than the fourth preset threshold (such as 0.2) is determined as the third effective training anchor frame. These anchor frames highly overlap with the real face detection frame and are therefore more suitable for training the face frame position detection branch, so that the model can learn more accurate face position information. At the same time, to avoid prosthesis confusion, the prosthesis face detection frame label does not participate in the face frame position detection branch training process.

[0103] Finally, through the above training process, a trained face liveness detection model is obtained, which has the ability to perform face detection and liveness detection at the same time, providing reliable support for subsequent face recognition tasks.

[0104] In addition, in a feasible implementation, model training may also include a facial key point recognition training process, so that the model can learn more accurate facial key point location information, thereby improving the accuracy and robustness of key point recognition.

[0105] For example, in a feasible implementation, the application scenario of the trained face liveness detection model is as follows: Figure 3 As shown, an image to be detected is obtained, which can be an image captured in real time or an image provided in advance. Then, features are extracted from the image through a feature extraction module (backbone) for subsequent face liveness detection. Then, the features extracted from different branches of the model are fused to form a comprehensive feature representation to improve the accuracy of liveness detection. The model may include two parts: face detection and face liveness detection, wherein face detection can be divided into a face score prediction branch, a face detection frame prediction branch, and a face key point prediction branch. The face score prediction branch obtains a numerical score representing the confidence of face detection, that is, a face classification score. The face detection frame position prediction branch can obtain the face position area in the image. The face key point prediction branch is an optional module. The face key point prediction branch can obtain the key points of the face in the image, such as eyes, nose, etc. Face liveness detection includes a face liveness prediction branch, which can obtain a numerical score representing the confidence of face liveness, that is, a face liveness score.

[0106] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment and the second embodiment can be referred to the above description, and will not be described in detail later. On this basis, the face detection data includes a face classification score and a face detection frame, and the step of "determining a first target anchor point frame from each anchor point frame according to each face detection data" in step S20 may include steps S201 to S203:

[0107] Step S201, calculating a third intersection-over-union ratio between the face detection frames, and determining whether the face detection frames are repeated detection frames of the same face according to the third intersection-over-union ratio;

[0108] By calculating the third intersection-over-union ratio between all face detection frames detected by each anchor point frame, we can determine which face detection frames are repeated detections of the same face. Specifically, when the IOU value of two detection frames is greater than a certain threshold (such as 0.4), they are considered to be repeated detection frames of the same face.

[0109] Step S202, when each of the face detection frames is a repeated detection frame, selecting a first target anchor point frame with the highest face classification score from the anchor point frames corresponding to each of the face detection frames;

[0110] For the identified duplicate detection frames, the one with the highest face classification score is selected from their respective corresponding anchor frames as the first target anchor frame. In this way, it can be ensured that when multiple face detection frames overlap, the anchor frame that is most likely to contain the real face and has the highest detection quality is selected.

[0111] In one embodiment, an anchor point frame with the largest face size is selected from the anchor point frames corresponding to the face detection frames as the first target anchor point frame with the highest face classification score.

[0112] Step S203: when there are detection frames of different faces in the face detection frames, first target anchor point frames are respectively determined for the different faces.

[0113] If there are detection frames belonging to different faces in the detected face detection frames, a screening process is performed on these different faces respectively, that is, the first target anchor point frame corresponding to each independent face is determined respectively.

[0114] For example, in order to solve the problem of repeated detection in the target detection process, that is, for the same face, the original face detection algorithm may predict multiple overlapping or similar face detection frames. Through NMS (Non-Maximum Suppression), it can be ensured that only one most accurate target face detection frame is retained for the same face, thereby reducing false alarms and repeated detections and improving the accuracy of target detection. As shown in Figure 4 (a), the figure shows the original face detection frame output by the face detection algorithm. The anchor positions around the face will output face detection frames with relatively high scores. After non-maximum suppression, the face detection frame with the highest score is retained, that is, Figure 4 (b) is obtained, in which the face detection frame is the target face detection frame corresponding to the first target anchor frame. It is worth noting that when calculating the liveness detection result, the liveness scores of the anchor positions around the face are involved in the mean calculation, and the final face liveness detection score is output.

[0115] In addition, in a feasible implementation, if the number of detected faces is very large and dense, a face clustering algorithm (such as clustering based on feature similarity) is used to assist in grouping to improve processing efficiency and accuracy.

[0116] In a feasible embodiment, step S30 may include steps S301 to S302:

[0117] Step S301, sequentially calculating the first intersection-over-union ratios between the target face detection frame and each of the anchor point frames;

[0118] After determining the first target anchor box, the first intersection-over-union ratio between the target face detection box (i.e., the face detection box corresponding to the first target anchor box) and all other anchor boxes in the detection image is calculated in sequence. This step is to find anchor boxes with a high degree of overlap with the target face detection box. These anchor boxes may contain useful information about the target face.

[0119] Step S302: determine the anchor point frame whose first intersection-over-union ratio is greater than a fifth preset threshold as the second target anchor point frame.

[0120] The anchor point frames whose first intersection-over-union ratio is greater than the fifth preset threshold (such as 0.05) are determined as second target anchor point frames. These second target anchor point frames highly overlap with the target face detection frame and may contain more feature information, which helps to improve the accuracy of subsequent liveness detection.

[0121] For example, Figure 5 As shown in the figure, a detection image of a determined target face detection frame is shown, the dotted frame represents each anchor frame in the detection image, the point in the center of the anchor frame represents the anchor position, and the solid frame represents the three determined target face detection frames. When the intersection and union ratio (i.e., the first intersection and union ratio) of the anchor frame and any one of the three target face detection frames exceeds the fifth preset threshold, the anchor frame is determined as the second target anchor frame. At the same time, since the receptive field of the face detection algorithm is much larger than the size of the anchor frame, this means that the anchor features near the face can receive feature information of areas outside the face.

[0122] In a feasible embodiment, step S40 may include steps S401 to S403:

[0123] Step S401, when the face liveness data of the second target anchor point frame are data of the same face, averaging the face liveness data to obtain target face liveness data;

[0124] If the live face data of multiple second target anchor point frames all belong to the same face, the live face data of the target face is obtained by taking the average of these live face data, thereby smoothing out the noise of individual data points and improving the stability of detection.

[0125] Step S402, when the facial liveness data of the second target anchor point frame is data of different faces, for a first face among the different faces, averaging the first facial liveness data to obtain target facial liveness data of the first face, wherein the first facial liveness data is facial liveness data of the second target anchor point frame corresponding to the first face;

[0126] If the facial liveness data of the second target anchor point frame belongs to different faces, each face is processed separately. Taking the first face as an example, the facial liveness data of all the second target anchor point frames corresponding to it (i.e., the first face liveness data) is averaged to obtain the target facial liveness data of the first face, so as to ensure that each face in the detection image can obtain an independent and accurate liveness detection result.

[0127] Step S403: determining a target face liveness detection result according to the target face liveness data.

[0128] The liveness detection result of the target face is determined based on the liveness data of the target face to judge whether the face is real or fake.

[0129] In a feasible embodiment, step S403 may include steps S4031 to S4033:

[0130] Step S4031, obtaining a face liveness score in the target face liveness data;

[0131] Step S4032, when the face liveness score exceeds a preset face liveness threshold, determining that the target face liveness detection result is liveness;

[0132] Step S4033: When the face liveness score does not exceed the face liveness threshold, determine that the target face liveness detection result is a fake.

[0133] A numerical score representing the possibility of face liveness, i.e., face liveness score, is extracted from the target face liveness data, and the extracted face liveness score is compared with a preset face liveness threshold. If the face liveness score exceeds the threshold, it means that the target face has a high possibility of being alive, and the target face liveness detection result is determined to be "live", indicating that a real face is detected; conversely, if the face liveness score does not exceed the threshold, the target face liveness detection result is determined to be "fake", indicating that the detected face may be forged or not real.

[0134] In a feasible embodiment, the step of "determining a target face detection result according to the face detection data of the first target anchor point frame" in step S20 may include steps S204 to S206:

[0135] Step S204, obtaining a face classification score in the face detection data of the first target anchor point frame;

[0136] Step S205, when the face classification score exceeds a preset face classification threshold, determining that the target face detection result is a normal face detection result;

[0137] Step S206, when the face classification score does not exceed the face classification threshold, determining the target face detection result as no face is detected.

[0138] From the face detection data of the first target anchor point frame, a numerical score representing the confidence of face detection, i.e., a face classification score, is obtained. The score is used to measure whether the detected object is a face and its confidence. Then, the obtained face classification score is compared with a preset face classification threshold. If the face classification score exceeds the threshold, it means that the detected object is very likely to be a face. Then, the target face detection result is determined to be "normal face detection", indicating that the face is successfully detected. Conversely, if the face classification score does not exceed the threshold, the target face detection result is determined to be "no face detected", indicating that the detected object may not be a face or the face detection algorithm fails to successfully detect the face.

[0139] It should also be noted that the thresholds used in this embodiment are dynamic thresholds, which can be adaptively adjusted according to a large amount of experimental data or actual application scenarios to improve the recognition capabilities of face detection and face liveness detection in different scenarios.

[0140] In summary, by adopting a face detection algorithm with a sufficiently large receptive field, this embodiment effectively utilizes information outside the face area, significantly improves the anti-attack capability of liveness detection, and can more accurately identify the difference between real faces and forged faces. At the same time, a liveness judgment branch is cleverly added to the face detection algorithm, which hardly adds additional storage and computing power, maintains the efficiency of the algorithm, enables the overall detection process to be completed quickly, effectively shortens the liveness detection time, and can quickly return accurate liveness detection results, thereby improving the user experience and system response speed, and meeting the needs of application scenarios with high real-time requirements.

[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the face liveness detection method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0142] The present application also provides a face liveness detection device, please refer to Figure 6 , the face liveness detection device comprises:

[0143] A data generation module 10 is used to input the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image;

[0144] A face detection module 20, configured to determine a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determine a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame;

[0145] An anchor frame determination module 30, configured to determine a second target anchor frame from each of the anchor frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor frames;

[0146] The face liveness detection module 40 is used to determine the target face liveness detection result according to the face liveness data of the second target anchor point frame.

[0147] Optionally, the face liveness detection device further includes a model training module (not shown), and the model training module is used to:

[0148] Acquire a training data set, wherein the training data set includes a first image and a second image, the first image is annotated with a living body label, a face detection frame label, and a face key point position label, and the second image is annotated with a prosthesis label, a face detection frame label, and a face key point position label;

[0149] The initial neural network model is trained based on the training data set to obtain a trained face liveness detection model.

[0150] Optionally, the model training module is also used to:

[0151] Generating each training anchor point frame on an input training image based on preset anchor point frame parameters, wherein the training image is the first image or the second image;

[0152] Calculating a second intersection-over-union ratio between each of the training anchor point frames and a training face detection frame of the training image, wherein the training face detection frame is determined based on the face detection frame label;

[0153] An effective training anchor point frame is determined in each of the training anchor point frames according to the second intersection-union ratio, and an initial neural network model is trained based on the effective training anchor point frame to obtain a trained face liveness detection model.

[0154] Optionally, the initial neural network model includes a living body detection branch, a face detection branch and a face frame position detection branch; the model training module is further used to:

[0155] Determine a training anchor point frame whose second intersection-over-union ratio is greater than a first preset threshold as a first valid training anchor point frame, and train the living body detection branch based on the first valid training anchor point frame;

[0156] Determine a training anchor point frame whose second intersection-over-union ratio is greater than a second preset threshold or less than a third preset threshold as a second valid training anchor point frame, and train the face detection branch based on the second valid training anchor point frame;

[0157] The training anchor point frame whose second intersection-over-union ratio is greater than a fourth preset threshold is determined as a third effective training anchor point frame, and the face frame position detection branch is trained based on the third effective training anchor point frame to obtain a trained face liveness detection model.

[0158] Optionally, the face detection module 20 is further used for:

[0159] Calculating a third intersection-over-union ratio between the face detection frames, and determining whether the face detection frames are repeated detection frames of the same face according to the third intersection-over-union ratio;

[0160] When each of the face detection frames is a repeated detection frame, selecting a first target anchor point frame with the highest face classification score from the anchor point frames corresponding to each of the face detection frames;

[0161] When there are detection frames of different faces in each of the face detection frames, first target anchor point frames are respectively determined for the different faces.

[0162] Optionally, the anchor box determination module 30 is further configured to:

[0163] Calculating first intersection-over-union ratios between the target face detection frame and each of the anchor point frames in sequence;

[0164] An anchor point frame whose first intersection-over-union ratio is greater than a fifth preset threshold is determined as a second target anchor point frame.

[0165] Optionally, the face liveness detection module 40 is further used for:

[0166] When the face liveness data in the second target anchor point frame are data of the same face, averaging the face liveness data to obtain target face liveness data;

[0167] When the facial liveness data of the second target anchor point frame is data of different faces, for a first face among the different faces, averaging the first facial liveness data to obtain target facial liveness data of the first face, wherein the first facial liveness data is the facial liveness data of the second target anchor point frame corresponding to the first face;

[0168] A target human face liveness detection result is determined according to the target human face liveness data.

[0169] Optionally, the face liveness detection module 40 is further used for:

[0170] Obtaining a face liveness score in the target face liveness data;

[0171] When the face liveness score exceeds a preset face liveness threshold, determining that the target face liveness detection result is liveness;

[0172] When the face liveness score does not exceed the face liveness threshold, it is determined that the target face liveness detection result is a fake.

[0173] Optionally, the face detection module 20 is further used for:

[0174] Obtaining a face classification score in the face detection data of the first target anchor point frame;

[0175] When the face classification score exceeds a preset face classification threshold, determining that the target face detection result is a normal face detection;

[0176] When the face classification score does not exceed the face classification threshold, it is determined that the target face detection result is that no face is detected.

[0177] The face liveness detection device provided in the embodiment of the present application adopts the face liveness detection method in the above embodiment, and can enhance the performance of the face recognition system in anti-counterfeiting attacks without adding extra memory burden and computing resource consumption. Compared with the prior art, the beneficial effects of the face liveness detection device provided in the embodiment of the present application are the same as the beneficial effects of the face liveness detection method provided in the above embodiment, and other technical features in the face liveness detection device are the same as the features disclosed in the face liveness detection method in the above embodiment, which will not be repeated here.

[0178] An embodiment of the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the face liveness detection method in the above-mentioned embodiment 1.

[0179] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to mobile terminals such as laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0180] like Figure 7As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0181] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0182] The electronic device provided in the embodiment of the present application adopts the face liveness detection method in the above embodiment, which can enhance the performance of the face recognition system in anti-counterfeiting attacks without adding extra memory burden and computing resource consumption. Compared with the prior art, the beneficial effects of the electronic device provided in the embodiment of the present application are the same as the beneficial effects of the face liveness detection method provided in the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the face liveness detection method in the previous embodiment, which will not be repeated here.

[0183] It should be understood that the various parts disclosed in the embodiments of the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0184] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0185] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the face liveness detection method in the above-mentioned embodiment.

[0186] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0187] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0188] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: inputs a detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image; determines a first target anchor point frame from each anchor point frame according to each face detection data, and determines a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame; determines a second target anchor point frame from each anchor point frame according to a first intersection-and-union ratio between the target face detection frame and each anchor point frame; and determines a target face liveness detection result according to the face liveness data of the second target anchor point frame.

[0189] The computer program code for performing the operation of the embodiment of the present application can be written in one or more programming languages ​​or a combination thereof, and the above-mentioned programming languages ​​include object-oriented programming languages, such as Java, Smalltalk, C++, and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN: Local Area Network) or a wide area network (WAN: Wide Area Network), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0190] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0191] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0192] The readable storage medium provided in the embodiment of the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned face liveness detection method, and can enhance the performance of the face recognition system in anti-counterfeiting attacks without adding additional memory burden and computing resource consumption. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present application are the same as the beneficial effects of the face liveness detection method provided in the above-mentioned embodiment, and will not be repeated here.

[0193] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for detecting liveness of a face, characterized in that: The human face liveness detection method comprises: Input the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image; Determine a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determine a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame; Determining a second target anchor point frame from each of the anchor point frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor point frames; Determine the target face liveness detection result according to the face liveness data of the second target anchor point frame.

2. The method for face liveness detection according to claim 1, characterized in that: Before the step of inputting the detection image into a preset face liveness detection model to obtain face detection data and face liveness data of each anchor point frame in the detection image, the method further includes: Acquire a training data set, wherein the training data set includes a first image and a second image, the first image is annotated with a living body label, a face detection frame label, and a face key point position label, and the second image is annotated with a prosthesis label, a face detection frame label, and a face key point position label; The initial neural network model is trained based on the training data set to obtain a trained face liveness detection model.

3. The method for face liveness detection according to claim 2, characterized in that: The step of training the initial neural network model based on the training data set to obtain a trained face liveness detection model includes: Generating each training anchor point frame on an input training image based on preset anchor point frame parameters, wherein the training image is the first image or the second image; Calculating a second intersection-over-union ratio between each of the training anchor point frames and a training face detection frame of the training image, wherein the training face detection frame is determined based on the face detection frame label; An effective training anchor point frame is determined in each of the training anchor point frames according to the second intersection-union ratio, and an initial neural network model is trained based on the effective training anchor point frame to obtain a trained face liveness detection model.

4. The method for face liveness detection according to claim 3, characterized in that: The initial neural network model includes a living body detection branch, a face detection branch and a face frame position detection branch; The step of determining a valid training anchor point frame in each of the training anchor point frames according to the second intersection-to-union ratio, and training the initial neural network model based on the valid training anchor point frame to obtain a trained face liveness detection model includes: Determine a training anchor point frame whose second intersection-over-union ratio is greater than a first preset threshold as a first valid training anchor point frame, and train the living body detection branch based on the first valid training anchor point frame; Determine a training anchor point frame whose second intersection-over-union ratio is greater than a second preset threshold or less than a third preset threshold as a second valid training anchor point frame, and train the face detection branch based on the second valid training anchor point frame; The training anchor point frame whose second intersection-over-union ratio is greater than a fourth preset threshold is determined as a third effective training anchor point frame, and the face frame position detection branch is trained based on the third effective training anchor point frame to obtain a trained face liveness detection model.

5. The method for face liveness detection according to claim 1, wherein: The face detection data includes a face classification score and a face detection frame, and the step of determining a first target anchor point frame from each anchor point frame according to each face detection data includes: Calculating a third intersection-over-union ratio between the face detection frames, and determining whether the face detection frames are repeated detection frames of the same face according to the third intersection-over-union ratio; When each of the face detection frames is a repeated detection frame, selecting a first target anchor point frame with the highest face classification score from the anchor point frames corresponding to each of the face detection frames; When there are detection frames of different faces in each of the face detection frames, first target anchor point frames are respectively determined for the different faces.

6. The method for face liveness detection according to claim 1, characterized in that: The step of determining a second target anchor point frame from each of the anchor point frames according to a first intersection-and-union ratio between the target face detection frame and each of the anchor point frames comprises: Calculating first intersection-over-union ratios between the target face detection frame and each of the anchor point frames in sequence; An anchor point frame whose first intersection-over-union ratio is greater than a fifth preset threshold is determined as a second target anchor point frame.

7. The method for detecting liveness of a face according to claim 1, wherein: The step of determining the target face liveness detection result according to the face liveness data of the second target anchor point frame comprises: When the face liveness data in the second target anchor point frame are data of the same face, averaging the face liveness data to obtain target face liveness data; When the facial liveness data of the second target anchor point frame is data of different faces, for a first face among the different faces, averaging the first facial liveness data to obtain target facial liveness data of the first face, wherein the first facial liveness data is the facial liveness data of the second target anchor point frame corresponding to the first face; A target human face liveness detection result is determined according to the target human face liveness data.

8. The method for face liveness detection according to claim 7, characterized in that: The step of determining the target face liveness detection result according to the target face liveness data comprises: Obtaining a face liveness score in the target face liveness data; When the face liveness score exceeds a preset face liveness threshold, determining that the target face liveness detection result is liveness; When the face liveness score does not exceed the face liveness threshold, it is determined that the target face liveness detection result is a fake.

9. The method for face liveness detection according to claim 1, characterized in that: The step of determining the target face detection result according to the face detection data of the first target anchor point frame comprises: Obtaining a face classification score in the face detection data of the first target anchor point frame; When the face classification score exceeds a preset face classification threshold, determining that the target face detection result is a normal face detection; When the face classification score does not exceed the face classification threshold, it is determined that the target face detection result is that no face is detected.

10. A face liveness detection device, characterized in that: The device comprises: A data generation module, used to input the detection image into a preset face liveness detection model to obtain face detection data and face liveness data for each anchor point frame in the detection image; A face detection module, configured to determine a first target anchor point frame from each of the anchor point frames according to each of the face detection data, and determine a target face detection result according to the face detection data of the first target anchor point frame, wherein the target face detection result includes a target face detection frame; An anchor frame determination module, used to determine a second target anchor frame from each of the anchor frames according to a first intersection-over-union ratio between the target face detection frame and each of the anchor frames; A face liveness detection module is used to determine a target face liveness detection result based on the face liveness data of the second target anchor point frame.

11. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for liveness detection of a face as claimed in any one of claims 1 to 9.

12. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the face liveness detection method according to any one of claims 1 to 9 are implemented.