Liveness detection method, device, equipment and computer-readable storage medium
By performing silent liveness detection and light liveness detection on the real-time video stream sent by the client, and combining the results of the two to determine whether the face image to be detected is live, the problem of low detection accuracy and real-time performance in the existing technology is solved, and Reduces client processing load.
Patent Information
- Application Number
- CN201910405260.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-15
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2039-05-15
AI Technical Summary
The existing live detection methods have problems such as low detection accuracy and real-time performance and high client processing burden.
Perform silent life detection by receiving the first real-time video stream sent by the client, send light life detection instructions to the client, control the client screen to light up, and receive the second real-time video stream during the lighting process to perform light life detection, combining the two The result determines whether the face image to be detected is a living body.
It improves the accuracy and real-time performance of living body detection and reduces the processing burden on the client.
Smart Images

Figure CN110119719B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a liveness detection method, device, equipment and computer-readable storage medium. Background Art
[0002] With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming to financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.
[0003] At present, face recognition technology has been widely used in identity authentication scenarios such as financial registration and payment. Face recognition technology includes face verification and liveness detection. Liveness detection is mainly used to confirm that the collected face image data comes from the user himself, rather than playback or forged materials. Existing liveness detection methods include: (1) Light liveness. Light liveness is to detect whether the user is alive by emitting light from the mobile phone screen and then detecting the reflected light from the face. The existing light liveness cannot completely resist plane attacks and video playback attacks, resulting in low accuracy of the detection results. In addition, the client needs to record the video containing the user's face and then send the video to the background server for detection, resulting in low real-time detection and affecting the user experience. (2) Silent liveness. Silent liveness determines whether a user is alive by detecting changes in micro-expressions within a short period of time (such as the movement of eyelids and eyeballs, blinking, and the expansion and contraction of lips and surrounding cheeks). Existing silent liveness cannot effectively resist plane attacks, video playback attacks, and mask attacks, resulting in low accuracy of detection results. In addition, the detection process is completed on the client, resulting in a heavy processing burden on the client.
[0004] Therefore, existing liveness detection methods have problems such as low detection accuracy and real-time performance, and a heavy client processing burden. Summary of the invention
[0005] The main purpose of the present invention is to provide a liveness detection method, device, equipment and computer-readable storage medium, aiming to improve the accuracy and real-time performance of liveness detection while reducing the client processing burden.
[0006] To achieve the above object, the present invention provides a liveness detection method, which comprises the following steps:
[0007] Receive a first real-time video stream sent by a client, perform silent liveness detection on a face image to be detected in the first real-time video stream, and obtain a first detection result;
[0008] Sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule;
[0009] During the process of the client screen emitting light, receiving a second real-time video stream sent by the client, performing light liveness detection on the face image to be detected in the second real-time video stream, and obtaining a second detection result;
[0010] Determine whether the face image to be detected is alive according to the first detection result and the second detection result.
[0011] Preferably, the step of receiving the first real-time video stream sent by the client comprises:
[0012] When receiving a liveness detection instruction sent by a client, establishing a webpage instant messaging connection with the client;
[0013] The first real-time video stream sent by the client is received through the web instant messaging connection.
[0014] Preferably, before the step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain a first detection result, the step further includes:
[0015] Obtaining video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to a preset video brightness;
[0016] When the video brightness is greater than or equal to a preset video brightness, obtaining the size and position of a face in the video corresponding to the first real-time video stream, and determining whether the size and position of the face meet a preset condition;
[0017] When the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video;
[0018] When the face background is different from the face background in the pre-saved historical liveness detection video, the step of performing silent liveness detection on the face image to be detected in the first real-time video stream is performed to obtain a first detection result.
[0019] Preferably, after the step of determining whether the face background is the same as the face background in the pre-saved historical liveness detection video, the method further includes:
[0020] When the face background is the same as the face background in the pre-saved historical liveness detection video, it is determined that the face image to be detected is not a live body, and prompt information indicating that the liveness detection has failed is returned to the client.
[0021] Preferably, the step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain a first detection result comprises:
[0022] Selecting a preset number of video frames from the first real-time video stream, sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent living body deep learning service;
[0023] Receive the first credibility value returned by the human skin mask deep learning service and the silent living body deep learning service, and use the first credibility value as the first detection result.
[0024] Preferably, the step of sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule includes:
[0025] Sending a light liveness detection instruction to the client to control the client screen to emit light of preset colors in a preset order;
[0026] The step of performing light liveness detection on the face image to be detected in the second real-time video stream to obtain a second detection result comprises:
[0027] Acquire the facial images corresponding to the light of the preset colors from the second real-time video stream to form a facial image sequence, wherein each color of light corresponds to a plurality of frames of facial images;
[0028] Obtaining difference maps between two adjacent colors in the facial image sequence to obtain a difference map sequence;
[0029] Sending the difference graph sequence to a preset plane attack deep learning service and a video attack deep learning service;
[0030] Receive second credibility values returned by the plane attack deep learning service and the video attack deep learning service, and use the second credibility values as the second detection result.
[0031] Preferably, the step of determining whether the face image to be detected is alive according to the first detection result and the second detection result comprises:
[0032] Comparing the first credibility value and the second credibility value with preset thresholds respectively;
[0033] When the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, it is determined that the face image to be detected is a living body.
[0034] Preferably, before the step of determining that the face image to be detected is alive, the method further comprises:
[0035] Determine whether the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person;
[0036] When the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person, the step of determining that the facial image to be detected is a living person is performed.
[0037] In addition, to achieve the above object, the present invention further provides a living body detection device, the living body detection device comprising:
[0038] A first detection module is used to receive a first real-time video stream sent by a client, perform silent liveness detection on a face image to be detected in the first real-time video stream, and obtain a first detection result;
[0039] A control module, used for sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule;
[0040] A second detection module is used to receive a second real-time video stream sent by the client during the process of the client screen emitting light, perform light liveness detection on the face image to be detected in the second real-time video stream, and obtain a second detection result;
[0041] A determination module is used to determine whether the face image to be detected is alive according to the first detection result and the second detection result.
[0042] Preferably, the first detection module is further used for:
[0043] When receiving a liveness detection instruction sent by a client, establishing a webpage instant messaging connection with the client;
[0044] The first real-time video stream sent by the client is received through the web instant messaging connection.
[0045] Preferably, the first detection module is further used for:
[0046] Obtaining video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to a preset video brightness;
[0047] When the video brightness is greater than or equal to a preset video brightness, obtaining the size and position of a face in the video corresponding to the first real-time video stream, and determining whether the size and position of the face meet a preset condition;
[0048] When the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video;
[0049] When the face background is different from the face background in the pre-saved historical liveness detection video, silent liveness detection is performed on the face image to be detected in the first real-time video stream to obtain a first detection result.
[0050] Preferably, the first detection module is further used for:
[0051] When the face background is the same as the face background in the pre-saved historical liveness detection video, it is determined that the face image to be detected is not a live body, and prompt information indicating that the liveness detection has failed is returned to the client.
[0052] Preferably, the first detection module is further used for:
[0053] Selecting a preset number of video frames from the first real-time video stream, sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent living body deep learning service;
[0054] Receive the first credibility value returned by the human skin mask deep learning service and the silent living body deep learning service, and use the first credibility value as the first detection result.
[0055] Preferably, the control module is also used for:
[0056] Sending a light liveness detection instruction to the client to control the client screen to emit light of preset colors in a preset order;
[0057] The second detection module is also used for:
[0058] Acquire the facial images corresponding to the light of the preset colors from the second real-time video stream to form a facial image sequence, wherein each color of light corresponds to a plurality of frames of facial images;
[0059] Obtaining difference maps between two adjacent colors in the facial image sequence to obtain a difference map sequence;
[0060] Sending the difference graph sequence to a preset plane attack deep learning service and a video attack deep learning service;
[0061] Receive second credibility values returned by the plane attack deep learning service and the video attack deep learning service, and use the second credibility values as the second detection result.
[0062] Preferably, the determining module is further used for:
[0063] Comparing the first credibility value and the second credibility value with preset thresholds respectively;
[0064] When the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, it is determined that the face image to be detected is a living body.
[0065] Preferably, the determining module is further used for:
[0066] Determine whether the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person;
[0067] When the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person, it is determined that the facial images to be detected are living beings.
[0068] In addition, to achieve the above-mentioned purpose, the present invention also provides a liveness detection device, which includes: a memory, a processor, and a liveness detection program stored in the memory and executable on the processor, and when the liveness detection program is executed by the processor, the steps of the liveness detection method described above are implemented.
[0069] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a liveness detection program is stored, and when the liveness detection program is executed by a processor, the steps of the liveness detection method described above are implemented.
[0070] The present invention receives a first real-time video stream sent by a client, performs silent liveness detection on a face image to be detected in the first real-time video stream, and obtains a first detection result; sends a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule; during the light-emitting process of the client screen, receives a second real-time video stream sent by the client, performs light liveness detection on the face image to be detected in the second real-time video stream, and obtains a second detection result; determines whether the face image to be detected is alive based on the first detection result and the second detection result. The present invention improves the accuracy and real-time performance of liveness detection by sequentially performing silent liveness detection and light liveness detection on the real-time video stream sent by the client, and then determines whether the face image to be detected in the real-time video stream is alive. In addition, the process does not require the client to perform complex calculations, thereby reducing the client processing burden. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0072] Figure 2 FIG. 1 is a flow chart of a first embodiment of a living body detection method according to the present invention.
[0073] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0074] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0075] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0076] The liveness detection device in the embodiment of the present invention is a liveness detection server corresponding to the client.
[0077] like Figure 1 As shown, the liveness detection device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0078] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0079] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a liveness detection program.
[0080] exist Figure 1In the device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the liveness detection program stored in the memory 1005 and perform the operations in each embodiment of the following liveness detection method.
[0081] Based on the above hardware structure, an embodiment of the living body detection method of the present invention is proposed.
[0082] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a liveness detection method according to the present invention, wherein the method comprises:
[0083] Step S10, receiving a first real-time video stream sent by a client, performing silent liveness detection on a face image to be detected in the first real-time video stream, and obtaining a first detection result;
[0084] The liveness detection method of this embodiment is applied to scenarios where a background liveness detection server performs identity authentication on a client user, such as various financial registration and payment scenarios in financial institutions (banks, insurance institutions, or financial management institutions), where the client can be a smart phone, tablet computer, portable computer, etc.
[0085] In this embodiment, when performing liveness detection, it is necessary to first establish a communication connection between the client and the server, and the communication connection can support real-time transmission of the video stream. After the communication connection is established, the client user enters the face adjustment stage. In this stage, the server receives the first real-time video stream sent by the client, and performs silent liveness detection on the face image to be detected in the first real-time video stream to obtain a first detection result.
[0086] Among them, the step of receiving the first real-time video stream sent by the client may further include: when receiving a liveness detection instruction sent by the client, establishing a web instant messaging connection with the client; and receiving the first real-time video stream sent by the client through the web instant messaging connection.
[0087] Specifically, the client can send a liveness detection instruction to the server when the user performs financial registration, payment or other scenarios that require user identity authentication. After the server receives the liveness detection instruction, it establishes a WebRTC (Web Real-Time Communication) connection with the client. Through the WebRTC connection, the server receives the first real-time video stream sent by the client, where the WebRTC connection supports real-time video transmission by web browsers.
[0088] It should be noted that in order to maximize the data transmission rate between the client and the server, the WebRTC connection can be based on the 5th generation mobile communication network (5G). Under 5G, the upload (500M / s) and download (1G / s) speeds are very fast, and the video is sufficient for real-time transmission. Of course, the WebRTC connection can also be based on other communication networks, which can be flexibly set during specific implementation.
[0089] Furthermore, before the step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain the first detection result, it may also include: obtaining the video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to the preset video brightness; when the video brightness is greater than or equal to the preset video brightness, obtaining the face size and face position in the video corresponding to the first real-time video stream, and determining whether the face size and the face position meet the preset conditions; when the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video; when the face background is different from the face background in the pre-saved historical liveness detection video, executing the step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain the first detection result.
[0090] In this embodiment, taking into account the impact of video brightness, facial posture in the video, and some typical attack scenarios related to facial background (if the facial background is the same but the face is different in several consecutive liveness detections, it is very likely an attack) on the accuracy of liveness detection, before performing silent liveness detection, the impact of these factors can be eliminated by detecting video brightness, face size and face position in the video, and face background in the video.
[0091] Specifically, after receiving the first real-time video stream sent by the client, the server can first obtain the video brightness corresponding to the first real-time video stream, and determine whether the video brightness is greater than or equal to the preset video brightness. If not, a prompt message is returned to the client to prompt the user to adjust the brightness. If so, face posture detection is entered. At this time, the face size and face position in the video corresponding to the first real-time video stream are obtained, and it is determined whether the face size and the face position meet preset conditions, which include but are not limited to whether the face size is within a preset range, whether the face position is in the center of the screen and is a complete face, etc. If not, the face size and the face position are within a preset range, and the face position is in the center of the screen and is a complete face. If the preset conditions are met, it means that the current facial posture is not correct (such as being too close or too far from the screen, looking up, tilting the head, etc.). At this time, a prompt message is returned to the client to prompt the user to adjust the posture. If the preset conditions are met, the facial background in the video corresponding to the first real-time video stream is further obtained to determine whether the facial background is the same as the facial background in the pre-saved historical liveness detection video, where the historical liveness detection video is the last or previous liveness detection videos of this liveness detection. If they are different, there is no attack. At this time, a silent liveness detection is performed on the face image to be detected in the first real-time video stream to obtain a first detection result.
[0092] Furthermore, after the step of determining whether the face background is the same as the face background in a pre-saved historical liveness detection video, it also includes: when the face background is the same as the face background in a pre-saved historical liveness detection video, determining that the face image to be detected is not alive, and returning a prompt message of liveness detection failure to the client.
[0093] When the face background is the same as the face background in the pre-saved historical liveness detection video, it is very likely an attack scenario. At this time, the server directly determines that the face image to be detected is not alive, and returns a prompt message of liveness detection failure to the client.
[0094] Through the above method, before silent liveness detection, the influence of video brightness, face posture in the video and face background on the accuracy of liveness detection can be effectively eliminated, which is conducive to further improving the accuracy of liveness detection.
[0095] Step S20, sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule;
[0096] After obtaining the silent liveness detection result, the server sends a light liveness detection instruction to the client to control the client screen to emit light according to preset rules. For example, the client screen can be controlled to emit light of different colors in a preset order. During this process, the client collects a second real-time video stream containing the face image to be detected through the camera and sends it to the server.
[0097] Step S30, receiving a second real-time video stream sent by the client while the client screen is emitting light, performing light liveness detection on the face image to be detected in the second real-time video stream, and obtaining a second detection result;
[0098] When the client screen is luminous, the server receives a second real-time video stream sent by the client, and performs light liveness detection on the face image to be detected in the second real-time video stream to obtain a second detection result.
[0099] Step S40: determining whether the face image to be detected is alive according to the first detection result and the second detection result.
[0100] In this step, the server determines whether the face image to be detected in the video stream sent by the client is alive based on the above-mentioned first detection result and the second detection result. For example, when the first detection result and the second detection result both return that the face image to be detected is alive, the server determines that the face image to be detected is alive; for another example, when the first detection result and the second detection result are credibility values, if the credibility values of the first detection result and the second detection result are both greater than the preset threshold, the server determines that the face image to be detected is alive. By combining the silent liveness detection result and the light liveness detection result, accurate judgment of whether the face image to be detected is alive is achieved.
[0101] It should be noted that the server can also save the first real-time video stream and the second real-time video stream to facilitate subsequent manual review and tracing.
[0102] In this embodiment, silent liveness detection and light liveness detection are performed in sequence on the real-time video stream sent by the client to determine whether the face image to be detected in the real-time video stream is alive, thereby improving the accuracy and real-time performance of liveness detection. In addition, this process does not require the client to perform complex calculations, thereby reducing the processing burden on the client.
[0103] Furthermore, based on the first embodiment of the liveness detection method of the present invention, a second embodiment of the liveness detection method of the present invention is proposed.
[0104] In this embodiment, the step of performing silent liveness detection on the facial image to be detected in the first real-time video stream to obtain a first detection result includes: selecting a preset number of video frames from the first real-time video stream, and sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent liveness deep learning service; receiving a first credibility value returned by the human skin mask deep learning service and the silent liveness deep learning service, and using the first credibility value as the first detection result.
[0105] After receiving the first real-time video stream, the server can select a preset number of video frames from the first real-time video stream. For example, in order to improve the accuracy of detection, the server can select an optimal video frame within a preset time period, and then send the selected video frame to the preset human skin mask deep learning service for human skin mask attack detection. At the same time, the server sends the first real-time video stream to the preset silent liveness deep learning service for silent liveness detection; thereafter, the server receives the credibility values returned by the human skin mask deep learning service and the silent liveness deep learning service, and uses it as the first detection result.
[0106] Through the above method, human skin mask attack detection and silent liveness detection are implemented on the first real-time video stream, and the detection is relatively comprehensive.
[0107] Furthermore, based on the second embodiment of the liveness detection method of the present invention, a third embodiment of the liveness detection method of the present invention is proposed.
[0108] In this embodiment, the above-mentioned step S20 may include: sending a light liveness detection instruction to the client to control the client screen to emit preset colors of light in sequence according to a preset order; correspondingly, the step of performing light liveness detection on the face image to be detected in the second real-time video stream to obtain a second detection result includes: obtaining the face image corresponding to the preset colors of light from the second real-time video stream to form a face image sequence, wherein each color of light corresponds to several frames of face images; obtaining a difference map between two adjacent colors in the face image sequence to obtain a difference map sequence; sending the difference map sequence to a preset plane attack deep learning service and a video attack deep learning service; receiving a second credibility value returned by the plane attack deep learning service and the video attack deep learning service, and using the second credibility value as the second detection result.
[0109] Specifically, in the light liveness detection stage, the server controls the client screen to emit preset colors of light in sequence according to a preset order, wherein the types and quantities of the colors of the light can be flexibly selected, for example, 4 colors can be randomly selected from 6 colors of light, namely red, yellow, blue, purple, green, and orange, and then the client screen is controlled to emit the 4 colors of light in sequence according to a preset order. According to the reflection of the light, the second real-time video stream will contain the face image corresponding to the light of the preset colors. The server obtains the face image corresponding to the light of the preset colors from the second real-time video stream, thereby forming a face image sequence, wherein each color of light The lines correspond to several frames of face images; then, the server obtains the difference maps between the two adjacent colors in the face image sequence to obtain a difference map sequence. For example, if the client screen emits red, yellow, blue, and purple light in sequence, it is necessary to obtain the difference maps between the adjacent colors of red and yellow, yellow and blue, and blue and purple respectively, thereby obtaining a difference map sequence; then, the difference map sequence is sent to the preset plane attack deep learning service and video attack deep learning service for light liveness detection; the server receives the credibility value returned by the plane attack deep learning service and the video attack deep learning service, and uses it as the second detection result.
[0110] The above method performs light liveness detection on the second real-time video stream through the plane attack deep learning service and the video attack deep learning service, and the detection is relatively comprehensive.
[0111] Furthermore, based on the third embodiment of the liveness detection method of the present invention, a fourth embodiment of the liveness detection method of the present invention is proposed.
[0112] In this embodiment, the above step S40 may include: comparing the first credibility value and the second credibility value with preset thresholds respectively; when the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, determining that the face image to be detected is alive.
[0113] In this embodiment, the server compares the first credibility value and the second credibility value with the preset threshold value to determine whether the face image to be detected is alive. In one embodiment, if the preset security level is high, when the first credibility value and the second credibility value are both greater than or equal to the preset threshold value, the face image to be detected is determined to be alive; in another embodiment, if the preset security level is low, when the first credibility value or the second credibility value is greater than or equal to the preset threshold value, the face image to be detected is determined to be alive. Such judgment has high flexibility.
[0114] Furthermore, before the step of determining that the facial image to be detected is a living body, the step may also include: judging whether the facial image to be detected in the first real-time video stream and the second real-time video stream is the same person; when the facial image to be detected in the first real-time video stream and the second real-time video stream is the same person, executing the step of determining that the facial image to be detected is a living body.
[0115] Considering that in actual attack scenarios, the client user may change his face. Therefore, before determining that the face image to be detected is alive, face recognition can be used to determine whether the face image to be detected in the first real-time video stream and the second real-time video stream is the same person. If so, the face image to be detected is determined to be alive; otherwise, the face image to be detected is determined not to be alive, and a prompt message indicating that the liveness detection failed is returned to the client. In this way, the accuracy of liveness detection is further improved.
[0116] The present invention also provides a living body detection device, the living body detection device comprising:
[0117] A first detection module is used to receive a first real-time video stream sent by a client, perform silent liveness detection on a face image to be detected in the first real-time video stream, and obtain a first detection result;
[0118] A control module, used for sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule;
[0119] A second detection module is used to receive a second real-time video stream sent by the client during the process of the client screen emitting light, perform light liveness detection on the face image to be detected in the second real-time video stream, and obtain a second detection result;
[0120] A determination module is used to determine whether the face image to be detected is alive according to the first detection result and the second detection result.
[0121] Furthermore, the first detection module is also used for:
[0122] When receiving a liveness detection instruction sent by a client, establishing a webpage instant messaging connection with the client;
[0123] The first real-time video stream sent by the client is received through the web instant messaging connection.
[0124] Furthermore, the first detection module is also used for:
[0125] Obtaining video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to a preset video brightness;
[0126] When the video brightness is greater than or equal to a preset video brightness, obtaining the size and position of a face in the video corresponding to the first real-time video stream, and determining whether the size and position of the face meet a preset condition;
[0127] When the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video;
[0128] When the face background is different from the face background in the pre-saved historical liveness detection video, silent liveness detection is performed on the face image to be detected in the first real-time video stream to obtain a first detection result.
[0129] Furthermore, the first detection module is also used for:
[0130] When the face background is the same as the face background in the pre-saved historical liveness detection video, it is determined that the face image to be detected is not a live body, and prompt information indicating that the liveness detection has failed is returned to the client.
[0131] Furthermore, the first detection module is also used for:
[0132] Selecting a preset number of video frames from the first real-time video stream, sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent living body deep learning service;
[0133] Receive the first credibility value returned by the human skin mask deep learning service and the silent living body deep learning service, and use the first credibility value as the first detection result.
[0134] Furthermore, the control module is also used for:
[0135] Sending a light liveness detection instruction to the client to control the client screen to emit light of preset colors in a preset order;
[0136] The second detection module is also used for:
[0137] Acquire the facial images corresponding to the light of the preset colors from the second real-time video stream to form a facial image sequence, wherein each color of light corresponds to a plurality of frames of facial images;
[0138] Obtaining difference maps between two adjacent colors in the facial image sequence to obtain a difference map sequence;
[0139] Sending the difference graph sequence to a preset plane attack deep learning service and a video attack deep learning service;
[0140] Receive second credibility values returned by the plane attack deep learning service and the video attack deep learning service, and use the second credibility values as the second detection result.
[0141] Furthermore, the determining module is also used for:
[0142] Comparing the first credibility value and the second credibility value with preset thresholds respectively;
[0143] When the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, it is determined that the face image to be detected is a living body.
[0144] Furthermore, the determining module is also used for:
[0145] Determine whether the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person;
[0146] When the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person, it is determined that the facial images to be detected are living beings.
[0147] The operations performed by the above modules may be specifically referred to in the embodiment of the living body detection method of the present invention, and will not be described in detail here.
[0148] The present invention also provides a computer-readable storage medium.
[0149] The computer-readable storage medium of the present invention stores a liveness detection program, and when the liveness detection program is executed by a processor, the steps of the liveness detection method described above are implemented.
[0150] Among them, the method implemented when the liveness detection program running on the processor is executed can refer to the various embodiments of the liveness detection method of the present invention, and will not be repeated here.
[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0152] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0154] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for detecting a living body, characterized in that: The living body detection method comprises the following steps: Receive a first real-time video stream sent by a client, perform silent liveness detection on a face image to be detected in the first real-time video stream, and obtain a first detection result; Sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule; During the process of the client screen emitting light, receiving a second real-time video stream sent by the client, performing light liveness detection on the face image to be detected in the second real-time video stream, and obtaining a second detection result; Determine whether the face image to be detected is alive according to the first detection result and the second detection result; Wherein, before the step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain a first detection result, the step further includes: Obtaining video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to a preset video brightness; When the video brightness is greater than or equal to a preset video brightness, obtaining the size and position of a face in the video corresponding to the first real-time video stream, and determining whether the size and position of the face meet a preset condition; When the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video; When the face background is different from the face background in the pre-saved historical liveness detection video, the step of performing silent liveness detection on the face image to be detected in the first real-time video stream is performed to obtain a first detection result.
2. The method for detecting a living body according to claim 1, wherein: The step of receiving the first real-time video stream sent by the client comprises: When receiving a liveness detection instruction sent by a client, establishing a webpage instant messaging connection with the client; The first real-time video stream sent by the client is received through the web instant messaging connection.
3. The method for detecting a living body according to claim 1, wherein: After the step of determining whether the face background is the same as the face background in the pre-saved historical liveness detection video, the method further includes: When the face background is the same as the face background in the pre-saved historical liveness detection video, it is determined that the face image to be detected is not a live body, and prompt information indicating that the liveness detection has failed is returned to the client.
4. The living body detection method according to any one of claims 1 to 3, characterized in that: The step of performing silent liveness detection on the face image to be detected in the first real-time video stream to obtain a first detection result comprises: Selecting a preset number of video frames from the first real-time video stream, sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent living body deep learning service; Receive the first credibility value returned by the human skin mask deep learning service and the silent living body deep learning service, and use the first credibility value as the first detection result.
5. The method for detecting a living body according to claim 4, wherein: The step of sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule includes: Sending a light liveness detection instruction to the client to control the client screen to emit light of preset colors in a preset order; The step of performing light liveness detection on the face image to be detected in the second real-time video stream to obtain a second detection result comprises: Acquire the facial images corresponding to the light of the preset colors from the second real-time video stream to form a facial image sequence, wherein each color of light corresponds to a plurality of frames of facial images; Obtaining difference maps between two adjacent colors in the facial image sequence to obtain a difference map sequence; Sending the difference graph sequence to a preset plane attack deep learning service and a video attack deep learning service; Receive second credibility values returned by the plane attack deep learning service and the video attack deep learning service, and use the second credibility values as the second detection result.
6. The method for detecting living body according to claim 5, characterized in that: The step of determining whether the face image to be detected is alive according to the first detection result and the second detection result comprises: Comparing the first credibility value and the second credibility value with preset thresholds respectively; When the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, it is determined that the face image to be detected is a living body.
7. The method for detecting a living body according to claim 6, wherein: Before the step of determining that the face image to be detected is alive, the method further includes: Determine whether the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person; When the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person, the step of determining that the facial image to be detected is a living person is performed.
8. A living body detection device, characterized in that: The living body detection device comprises: A first detection module is used to receive a first real-time video stream sent by a client, perform silent liveness detection on a face image to be detected in the first real-time video stream, and obtain a first detection result; A control module, used for sending a light liveness detection instruction to the client to control the client screen to emit light according to a preset rule; A second detection module is used to receive a second real-time video stream sent by the client during the process of the client screen emitting light, perform light liveness detection on the face image to be detected in the second real-time video stream, and obtain a second detection result; A determination module, configured to determine whether the face image to be detected is alive according to the first detection result and the second detection result; The first detection module is also used for: Obtaining video brightness corresponding to the first real-time video stream, and determining whether the video brightness is greater than or equal to a preset video brightness; When the video brightness is greater than or equal to a preset video brightness, obtaining the size and position of a face in the video corresponding to the first real-time video stream, and determining whether the size and position of the face meet a preset condition; When the face size and the face position meet the preset conditions, obtaining the face background in the video corresponding to the first real-time video stream, and determining whether the face background is the same as the face background in the pre-saved historical liveness detection video; When the face background is different from the face background in the pre-saved historical liveness detection video, silent liveness detection is performed on the face image to be detected in the first real-time video stream to obtain a first detection result.
9. The living body detection device according to claim 8, characterized in that: The first detection module is also used for: When receiving a liveness detection instruction sent by a client, establishing a webpage instant messaging connection with the client; The first real-time video stream sent by the client is received through the web instant messaging connection.
10. The living body detection device according to any one of claims 8 to 9, characterized in that: The first detection module is also used for: Selecting a preset number of video frames from the first real-time video stream, sending the video frames to a preset human skin mask deep learning service, and at the same time, sending the first real-time video stream to a preset silent living body deep learning service; Receive the first credibility value returned by the human skin mask deep learning service and the silent living body deep learning service, and use the first credibility value as the first detection result.
11. The living body detection device according to claim 10, characterized in that: The control module is also used for: Sending a light liveness detection instruction to the client to control the client screen to emit light of preset colors in a preset order; The second detection module is also used for: Acquire the facial images corresponding to the light of the preset colors from the second real-time video stream to form a facial image sequence, wherein each color of light corresponds to a plurality of frames of facial images; Obtaining difference maps between two adjacent colors in the facial image sequence to obtain a difference map sequence; Sending the difference graph sequence to a preset plane attack deep learning service and a video attack deep learning service; Receive second credibility values returned by the plane attack deep learning service and the video attack deep learning service, and use the second credibility values as the second detection result.
12. The living body detection device according to claim 11, characterized in that: The determining module is also used for: Comparing the first credibility value and the second credibility value with preset thresholds respectively; When the first credibility value and / or the second credibility value is greater than or equal to the preset threshold, it is determined that the face image to be detected is a living body.
13. The living body detection device according to claim 12, characterized in that: The determining module is also used for: Determine whether the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person; When the facial images to be detected in the first real-time video stream and the second real-time video stream are of the same person, it is determined that the facial images to be detected are living beings.
14. A living body detection device, characterized in that: The liveness detection device comprises: a memory, a processor, and a liveness detection program stored in the memory and executable on the processor. When the liveness detection program is executed by the processor, the steps of the liveness detection method according to any one of claims 1 to 7 are implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a liveness detection program, and when the liveness detection program is executed by the processor, the steps of the liveness detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Bio-assay method and device and computer readable storage medium
CN107832712A
Living body detection method and device and storage medium
CN107992794A