Human face liveness detection method, device and equipment

By extracting local area of ​​the face and a grayscale feature analysis of infrared images, combined with the pre-trained live detection model, the problem of degradation of detection accuracy when partial areas of the face are blocked is solved, and high-accurate live detection of face is achieved.

CN112329720BActive Publication Date: 2025-04-08HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011349369.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-26
Publication Date
2025-04-08
Estimated Expiration
2040-11-26

AI Technical Summary

Technical Problem

When existing facial live detection methods are blocked, the detection accuracy decreases, making it difficult to effectively identify living bodies and prostheses.

Method used

By obtaining infrared images of the object to be detected, local areas of the face (such as the eyes and mouth), their grayscale characteristics are determined, and the pre-trained live detection model is used for detection.

Benefits of technology

Accurate and effective live detection based on local features of the face is realized, and the accuracy of the detection results is improved, especially when some areas of the face are blocked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112329720B_ABST
    Figure CN112329720B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method, device and equipment for face liveness detection, wherein the method comprises: obtaining an infrared image of an object to be detected; extracting a local face area of ​​the acquired infrared image to obtain a target face local area image; determining the grayscale features of the target face local area image, performing liveness detection processing based on the determined grayscale features and a pre-trained liveness detection model, and obtaining a face liveness detection result of the object to be detected. The embodiment of the present application implements liveness detection based on local face features, avoiding problems such as decreased accuracy of liveness detection results caused by partial occlusion of the face.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of biometric identification technology, and in particular to a method, device and equipment for detecting liveness of a human face. Background Art

[0002] Liveness detection is not unfamiliar to people. It is to prevent some users from maliciously using forged biometric features of others for identity authentication, such as using stolen photos, videos recorded online, and made-up prosthetic masks. In the current liveness detection process, detection is usually based on the overall features of the face. When the mask or scarf of the detected user is not completely removed or due to other factors, causing the face to be partially blocked, the accuracy of the detection will decrease. Therefore, it is particularly important to implement liveness detection based on local features of the face. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, device and equipment for face liveness detection, so as to realize liveness detection based on the local area of ​​the face.

[0004] To solve the above technical problems, the embodiments of the present application are implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for detecting a live face, comprising:

[0006] Acquire an infrared image of the object to be detected;

[0007] Performing facial local area extraction processing on the infrared image to obtain a target facial local area image;

[0008] Determining the grayscale features of the local area image of the target face;

[0009] Liveness detection processing is performed according to the grayscale features and a pre-trained liveness detection model to obtain a liveness detection result of the face of the object to be detected.

[0010] In a second aspect, an embodiment of the present application provides a face liveness detection device, comprising:

[0011] An image sensor, used to obtain an infrared image of the object to be detected;

[0012] The processor is used to extract the local area of ​​the face of the infrared image to obtain the local area image of the target face; determine the grayscale features of the local area image of the target face; perform detection processing based on the grayscale features and a pre-trained liveness detection model to obtain the liveness detection result of the face of the object to be detected.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising: 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 bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the above-mentioned face liveness detection method.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned face liveness detection method are implemented.

[0015] In the embodiment of the present application, the local face region of the infrared image of the object to be detected is extracted to obtain the local face region image of the target human face; and the liveness detection is performed based on the grayscale features of the local face region image of the target human face and the pre-trained liveness detection model to determine whether the object to be detected is a live human face. Thus, accurate and effective liveness detection is achieved based on the local features of the human face, effectively solving the problem of reduced accuracy of the detection result caused by partial occlusion of the human face region. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] 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, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0017] Figure 1 A first flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the eye regions of a living body and a prosthesis in an infrared image provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of the mouth area of ​​a living body and a prosthesis in an infrared image provided in an embodiment of the present application;

[0020] Figure 4 A second flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0021] Figure 5 A third flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0022] Figure 6 A fourth flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0023] Figure 7 A fifth flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0024] Figure 8 A sixth flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0025] Fig. 9 A seventh flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0026] Fig.10 An eighth flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0027] Fig.11 A ninth flow chart of a method for face liveness detection provided in an embodiment of the present application;

[0028] Fig.12 A tenth flow chart of a method for detecting live faces provided in an embodiment of the present application;

[0029] Fig.13 A schematic diagram of the module composition of a face liveness detection device provided in an embodiment of the present application;

[0030] Fig.14 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0032] Figure 1 A flowchart of a face liveness detection method is provided for one or more embodiments of the present application, see Figure 1 , the method may specifically include the following steps:

[0033] Step 102, obtaining an infrared image of the object to be detected;

[0034] The face liveness detection method provided in the embodiment of the present application can be applied to a face liveness detection device, which includes an image sensor, such as a 2-megapixel image sensor. The face liveness detection device can be applied to various scenarios where liveness detection is required, such as access control systems, attendance systems, and security systems. When it is necessary to determine whether the object to be detected is alive, the face detection device collects an infrared image of the object to be detected.

[0035] It should be pointed out that considering that the face image in the infrared image corresponding to the infrared light band is less affected by external light, has stable features, and has obvious information in local areas such as eyes and mouth, the infrared image in the infrared light band is used for face liveness detection in the embodiment of the present application. In actual applications, the acquisition band of the infrared image can be a band between 850nm-1200nm.

[0036] Step 104, extracting the local face area of ​​the acquired infrared image to obtain a local face area image of the target face;

[0037] In order to better understand the difference between the local areas of the human face in the infrared images of the living body and the prosthesis, the present application embodiment takes the living body, the paper photo prosthesis, and the silicone prosthesis as examples for illustrative explanation. Figure 2 , where a is the eye region image in the infrared image of the living body, b is the eye region image in the infrared image of the paper photo prosthesis, and c is the eye region in the infrared image of the silicone prosthesis. Figure 2 It can be seen that for a living body, the pupil, iris and sclera of the eye can be clearly distinguished. For a paper photo prosthesis, the eye has only two parts, black and white, and the pupil and iris cannot be distinguished, and the grayscale distribution of the eye is quite different from that of a living eye. For a silicone prosthesis, although the pupil, iris and sclera can be distinguished, the grayscale distribution of the eye is significantly different from that of a living eye. It can be seen that there are obvious differences between the eye area of ​​a living body and a prosthesis in the infrared image. In actual applications, the applicant found that not only the eye area is significantly different, but the mouth area is also different. Taking a living body and a silicone prosthesis as an example for illustrative explanation, see. Figure 3 , where e is the mouth area image in the infrared image of the living body, and f is the mouth area in the infrared image of the silicone prosthesis. Figure 3It can be seen that the grayscale of the mouth of a living person and the surrounding face can be clearly divided, the mouth is darker and the surrounding face is brighter; while the silicone prosthesis is the opposite, the mouth is much brighter than the surrounding face. Although this is related to the reflective properties of the silicone material and the coating, repeated experiments on silicone prostheses of different materials and with different reflective properties have proved that the grayscale difference is sufficient for liveness detection. Based on this, in the embodiment of the present application, the eye area image and the mouth area image are extracted and processed from the acquired infrared image, and the obtained eye area image and mouth area image are determined as the local area image of the target face.

[0038] Step 106, determining the grayscale features of the local area image of the target face;

[0039] Specifically, a grayscale histogram of the local area image of the target face is drawn, and the grayscale features of the local area image of the target face are determined based on the drawn grayscale histogram.

[0040] Step 108, performing liveness detection processing according to the determined grayscale features and the pre-trained liveness detection model to obtain a liveness detection result of the face of the object to be detected.

[0041] Specifically, the determined grayscale features are input into a pre-trained liveness detection model for liveness detection processing to obtain a liveness detection result of the face of the object to be detected.

[0042] In the embodiment of the present application, the local face region of the infrared image of the object to be detected is extracted to obtain the local face region image of the target human face; and the liveness detection is performed based on the grayscale features of the local face region image of the target human face and the pre-trained liveness detection model to determine whether the object to be detected is a live human face. Thus, accurate and effective liveness detection is achieved based on the local features of the human face, effectively solving the problem of reduced accuracy of the detection result caused by partial occlusion of the human face region.

[0043] In order to accurately extract the local area image of the target face to improve the accuracy of liveness detection, in one or more embodiments of the present application, the key points of the face are first detected, and the local area image of the face is extracted based on the detected key points. Figure 4 As shown, step S104 may include the following steps 104-2 to 104-8:

[0044] Step 104-2, performing key point detection processing on the infrared image according to a preset method to obtain eye key points and mouth key points;

[0045] Among them, the eye key points include the left eye key points and the right eye key points, and the mouth key points include the left mouth corner key points and the right mouth corner key points. The key point detection method and specific detection process can be set according to actual needs in actual applications, such as using the ASM (Active Shape Model) algorithm, CPR (Cascaded Pose Regression) algorithm, etc. for key point detection. Since the ASM algorithm and the CPR algorithm are both well-known technical means for those skilled in the art, they will not be described in detail here.

[0046] Step 104-4, extracting the eye region image according to the obtained eye key points;

[0047] Specifically, Figure 5 As shown, step 104-4 may include the following steps 104-42 to 104-44:

[0048] Step 104-42, determining a first distance between the left eye key point and the right eye key point, and defining a left eye area and a right eye area based on the first distance and a first preset ratio, respectively, with the left eye key point and the right eye key point as the center;

[0049] Specifically, determine the first coordinate information of the left eye key point and the second coordinate information of the right eye key point; determine the first distance between the left eye key point and the right eye key point according to the first coordinate information and the second coordinate information; calculate the length and width of the rectangular area to be delineated according to the first distance and the first preset ratio, and delineate the rectangular left eye area with the left eye key point as the center according to the calculated length and width; and delineate the rectangular right eye area with the right eye key point as the center according to the calculated length and width.

[0050] The first distance can be considered as the interpupillary distance between the left eye and the right eye; the first preset ratio includes a first preset width ratio and a first preset length ratio; the first preset ratio can be set as needed in actual applications. For example, if the interpupillary distance is recorded as IPD, the first preset width ratio can be 0.16-0.18 times of the IPD, and the first preset length ratio can be 0.4-0.45 times of the IPD.

[0051] Step 104-44, determining the images corresponding to the delineated left eye area and right eye area as eye area images.

[0052] Specifically, the image corresponding to the defined left eye area is determined as the left eye area image, the image corresponding to the defined right eye area is determined as the right eye area image, and the left eye area image and the right eye area image are determined as eye area images.

[0053] Furthermore, considering that in the infrared image of the paper photo prosthesis, the eye cannot distinguish the pupil, iris and sclera, and based on the special structure of the eye, for a living body, Figure 2 As shown in FIG. 1 , two circles can be fitted based on the grayscale features. Based on this, in the process of obtaining the eye area image, whether the object to be detected is a living body can be determined by fitting the circles. Specifically, Figure 6 As shown, step 104-44 may include the following steps 104-442 to 104-446

[0054] Step 104-442, edge detection processing is performed on the images corresponding to the left eye area and the right eye area, and circular fitting processing is performed based on the processing result of the edge detection processing; if the circular fitting processing fails, step 104-444 is executed; if the circular fitting processing is successful, step 104-446 is executed;

[0055] The edge detection process is performed based on Laplace operator, Gaussian operator, etc., and a circular fit is performed based on the detected edge. Since the process of edge detection is a prior art, it will not be described in detail in this application.

[0056] Step 104-444, determining that there is no living body, and the result of the face liveness detection of the object to be detected is detection failure;

[0057] Step 104-446, determining the images corresponding to the delineated left eye area and right eye area as eye area images.

[0058] By detecting the key points of the eye and extracting the eye area image based on the key points of the eye, the accuracy of the eye area image extraction is ensured. By performing circular fitting processing during the extraction of the eye area image, prostheses in the form of paper photos can be identified in a timely manner without the need for subsequent related processing, which can improve the detection efficiency.

[0059] Step 104-6, extracting the mouth area image according to the obtained mouth key points;

[0060] Specifically, Figure 7 As shown, step 104-6 may include the following steps 104-62 to 104-66:

[0061] Step 104-62, determining the reference point of the mouth according to the left corner of the mouth key point and the right corner of the mouth key point;

[0062] Specifically, the third coordinate information of the key point of the left corner of the mouth and the fourth coordinate information of the key point of the right corner of the mouth are determined, and the reference point of the mouth is determined according to the third coordinate information and the fourth coordinate information. For example, the average value of the third coordinate information and the fourth coordinate information is calculated, and the point corresponding to the calculated average value is determined as the reference point of the mouth; or, if it is determined that the object to be detected is in a tilted state when the infrared image is acquired, the average value can be multiplied by the set adjustment coefficient when the average value is obtained.

[0063] Step 104-64, determining a second distance between the left corner of the mouth key point and the right corner of the mouth key point, and defining the mouth area based on the second distance and a second preset ratio with the reference point as the center;

[0064] Specifically, the second distance between the left corner of the mouth key point and the right corner of the mouth key point is calculated based on the third coordinate information of the left corner of the mouth key point and the fourth coordinate information of the right corner of the mouth key point; the length and width of the rectangular area to be delineated are calculated based on the second distance and the second preset ratio, and the rectangular mouth area is delineated based on the calculated length and width with the reference point of the mouth as the center. The second preset ratio may include a width ratio, and the second distance is determined as the length of the rectangular area to be delineated, and the length is recorded as d. The second preset ratio may be 0.32-0.36 times of d.

[0065] It should be noted that the first preset ratio and the second preset ratio can be set as needed in actual applications. And when the detected key points are not just one left eye key point, one right eye key point, one left corner of mouth key point and one right corner of mouth key point, but many key points, the eye area and the mouth area can also be delineated based on the detected key points.

[0066] Step 104-66 determines the image corresponding to the delineated mouth area as the mouth area image.

[0067] Furthermore, considering that the grayscale distribution of the mouth area of ​​a prosthesis such as silicone is significantly different from that of a living body, in the process of obtaining an image of the mouth area, the grayscale feature can be used to determine whether the object to be detected is a living body. Figure 8 As shown, in one or more embodiments of the present application, step 106-66 may include the following steps 106-662 to 106-666:

[0068] Step 106-662, calculate the grayscale mean of the image corresponding to the designated mouth area, and determine whether the statistical grayscale mean meets the preset conditions; if not, execute step 106-664, if yes, execute step 106-666;

[0069] Specifically, determine the number of pixels of the image corresponding to the delineated mouth area and the grayscale value of each pixel, and calculate the grayscale mean based on the determined number and grayscale value; determine whether the calculated grayscale mean is greater than the preset grayscale value, if so, determine that the statistical grayscale mean does not meet the preset conditions, if not, determine that the statistical grayscale mean meets the preset conditions.

[0070] Step 106-664, determining that there is no living body, and the result of the face liveness detection of the object to be detected is detection failure;

[0071] Step 106-666, determining the image corresponding to the defined mouth area as the mouth area image.

[0072] By detecting the key points of the mouth and extracting the mouth area image based on the key points of the mouth, the accuracy of the extracted mouth area image is ensured. By calculating the grayscale mean of the mouth area and determining whether the grayscale mean meets the preset conditions, prostheses such as silicone can be detected in a timely manner, thereby eliminating the need for subsequent detection processing and improving detection efficiency.

[0073] Step 104 - 8 , determining the extracted eye area image and mouth area image as the target face local area image.

[0074] It should be noted that the execution order of the above steps 104 - 4 and 104 - 6 can be interchanged and can also be executed simultaneously.

[0075] Considering that different imaging devices have different imaging distances, for example, some imaging devices are suitable for imaging within a range of 30 cm to 100 cm, while some devices are suitable for imaging within a range of 30 cm to 200 cm or even farther; and the sizes of the facial images in the obtained infrared images are often different due to different imaging distances. In order to avoid detection differences caused by differences in the sizes of facial images, in one or more embodiments of the present application, the extracted local area images of the target face are normalized and then subsequently processed. Specifically, Fig. 9 As shown, step 106 includes the following steps 106-2 to 106-6:

[0076] Step 106-2, normalizing the local area image of the target face to obtain an image of a preset size;

[0077] Specifically, the left eye region image, the right eye region image, and the mouth region image are normalized to obtain images of a preset size, wherein the size of the normalized image can be set as required in actual applications.

[0078] Step 106-4, drawing a grayscale histogram of an image of a preset size;

[0079] Specifically, for each image of a preset size, the grayscale value of each pixel is determined, and the number of each grayscale value is counted, and a grayscale histogram is drawn according to the determined grayscale value and the counted number, with the grayscale value as the horizontal axis and the number as the vertical axis.

[0080] It should be pointed out that when drawing a grayscale histogram, you can also specify the interval of grayscale values, such as only counting the grayscale values ​​between [20, 220] and drawing a grayscale histogram.

[0081] Step 106-6, determining a grayscale vector according to the grayscale histogram, and determining the grayscale vector as a grayscale feature of the local area image of the target face.

[0082] Specifically, a one-dimensional grayscale vector is determined according to the grayscale histograms of the drawn left eye area image, the right eye area image, and the mouth area image, each element of which represents the number of pixel points of the corresponding grayscale value; the three determined one-dimensional grayscale vectors are determined as the grayscale features of the local area image of the target face.

[0083] In order to improve the accuracy of detection, after obtaining the grayscale features of the local area image of the target face, liveness detection processing can be performed based on the grayscale features based on a pre-trained liveness detection model. Optionally, the liveness detection model includes a first liveness detection module and a second liveness detection model, wherein the first liveness detection model is used to perform liveness detection on the eye area, and the second liveness detection model is used to perform liveness detection on the mouth area. Fig.10 As shown, step 108 may include the following steps 108-2 to 108-6:

[0084] Step 108-2, inputting the grayscale features of the eye area image into the first living body detection model for detection processing to obtain a first detection result;

[0085] Specifically, the grayscale vector of the left eye area image and the grayscale vector of the right eye area image are input into the first living body detection model for detection processing to obtain a first detection result.

[0086] Step 108-4, inputting the grayscale features of the mouth area image into the second living body detection model for detection processing to obtain a second detection result;

[0087] Specifically, the grayscale vector of the mouth area image is input into the second living body detection model for detection processing to obtain a second detection result.

[0088] Step 108-6: If both the first detection result and the second detection result indicate the presence of a living body, then the liveness detection result of the face of the object to be detected is determined to be passed.

[0089] Further, when any one or more of the first detection result and the second detection result indicates that there is no living body, it is determined that the liveness detection result of the face of the object to be detected is detection failure.

[0090] In one or more embodiments of the present application, the liveness detection model may include a third detection model, and the third detection model is used to perform liveness detection on the eye area and the mouth area at the same time. Fig.11 As shown, step 108 may include the following steps 108-8 and 108-10:

[0091] Step 108-8, merging the grayscale features of the eye region image and the grayscale features of the mouth region to obtain a merged grayscale feature;

[0092] Among them, the merging method can be set according to needs in actual applications. For example, the grayscale vector of the eye area image is spliced ​​with the grayscale vector of the mouth area image to obtain a merged grayscale vector, and the merged grayscale vector is determined as a merged grayscale feature.

[0093] Step 108-10: input the combined grayscale features into the third liveness detection model for detection processing to obtain a liveness detection result of the face of the object to be detected.

[0094] Specifically, the combined grayscale vector is input into the third liveness detection model for detection processing to obtain a liveness detection result of the face of the object to be detected.

[0095] It should be pointed out that for some scenarios where security requirements are not particularly high, liveness detection can be performed only through the first liveness detection model or only through the second liveness detection model; accordingly, after obtaining the infrared image of the object to be detected, only the eye area image or only the mouth area image can be extracted. The number and usage of the models can be set according to needs in actual applications.

[0096] Furthermore, in order to achieve high-accuracy liveness detection based on a local area of ​​a human face, in one or more embodiments of the present application, Fig.12 As shown, before step 102, the following steps 100-2 to 100-8 may also be included:

[0097] Step 100-2, acquiring infrared images of multiple samples; wherein the samples include positive samples and negative samples, the positive samples are living objects, and the negative samples are prosthetic objects;

[0098] The infrared images of the multiple samples may be collected by an infrared image collection device, or may be obtained from a network. The method for obtaining the infrared images of the multiple samples is not specifically limited in this application.

[0099] Step 100-4, extracting the local face region of each sample infrared image to obtain a local face region image to be trained;

[0100] Among them, the extraction and processing process of the local area image of the face is the same as the extraction process of the local area image of the target face mentioned above. Please refer to the above related description, and the repeated parts will not be repeated here.

[0101] Step 100-6, determining the grayscale features of the local face area image to be trained;

[0102] Among them, the method for determining the grayscale features is the same as the method for determining the grayscale features of the aforementioned target face local area image. Please refer to the aforementioned related description, and the repeated parts will not be repeated here.

[0103] Step 100-8, according to a preset training method, training processing is performed based on the grayscale features of the local area image of the face to be trained to obtain a living body detection model.

[0104] Specifically, according to the liveness and prosthesis attributes of each sample, the grayscale features of the local area image of the face to be trained are labeled to mark the corresponding sample as liveness or prosthesis. The grayscale features with labels are divided into a training set and a test set, and the SVM (Support Vector Machine) support vector machine is used to train the liveness detection model based on the training set to obtain an initial liveness detection model. The obtained initial liveness detection model is tested based on the test set to obtain a test result. If it is determined that the test result meets the preset conditions, the initial liveness detection model is determined as the final liveness detection model; if it is determined that the test result does not meet the preset conditions, the liveness detection model is retrained based on the training set until the test result meets the preset conditions to obtain the final liveness detection model. Among them, the preset conditions are such as the accuracy of the detection result is greater than the preset accuracy. Since the model training process is a technical means well known to those skilled in the art, the model training process will not be described in detail in this application.

[0105] It should be noted that when the liveness detection model includes a first liveness detection model and a second liveness detection model, the first liveness detection model is trained according to the grayscale features of the eye area image to be trained, and the second liveness detection model is trained according to the grayscale features of the mouth area image to be trained. The training method of the liveness detection model is not limited to the above-mentioned SVM training, and can also be based on neural network training. The training method of the liveness detection model can be set according to the actual application needs.

[0106] In the embodiment of the present application, the local face region of the infrared image of the object to be detected is extracted to obtain the local face region image of the target human face; and the liveness detection is performed based on the grayscale features of the local face region image of the target human face and the pre-trained liveness detection model to determine whether the object to be detected is a live human face. Thus, accurate and effective liveness detection is achieved based on the local features of the human face, effectively solving the problem of reduced accuracy of the detection result caused by partial occlusion of the human face region.

[0107] Based on the same technical concept, one or more embodiments of the present application also provide a face liveness detection device. Fig.13 One or more embodiments of the present application also provide a schematic diagram of the module composition of a face liveness detection device, such as Fig.13 As shown, the device comprises:

[0108] An image sensor 201 is used to obtain an infrared image of an object to be detected;

[0109] Processor 202 is used to extract the local area of ​​the face of the infrared image to obtain the local area image of the target face; determine the grayscale features of the local area image of the target face; perform detection processing based on the grayscale features and a pre-trained liveness detection model to obtain the liveness detection result of the face of the object to be detected.

[0110] The face liveness detection device provided in the embodiment of the present application extracts the local face area of ​​the infrared image of the object to be detected to obtain the local face area image of the target human face; and performs liveness detection based on the grayscale features of the local face area image of the target human face and the pre-trained liveness detection model to determine whether the object to be detected is a live human face. Therefore, accurate and effective liveness detection is achieved based on the local features of the human face, effectively solving the problem of reduced accuracy of the detection result caused by the occlusion of part of the human face area.

[0111] Optionally, the processor 202 extracts an eye region image according to the eye key points; and

[0112] Extracting a mouth area image according to the mouth key points;

[0113] The eye area image and the mouth area image are determined as the target face local area images.

[0114] Optionally, the eye key points include left eye key points and right eye key points;

[0115] Accordingly, the processor 202 determines a first distance between the left eye key point and the right eye key point; and

[0116] Taking the left eye key point and the right eye key point as the center respectively, demarcate the left eye area and the right eye area according to the first distance and the first preset ratio;

[0117] The images corresponding to the defined left eye area and right eye area are determined as eye area images.

[0118] Optionally, the processor 202 performs edge detection processing on the images corresponding to the left eye area and the right eye area; and

[0119] Performing a circle fitting process based on the processing result of the edge detection process;

[0120] If the circle fitting process is successful, the images corresponding to the demarcated left eye area and right eye area are determined as eye area images;

[0121] If the circle fitting process fails, it is determined that there is no living body, and the result of the face liveness detection of the object to be detected is detection failure.

[0122] Optionally, the processor 202 determines first coordinate information of the left eye key point and second coordinate information of the right eye key point; and

[0123] A first distance between the left-eye key point and the right-eye key point is determined according to the first coordinate information and the second coordinate information.

[0124] Optionally, the mouth key points include left corner of mouth key points and right corner of mouth key points;

[0125] Accordingly, the processor 202 determines the reference point of the mouth according to the left corner of the mouth key point and the right corner of the mouth key point; and

[0126] Determine a second distance between the left mouth corner key point and the right mouth corner key point;

[0127] Taking the reference point as the center, defining the mouth area according to the second distance and the second preset ratio;

[0128] The image corresponding to the delineated mouth area is determined as the mouth area image.

[0129] Optionally, the processor 202 calculates the grayscale mean of the image corresponding to the determined mouth area; and

[0130] Determining whether the grayscale mean meets a preset condition;

[0131] If yes, the image corresponding to the delineated mouth area is determined as the mouth area image;

[0132] If not, it is determined that there is no living body, and the liveness detection result of the face of the object to be detected is detection failure.

[0133] Optionally, the processor 202 determines the third coordinate information of the left mouth corner key point and the fourth coordinate information of the right mouth corner key point;

[0134] The reference point of the mouth is determined according to the third coordinate information and the fourth coordinate information.

[0135] Optionally, the processor 202 performs normalization processing on the local area image of the target face to obtain an image of a preset size;

[0136] Draw a grayscale histogram of the image of the preset size;

[0137] A grayscale vector is determined according to the grayscale histogram, and the grayscale vector is determined as a grayscale feature of the local area image of the target face.

[0138] Optionally, the processor 202 inputs the grayscale feature of the eye region image into a first living body detection model for detection processing to obtain a first detection result;

[0139] Inputting the grayscale features of the mouth area image into a second living body detection model for detection processing to obtain a second detection result;

[0140] If both the first detection result and the second detection result indicate the presence of a living body, then the liveness detection result of the face of the object to be detected is determined to be a passed detection.

[0141] Optionally, the processor 202 combines the grayscale features of the eye region image and the grayscale features of the mouth region to obtain a combined grayscale feature;

[0142] The combined grayscale feature is input into a third liveness detection model for detection processing to obtain a liveness detection result of the face of the object to be detected.

[0143] Optionally, the processor 202 acquires infrared images of a plurality of samples; wherein the samples include positive samples and negative samples, the positive samples are living objects, and the negative samples are prosthetic objects; and,

[0144] Extracting the local face area of ​​each sample infrared image to obtain the local face area image to be trained;

[0145] Determining the grayscale features of the local face area image to be trained;

[0146] According to a preset training method, training processing is performed based on the grayscale features of the local area image of the face to be trained to obtain the living body detection model.

[0147] The face liveness detection device provided in the embodiment of the present application extracts the local face area of ​​the infrared image of the object to be detected to obtain the local face area image of the target human face; and performs liveness detection based on the grayscale features of the local face area image of the target human face and the pre-trained liveness detection model to determine whether the object to be detected is a live human face. Therefore, accurate and effective liveness detection is achieved based on the local features of the human face, effectively solving the problem of reduced accuracy of the detection result caused by the occlusion of part of the human face area.

[0148] In addition, for the above-mentioned device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. In addition, it should be noted that among the various components of the device of the present invention, the components are logically divided according to the functions to be implemented, but the present invention is not limited thereto, and the various components can be re-divided or combined as needed.

[0149] Fig.14 This is a schematic diagram of a structure of an electronic device provided by an embodiment of the present invention, see Fig.14 , the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a face liveness detection device at the logical level. Of course, in addition to the software implementation method, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0150] The network interface, processor and memory can be connected to each other through a bus system. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0151] The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may include high-speed random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.

[0152] The processor is used to execute the program stored in the memory, and specifically perform:

[0153] Acquire an infrared image of the object to be detected;

[0154] Performing facial local area extraction processing on the infrared image to obtain a target facial local area image;

[0155] Determining the grayscale features of the local area image of the target face;

[0156] Liveness detection processing is performed according to the grayscale features and a pre-trained liveness detection model to obtain a liveness detection result of the face of the object to be detected.

[0157] The above application Fig.13The method performed by the face liveness detection device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0158] Based on the same technical concept, the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 1 , Figures 4 to 12 A method for detecting live faces provided by any corresponding embodiment.

[0159] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0160] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0161] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0162] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0166] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0168] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0169] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0170] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for detecting liveness of a face, characterized in that: include: Acquire an infrared image of the object to be detected; Extracting the local area of ​​the face from the infrared image to obtain a local area image of the target face; the local area of ​​the face includes an eye area and a mouth area; the eye area includes a left eye area and a right eye area; Performing edge detection processing on the images corresponding to the left eye area and the right eye area, and performing circular fitting processing based on the processing result of the edge detection processing. If the circular fitting processing fails, it is determined that there is no living body, and the liveness detection result of the face of the object to be detected is detection failure; The grayscale mean of the image corresponding to the mouth area is determined by the statistics. If the grayscale mean does not meet the preset conditions, it is determined that there is no living body, and the face liveness detection result of the object to be detected is that the detection fails; wherein, if the grayscale mean is greater than the preset grayscale value, it is determined that the statistical grayscale mean does not meet the preset conditions; if the grayscale mean is not greater than the preset grayscale value, it is determined that the statistical grayscale mean meets the preset conditions; Determining the grayscale features of the local area image of the target face; The grayscale features of the eye area image are input into a first liveness detection model for detection processing to obtain a first detection result; the grayscale features of the mouth area image are input into a second liveness detection model for detection processing to obtain a second detection result; if the first detection result and the second detection result both indicate the presence of a living body, the liveness detection result of the face of the object to be detected is determined to be a passed detection; or, the grayscale features of the eye area image and the grayscale features of the mouth area are merged to obtain a merged grayscale feature; the merged grayscale feature is input into a third liveness detection model for detection processing to obtain the liveness detection result of the face of the object to be detected.

2. The method according to claim 1, characterized in that The step of extracting a local face region from the infrared image to obtain a local face region image of a target person includes: Performing key point detection processing on the infrared image according to a preset method to obtain eye key points and mouth key points; Extracting an eye region image according to the eye key points; Extracting a mouth area image according to the mouth key points; The eye area image and the mouth area image are determined as the target face local area images.

3. The method according to claim 2, characterized in that The eye key points include left eye key points and right eye key points; The step of extracting the eye region image according to the eye key points comprises: Determine a first distance between the left eye key point and the right eye key point; Taking the left eye key point and the right eye key point as the center respectively, demarcate the left eye area and the right eye area according to the first distance and the first preset ratio; The images corresponding to the defined left eye area and right eye area are determined as eye area images.

4. The method according to claim 3, characterized in that: The step of determining the images corresponding to the defined left eye area and the right eye area as eye area images includes: If the circle fitting process is successful, the images corresponding to the demarcated left eye area and right eye area are determined as eye area images.

5. The method according to claim 3, characterized in that: The determining a first distance between the left eye key point and the right eye key point comprises: Determine the first coordinate information of the left eye key point and the second coordinate information of the right eye key point; A first distance between the left-eye key point and the right-eye key point is determined according to the first coordinate information and the second coordinate information.

6. The method according to claim 2, characterized in that The mouth key points include left corner of mouth key points and right corner of mouth key points; The extracting the mouth area image according to the mouth key points includes: Determine the reference point of the mouth according to the left corner of the mouth key point and the right corner of the mouth key point; Determine a second distance between the left mouth corner key point and the right mouth corner key point; Taking the reference point as the center, defining the mouth area according to the second distance and the second preset ratio; The image corresponding to the delineated mouth area is determined as the mouth area image.

7. The method according to claim 6, characterized in that The step of determining the image corresponding to the delineated mouth area as the mouth area image includes: When the grayscale mean meets the preset condition, the image corresponding to the delineated mouth area is determined as the mouth area image.

8. The method according to claim 6, characterized in that The determining of the reference point of the mouth according to the left corner of the mouth key point and the right corner of the mouth key point comprises: Determine the third coordinate information of the left corner of the mouth key point and the fourth coordinate information of the right corner of the mouth key point; The reference point of the mouth is determined according to the third coordinate information and the fourth coordinate information.

9. The method according to claim 1, characterized in that: Determining the grayscale features of the local area image of the target face includes: Normalizing the local area image of the target face to obtain an image of a preset size; Draw a grayscale histogram of the image of the preset size; A grayscale vector is determined according to the grayscale histogram, and the grayscale vector is determined as a grayscale feature of the local area image of the target face.

10. The method according to claim 1, characterized in that The method further comprises: Acquire infrared images of a plurality of samples; wherein the samples include positive samples and negative samples, the positive samples are living objects, and the negative samples are prosthetic objects; Extracting the local face area of ​​each sample infrared image to obtain the local face area image to be trained; Determining the grayscale features of the local face area image to be trained; According to a preset training method, training processing is performed based on the grayscale features of the local area image of the face to be trained to obtain the living body detection model.

11. A face liveness detection device, characterized in that: include: An image sensor, used to obtain an infrared image of the object to be detected; A processor, configured to extract a local face region from the infrared image to obtain a local face region image of a target person; the local face region includes an eye region and a mouth region; the eye region includes a left eye region and a right eye region; Performing edge detection processing on the images corresponding to the left eye area and the right eye area, and performing circular fitting processing based on the processing result of the edge detection processing. If the circular fitting processing fails, it is determined that there is no living body, and the liveness detection result of the face of the object to be detected is detection failure; The grayscale mean of the image corresponding to the mouth area is determined by the statistics. If the grayscale mean does not meet the preset conditions, it is determined that there is no living body, and the face liveness detection result of the object to be detected is that the detection fails; wherein, if the grayscale mean is greater than the preset grayscale value, it is determined that the statistical grayscale mean does not meet the preset conditions; if the grayscale mean is not greater than the preset grayscale value, it is determined that the statistical grayscale mean meets the preset conditions; Determining the grayscale features of the local area image of the target face; The grayscale features of the eye area image are input into a first liveness detection model for detection processing to obtain a first detection result; the grayscale features of the mouth area image are input into a second liveness detection model for detection processing to obtain a second detection result; if the first detection result and the second detection result both indicate the presence of a living body, the liveness detection result of the face of the object to be detected is determined to be a passed detection; or, the grayscale features of the eye area image and the grayscale features of the mouth area are merged to obtain a merged grayscale feature; the merged grayscale feature is input into a third liveness detection model for detection processing to obtain the liveness detection result of the face of the object to be detected.

12. An electronic device, characterized in that: include: 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 bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the method described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Method for detecting living object, computing equipment, and readable storage medium

    CN108764121A

  • Living body detection method and device and recognition model training method thereof

    CN111222380A