Method and device for liveness detection

By converting the image to be detected into input images of multiple color models and using pre-trained detection models, the problem of low detection accuracy in the existing technology is solved, and high-precision live detection in new scenarios is realized, and features are automatically selected. Improves the generalization and accuracy of detection.

CN112949356BActive Publication Date: 2025-01-17BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201911259667.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-10
Publication Date
2025-01-17
Estimated Expiration
2039-12-10

AI Technical Summary

Technical Problem

The existing live detection methods have low detection accuracy and insufficient generalization in new scenarios, so automatic feature selection and detection accuracy are needed.

Method used

By converting the image to be detected into input images of multiple color models and using pre-trained detection models for detection, combining multiple color models (such as bgr, hsv, YCbCr) and deep learning networks (such as googleNet) for training, automatically Select features to improve detection accuracy.

Benefits of technology

It realizes live detection with high detection accuracy and good generalization when switching scenes, automatically selects features without manual extraction, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112949356B_ABST
    Figure CN112949356B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting a living body, and relates to the field of computer technology. A specific implementation of the method includes: obtaining a picture to be detected, and then converting the picture to be detected into input pictures of multiple color models; inputting the multiple input pictures into a pre-trained detection model, and obtaining output data of the detection model, wherein the output data is used to indicate whether the target in the picture to be detected is a living body. This implementation can automatically select features, has good generalization, and has high detection accuracy when switching scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for liveness detection. Background Art

[0002] Silent liveness detection refers to a liveness detection method that can complete the entire detection process without the user taking any action. Existing solutions introduce concepts such as color space and color when performing liveness detection, but still manually select features in the color space.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] Lack of generalization and low detection accuracy in new scenarios. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for liveness detection, which can automatically select features, have good generalization, and have high detection accuracy when switching scenes.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for liveness detection is provided, comprising:

[0007] Acquire a picture to be detected, and then convert the picture to be detected into input pictures of multiple color models;

[0008] Inputting the plurality of input images into a pre-trained detection model, and obtaining output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body;

[0009] The detection model is trained according to the following steps:

[0010] Acquire a training sample, wherein the training sample includes a sample image and a sample label, wherein the sample label is used to indicate whether a target in the sample image is a living body;

[0011] Collecting a target area image in the sample image; determining each target key point in the target area image, and determining a target contour based on each target key point;

[0012] The target area image is converted into sample input images of multiple color models; and training is performed based on the sample input images of the multiple color models corresponding to each of the sample images and the target contour to obtain the detection model.

[0013] Optionally, the multiple color models include: bgr color model, hsv color model, and YCbCr color model.

[0014] Optionally, training is performed based on sample input images of multiple color models corresponding to each of the sample images and target contours to obtain the detection model, including:

[0015] The sample input images of multiple color models corresponding to the sample images are input into the GoogleNet network for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

[0016] Optionally, the target area image in the sample image is collected by using an SSD algorithm;

[0017] Determining each target key point in the target area image includes: determining each target key point in the target area image based on a squeezeNet network through an MTCNN algorithm.

[0018] Optionally, after collecting the target area images in the sample pictures, the method further includes: unifying the posture and size of each of the target area images.

[0019] According to a second aspect of an embodiment of the present invention, there is provided a living body detection device, comprising:

[0020] An image conversion unit is used to obtain an image to be detected and then convert the image to be detected into input images of multiple color models;

[0021] A model detection unit, inputting the plurality of input images into a pre-trained detection model, and obtaining output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body;

[0022] The model training unit is trained to obtain the detection model according to the following steps:

[0023] Acquire a training sample, wherein the training sample includes a sample image and a sample label, wherein the sample label is used to indicate whether a target in the sample image is a living body;

[0024] Collecting a target area image in the sample image; determining each target key point in the target area image, and determining a target contour based on each target key point;

[0025] The target area image is converted into sample input images of multiple color models; and training is performed based on the sample input images of the multiple color models corresponding to each of the sample images and the target contour to obtain the detection model.

[0026] Optionally, the multiple color models include: bgr color model, hsv color model, and YCbCr color model.

[0027] Optionally, the model training unit performs training based on sample input images of multiple color models corresponding to each of the sample images and target contours to obtain the detection model, including:

[0028] The sample input images of multiple color models corresponding to the sample images are input into the GoogleNet network for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

[0029] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for liveness detection, comprising:

[0030] one or more processors;

[0031] a storage device for storing one or more programs,

[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0033] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0034] An embodiment of the above invention has the following advantages or beneficial effects: the image to be detected is converted into an input image of multiple color models as a feature input detection model of the image to be detected, which can automatically select features, has good generalization, and has high detection accuracy when switching scenes.

[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0037] Figure 1 is a schematic diagram of the main process of the method for liveness detection according to an embodiment of the present invention;

[0038] Figure 2 is a schematic diagram of the target contour in the positive sample image in an embodiment of the present invention;

[0039] Figure 3 is a schematic diagram of the target contour in the negative sample image in an embodiment of the present invention;

[0040] Figure 4is a schematic diagram of the main components of a living body detection device according to an embodiment of the present invention;

[0041] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0042] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0044] According to one aspect of an embodiment of the present invention, a method for liveness detection is provided.

[0045] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for liveness detection according to an embodiment of the present invention. Figure 1 As shown, the method of liveness detection includes:

[0046] Step S101, obtaining a picture to be detected, and then converting the picture to be detected into input pictures of multiple color models;

[0047] Step S102: input the plurality of input images into a pre-trained detection model to obtain output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body.

[0048] Live means that the target in the image to be detected is a real target, and non-live means that the target in the image to be detected is not a real target, such as a pre-taken target photo. The target in the embodiment of the present invention can be selectively set according to the actual situation. For example, fingerprints are used as targets. For another example, in scenarios such as using faces to unlock smartphones, face recognition to punch in, and face access control systems, the target is a face.

[0049] The color model is a mathematical model that uses a set of numerical values ​​to describe color. The present invention directly converts the image to be detected into images of multiple color models, and uses the images of each color model as features to input into the detection model. There is no need to manually extract the features of the image to be detected, and the features can be automatically selected, with good generalization and high detection accuracy when switching scenes.

[0050] Optionally, the multiple color models include: bgr color model, hsv color model, YCbCr color model. The bgr color model is a color model that obtains a variety of colors by changing the three color channels of blue (B), green (G), and red (R) and superimposing them on each other. HSV (Hue, Saturation, Value) is a color space created based on the intuitive characteristics of color, also known as the hexcone model (Hexcone Model). The color parameters in the model are: hue (H), saturation (S), and brightness (V). YCbCr is a color space, Y is the brightness (luma) component of the color, and Cb and Cr are the concentration offset components of blue and red. Using the three color models of bgr, hsv and YCbCr can further improve the accuracy of living body detection.

[0051] When the detection model is optional, each sample image can be converted into a sample input image of multiple color models, and then the sample input image is used as the input and the sample label of the sample image is used as the output training model, that is, the training model is trained through only one channel.

[0052] In the present invention, the detection model is obtained by training according to the following steps: obtaining training samples, the training samples include sample images and sample labels, the sample labels are used to indicate whether the target in the sample image is a living body; collecting the target area image in the sample image; determining each target key point in the target area image, and determining the target contour based on each target key point; converting the target area image into sample input images of multiple color models; training based on the sample input images and target contours of the multiple color models corresponding to each of the sample images to obtain the detection model.

[0053] In addition to using the sample input images corresponding to each sample image as input and the sample labels of the sample images as output training models, the present invention also determines the target contours in each sample image, and uses the determined target contours as input for model training, that is, the present invention uses two channels for model training. During the model training process, the model parameters of the previous channel training are adjusted according to the calculation results of the latter channel, and the model can be trained from multiple dimensions. Compared with the aforementioned method of using only one channel to train the model, the present invention uses two channels to train the model, and the accuracy of the resulting detection model is better.

[0054] Optionally, training is performed based on sample input images of multiple color models corresponding to each of the sample images and target contours to obtain the detection model, including:

[0055] The sample input images of multiple color models corresponding to the sample images are input into the googleNet network (a deep learning network) for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

[0056] In this example, the model parameters are optimized not only based on the training results of the sample input images and the sample labels of the sample images, but also based on the Euclidean distance corresponding to each target contour, which can further improve the accuracy of the detection model.

[0057] Optionally, the target area image in the sample image is collected by the SSD algorithm; and each target key point in the target area image is determined, including: determining each target key point in the target area image based on the squeezeNet network through the MTCNN algorithm. The number of target key points can be selectively set according to actual conditions. Exemplarily, the target is a face, and the face area image in the sample image is collected by the SSD algorithm, and then based on the squeezeNet network, according to the loss function of the MTCNN algorithm, the position of the face and the positions of the eyebrows, eyes, nose, mouth, and facial contours, 68 key points are obtained. Determining each target key point in the target area image based on the squeezeNet network can reduce the computational complexity of model training.

[0058] In actual application, when determining the target contour in the target area image, the target key points in all sample images can be calculated first, and then the target contour shape can be obtained through the target key points. Among them, for living targets, such as real faces, the face contour is obtained using the face key points, the pixel value of the pixel inside the contour is 1, and the pixel value of the pixel outside the contour is set to 0; for non-living targets, such as fake faces, the pixel values ​​of all pixels are set to 0, so as to obtain the face contours of positive and negative samples. Figure 2 and Figure 3 As shown, a positive sample image refers to a sample image in which the target is a living object, and a negative sample image refers to a sample image in which the target is a non-living object.

[0059] Optionally, after collecting the target area images in the sample pictures, it also includes: unifying the posture and size of each target area image. The target areas in different sample pictures, such as face areas, often have different sizes and different rotation angles. Therefore, the average target key points can be statistically obtained first, and then each target area image is rotated, translated, and scaled to minimize the distance between the key points and the average key points. The target areas obtained in this way are all of the same size and the same rotation angle, that is, the same posture and the same size. Unifying the posture and size of the target area images corresponding to each sample picture facilitates key point detection and target contour recognition, and reduces the computational complexity of model training.

[0060] The liveness detection method of this embodiment can be applied in multiple scenarios such as insurance and access control. When performing face detection, the present invention can effectively solve the problem of whether the face image is taken of a real person, laying a foundation for the promotion of face applications. Since face toilet cleaning can be achieved without the user making any coordinated actions, the user experience can be improved.

[0061] According to a second aspect of an embodiment of the present invention, a device for implementing the above method is provided.

[0062] Figure 4 FIG. 1 is a schematic diagram of the main components of a living body detection device according to an embodiment of the present invention. Figure 4 As shown, the living body detection device 400 includes:

[0063] The picture conversion unit 401 obtains the picture to be detected, and then converts the picture to be detected into input pictures of multiple color models;

[0064] A model detection unit 402 inputs the plurality of input images into a pre-trained detection model to obtain output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body;

[0065] The model training unit 403 is trained to obtain the detection model according to the following steps:

[0066] Acquire a training sample, wherein the training sample includes a sample image and a sample label, wherein the sample label is used to indicate whether a target in the sample image is a living body;

[0067] Collecting a target area image in the sample image; determining each target key point in the target area image, and determining a target contour based on each target key point;

[0068] The target area image is converted into sample input images of multiple color models; and training is performed based on the sample input images of the multiple color models corresponding to each of the sample images and the target contour to obtain the detection model.

[0069] Optionally, the multiple color models include: bgr color model, hsv color model, and YCbCr color model.

[0070] Optionally, the model training unit performs training based on sample input images of multiple color models corresponding to each of the sample images and target contours to obtain the detection model, including:

[0071] The sample input images of multiple color models corresponding to the sample images are input into the GoogleNet network for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

[0072] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for liveness detection, comprising:

[0073] one or more processors;

[0074] a storage device for storing one or more programs,

[0075] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0076] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0077] Figure 5 An exemplary system architecture 500 is shown to which the method or apparatus for liveness detection according to the embodiments of the present invention may be applied.

[0078] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0079] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0080] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0081] The server 505 may be a server that provides various services, such as a background management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The background management server may analyze and process the received application login request and other data, and feed back the processing results (such as liveness detection results, etc. - only an example) to the terminal device.

[0082] It should be noted that the method for liveness detection provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the device for liveness detection is generally disposed in the server 505 .

[0083] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0084] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device 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.

[0085] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0086] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0087] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0088] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-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 of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), 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. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

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

[0090] The units involved in the embodiments of the present invention can be implemented by software or hardware. The units described can also be set in a processor, for example, can be described as: a processor includes: an image conversion unit, which obtains the image to be detected, and then converts the image to be detected into input images of multiple color models; a model detection unit, which inputs multiple input images into a pre-trained detection model, and obtains output data of the detection model, and the output data is used to indicate whether the target in the image to be detected is a living body; a model training unit, which trains to obtain the detection model according to the following steps: obtaining training samples, the training samples include sample images and sample labels, and the sample labels are used to indicate whether the target in the sample image is a living body; collecting the target area image in the sample image; determining each target key point in the target area image, and determining the target contour based on each target key point; converting the target area image into sample input images of multiple color models; training based on the sample input images and target contours of the multiple color models corresponding to each sample image to obtain the detection model. Among them, the names of these units do not constitute a limitation on the units themselves in some cases. For example, the image conversion unit can also be described as "a unit that inputs multiple input images into a pre-trained detection model."

[0091] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a picture to be detected, and then converting the picture to be detected into input pictures of multiple color models; inputting multiple input pictures into a pre-trained detection model, and obtaining output data of the detection model, and the output data is used to indicate whether the target in the picture to be detected is a living body; wherein the detection model is trained according to the following steps: obtaining training samples, the training samples include sample pictures and sample labels, and the sample labels are used to indicate whether the target in the sample picture is a living body; collecting the target area image in the sample picture; determining each target key point in the target area image, and determining the target contour based on each target key point; converting the target area image into a sample input picture of multiple color models; training based on the sample input pictures and target contours of the multiple color models corresponding to each sample picture, to obtain the detection model.

[0092] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: the image to be detected is converted into an input image of multiple color models as a feature input detection model of the image to be detected, and features can be automatically selected with good generalization and high detection accuracy when switching scenes.

[0093] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for liveness detection, characterized in that: include: Acquire a picture to be detected, and then convert the picture to be detected into input pictures of multiple color models; Inputting the plurality of input images into a pre-trained detection model, and obtaining output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body; The detection model is trained according to the following steps: Acquire a training sample, wherein the training sample includes a sample image and a sample label, wherein the sample label is used to indicate whether a target in the sample image is a living body; Collecting a target area image in the sample image; determining each target key point in the target area image, and determining a target contour based on each target key point; The target area image is converted into sample input images of multiple color models; training is performed based on the sample input images of the multiple color models corresponding to each of the sample images and the target contour to obtain the detection model; two channels are used for model training, and during the model training process, the model parameters trained by the previous channel are adjusted according to the calculation results of the latter channel.

2. The method according to claim 1, characterized in that The multiple color models include: bgr color model, hsv color model, and YCbCr color model.

3. The method according to claim 1, characterized in that The detection model is obtained by training based on sample input images of multiple color models corresponding to each sample image and the target contour, including: The sample input images of multiple color models corresponding to the sample images are input into the GoogleNet network for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

4. The method according to claim 1, characterized in that Acquire the target area image in the sample image by using the SSD algorithm; Determining each target key point in the target area image includes: determining each target key point in the target area image based on a squeezeNet network through an MTCNN algorithm.

5. The method according to claim 1, characterized in that After collecting the target area images in the sample pictures, the method further includes: unifying the posture and size of each of the target area images.

6. A device for liveness detection, characterized in that: include: An image conversion unit is used to obtain an image to be detected and then convert the image to be detected into input images of multiple color models; A model detection unit, inputting the plurality of input images into a pre-trained detection model, and obtaining output data of the detection model, wherein the output data is used to indicate whether the target in the image to be detected is a living body; The model training unit is trained to obtain the detection model according to the following steps: Acquire a training sample, wherein the training sample includes a sample image and a sample label, wherein the sample label is used to indicate whether a target in the sample image is a living body; Collecting a target area image in the sample image; determining each target key point in the target area image, and determining a target contour based on each target key point; The target area image is converted into sample input images of multiple color models; training is performed based on the sample input images of the multiple color models corresponding to each of the sample images and the target contour to obtain the detection model; two channels are used for model training, and during the model training process, the model parameters trained by the previous channel are adjusted according to the calculation results of the latter channel.

7. The device according to claim 6, characterized in that The multiple color models include: bgr color model, hsv color model, and YCbCr color model.

8. The device according to claim 6, characterized in that The model training unit performs training based on sample input images of multiple color models corresponding to each of the sample images and the target contour to obtain the detection model, including: The sample input images of multiple color models corresponding to the sample images are input into the GoogleNet network for forward propagation to obtain a predicted contour; the Euclidean distance between the predicted contour and the target contour is determined, and back propagation is performed based on the Euclidean distance to obtain the detection model.

9. An electronic device for liveness detection, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Human face key point detection method and apparatus

    CN108764048A

  • Living body detection method and device based on human face

    CN109858439A

  • Human face living body detection method and device and computer readable storage medium

    CN110427828A