Method and related equipment for face liveness detection based on improved Resnet

Through the improved Resnet model, the high cost and low accuracy problems caused by relying on temperature sensing hardware in the prior art are solved, and high-precision face detection on portable terminals are realized.

CN110059542BActive Publication Date: 2024-12-13PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910160807.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-03-04
Publication Date
2024-12-13
Estimated Expiration
2039-03-04

AI Technical Summary

Technical Problem

The existing live detection technology relies on temperature sensing hardware, resulting in high cost and low accuracy in some environments, and is not suitable for portable terminals.

Method used

The improved Resnet model is used to detect face living bodies. By acquiring a single frame image to be detected in the face image, the probability value of the face image directly originating from the living body is obtained based on the improved Resnet, and the probability value and the preset threshold are determined.

Benefits of technology

Simplify hardware requirements, improve the accuracy of facial liveness detection, reduce costs, and maintain high accuracy in special environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110059542B_ABST
    Figure CN110059542B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for face liveness detection based on improved Resnet and related equipment, which relates to the field of liveness detection. The method comprises: obtaining a single-frame image to be detected containing a face image; for each face image in the single-frame image to be detected, obtaining a probability value of the face image directly derived from a live body based on improved Resnet; and judging whether the face image directly derived from a live body based on the matching result of the probability value and a preset threshold. The method improves the accuracy of face liveness detection.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of Internet technology, the application of face recognition is becoming more and more closely connected with life, such as access control systems, face payment, etc. In these scenarios, in addition to being able to recognize faces, the authenticity of faces must also be judged to prevent malicious people from using other people's photos and videos to carry out illegal activities. The authenticity judgment of faces is called liveness detection.

[0003] In the existing liveness detection technology, most of them rely on temperature sensing hardware, such as infrared sensors. The temperature sensing hardware is used to determine whether the currently acquired video is directly from a living body. The disadvantage of this method is that it is not suitable for portable terminals, and the deployment of hardware increases the cost of the liveness detection system. Moreover, in some special environments, the liveness detection accuracy of this liveness detection system is not satisfactory. Summary of the invention

[0004] Based on this, in order to solve the technical problem of how to improve the accuracy of face liveness detection from a technical level in the related art, the present invention provides a method and related equipment for face liveness detection based on an improved Resnet.

[0005] In a first aspect, a method for face liveness detection based on an improved Resnet is provided, comprising:

[0006] Obtain a single frame image to be detected containing a face image;

[0007] For each face image in the single frame image to be detected, based on the improved Resnet, obtaining a probability value that the face image directly comes from a living body;

[0008] Based on the matching result between the probability value and the preset threshold, it is determined whether the face image directly comes from a living body.

[0009] In an exemplary embodiment of the present disclosure, obtaining a single frame image to be detected containing a face image includes:

[0010] Get the video to be detected;

[0011] Decomposing the video to be detected into single-frame images;

[0012] Based on the dlib framework, a single frame image to be detected containing a face image is obtained from the single frame image.

[0013] In an exemplary embodiment of the present disclosure, based on the dlib framework, obtaining a single frame image to be detected containing a face image from the single frame image includes:

[0014] Randomly extract one of the single-frame images as the original single-frame image;

[0015] Based on the dlib framework, confirm whether the original single-frame image contains a face image;

[0016] If it is confirmed that the original single-frame image contains a face image, the original single-frame image is used as the single-frame image to be detected; if it is confirmed that the original single-frame image does not contain a face image, another single-frame image is randomly selected from the single-frame images as the original single-frame image, until it is confirmed that the original single-frame image contains a face image, and the original single-frame image is used as the single-frame image to be detected.

[0017] In an exemplary embodiment of the present disclosure, each face image in the single frame image to be detected is obtained by the following method:

[0018] Based on the dlib framework, extract the facial feature points in the single frame image to be detected;

[0019] The image of each group of facial feature points in a region of a predetermined shape and size is used as the facial image.

[0020] In an exemplary embodiment of the present disclosure, the improved Resnet includes:

[0021] A dropout layer is added after the Resnet pooling layer;

[0022] A sigmoid function is used to output a probability value that the face image directly originates from a living body.

[0023] In an exemplary embodiment of the present disclosure, the improved Resnet is trained in the following manner:

[0024] The facial images that were pre-labeled as "live" or "non-live" according to whether they were directly from a living body were used as samples and randomly divided into two parts: a training set and a validation set.

[0025] Based on the gradient descent algorithm, the improved Resnet is trained using the training set: for each sample of the training set input, the improved Resnet will output the probability value of the sample directly derived from a living organism, and the sample with the probability value greater than or equal to the preset standard value is labeled as "living organism", and the sample with the probability value less than the preset standard value is labeled as "non-living organism", and the improved Resnet determines the accuracy of judging whether the training set samples are directly derived from living organisms. If the accuracy of judging the training set samples is less than the preset expected value, the improved Resnet is updated and then trained using the training set until the accuracy of judging the training set samples is greater than or equal to the preset expected value;

[0026] The improved Resnet whose labeling accuracy of the training set samples is greater than or equal to the preset expected value is verified using the validation set: the improved Resnet's judgment accuracy of whether the validation set samples are directly derived from living organisms is determined; if the judgment accuracy of the validation set samples is greater than or equal to the preset expected value, the Resnet training is completed; if it is less than the preset expected value, the improved Resnet is retrained until the judgment accuracy of the validation set samples is greater than or equal to the preset expected value.

[0027] In an exemplary embodiment of the present disclosure, for each face image in the single frame image to be detected, based on the improved Resnet, obtaining a probability value that the face image directly comes from a living body includes:

[0028] Input each of the face images into the improved Resnet in turn according to the order from left to right of the area where the face image is located, and obtain the probability value of the face image directly derived from the living body output by the improved Resnet.

[0029] In an exemplary embodiment of the present disclosure, determining whether the face image is directly derived from a living body based on a matching result between the probability value and a preset threshold value includes:

[0030] If the probability value is greater than or equal to a preset threshold, it is determined that the face image is directly derived from a living body; if the probability value is less than the preset threshold, it is determined that the face image is directly derived from a non-living body.

[0031] According to a second aspect of the present disclosure, a device for face liveness detection based on an improved Resnet is provided, comprising:

[0032] The first acquisition module is used to acquire a single frame image to be detected containing a face image;

[0033] A second acquisition module is used to obtain, for each face image in the single frame image to be detected, a probability value that the face image directly originates from a living body based on an improved Resnet;

[0034] The determination module is used to determine whether the face image is directly derived from a living body based on a matching result between the probability value and a preset threshold.

[0035] According to a third aspect of the present disclosure, an electronic device for face liveness detection based on an improved Resnet is provided, comprising:

[0036] a memory configured to store executable instructions;

[0037] The processor is configured to execute the executable instructions stored in the memory to perform the above method.

[0038] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer program instructions. When the computer instructions are executed by a computer, the computer executes the method described above.

[0039] Compared with the traditional technology of performing liveness detection on facial images that relies on external temperature sensing devices, the embodiments of the present disclosure perform liveness detection on facial images by using an improved Resnet, which simplifies the hardware requirements and improves the accuracy of facial liveness detection.

[0040] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0041] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of face liveness detection based on improved Resnet according to an example implementation of the present disclosure is shown.

[0043] Figure 2 A block diagram of a device for face liveness detection based on improved Resnet according to an example embodiment of the present disclosure is shown.

[0044] Figure 3 A detailed flowchart of obtaining a single-frame image to be detected containing a face image according to an example implementation of the present disclosure is shown.

[0045] Figure 4 A detailed flowchart of obtaining a single frame image to be detected containing a face image from the single frame image based on a dlib framework according to an example implementation of the present disclosure is shown.

[0046] Figure 5 A detailed flowchart of confirming whether the original single-frame image contains a face image based on the dlib framework according to an example implementation of the present disclosure is shown.

[0047] Figure 6 A system architecture diagram of face liveness detection based on improved Resnet according to an example implementation of the present disclosure is shown.

[0048] Figure 7 A diagram of an electronic device for face liveness detection based on improved Resnet according to an example implementation of the present disclosure is shown.

[0049] Figure 8 A diagram of a computer-readable storage medium for face liveness detection based on improved Resnet according to an example embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0050] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0051] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0052] The purpose of the present disclosure is to improve the accuracy of face liveness detection from a technical aspect. According to an embodiment of the present disclosure, a method for face liveness detection based on an improved Resnet includes: obtaining a single-frame image to be detected containing a face image; for each face image in the single-frame image to be detected, based on the improved Resnet, obtaining a probability value that the face image directly originates from a living body; based on the matching result between the probability value and a preset threshold, determining whether the face image directly originates from a living body. Compared with the traditional technology that relies on external temperature sensing equipment for liveness detection of face images, the embodiment of the present disclosure uses an improved Resnet to perform liveness detection on face images, which simplifies the hardware requirements and improves the accuracy of face liveness detection.

[0053] Figure 1 The following is a flowchart of face liveness detection based on improved Resnet according to an example implementation of the present disclosure:

[0054] Step S100: obtaining a single frame image to be detected containing a face image;

[0055] Step S110: for each face image in the single frame image to be detected, based on the improved Resnet, obtaining a probability value that the face image directly comes from a living body;

[0056] Step S120: Based on the matching result between the probability value and the preset threshold, determine whether the face image is directly derived from a living body.

[0057] Below, each step of performing personalized typesetting on a page in this example implementation will be explained and illustrated in detail with reference to the accompanying drawings.

[0058] In step S100, a single frame image to be detected containing a face image is obtained.

[0059] The single-frame image to be detected refers to an image obtained by decomposing the video to be detected into single frames.

[0060] In one embodiment, if Figure 3 As shown, step S100 includes:

[0061] Step S1001: Obtain a video to be detected;

[0062] Step S1002: Decomposing the video to be detected into single frame images;

[0063] Step S1003: Based on the dlib framework, a single frame image to be detected containing a face image is obtained from the single frame image.

[0064] The video to be detected refers to a video acquired by the server and requiring detection of whether a face image appearing in the video is directly derived from a living body.

[0065] dlib is a toolkit containing machine learning algorithms that can determine the area where the face is located in an image, that is, recognize the face image in a single frame.

[0066] In one embodiment, the server obtains a video to be detected from a video input terminal, such as a camera, in which a facial image to be detected is directly derived from a living body. The video to be detected may be obtained by directly capturing the action of a living body by the video input terminal, or may be obtained by capturing a video played by an electronic device by the video input terminal. Therefore, it is necessary to perform liveness detection on the acquired video to determine whether the facial image in the video is directly derived from a living body.

[0067] After obtaining the video to be detected, the video to be detected is decomposed into single-frame images. Based on the dlib framework, face detection is performed on the single-frame images, and the single-frame images containing face images are determined as the single-frame images to be detected.

[0068] By using this method, a single frame image to be detected containing a face image is extracted, so that the server can further perform liveness detection on the single frame image to be detected containing a face image.

[0069] In one embodiment, if Figure 4 As shown, step S1003 includes:

[0070] Step S10031: randomly selecting one of the single-frame images as the original single-frame image;

[0071] Step S10032: Based on the dlib framework, confirm whether the original single-frame image contains a face image;

[0072] Step S10033: If it is confirmed that the original single-frame image contains a face image, the original single-frame image is used as the single-frame image to be detected; if it is confirmed that the original single-frame image does not contain a face image, another single-frame image is randomly selected from the single-frame images as the original single-frame image, until it is confirmed that the original single-frame image contains a face image, and the original single-frame image is used as the single-frame image to be detected.

[0073] In one embodiment, the server decomposes the video to be detected into single-frame images one by one. A random image is selected from the single-frame images, and it is determined based on the dlib framework whether the image contains a face image. If so, the image is used as the single-frame image to be detected for liveness detection; if not, another image is randomly selected until a single-frame image with a face image is obtained, which is used as the single-frame image to be detected for liveness detection.

[0074] Through this method, the purpose of obtaining a single frame image to be detected containing a face image is achieved.

[0075] In step S110, for each face image in the single frame image to be detected, a probability value that the face image directly originates from a living body is obtained based on the improved Resnet.

[0076] Resnet refers to a deep residual network based on residual learning to solve the gradient vanishing problem during machine learning training.

[0077] In one embodiment, after the server obtains a single-frame image to be detected containing a facial image, each facial image contained in the single-frame image is extracted separately and input into an improved Resnet to obtain a probability value that each facial image output by Resnet is directly derived from a living body.

[0078] By using this method, when there are multiple face images in a single frame image to be detected, the server can judge whether each face image directly originates from a living body according to the probability value of each face image directly originating from a living body.

[0079] In one embodiment, if Figure 5 As shown, the method for obtaining each face image in the single frame image to be detected in step S110 includes:

[0080] Step S1101: extracting facial feature points in the single frame image to be detected based on the dlib framework;

[0081] Step S1102: taking an image of a region of a predetermined shape and size where each group of facial feature points are located as the facial image.

[0082] In one embodiment, after extracting facial feature points from a single frame image to be detected containing a facial image, a group of facial feature points is obtained. Each group of facial feature points corresponds to a facial image. An image of a square area of ​​a predetermined size where each group of facial feature points is located is determined as the facial image corresponding to the facial feature points. Thus, each facial image in the single frame image to be detected is obtained.

[0083] Through this method, each face image in the single frame image to be detected is determined.

[0084] In one embodiment, the improved Resnet includes:

[0085] A dropout layer is added after the Resnet pooling layer;

[0086] A sigmoid function is used to output a probability value that the face image directly originates from a living body.

[0087] The dropout layer allows the neural network to ignore half of the feature detectors in each training batch, thereby reducing the occurrence of overfitting during training.

[0088] The sigmoid function is a special case of the logistic regression function. Its mathematical curve is "S" shaped and is used to deal with binary classification problems.

[0089] In one embodiment, adding a dropout layer after the Resnet pooling layer can effectively prevent overfitting.

[0090] In one embodiment, the Resnet used to process multi-classification problems is improved to process binary classification problems, that is, the sigmoid function is used to output the probability value that the face image directly comes from a living body, rather than the softmax function used in the prior art to output the probability value. This is because the probability value output by the sigmoid function is more suitable for further binary classification judgment, which makes the sigmoid function perform better in processing binary classification problems than the softmax function specifically used for processing multi-classification problems.

[0091] Through this method, the Resnet improved according to this method performs better in dealing with the binary classification problem of liveness detection ("live" and "non-live").

[0092] In one embodiment, the improved Resnet is trained in the following manner:

[0093] The facial images that were pre-labeled as "live" or "non-live" according to whether they were directly from a living body were used as samples and randomly divided into two parts: a training set and a validation set.

[0094] Based on the gradient descent algorithm, the improved Resnet is trained using the training set: for each sample of the training set input, the improved Resnet will output the probability value of the sample directly derived from a living organism, and the sample with the probability value greater than or equal to the preset standard value is labeled as "living organism", and the sample with the probability value less than the preset standard value is labeled as "non-living organism", and the improved Resnet determines the accuracy of judging whether the training set samples are directly derived from living organisms. If the accuracy of judging the training set samples is less than the preset expected value, the improved Resnet is updated and then trained using the training set until the accuracy of judging the training set samples is greater than or equal to the preset expected value;

[0095] The improved Resnet whose labeling accuracy of the training set samples is greater than or equal to the preset expected value is verified using the validation set: the improved Resnet's judgment accuracy of whether the validation set samples are directly derived from living organisms is determined; if the judgment accuracy of the validation set samples is greater than or equal to the preset expected value, the Resnet training is completed; if it is less than the preset expected value, the improved Resnet is retrained until the judgment accuracy of the validation set samples is greater than or equal to the preset expected value.

[0096] In one embodiment, when training with training set samples, the preset standard value is 97% and the preset expected value is 99%. Among them, the preset standard value is used to measure how likely it is that the training set samples are directly derived from living organisms; the preset expected value is used to measure the accuracy of Resnet's judgment on the training set samples. That is, only when the probability value of Resnet outputting that the training set samples are directly derived from living organisms is greater than or equal to 97%, the training set samples will be labeled as "living organisms". Due to the existence of Resnet errors, according to this method, the final label will be wrong, that is, the judgment of the training set samples may not be accurate. The purpose of using the training set for training is to achieve this method so that the judgment accuracy of the training set samples can be greater than or equal to the preset expected value, that is, 99%.

[0097] After using the training set samples to meet the training purpose, Resnet must be verified. This is because the training process uses the same set of samples for repeated training, and there is sample deviation. The judgment accuracy of the training set samples can be greater than or equal to the preset expected value, which does not mean that the judgment accuracy of samples outside the training set can also be greater than or equal to the preset expected value. Therefore, the validation set samples are used for verification and adjustment, so that Resnet's judgment accuracy for the training set samples and the validation set samples is greater than or equal to the preset expected value, that is, 99%. At this point, Resnet training is completed.

[0098] Through this method, the occurrence of overfitting is further reduced, so that in practical applications, Resnet can correctly determine whether the input face image is directly from a living body.

[0099] In one embodiment, for each face image in the single frame image to be detected, based on the improved Resnet, obtaining a probability value that the face image directly originates from a living body includes:

[0100] Input each of the face images into the improved Resnet in turn according to the order from left to right of the area where the face image is located, and obtain the probability value of the face image directly derived from the living body output by the improved Resnet.

[0101] Through this method, the probability value of each face image in the single frame image to be detected directly coming from a living body is determined.

[0102] In one embodiment, determining whether the face image is directly from a living body based on a matching result between the probability value and a preset threshold value includes:

[0103] If the probability value is greater than or equal to a preset threshold, it is determined that the face image is directly derived from a living body; if the probability value is less than the preset threshold, it is determined that the face image is directly derived from a non-living body.

[0104] In one embodiment, the preset threshold is 98.7%, that is, only the facial images whose corresponding probability value of directly deriving from a living organism is greater than or equal to 98.7% will be determined to be directly derived from a living organism. There are two facial images in the single-frame image to be detected: facial image A and facial image B. After inputting facial image A into the improved Resnet, the probability value of directly deriving from a living organism output by Resnet is 99.1%, which is greater than the preset threshold, so it is determined that facial image A is directly derived from a living organism; after inputting facial image B into the improved Resnet, the probability value of directly deriving from a living organism output by Resnet is 95.3%, which is less than the preset threshold, so it is determined that facial image B is directly derived from a non-living organism.

[0105] By comparing the probability value with a preset threshold, it is determined whether the face image is directly from a living body, thereby achieving the purpose of living body detection.

[0106] In one embodiment, if Figure 2 As shown, a device for face liveness detection based on an improved Resnet is provided, which specifically includes:

[0107] The first acquisition module 210 is used to acquire a single frame image to be detected containing a face image;

[0108] The second acquisition module 220 is used to obtain, for each face image in the single frame image to be detected, a probability value that the face image directly originates from a living body based on the improved Resnet;

[0109] The determination module 230 is used to determine whether the face image is directly derived from a living body based on the matching result between the probability value and a preset threshold.

[0110] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method for face liveness detection based on improved Resnet, which will not be repeated here.

[0111] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0112] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0113] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0114] Figure 6 The system architecture diagram of face liveness detection based on improved Resnet according to an example implementation of the present disclosure is shown. The system architecture includes: a video input terminal 310, a server 320, and a management terminal 330.

[0115] In one embodiment, the management terminal 330 sends the parameters required for Resnet training: preset standard values ​​and preset expected values ​​to the server 320, so that the server 320 can complete the training of Resnet. The server 320 obtains the video to be detected uploaded from the video input terminal 310, and obtains a single-frame image after dividing the video to be detected into frames. After obtaining the single-frame image to be detected containing a face image, each face image in the single-frame image to be detected is input into the improved Resnet to determine whether each face image is directly derived from a living body. The server 320 sends the recognition result to the management terminal 330, so that the management terminal 330 performs corresponding business processing based on the recognition result.

[0116] Through the above description of the system architecture, it is easy for those skilled in the art to understand that the system architecture described here can achieve Figure 2 The functions of each module in the device for face liveness detection based on the improved Resnet are shown.

[0117] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0118] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0119] Refer to the following Figure 7 An electronic device 400 according to this embodiment of the present invention will be described. Figure 7The electronic device 400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0120] like Figure 7 As shown, the electronic device 400 is in the form of a general computing device. The components of the electronic device 400 may include but are not limited to: at least one processing unit 410, at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410).

[0121] The storage unit stores program codes, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 410 can perform the following steps: Figure 1 Step S100 shown in the figure: obtain a single frame image to be detected containing a face image; step S110: for each face image in the single frame image to be detected, based on the improved Resnet, obtain a probability value that the face image directly originates from a living body; step S120: based on the matching result of the probability value and a preset threshold, determine whether the face image directly originates from a living body.

[0122] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202 , and may further include a read-only storage unit (ROM) 4203 .

[0123] The storage unit 420 may also include a program / utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0124] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0125] The electronic device 400 may also communicate with one or more external devices 500 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 400, and / or communicate with any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 450. Furthermore, the electronic device 400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 460. As shown, the network adapter 460 communicates with other modules of the electronic device 400 via a bus 430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0126] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0127] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0128] refer to Figure 8 As shown, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0129] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0130] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0132] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0133] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0134] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for face liveness detection based on improved Resnet, It is characterized in that include: Acquire a single-frame image to be detected containing a face image, wherein the single-frame image to be detected includes one or more face images; For each face image in the single-frame image to be detected, based on the improved Resnet, a probability value of the face image directly originating from a living body is obtained; wherein, if there are multiple face images in the single-frame image to be detected, each face image is input into the improved Resnet in sequence from left to right in the area where the face image is located, and a probability value of the face image directly originating from a living body output by the improved Resnet is obtained; wherein, The improved Resnet adds a dropout layer after the Resnet pooling layer, and uses a sigmoid function to output a probability value that the face image directly originates from a living body; Based on the matching result between the probability value and the preset threshold, it is determined whether the face image directly comes from a living body.

2. The method according to claim 1, It is characterized in that The step of obtaining a single frame image to be detected containing a face image comprises: Get the video to be detected; Decomposing the video to be detected into single-frame images; Based on the dlib framework, a single frame image to be detected containing a face image is obtained from the single frame image.

3. The method according to claim 2, It is characterized in that The method of obtaining a single frame image to be detected containing a face image from the single frame image based on the dlib framework includes: Randomly extract one of the single-frame images as the original single-frame image; Based on the dlib framework, confirm whether the original single-frame image contains a face image; If it is confirmed that the original single-frame image contains a face image, the original single-frame image is used as the single-frame image to be detected; if it is confirmed that the original single-frame image does not contain a face image, another single-frame image is randomly selected from the single-frame images as the original single-frame image, until it is confirmed that the original single-frame image contains a face image, and the original single-frame image is used as the single-frame image to be detected.

4. The method according to claim 1, It is characterized in that Each face image in the single frame image to be detected is obtained by the following method: Based on the dlib framework, extract the facial feature points in the single frame image to be detected; The image of each group of facial feature points in a region of a predetermined shape and size is used as the facial image.

5. The method according to claim 1, It is characterized in that The determining whether the face image is directly derived from a living body based on the matching result between the probability value and a preset threshold value includes: If the probability value is greater than or equal to a preset threshold, it is determined that the face image is directly derived from a living body; if the probability value is less than the preset threshold, it is determined that the face image is directly derived from a non-living body.

6. A device for face liveness detection based on improved Resnet, It is characterized in that include: A first acquisition module is used to acquire a single-frame image to be detected containing a face image, wherein the single-frame image to be detected includes one or more face images; A second acquisition module is used to obtain, for each face image in the single-frame image to be detected, a probability value of the face image directly originating from a living organism based on the improved Resnet; wherein, if there are multiple face images in the single-frame image to be detected, each face image is input into the improved Resnet in sequence from left to right in the area where the face image is located, and the probability value of the face image directly originating from a living organism output by the improved Resnet is obtained; wherein, the improved Resnet adds a dropout layer after the Resnet pooling layer, and uses a sigmoid function to output the probability value of the face image directly originating from a living organism; The determination module is used to determine whether the face image is directly derived from a living body based on a matching result between the probability value and a preset threshold.

7. An electronic device for face liveness detection based on improved Resnet, It is characterized in that include: a memory configured to store executable instructions; A processor configured to execute the executable instructions stored in the memory to perform the method according to any one of claims 1-5.

8. A computer-readable storage medium, It is characterized in that The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 5.