WO2021219095A1 - 一种活体检测方法及相关设备 - Google Patents

一种活体检测方法及相关设备 Download PDF

Info

Publication number
WO2021219095A1
WO2021219095A1 PCT/CN2021/091118 CN2021091118W WO2021219095A1 WO 2021219095 A1 WO2021219095 A1 WO 2021219095A1 CN 2021091118 W CN2021091118 W CN 2021091118W WO 2021219095 A1 WO2021219095 A1 WO 2021219095A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
images
infrared light
infrared
difference
Prior art date
Application number
PCT/CN2021/091118
Other languages
English (en)
French (fr)
Inventor
刁继尧
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021219095A1 publication Critical patent/WO2021219095A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • This application relates to the field of face recognition technology, and in particular to a living body detection method and related equipment.
  • live body detection is a key technology in the face recognition process. Live body detection is mainly used to confirm that the collected face image is the real face of the user, rather than video playback or forged materials.
  • the current common face attack methods that use the user's face data information mainly include the following three:
  • Print photo attacks which mainly include using the user's own paper print photos (which can be a variety of printing materials, such as professional photo paper, A4 printing paper, etc.) and the user's own photos saved in the mobile phone.
  • the print photos can include Color print photos, black and white print photos, grayscale print photos, etc.
  • Face video attacks which mainly include recorded specific video playback, for example, video playback containing specific action instructions such as blinking, turning the head, opening the mouth, etc., which are used to deceive the face recognition system.
  • Three-dimensional face mask attacks There are many types of three-dimensional face masks.
  • the main materials include plastic and hard paper.
  • the cost of attacking masks of this type of material is low, but the material is very low similar to real human skin. It uses photos and real people.
  • the difference in texture characteristics can be easily identified.
  • the embodiments of the present application provide a living body detection method and related equipment, which can effectively improve the accuracy of living body detection, thereby accurately determining whether the face image collected by the camera is a real face of a living body, and avoiding user privacy leakage or property loss.
  • an embodiment of the present application provides a living body detection method, which is characterized in that it is applied to a terminal device, the terminal device includes an infrared camera module, the infrared camera module includes an infrared lamp, and the method includes: obtaining an environment Light intensity; according to the ambient light intensity, determine the N infrared light intensity of the infrared light; adjust the infrared light based on the N infrared light intensity, and shoot under the N infrared light intensities, respectively, N face images are collected; each of the N face images includes a target face; where N is an integer greater than or equal to 2; compare the target in the N face images In the face area, it is judged whether the target face is a living face according to the difference of the target face area in the N face images.
  • the method provided in the first aspect it is possible to formulate different image acquisition strategies in the live detection of face recognition according to the ambient light intensity in the current scene, set different infrared light intensities, and set different infrared light intensities (for example, It may include multiple infrared light intensities with a value greater than 0, and may also include infrared light intensities with a value equal to 0, that is, the infrared light is turned off for shooting), and multiple face images are collected. Then, according to the difference between the target face regions in the multiple face images, it is judged whether the target face is a living face.
  • the embodiments of the application not only take into account the influence of environmental light intensity, but also perform live body detection through the difference between the face images collected under different lighting, which greatly reduces the impact of environmental light intensity on live body detection and greatly improves The accuracy rate of living body detection is ensured, and the security of the application of face recognition technology is ensured, thereby ensuring the privacy and property safety of users.
  • each of the N infrared light intensities is greater than 0; if the ambient light intensity is greater than or equal to the With a preset value, the P infrared light intensities in the N infrared light intensities are all equal to 0, and the K infrared light intensities in the N infrared light intensities are all greater than 0; where P and K are greater than or equal to An integer of 1, and the sum of P and K is N.
  • the image acquisition strategy of turning on the infrared light can be adopted, and the infrared light can be adjusted to multiple values greater than 0 infrared light intensity, and collect multiple face images under the multiple infrared light intensity values greater than 0.
  • the ambient light intensity is greater than or equal to the preset value (that is, in the daytime, indoors with lights on and other strong light environments)
  • a face image with a value greater than 0 under the illumination of the infrared light intensity must also be collected with the face image with the infrared light turned off (that is, there is no infrared light, and the infrared light intensity is equal to 0).
  • adopting different image acquisition strategies under different environmental light intensities can greatly improve the accuracy of living body detection under various environmental conditions.
  • the above-mentioned infrared lamp may also be referred to as an infrared transmitter, which is not specifically limited in the embodiment of the present application.
  • the terminal device further includes an RGB camera
  • the infrared camera module further includes an infrared camera
  • the infrared light is adjusted based on the N infrared light intensity
  • each Shooting under the N infrared light intensities to collect and obtain N face images includes: if the ambient light intensity is less than the preset value, turning on the infrared lamp, and using the infrared camera to view Shooting under the N infrared light intensities, and collect the N face images; if the ambient light intensity is greater than or equal to the preset value, turn off the infrared lights and use the RGB cameras respectively Shooting under the P infrared light intensities to collect P face images; and turn on the infrared lamp, and shoot under the K infrared light intensities through the infrared camera to collect K images Face image.
  • the terminal device further includes an RGB camera
  • the above-mentioned infrared camera module further includes an infrared camera. It is understandable that in a low-light environment, because there is almost no visible light, ordinary RGB cameras cannot collect clear face images. At this time, infrared photography has better results. You can turn on the infrared light and The infrared camera is used to shoot separately under multiple infrared light intensity with a value greater than 0, and multiple clear face images are collected for subsequent live detection.
  • the effect of infrared light is minimal, so you can turn off the infrared light and use the RGB camera to shoot without infrared light (that is, the infrared light intensity is 0).
  • the face images collected by the RGB camera and the infrared camera in the above-mentioned strong light environment can be used for subsequent living body detection.
  • the target face area in the N face images is compared, and the target person is determined according to the difference in the target face area in the N face images Whether the face is a living face includes: determining the target face area in each of the N face images, and calculating the difference between the target face areas in two adjacent face images , Obtain M face difference maps; where M is an integer greater than or equal to 1 and less than N; input the M face difference maps to a pre-trained living body detection model to determine whether the target face is Living human face.
  • the target face area in each face image of the N face images may be determined first, and then the difference calculation of the target face area in the two adjacent face images may be performed. Obtain M face difference images. Finally, the M face difference images are input to a pre-trained living body detection model, and it is judged whether the target face is a living body face. In this way, compared with the detection of a living body by only collecting a face image in the prior art, the conditions for judging whether it is a living body face based on the difference in the target face area in the face image are more stringent, which greatly improves the performance of the living body detection. The accuracy rate ensures the user's privacy and property safety.
  • Calculating the difference in the face area to obtain M face difference maps includes: performing face detection on each of the N face images to obtain all of the face images in each of the face images.
  • the detection frame coordinates of the target face according to the detection frame coordinates of the target face in each face image, face cropping is performed on each face image, and each face image is determined
  • the target face area in the face image subtract the pixels of the target face area in the i-th face image from the target face area in the i+1-th face image to obtain the person after the pixel subtraction Face image; the histogram equalization of the face image after the pixel subtraction is performed to obtain the face difference map corresponding to the i-th face image and the i+1-th face image; i is greater than or equal to 1, And an integer less than M.
  • the face detection can be performed on each of the N face images to obtain the detection frame coordinates of the target face in each face image; and then according to the detection
  • the frame coordinates are used to crop each face image, thus, the target face area in each face image can be determined more accurately, and the accuracy of subsequent live detection is greatly improved.
  • This embodiment of the application does not do this. Specific restrictions. Since there are obvious differences between the face difference maps of the living face and the non-living face, compared with the detection of the living body by only collecting the face image in the prior art, it is judged whether it is a living body through the face difference map.
  • the face can greatly improve the accuracy of live detection, ensuring the privacy and property safety of users.
  • the living body detection model includes a deep recovery network and a classifier; the M face difference images are input to a pre-trained living body detection model to determine whether the target face is Living human faces, including: inputting the M face difference maps to the depth recovery network in the living body detection model to obtain M depth maps of target face regions corresponding to the M face difference maps ; Based on the depth maps of the M target face regions, determine whether the target face is a living face through the classifier.
  • the depth estimation can be performed on one or more face difference maps through the depth recovery network in the living body detection model to obtain the corresponding depth map of one or more target face regions, and then The live body face can be judged based on the depth map of the one or more target face regions by the classifier in the live body detection model, and the live body detection result can be output. For example, if the live body detection result indicates that the target face is a live body face, the target face passes the live body detection, that is, the user's face recognition is passed, and the user can perform operations such as registration or payment.
  • the target face fails the live body detection, that is, the face recognition fails, which effectively prevents Attackers use other people’s photos or masks for face recognition to steal other people’s private information and steal other people’s property.
  • the method further includes: obtaining a positive sample set and a negative sample set, the positive sample set includes a plurality of first face difference images, and the negative sample set includes a plurality of second persons Face difference map; each first face difference map in the multiple first face difference maps is a live face image taken under two infrared light intensities, and two live face images are collected The face difference map; each second face difference map in the plurality of second face difference maps is a photograph of a non-living human face under the two infrared light intensities, and the two collected A face difference map of a non-living face image; at least one of the two infrared light intensities is greater than 0; based on the multiple first face difference maps and the multiple second face differences The image is used as a training input, and the multiple first face difference images and the multiple second face difference images respectively correspond to living human faces or non-living human faces as labels, and the living detection model is obtained by training.
  • the positive sample may include multiple face difference maps of living human faces under different infrared light intensities (for example, it may include the face images of the human faces respectively captured by infrared cameras under two infrared light intensities with a value greater than 0).
  • the difference map can also include the face difference map between the face image collected by the RGB camera without infrared light and the face image collected by the infrared camera with the infrared light turned on),
  • the negative sample can include multiple The face difference map of non-living human faces (such as photos, masks, videos, etc.) under different infrared light intensities.
  • a living body detection model for living body detection can be more efficiently trained through a large number of positive and negative samples.
  • the living body detection model can accurately determine whether the current face recognition is a live face based on the input face difference map. , Which greatly improves the accuracy of live detection and ensures the privacy and property safety of users.
  • a living body detection device provided by an embodiment of the present application is characterized in that it is applied to a terminal device, the terminal device includes an infrared camera module, the infrared camera module includes an infrared lamp, and the device includes:
  • the first obtaining unit is used to obtain the ambient light intensity
  • a determining unit configured to determine N infrared light intensities of the infrared lamp according to the environmental light intensity
  • the collection unit is configured to adjust the infrared lamp based on the N infrared light intensities, and shoot under the N infrared light intensities respectively, and collect N face images; among the N face images Each face image includes the target face; where N is an integer greater than or equal to 2;
  • the living body detection unit is configured to compare the target face regions in the N face images, and determine whether the target face is a live face according to the difference of the target face regions in the N face images.
  • each of the N infrared light intensities is greater than 0; if the ambient light intensity is greater than or equal to the With a preset value, the P infrared light intensities in the N infrared light intensities are all equal to 0, and the K infrared light intensities in the N infrared light intensities are all greater than 0; where P and K are greater than or equal to An integer of 1, and the sum of P and K is N.
  • the terminal device further includes an RGB camera
  • the infrared camera module further includes an infrared camera
  • the collection unit is specifically configured to:
  • the ambient light intensity is less than the preset value, turn on the infrared lamp, and use the infrared camera to shoot under the N infrared light intensities to collect the N face images;
  • the ambient light intensity is greater than or equal to the preset value, turn off the infrared light, and use the RGB camera to shoot under the P infrared light intensities to collect and obtain P face images; and The infrared lamp is turned on, and the infrared camera is used to shoot under the K infrared light intensities respectively, and K face images are collected.
  • the living body detection unit is specifically configured to:
  • M is an integer greater than or equal to 1 and less than N;
  • the living body detection unit is further specifically configured to:
  • the living body detection unit is further specifically configured to:
  • the classifier determines whether the target face is a living face.
  • the device further includes:
  • the second acquisition unit is configured to acquire a positive sample set and a negative sample set, the positive sample set includes multiple first face difference images, and the negative sample set includes multiple second face difference images;
  • the multiple Each first face difference map in the first face difference map is a face difference map of two live face images obtained by shooting a live face under two infrared light intensities respectively;
  • Each second face difference image in the multiple second face difference images is a person who photographs a non-living human face under the two infrared light intensities, and collects two non-living human face images.
  • Face difference map; at least one of the two infrared light intensities has an infrared light intensity greater than 0;
  • the training unit is configured to use the multiple first face difference images and the multiple second face difference images as training inputs, and use the multiple first face difference images and the multiple second person
  • the face difference map respectively corresponds to a living human face or a non-living human face as a label, and the living detection model is obtained by training.
  • a terminal device provided by an embodiment of the present application is characterized in that the terminal device includes a processor, and the processor is configured to support the terminal device to implement corresponding functions in the living body detection method provided in the first aspect.
  • the terminal device may also include a memory, which is used for coupling with the processor and stores the necessary program instructions and data of the terminal device.
  • the terminal device may also include a communication interface for the terminal device to communicate with other devices or a communication network.
  • an embodiment of the present application provides a computer-readable storage medium that stores a computer program that, when executed by a processor, realizes the living body described in any one of the above-mentioned first aspects. Detection method flow.
  • the embodiments of the present application provide a computer program, the computer program includes instructions, when the computer program is executed by a computer, the computer can execute the flow of the living body detection method described in any one of the first aspect.
  • an embodiment of the present application provides a chip system that includes the living body detection device according to any one of the above-mentioned first aspect, and is used to implement the living body detection according to any one of the above-mentioned first aspect The functions involved in the method flow.
  • the chip system further includes a memory for storing program instructions and data necessary for the living body detection method.
  • the chip system can be composed of chips, or include chips and other discrete devices.
  • Fig. 1 is a schematic diagram of a group of face attack methods in the prior art.
  • Fig. 2 is a schematic flow chart of a living body detection method in the prior art.
  • Fig. 3 is a schematic diagram of a screen lighting scheme in a living body detection method in the prior art.
  • Fig. 4 is a functional block diagram of a terminal device provided by an embodiment of the present application.
  • Fig. 5 is a software structure block diagram of a terminal device provided by an embodiment of the present application.
  • Fig. 6a is a schematic diagram of an application scenario of a living body detection method provided by an embodiment of the present application.
  • Fig. 6b is a schematic diagram of an application scenario of another living body detection method provided by an embodiment of the present application.
  • Figures 7a-7b are schematic diagrams of a set of interfaces provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a living body detection method provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of another living body detection method provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a comparison of experimental results between a group of outdoor real people and outdoor photos provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a comparison of experimental results between a group of indoor real people and indoor photos provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of a living body detection process provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a network structure of a living body detection model provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a living body detection device provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • components used in this specification are used to denote computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution.
  • the component may be, but is not limited to, a process, a processor, an object, an executable file, an execution thread, a program, and/or a computer running on a processor.
  • the application running on the terminal device and the terminal device can be components.
  • One or more components may reside in processes and/or threads of execution, and components may be located on one computer and/or distributed among two or more computers.
  • these components can be executed from various computer readable media having various data structures stored thereon.
  • the component can be based on, for example, a signal having one or more data packets (e.g. data from two components interacting with another component in a local system, a distributed system, and/or a network, such as the Internet that interacts with other systems through a signal) Communicate through local and/or remote processes.
  • a signal having one or more data packets (e.g. data from two components interacting with another component in a local system, a distributed system, and/or a network, such as the Internet that interacts with other systems through a signal) Communicate through local and/or remote processes.
  • NIR Near infrared light
  • VIS visible light
  • MIR mid-infrared light
  • ASTM American Society for Testing and Materials
  • the definition refers to electromagnetic waves with a wavelength in the range of 780-2526nm, and the near-infrared region is conventionally divided into two regions: near-infrared short-wave (780-1100nm) and near-infrared long-wave (1100-2526nm).
  • Face recognition is a biometric recognition technology based on human facial feature information, including face detection and analysis, facial features positioning, face comparison and verification, face retrieval, living body detection, etc.
  • a series of related technologies that use a video camera or camera to collect images or video streams containing human faces, and automatically detect and track human faces in the images, and then recognize the detected human faces, usually also called face recognition and facial recognition.
  • Face recognition technology can be applied to scenes such as beauty makeup, facial motion synthesis, security monitoring and escaping, identity authentication in the financial field, etc., to solve the various face special effects processing and user identity confirmation needs of customers in various industries.
  • Histogram equalization is a method in the field of image processing that uses image histograms to adjust contrast. This method is usually used to increase the local contrast of many images, especially when the contrast of the useful data of the image is quite close. In this way, the brightness can be better distributed on the histogram. This can be used to enhance the local contrast without affecting the overall contrast. Histogram equalization achieves this function by effectively expanding the commonly used brightness.
  • FIG. 1 is a schematic diagram of a group of face attack methods in the prior art.
  • human faces are easily copied by printing photos, electronic photos, 3D masks, and videos. Therefore, counterfeiting the faces of legitimate users is an important threat to the security of the face recognition and authentication system. Considering that once a false face attack is successful, it is very likely to cause heavy losses to users, so it is bound to develop a reliable and efficient face living detection technology for the existing face recognition system.
  • the living body detection technology in face recognition includes a variety of technical solutions.
  • the following exemplarily enumerates a common solution as follows.
  • Solution 1 A live face detection solution based on screen lighting.
  • Figure 2 is a schematic flow diagram of a living body detection method in the prior art. As shown in Figure 2, the method may include the following steps S10-S40:
  • Step S10 Receive the first real-time video stream sent by the client, and perform silent living detection on the face image to be detected in the first real-time video stream to obtain a first detection result.
  • Step S20 Send a light living body detection instruction to the client to control the client's screen to emit light according to a preset rule.
  • Step S30 in the process of the client's screen illuminating, receiving a second real-time video stream sent by the client, and performing light living detection on the face image to be detected in the second real-time video stream to obtain a second detection result.
  • Step S40 Determine whether the face image to be detected is a living body according to the first detection result and the second detection result.
  • the client will collect the first real-time video stream, and perform silent living body detection on the face image in the video stream to obtain the first detection result. . Then, the client controls the screen (for example, a screen of a smart phone or a screen of a tablet computer, etc.) to emit light according to a predetermined rule.
  • the screen for example, a screen of a smart phone or a screen of a tablet computer, etc.
  • Figure 3 is a schematic diagram of a screen lighting scheme in a living body detection method in the prior art.
  • the client after triggering the live detection, the client first needs to establish a communication connection with the server, and then the client sends the real-time captured video stream to the server, and the server uses the multi-frame pictures in the video stream to perform the live test Detection.
  • the life detection process will take a long time, which results in a long time required for the entire face recognition and poor user experience.
  • the first solution uses active screen lighting, and always keeps the intensity of the screen light source greater than the ambient light. However, this solution will fail in scenarios where the outdoor ambient light intensity is high.
  • the final live detection results are completely dependent on the first silent live detection results and the second light live detection results.
  • the above solution 1 cannot meet the requirements of realizing accurate and efficient live detection under various ambient light conditions, and the input information is single, which is easily broken by various photos, masks and videos, and cannot guarantee that users are applying face recognition.
  • Security in technology Therefore, in order to solve the problem that the current living body detection technology does not meet the actual business needs, the technical problems to be solved in this application include the following aspects: based on the existing terminal equipment, realizing accurate and efficient face living detection and ensuring face recognition technology
  • the security of various applications (such as the application of face recognition technology to authenticate the user's identity, such as various registration and payment scenarios in financial institutions such as banking institutions, insurance institutions, tax institutions, or wealth management institutions) to ensure user privacy And property security.
  • the terminal device 100 may be configured in a fully or partially automatic shooting mode.
  • the terminal device 100 may be in a timer and continuous automatic shooting mode, or an automatic shooting mode for shooting when a preset target object (such as a human face, etc.) is detected within the shooting range according to computer instructions.
  • a preset target object such as a human face, etc.
  • the terminal device 100 can be set to operate without interacting with a person.
  • the terminal device 100 may have more or fewer components than those shown in FIG. 4, may combine two or more components, or may have different component configurations.
  • the various components shown in FIG. 4 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the terminal device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display 194, And subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100.
  • the terminal device 100 may include more or fewer components than shown in FIG. 4, or combine certain components, or split certain components, or arrange different components, and so on.
  • the components shown in FIG. 4 may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 may be a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. The repeated access of instructions or data is avoided, the waiting time of the processor 110 is reduced, and the operating efficiency of the system can be greatly improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter/receiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the terminal device 100.
  • the terminal device 100 may also adopt a different interface connection manner from the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the terminal device 100 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the terminal device 100 may include one or more display screens 194.
  • the terminal device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, contrast, and facial skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • the DSP converts the digital image signal into a standard RGB or YUV format image signal.
  • the terminal device 100 may include multiple cameras 193, for example, may include one or more RGB cameras, and one or more infrared cameras, and so on.
  • the infrared camera may be a near infrared camera (for example, a 2D NIR camera).
  • the terminal device 100 may also include one or more infrared lamps (that is, an infrared transmitter, not shown in FIG. 4) for infrared photography, which is not specifically limited in the embodiment of the present application.
  • the processor can control the turning on and off of the infrared lamp, and the infrared light intensity of the infrared lamp can also be adjusted.
  • different image acquisition strategies can be formulated according to the ambient light intensity in the current scene.
  • the processor can control to turn on the infrared light, and use the infrared camera to shoot under multiple different infrared light intensities to collect multiple face images.
  • the processor can control to turn off the infrared light and shoot through the RGB camera to collect one or more unlit face images; and the processor can also control to turn on the infrared light and pass The infrared camera shoots under one or more infrared light intensities and collects one or more face images.
  • the processor 110 may acquire multiple face images collected in the aforementioned dark or strong light environment, and then the target face region in the multiple face images (for example, face recognition is in progress). The user's face area) performs a difference calculation, and judges whether the target face is a living face according to the difference. For example, the processor 110 may perform a difference calculation on the target face region in every two adjacent face images to obtain a face difference map of every two adjacent face images. Then, the obtained one or more face difference images can be input to the pre-trained live detection model to obtain the live detection result of the target face, that is, it is judged whether the target face is a live face. As a result, efficient and accurate live detection is achieved, the security of the face recognition technology in all aspects is guaranteed, the privacy and property safety of users are protected, and the actual needs of users are met.
  • the camera 193 may be located on the front of the terminal device 100, for example, above the touch screen, or may be located at other locations, such as on the back of the terminal device.
  • the RGB camera and infrared camera used for face recognition can generally be located on the front of the terminal device 100, such as on the top of the touch screen, or in other locations, such as the back of the terminal device 100.
  • the infrared lamp used for infrared photography is generally also located on the front of the terminal device 100, for example, located above the touch screen. It can be understood that the infrared lamp is generally located on the same side of the terminal device 100 as the infrared camera for infrared image viewing. collection.
  • the terminal device 100 may also include other cameras.
  • the terminal device 100 may further include a dot matrix transmitter (not shown in FIG. 4) for emitting light.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the terminal device 100 can be realized, such as: image recognition, face recognition (including living body detection, face detection and analysis, facial features positioning, face comparison and verification, and face retrieval, etc.), Image processing such as speech recognition, text comprehension, histogram equalization, etc.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the terminal device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, videos, photos and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store the operating system and at least one application required by the function, such as face recognition functions (including live body detection, face detection and analysis, facial features positioning, face comparison and verification, and face retrieval functions) , Video function, camera function, image processing function, etc.
  • the data storage area can store data created during the use of the terminal device 100 and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the terminal device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the gyro sensor 180B may be used to determine the movement posture of the terminal device 100.
  • the angular velocity of the terminal device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be determined by the gyro sensor 180B.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can be used to obtain the ambient light brightness in the current scene, and the terminal device 100 can formulate different image acquisition strategies according to the ambient light intensity, for example, in a dark light environment (for example, the ambient light intensity is less than 5).
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the terminal device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the fingerprint sensor 180H can be arranged under the touch screen, the terminal device 100 can receive a user's touch operation on the touch screen in the area corresponding to the fingerprint sensor, and the terminal device 100 can collect the fingerprint of the user's finger in response to the touch operation. Information to achieve related functions.
  • the temperature sensor 180J is used to detect temperature.
  • the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the terminal device 100, which is different from the position of the display screen 194.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the terminal device 100 may receive key input, and generate key signal input related to user settings and function control of the terminal device 100.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the terminal device 100.
  • the terminal device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
  • the terminal device 100 may be a smart phone, a smart wearable device, a tablet computer, a notebook computer, a desktop computer, a computer, and other devices with the above-mentioned functions, which are not specifically limited in the embodiment of the present application.
  • the software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the terminal device 100 by way of example.
  • FIG. 5 is a software structure block diagram of a terminal device provided by an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications (also referred to as applications) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. It may also include the relevant living body detection application involved in this application, through which the living body detection method in this application can be used to efficiently and accurately realize the living body detection in the face recognition technology, and effectively prevent others from using the user's photos Or masks, etc., steal users’ privacy and property through facial recognition and other illegal and criminal acts.
  • applications also referred to as applications
  • applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the relevant living body detection application involved in this application through which the living body detection method in this application can be used to efficiently and accurately realize the living body detection in the face recognition technology, and effectively prevent others from using the user's photos Or masks, etc., steal users’ privacy and property through facial recognition and other illegal and criminal acts.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the camera interface of the relevant face recognition control may be included.
  • the face recognition control By clicking on the face recognition control, one of the living body detection methods in this application can be used to make different settings according to the ambient light intensity in the current scene.
  • the image acquisition strategy multiple face images are collected according to the formulated image acquisition strategy, and according to the difference of the target face area in the multiple face images, it is judged whether the target face is a living face. Thereby, the accuracy of live detection in face recognition is greatly improved, and the privacy and property safety of users are guaranteed.
  • the phone manager is used to provide the communication function of the terminal device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialogue interface.
  • prompt text messages in the status bar sound a prompt tone, terminal equipment vibration, flashing indicator lights, etc.
  • a text message may be used on the face recognition interface to prompt the user that the face recognition has been passed, and the registration or payment has been completed through the face recognition, and so on.
  • face recognition cannot be performed correctly, such as when the user wears a hat or a mask and covers most of the face, the user can be prompted to show all naked faces to the camera through text information on the face recognition interface.
  • the live detection of face recognition fails (that is, the current target face is judged to be a non-living face, such as a photo or video, etc.) through the live detection, a text message can be prompted on the face recognition interface
  • the embodiment of the application does not specifically limit this.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the video format involved in this application can be, for example, RM, RMVB, MOV, MTV, AVI, AMV, DMV, FLV, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the core layer includes at least display driver, camera driver (for example, infrared camera driver and RGB camera driver), audio driver, and sensor driver.
  • the following exemplarily enumerates the applicable application scenarios of a living body detection method in the present application, which may include the following two scenarios.
  • Scenario 1 the user conducts live body detection through terminal equipment, completes face recognition and makes online payment.
  • FIG. 6a is a schematic diagram of an application scenario of a living body detection method provided by an embodiment of the present application.
  • the application scenario includes a terminal device (a smart phone is taken as an example in Figure 6a).
  • the terminal device may include related shooting modules, displays, processors, and so on.
  • the shooting module, the display and the processor can perform data transmission through the system bus.
  • the photographing module may include an infrared photographing module and an RGB camera, and the infrared photographing module may include an infrared lamp (that is, an infrared transmitter) and an infrared camera.
  • the RGB camera, the infrared camera, and the infrared lamp can be located on the front of the terminal device, and the aforementioned cameras can all convert the captured light source signal into a digital signal to complete image collection.
  • the terminal device can formulate a corresponding image acquisition strategy according to the ambient light intensity in the current scene, and obtain multiple images through the infrared camera according to the image acquisition strategy. Face images, or multiple face images can be acquired through infrared cameras and RGB cameras. Then, the collected face image can be transmitted to the processor of the terminal device through the above-mentioned system bus, and the processor uses a living body detection method in this application to detect the target person in the face image according to the acquired face image.
  • Face live detection For example, the processor obtains one or more face difference maps (that is, a sequence of face difference maps) based on the collected multiple face images through difference calculation, and then the one or more face difference maps Input to the pre-trained living body detection model to determine whether the target face is a living body face, thereby completing the living body detection part of face recognition.
  • face difference maps that is, a sequence of face difference maps
  • the user's operation process of the terminal device can refer to Figure 7a and Figure 7b.
  • Figures 7a-7b are provided by the embodiment of this application.
  • the terminal device displays an order payment interface 701, where the order payment interface 701 may include a setting control 702, an immediate payment control 703, and other controls (such as a return control, a payment method selection control, a product deletion control, and Commodity quantity selection control, etc.).
  • the user confirms that the shopping order is correct and wants to make a payment he can trigger the payment operation through an input operation 704 (for example, a click).
  • the terminal device displays a face recognition interface 705, where the face recognition interface may include a start face recognition control 706 and other controls (such as return Control, setting control and input password control, etc.).
  • the user can start face recognition by input operation 707 (for example, click).
  • the face recognition process includes live body detection.
  • live body detection one of the live body detection methods provided in this application can be used to first obtain the current scene According to the ambient light intensity, make a reasonable image acquisition strategy to determine the multiple infrared light intensity of the infrared lamp.
  • the infrared lamp is adjusted correspondingly according to the multiple infrared light intensities, and shooting is performed under the multiple infrared light intensities to collect multiple face images.
  • one or more face difference maps are obtained (that is, the face difference map sequence is obtained) , And then input the one or more face difference maps to the pre-trained living detection model to determine whether the current target face for face recognition (that is, the face of the user performing this payment operation) is a living person Face, thus completing the life detection part of face recognition.
  • the user can complete the payment.
  • the user can also set the default payment authentication method (for example, face recognition, password input, fingerprint input, etc.) by clicking the setting control 702, and the user can also set the number of faces for face recognition (for example, set this shopping account
  • the upper limit of the number of faces for face recognition is 5 different faces, etc.) or modify the faces of face recognition (for example, re-enter the user’s own face, add or delete the faces of friends and family, etc.), And so on, the embodiment of the present application does not specifically limit this.
  • the developer when a developer wants to perform face recognition to test a living body detection method in this application, the developer can also refer to FIG. 7a and FIG. 7b for the operation process of the terminal device. I will not repeat them here. Developers can continuously optimize the image acquisition strategy, difference calculation method, and living body detection model formulated according to the ambient light intensity in this application according to the obtained living body detection results, so as to continuously improve the performance of living body detection and effectively improve the living body detection The correct rate.
  • the terminal device may be a smart phone, a smart wearable device, a tablet computer, a laptop computer, a desktop computer, etc. with the above-mentioned functions, which is not specifically limited in the embodiment of the present application.
  • the user performs a living body detection through a terminal device and a server connected to the terminal device, completes face recognition and performs financial registration.
  • the application scenario may include a terminal device (a smart phone is taken as an example in FIG. 6b) and a computing device (for example, it may be a server of a certain banking institution).
  • terminal devices and computing devices can transmit data through wireless communication methods such as Bluetooth, Wi-Fi, or mobile networks, or wired communication methods such as data lines.
  • the terminal device may include related shooting modules, displays, processors, and so on.
  • the shooting module, the display and the processor can perform data transmission through the system bus.
  • the photographing module may include an infrared photographing module and an RGB camera, and the infrared photographing module may include an infrared lamp (that is, an infrared transmitter) and an infrared camera.
  • the RGB camera, the infrared camera, and the infrared lamp can be located on the front of the terminal device, and the aforementioned cameras can all convert the captured light source signal into a digital signal to complete image collection.
  • the terminal device can formulate a corresponding image acquisition strategy according to the ambient light intensity in the current scene, and obtain multiple images through the infrared camera according to the image acquisition strategy. Face images, or multiple face images can be acquired through infrared cameras and RGB cameras.
  • the terminal device can be related to The server of the banking institution establishes an instant communication connection, and then the terminal device can wirelessly send the collected multiple facial images to the server, and the server uses a living body detection method in this application according to the received facial images. Live detection is performed on the target face in the face image.
  • the server obtains one or more face difference maps (that is, obtains the sequence of face difference maps) through difference calculation, and then inputs the one or more face difference maps To the pre-trained living body detection, it is judged whether the target face is a living body face, thereby completing the living body detection part in face recognition.
  • the computing device can send the result of the living body detection to the terminal device, and the terminal device can display a corresponding interface according to the result of the living body detection.
  • the user For example, if the live detection and other parts of the face recognition (such as face detection and analysis, facial features positioning, face comparison and verification, etc.) are passed, the user’s face recognition passes, and the user can Complete its financial registration with the relevant banking institution through the terminal device, for example, to create a bank account and so on.
  • the relevant banking institution such as face detection and analysis, facial features positioning, face comparison and verification, etc.
  • the terminal device may be a smart phone, a smart wearable device, a tablet computer, a laptop computer, a desktop computer, etc., with the above-mentioned functions, which is not specifically limited in the embodiment of the present application; the computing device may be equipped with the above-mentioned functions.
  • the server can be a server with the above-mentioned functions, a server cluster composed of multiple servers, or a cloud computing service center, etc., The embodiments of the present application do not specifically limit this.
  • the living body detection method provided in this application can also be applied to other scenarios besides the above two application scenarios.
  • terminal devices such as smart phones and tablets through face recognition
  • tax authorities or application scenarios such as high-speed trains, high-speed railways and other public transportation places that use face recognition to authenticate users, etc., will not be repeated here.
  • FIG. 8 is a schematic flow chart of a living body detection method provided by an embodiment of the present application.
  • the method can be applied to the application scenarios and system architectures described in FIG. 6a or FIG. In the terminal device 100 of FIG. 4 described above. In the following, description will be made with reference to FIG. 8 taking the execution subject as the terminal device 100 in FIG. 4 as an example.
  • the method may include the following steps S801 to S804:
  • Step S801 Acquire the ambient light intensity.
  • the terminal device obtains the ambient light intensity in the current scene.
  • the terminal device can obtain the ambient light intensity in the current scene through the following application programming interface (Application Programming Interface, API): "public static float light_strength;”.
  • API Application Programming Interface
  • FIG. 9 is a schematic flowchart of another living body detection method provided by an embodiment of the present application.
  • step S11 shown in FIG. 9. the user can trigger face recognition (that is, trigger the living body detection included in the face recognition) through the terminal device.
  • the user can trigger face recognition by clicking on the relevant controls displayed on the terminal device (such as face recognition control, face payment control, authentication control, etc.), or double-clicking the locked screen of the terminal device to trigger face recognition.
  • the living body detection process in the embodiment of this application is not specifically limited in the embodiment of this application.
  • the terminal device can obtain the ambient light intensity in the current scene through the above-mentioned application programming interface.
  • the ambient light intensity can generally range from 50 lux to 60 lux.
  • the ambient light intensity is generally less than 5 lux, or even less than 1lux, etc. I won’t repeat them here.
  • Step S802 Determine N infrared light intensities of the infrared lamp according to the ambient light intensity.
  • the terminal device may include an infrared camera module, and the infrared camera module may include an infrared lamp (or called an infrared transmitter).
  • the terminal device may formulate a corresponding image acquisition strategy according to the acquired ambient light intensity, and Determine the N infrared light intensity of the infrared lamp, where N is an integer greater than or equal to 2.
  • N is an integer greater than or equal to 2.
  • step S12 and step S13 as shown in FIG. 9.
  • the ambient light intensity is less than the preset value (for example, it can be less than 5 lux or 1 lux, etc., the embodiment of the present application does not specifically limit this), that is, in a dark light environment, a complete infrared camera acquisition strategy can be adopted , And determine the N infrared light intensities of the infrared lamp, where the values of the N infrared light intensities are all greater than 0, such as 20 lux, 30 lux, 40 lux, and so on.
  • the preset value for example, it can be less than 5 lux or 1 lux, etc., the embodiment of the present application does not specifically limit this
  • part of the infrared camera acquisition strategy can be adopted, and the N infrared light intensity of the infrared lamp can be determined, where the N infrared light intensity
  • the value of the P infrared light intensity in the infrared light intensity is equal to 0, that is, the infrared light is turned off, and the infrared light is not performed; and the K infrared light intensity values of the N infrared light intensities are all greater than 0, for example, They are 20lux, 35lux, 43lux and so on.
  • P and K are integers greater than or equal to 1, and the sum of P and K is N.
  • the terminal device may also adopt a completely infrared image capturing strategy, which is not specifically limited in the embodiment of the present application. That is, in a low light environment, its image acquisition strategy is generally to collect multiple face images under different intensities of infrared light, while in a strong light environment, its image acquisition strategy is generally to collect one or more images. The face image without infrared light, and one or more face images with infrared light are collected.
  • step S803 the infrared lamps are adjusted based on the N infrared light intensities, and shooting is performed under the N infrared light intensities respectively, and N face images are collected.
  • the terminal device adjusts the infrared light of the terminal device based on the N infrared light intensities, and shoots under the N infrared light intensities respectively, and collects N face images, each of the N face images
  • a face image includes a target face (for example, the face of the user, or the face of a developer or experimenter in the software testing phase).
  • the terminal device may also include an RGB camera, and the infrared camera module may also include an infrared camera.
  • the terminal device controls to turn on the infrared light, and performs the operation under the N infrared light intensities through the infrared camera.
  • the N infrared light intensities Through the infrared camera.
  • the terminal device controls to turn off the infrared light, and uses the RGB camera to shoot under the P infrared light intensity with a value equal to 0 (that is, Shoot through the RGB camera without infrared lighting), collect P face images; and turn on the infrared light, and shoot through the infrared camera under the K infrared light intensity values greater than 0. (That is, the infrared camera is used for shooting under the condition of infrared lighting), and K face images are collected. It is understandable that in a strong light environment, due to the presence of strong visible light, the effect of infrared light is minimal.
  • the above-mentioned face image acquisition method of separately calling the RGB camera and the infrared camera to shoot can be adopted. It is understandable that, based on the principle of infrared imaging, the infrared light emitted by the infrared lamp is used for infrared photography by the infrared camera. Therefore, it is usually necessary to turn on the infrared lamp when using the infrared camera to collect the face image, but when using the RGB camera to collect the face The infrared light is usually turned off during the image.
  • the infrared lamp may be one or more infrared lamps, which is not specifically limited in the embodiment of the present application.
  • the terminal device can control the infrared light through the infrared light setting interface as shown below:
  • the image acquisition strategy is generally to collect multiple face images under different intensities of infrared light
  • the image acquisition strategy is generally to collect one or Multiple face images without infrared light, and one or more face images with infrared light are collected.
  • different image acquisition strategies are adopted according to different environmental light intensities, the corresponding camera is called to shoot, and face images are collected, which greatly reduces the impact of environmental light intensity on living body detection and greatly improves the accuracy of living body detection.
  • face recognition technology thereby ensuring the user's privacy and property security.
  • the application does not specifically limit the collection order of the face image with infrared light and the face image without infrared light.
  • Step S804 comparing the target face regions in the N face images, and judging whether the target face is a living face according to the difference of the target face regions in the N face images.
  • the terminal device may transmit the collected N face images to the processor, and the processor compares the target face area in the N face images, and based on the target face area in the N face images Determine whether the target face is a living face.
  • the above step of comparing the target face area in the N face images, and judging whether the target face is a living face according to the difference in the target face area in the N face images may specifically include the following steps S21- Step S22:
  • Step S21 Determine the target face area in each of the N face images, and calculate the difference between the target face areas in the two adjacent face images to obtain M face difference maps .
  • the N face images can be preprocessed respectively, where the preprocessing process can include face detection and face cropping.
  • face detection can be performed on each of the N face images to obtain the target face in each face image. Coordinates of the detection frame.
  • face cropping may be performed on each face image to determine the target face area in each face image.
  • the target face area in each of the two adjacent face images may be The difference calculation is performed on the target face area, and M face difference maps are obtained.
  • M is an integer greater than or equal to 1 and less than N. For example, subtract the pixels of the target face area in the i-th face image in the N face images from the target face area in the i+1-th face image to obtain the face after the pixel subtraction Image; then, the histogram equalization is performed on the face image after the pixel subtraction to obtain the face difference map corresponding to the i-th face image and the i+1-th face image, so that M faces can be obtained Difference chart.
  • i is an integer greater than or equal to 1 and less than M.
  • the difference calculation can be achieved by calculating the variance of the pixels of the target face region in two adjacent face images, and then performing a histogram equalization method to obtain a face difference map, etc., the embodiment of the present application There is no specific restriction on this.
  • the difference calculation can also be performed on the target face regions in any two face difference maps in the N face images to obtain a corresponding face difference map.
  • the acquisition strategy of complete infrared photography can be adopted, and the total acquisition is Three face images, the three face images are respectively a face image a, a face image b, and a face image c.
  • the face image a can be a face image collected by an infrared camera under the condition of an infrared light intensity of 30 lux
  • the face image b can be a face image collected by an infrared camera under a condition of an infrared light intensity of 40 lux.
  • the face image c may be a face image collected by an infrared camera when the infrared light intensity is 50 lux.
  • the terminal device can subtract the pixels of the target face region in the face image a and the face image b, and then perform the histogram equalization on the image obtained after the pixel subtraction, thereby obtaining this live body detection.
  • the terminal device can subtract the pixels of the target face area in the face image b and the face image c, and then perform the histogram equalization on the image obtained after the pixel subtraction , Thus get the second face difference map of this living body detection.
  • the inter-frame difference calculation of the face image is completed, that is, the difference calculation for every two adjacent face images is completed.
  • the terminal device can also select only the face image a and the face image b for difference calculation to obtain a face difference map for the subsequent live detection; it can also only select the face image b and the face image c to perform the difference calculation. Difference calculation to obtain a face difference map for subsequent live detection; it is also possible to select only face image a and face image c for difference calculation to obtain a face difference map for subsequent live detection, etc.
  • the application embodiment does not specifically limit this.
  • the living body detection method in the embodiments of the present application usually generates 3 or 4 frames of face images (that is, 3 or 4 face images are collected), and one or more face difference images are calculated. , Used for subsequent live body detection, which is not specifically limited in the embodiment of the present application.
  • the ambient light intensity is 50 lux (such as a room with lights on) and the preset value is 5 lux, that is, when the ambient light intensity is greater than the preset value
  • some infrared camera acquisition strategies can be adopted.
  • Three face images are collected, and the three face images are respectively a face image d, a face image e, and a face image f.
  • the face image d can be a face image collected by an RGB camera when the infrared light intensity is 0 lux (that is, when the infrared light is turned off);
  • the face image e can be a face image that has an infrared light intensity of 55 lux.
  • a face image collected by an infrared camera the face image f may be a face image collected by an infrared camera when the infrared light intensity is 60 lux.
  • the terminal device can subtract the pixels of the target face area in the face image d and the face image e, and then perform the histogram equalization on the image obtained after the pixel subtraction, thereby obtaining this live detection Then, the terminal device can subtract the pixels of the target face area in the face image e and the face image f, and then perform the histogram equalization on the image obtained after the pixel subtraction , Thus get the second face difference map of this living body detection.
  • the terminal device can also select only the face image d and the face image e for difference calculation to obtain a face difference map for subsequent live detection; it can also select only the face image e and the person Perform difference calculation on the face image f to obtain a face difference map for subsequent live detection; you can also select only the face image d and face image f for difference calculation to obtain a face difference map for subsequent live detection, And so on, the embodiment of the present application does not specifically limit this.
  • FIG. 10 is a schematic diagram of a comparison of experimental results between a group of outdoor real people and outdoor photos provided by an embodiment of the present application.
  • the face image 1 and the face image 2 may be face images collected in the same outdoor scene (for example, the ambient light intensity is 60 lux) in the live detection.
  • the face image 1 may be a face image captured by a target face 1 of a real person (ie, a living face) under an infrared light intensity of 1 (for example, 0 lux, that is, no infrared light is turned on).
  • the human face image 2 may be a human face image obtained by shooting the target human face 1 of a real person under an infrared light intensity 2 (for example, 65 lux, that is, turning on infrared light).
  • the image obtained after subtracting the pixels of the target face region in the face image 1 and the face image 2 is shown in Figure 10.
  • the overall image is dark and cannot be seen clearly. At this time, you can use the histogram
  • the image is equalized to improve the image quality, and the real person's face difference map as shown in FIG. 10 is obtained.
  • the real person's face difference map as shown in FIG. 10 the facial features of the target face 1 are clear, and the face The outline is more obvious. Please refer to FIG. 10 together. As shown in FIG.
  • the face image 3 and the face image 4 may be face images collected in the live detection of the same outdoor scene (for example, the ambient light intensity is 60 lux).
  • the face image 3 may be a face image taken from the target face 2 (ie, non-living face) of the photo under the infrared light intensity 3 (for example, 0 lux, that is, the infrared light is not turned on).
  • the face image 4 may be a face image captured by the target face 2 of the photo under the infrared light intensity 4 (for example, 65 lux, that is, the infrared light is turned on).
  • the image obtained after subtracting the pixels of the target face area in the face image 3 and the face image 4 is shown in Figure 10. The overall image is dark and cannot be seen clearly.
  • the image equalization obtains the face difference map of the photo shown in FIG. 10.
  • the facial features of the target face 2 are blurred, and the facial contour is not obvious.
  • FIG. 11 is a schematic diagram of a comparison of experimental results between a group of indoor real people and indoor photos provided by an embodiment of the present application.
  • the live detection is performed in an indoor scene, and there is a big gap between the real person's face difference map and the photo's face difference map.
  • the real person's face difference map shown in Figure 11 The facial features of the target face are clear, and the facial contours are more obvious.
  • the facial features of the target face are blurred and the facial contours are not obvious, so I will not repeat them here.
  • the face difference map can be used to determine whether the current target face for live detection is a live face, which can improve the performance of live detection, greatly improve the accuracy of live detection, and effectively prevent attackers from using other people’s photos or masks to perform Face recognition is the illegal and criminal behavior of embezzling other people's private information and stealing other people's property.
  • Step S22 Input the M face difference images to the pre-trained living body detection model, and judge whether the target face is a living body face.
  • the terminal device inputs the M face difference maps obtained through the difference calculation into a pre-trained living body detection model, and the living body detection model can determine whether the target face is a living body face.
  • step S17 and step S18 shown in FIG. 9. Please refer to FIG. 12, which is a schematic diagram of a living body detection process provided by an embodiment of the present application.
  • two face images are collected in the living body detection, which may include the face image 5 collected under the infrared light intensity of 5, and the face image collected under the infrared light intensity of 6 6.
  • FIG. 12 is a schematic diagram of a living body detection process provided by an embodiment of the present application.
  • two face images are collected in the living body detection, which may include the face image 5 collected under the infrared light intensity of 5, and the face image collected under the infrared light intensity of 6 6.
  • FIG. 12 is a schematic diagram of a living body detection process provided by an embodiment of the present application.
  • the ambient light intensity of this live body detection may be 40 lux, and the infrared light intensity 5 may be 0 lux, that is, the face image 5 may be the infrared light turned off and the RGB camera is used for shooting.
  • the collected face image; the infrared light intensity 6 may be 50 lux, that is, the face image 6 may be the face image obtained by turning on the infrared light and shooting with an infrared camera.
  • the living body detection model may include a deep recovery network and a classifier.
  • the difference calculation can be performed on the target face region in the face image 5 and the face image 6 to obtain the corresponding face difference map (not shown in FIG.
  • the face difference map can be represented by a normal vector (that is, the normal vector hint shown in Figure 12), and then input it into the depth recovery network in the life detection model, and estimate the target face through the depth map. Depth map of the area. Then, the classifier can be used to determine whether the target face is a live face based on the depth map of the target face area, that is, the detection result of this live detection can be directly output by the classifier.
  • the living body detection process provided by the present application can be completely completed by the terminal device, and the detection efficiency is high. Compared with the living body detection algorithm in the prior art discussed above, it has better real-time performance and enhances the user's physical examination. As shown in FIG.
  • the output result of the classifier may be a live face or a non-living face (or, it may be a real face or a fake face, etc., which is not specifically limited in the embodiment of the present application).
  • the multiple face difference maps can be input into the depth recovery network of the living body detection model to obtain multiple target faces The depth map of the region, and then the classifier determines whether the target face is a living face based on the depth maps of the multiple target face regions.
  • the living body detection model may include two types of inputs, namely the first type of face difference map (image_face1) and the second type of face difference map (image_face2).
  • the first type of face difference map can be a face difference map between a face image collected under infrared light and a face image collected under infrared light
  • the second type of face difference map can be The face difference map between the face images collected under the intensity of infrared lighting.
  • the input (input) and input dimension (input_dim) in the prototype file (prototxt) can be as follows:
  • the training process of the living body detection model may include the following steps S31 to S32:
  • Step S31 Obtain a positive sample set and a negative sample set.
  • the positive sample set may include multiple first face difference images
  • the negative sample set may include multiple second face difference images.
  • each of the first face difference images in the plurality of first face difference images may be a person who photographs a live face under two infrared light intensities, and collects two live face images.
  • Face difference map; each second face difference map in the multiple second face difference maps can be two non-living human faces that are captured under two infrared light intensities. The face difference map of the face image.
  • the multiple first face difference images in the positive sample set may include the above-mentioned first type of face difference images, and may also include the above-mentioned first face difference images.
  • Two types of face difference maps; and, the multiple second face difference maps in the negative sample set may include the aforementioned first type of face difference maps, and may also include the aforementioned second type of face difference maps.
  • Step S32 taking multiple first face difference images and multiple second face difference images as training inputs, and each of the multiple first face difference images and the multiple second face difference images corresponds to a living person Faces or non-living human faces are used as labels, and one or more parameters in the initial network are continuously modified to obtain the living detection model through training, which will not be repeated here.
  • the embodiment of the application provides a living body detection method, which can formulate different image acquisition strategies in the living body detection of face recognition according to the ambient light intensity in the current scene, set different infrared light intensity, and set different infrared light intensity.
  • Shooting under light intensity for example, multiple infrared light intensities with a value greater than 0, or infrared light intensities with a value equal to 0, that is, turning off the infrared light
  • multiple face images are collected.
  • the embodiments of the application not only take into account the influence of environmental light intensity, but also perform live body detection through the difference between the face images collected under different lighting, which greatly reduces the impact of environmental light intensity on live body detection and greatly improves The accuracy rate of living body detection is ensured, and the security of the application of face recognition technology is ensured, thereby ensuring the privacy and property safety of users.
  • the purpose of this application is to flexibly adopt different image acquisition strategies according to different environmental light intensities, and further call the corresponding camera to not emit infrared light or in the case of different intensities of infrared light.
  • Shooting is performed in the next step, and multiple images for biopsy are acquired, so as to further determine whether the subject of the biopsy is a living body based on the difference between the collected images. Therefore, further, the living body detection method provided by the embodiments of the present application can also be applied to other living body detections other than human faces, such as the live detection of poultry, wild animals, etc., and the embodiment of the present application does not do this. Specific restrictions.
  • FIG. 14 is a schematic structural diagram of a living body detection device provided by an embodiment of the present application.
  • the living body detection device may be applied to a terminal device.
  • the terminal device may include an infrared camera module, and the infrared camera module may include Infrared light.
  • the living body detection device may include a device 30, which may include a first acquisition unit 301, a determining unit 302, an acquisition unit 303, and a living body detection unit 304, wherein the detailed description of each unit is as follows.
  • the first obtaining unit 301 is configured to obtain the ambient light intensity
  • the determining unit 302 is configured to determine N infrared light intensities of the infrared lamp according to the environmental light intensity;
  • the acquisition unit 303 is configured to adjust the infrared lamp based on the N infrared light intensities, and to shoot under the N infrared light intensities respectively, and acquire N face images; among the N face images Each face image of includes the target face; where N is an integer greater than or equal to 2;
  • the living body detection unit 304 is configured to compare the target face area in the N face images, and determine whether the target face is a live face according to the difference in the target face area in the N face images.
  • each of the N infrared light intensities is greater than 0; if the ambient light intensity is greater than or equal to the With a preset value, the P infrared light intensities in the N infrared light intensities are all equal to 0, and the K infrared light intensities in the N infrared light intensities are all greater than 0; where P and K are greater than or equal to An integer of 1, and the sum of P and K is N.
  • the terminal device further includes an RGB camera
  • the infrared camera module further includes an infrared camera
  • the collection unit 303 is specifically configured to:
  • the ambient light intensity is less than the preset value, turn on the infrared lamp, and use the infrared camera to shoot under the N infrared light intensities to collect the N face images;
  • the ambient light intensity is greater than or equal to the preset value, turn off the infrared light, and use the RGB camera to shoot under the P infrared light intensities to collect and obtain P face images; and The infrared lamp is turned on, and the infrared camera is used to shoot under the K infrared light intensities respectively, and K face images are collected.
  • the living body detection unit 304 is specifically configured to:
  • M is an integer greater than or equal to 1 and less than N;
  • the living body detection unit 304 is further specifically configured to:
  • the living body detection unit 304 is further specifically configured to:
  • the classifier determines whether the target face is a living face.
  • the device 30 further includes:
  • the second acquiring unit 305 is configured to acquire a positive sample set and a negative sample set, the positive sample set includes multiple first face difference images, and the negative sample set includes multiple second face difference images;
  • Each first face difference map in the first face difference map is a face difference map of two live face images obtained by shooting a live face under two infrared light intensities respectively;
  • Each of the plurality of second face difference images is a photograph of a non-living human face under the two infrared light intensities, and the two non-living human face images are collected.
  • Human face difference map; at least one of the two infrared light intensities has an infrared light intensity greater than 0;
  • the training unit 306 is configured to use the multiple first face difference images and the multiple second face difference images as training inputs, and use the multiple first face difference images and the multiple second face difference images as training inputs.
  • the face difference map respectively corresponds to a living human face or a non-living human face as a label, and the living detection model is obtained by training.
  • Each unit in FIG. 14 can be implemented by software, hardware, or a combination thereof.
  • the hardware-implemented units can include circuits and electric furnaces, arithmetic circuits, or analog circuits.
  • a unit implemented in software may include program instructions, which is regarded as a software product, is stored in a memory, and can be run by a processor to implement related functions. For details, refer to the previous introduction.
  • FIG. 15 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device at least includes a processor 401, an input device 402, an output device 403, and a computer-readable storage medium 404.
  • the terminal device also Other common components can be included, which will not be described in detail here.
  • the processor 401, the input device 402, the output device 403, and the computer-readable storage medium 404 in the terminal device may be connected by a bus or other means.
  • the input device 402 may include an infrared camera module.
  • the infrared camera module may include an infrared camera and an infrared lamp.
  • the infrared lamp can be turned on in a low-light environment or a strong-light environment, and different infrared light intensity can be adjusted.
  • the infrared camera is used for infrared imaging. , Collect multiple face images for live detection.
  • the input device 402 may also include an RGB camera, which can be used to shoot in a strong light environment to collect one or more face images for living body detection.
  • the infrared camera may be a 2D near-infrared camera, or other cameras that can implement the above-mentioned functions, and so on. The embodiments of the present application do not specifically limit this.
  • the processor 401 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the programs in the above scheme.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the memory in the terminal device can be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or can store information and Other types of dynamic storage devices for instructions can also be Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory, CD-ROM or other optical discs Storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures And any other media that can be accessed by the computer, but not limited to this.
  • the memory can exist independently and is connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the computer-readable storage medium 404 may be stored in the memory of the terminal device.
  • the computer-readable storage medium 404 is used to store a computer program.
  • the computer program includes program instructions.
  • the processor 401 is used to execute the computer-readable Program instructions stored in the storage medium 404.
  • the processor 401 (or CPU (Central Processing Unit, Central Processing Unit)) is the computing core and control core of the terminal device.
  • the processor 401 described in the embodiment of the application can be used to perform a series of processing of living body detection, including: obtaining the ambient light intensity; determining the infrared light according to the ambient light intensity N infrared light intensities of the lamp; adjust the infrared light based on the N infrared light intensities, and shoot under the N infrared light intensities respectively, and collect N face images; the N faces Each face image in the image includes a target face; where N is an integer greater than or equal to 2; comparing the target face area in the N face images, according to the N face images The difference of the target face area determines whether the target face is a living face, and so on.
  • the embodiment of the present application also provides a computer-readable storage medium (Memory).
  • the computer-readable storage medium is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium herein may include a built-in storage medium in the terminal device, and of course, may also include an extended storage medium supported by the terminal device.
  • the computer-readable storage medium provides storage space, and the storage space stores the operating system of the terminal device.
  • one or more instructions suitable for being loaded and executed by the processor 401 are stored in the storage space, and these instructions may be one or more computer programs (including program codes).
  • the computer-readable storage medium here may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it may also be at least one located far away from the foregoing
  • the processor is a computer-readable storage medium.
  • the embodiments of the present application also provide a computer program, which includes instructions, when the computer program is executed by a computer, the computer can execute part or all of the steps of any living body detection method.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to execute all or part of the steps of the above methods of the various embodiments of the present application.
  • the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or random access memory (Random Access Memory, abbreviation: RAM), etc.
  • the medium of the program code may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or random access memory (Random Access Memory, abbreviation: RAM), etc.
  • the medium of the program code may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or random access memory (Random Access Memory, abbreviation: RAM), etc.
  • the medium of the program code may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or random access memory (Random Access Memory, abbreviation: RAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

本申请实施例公开了一种活体检测方法及相关设备,具体可以应用于人脸识别等领域。其中,一种活体检测方法可以应用于终端设备,所述终端设备包括红外摄像模块,所述红外摄像模块包括红外灯,该方法包括:获取环境光照强度;根据所述环境光照强度,确定所述红外灯的N个红外光照强度;基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸。如此,可以大大提高人脸识别中活体检测的准确率,保证用户的隐私和财产安全。

Description

一种活体检测方法及相关设备
本申请要求于2020年04月30日提交中国专利局、申请号为202010366189.1、申请名称为“一种活体检测方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人脸识别技术领域,尤其涉及一种活体检测方法及相关设备。
背景技术
目前,人脸识别技术已经广泛地应用于金融注册、支付等身份认证场景中,在越来越多用户使用人脸识别技术的情况下,如何保障人脸识别的安全性就显得尤为重要。其中,活体检测是人脸识别流程当中的关键技术,活体检测主要用于确认采集到的人脸图像是来自用户的真实人脸,而不是视频回放或者伪造材料等。
由于用户人脸数据信息容易泄露,因此针对现有的人脸识别技术,目前常见的利用用户人脸数据信息的人脸攻击方式主要包括以下三种:
a.打印照片攻击,主要包括使用用户本人的纸质打印照片(可以是多种打印材质,比如专业相纸、A4打印纸等)和手机里保存的用户本人照片等,其中,打印照片可以包括彩色打印照片、黑白打印照片和灰度打印照片等。
b.人脸视频攻击,主要包括录制的特定视频回放,例如包含眨眼、转头、张嘴等特定动作指令的视频回放,用于欺骗人脸识别系统。
c.三维人脸面具攻击,三维人脸面具的种类繁多,主要材质包括塑料和硬纸,此类材质的面具攻击成本较低,但其材质与真人皮肤的相似度极低,利用照片与真人的纹理特征差异就可以轻松识别。另外,还有用硅胶、乳胶以及3D打印的立体面具,此类材质的面具纹理与真人皮肤相似度极高,很难轻易识别。
因此,针对层出不穷的人脸攻击方式,如何有效提高活体检测的正确率,从而准确判断出摄像头采集到的人脸图像是否为活体的真实人脸,避免用户隐私泄露或者财产损失,是亟待解决的问题。
发明内容
本申请实施例提供一种活体检测方法及相关设备,可以有效提高活体检测的正确率,从而准确判断出摄像头采集到的人脸图像是否为活体的真实人脸,避免用户隐私泄露或者财产损失。
第一方面,本申请实施例提供了一种活体检测方法,其特征在于,应用于终端设备,所述终端设备包括红外摄像模块,所述红外摄像模块包括红外灯,所述方法包括:获取环境光照强度;根据所述环境光照强度,确定所述红外灯的N个红外光照强度;基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;其中,N为大于或者等于2的整数;对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的 目标人脸区域的差异判断所述目标人脸是否为活体人脸。
通过第一方面提供的方法,可以根据当前场景下的环境光照强度,在人脸识别的活体检测中制定不同的采图策略,设置不同的红外光照强度,并在该不同的红外光照强度(例如可以包括多个数值大于0的红外光照强度,还可以包括数值等于0的红外光照强度,也即关闭红外灯进行拍摄)下分别进行拍摄,采集得到多张人脸图像。然后根据该多张人脸图像中的目标人脸区域之间的差异,判断该目标人脸是否为活体人脸。如此,对比现有技术中,不考虑环境光照强度,仅仅根据预设的方案通过屏幕光源打光或者红外打光的方式采集人脸图像,然后根据采集到的图像进行活体检测,容易被攻击者用人脸照片、面具或者视频等方法攻破的方案而言。本申请实施例不仅考虑到了环境光照强度的影响,还通过不同打光下采集到的人脸图像之间的差异进行活体检测,大大降低了环境光照强度对活体检测的影响,极大程度上提高了活体检测的准确率,保证了人脸识别技术应用的安全性,进而保证用户的隐私和财产安全。
在一种可能的实现方式中,若所述环境光照强度小于预设值,则所述N个红外光照强度中的每一个红外光照强度均大于0;若所述环境光照强度大于或者等于所述预设值,则所述N个红外光照强度中的P个红外光照强度均等于0,所述N个红外光照强度中的K个红外光照强度均大于0;其中,P、K为大于或者等于1的整数,P与K的和为N。
在本申请实施例中,在环境光照强度小于预设值时(也即在黑夜、黄昏等暗光环境下),可以采取开启红外灯的采图策略,将红外灯打光调节至多个数值大于0的红外光照强度,并在该多个数值大于0的红外光照强度下采集多张人脸图像。而在环境光照强度大于或者等于预设值时(也即在白天、开灯的室内等强光环境下),可以采取开启红外灯以及关闭红外灯的采图策略,也即既要采集在多个数值大于0的红外光照强度打光下的人脸图像,也要采集关闭红外灯(也即没有红外打光,红外光照强度等于0)的人脸图像。如此,考虑到环境光照强度的影响,在不同的环境光照强度下采取不同的采图策略,可以大大提高各种环境情况下活体检测的准确率。可选地,上述红外灯还可以称之为红外发射器,本申请实施例对此不作具体限定。
在一种可能的实现方式中,其特征在于,所述终端设备还包括RGB摄像头,所述红外摄像模块还包括红外摄像头;所述基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像,包括:若所述环境光照强度小于所述预设值,则开启所述红外灯,并通过所述红外摄像头分别在所述N个红外光照强度下进行拍摄,采集得到所述N张人脸图像;若所述环境光照强度大于或者等于所述预设值,则关闭所述红外灯,并通过所述RGB摄像头分别在所述P个红外光照强度下进行拍摄,采集得到P张人脸图像;以及开启所述红外灯,并通过所述红外摄像头分别在所述K个红外光照强度下进行拍摄,采集得到K张人脸图像。
在本申请实施例中,终端设备还包括RGB摄像头,上述红外摄像模块还包括红外摄像头。可以理解的是,在暗光环境中,由于几乎不存在可见光,因此普通的RGB摄像头无法采集到清晰的人脸图像,而此时红外拍摄具有较好的效果,则可以通过开启红外灯,并利用红外摄像头在多个数值大于0的红外光照强度下分别进行拍摄,采集得到多张清晰的人脸图像,用于后续的活体检测。而在强光环境中,由于存在较强的可见光,红外光的效果 微乎其微,因此可以关闭红外灯,利用RGB摄像头在未打红外光(也即红外光照强度为0)的情况下进行拍摄,采集人脸图像;并且,在强光环境中还可以开启红外灯,利用红外摄像头在多个数值大于0的红外光照强度下分别进行拍摄,采集人脸图像。上述强光环境中通过RGB摄像头和红外摄像头采集到的人脸图像均可以用于后续的活体检测。如此,考虑到环境光照强度的影响,在不同的环境光照强度下采取不同的采图策略,利用不同的摄像头(例如包括上述的RGB摄像头和红外摄像头)进行拍摄,采集多张的人脸图像,可以大大提高各种环境情况下活体检测的准确率。
在一种可能的实现方式中,其特征在于,对比所述N张人脸图像中的目标人脸区域,并根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸,包括:确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图;其中,M为大于或者等于1,且小于N的整数;将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。
在本申请实施例中,可以首先确定该N张人脸图像中的每一张人脸图像中的目标人脸区域,然后对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图。最后将该M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。如此,对比现有技术中仅仅通过采集到的人脸图像进行活体检测而言,通过人脸图像中的目标人脸区域的差异判断是否为活体人脸的条件更加严格,大大提高了活体检测的准确率,保证了用户的隐私和财产安全。
在一种可能的实现方式中,其特征在于,所述确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图,包括:对所述N张人脸图像中的每一张人脸图像进行人脸检测,得到所述每一张人脸图像中的所述目标人脸的检测框坐标;根据所述每一张人脸图像中的所述目标人脸的检测框坐标,对所述每一张人脸图像进行人脸裁剪,确定所述每一张人脸图像中的目标人脸区域;将第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;对所述像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图;i为大于或者等于1,且小于M的整数。
在本申请实施例中,可以首先对N张人脸图像中的每一张人脸图像进行人脸检测,得到每一张人脸图像中的目标人脸的检测框坐标;然后再根据该检测框坐标,对每一张人脸图像进行人脸裁剪,由此,可以更加准确的确定每一张人脸图像中的目标人脸区域,大大提高后续活体检测的准确率。并且,可以通过对目标人脸区域的像素相减,再进行直方图均衡化实现N张人脸图像中两两相邻两张人脸图像(或者是N张人脸图像中任意两张人脸图像)的目标人脸区域的差异计算。在一些可能的实施方式中,还可以通过计算将相邻人脸图像中目标人脸区域的像素的方差值,再进行直方图均衡化实现差异计算,等等,本申请实施例对此不作具体限定。由于活体人脸与非活体人脸的人脸差异图之间存在明显的差异,因此对比现有技术中仅仅通过采集到的人脸图像进行活体检测而言,通过人脸差异图判断是否为活体人脸可以大大提高活体检测的准确率,保证了用户的隐私和财产安全。
在一种可能的实现方式中,所述活体检测模型包括深度恢复网络和分类器;所述将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸,包括:将所述M张人脸差异图输入至所述活体检测模型中的所述深度恢复网络,得到所述M张人脸差异图对应的M张目标人脸区域的深度图;基于所述M张目标人脸区域的深度图,通过所述分类器判断所述目标人脸是否为活体人脸。
在本申请实施例中,可以首先通过该活体检测模型中的深度恢复网络对一张或者多张人脸差异图进行深度估计,得到对应的一张或者多张目标人脸区域的深度图,然后可以通过该活体检测模型中的分类器基于该一张或者多张目标人脸区域的深度图进行活体人脸的判断,并输出活体检测结果。例如,若该活体检测结果表明该目标人脸为活体人脸,则目标人脸通过活体检测,也即用户的人脸识别通过,用户可以进行注册或者支付等操作。又例如,若该活体检测结果表明该目标人脸为非活体人脸(也即为照片或者面具等假脸),则目标人脸未通过活体检测,也即人脸识别未通过,有效阻止了攻击者利用他人的照片或者面具进行人脸识别,以盗用他人的隐私信息和窃取他人的财产的违法犯罪行为。
在一种可能的实现方式中,所述方法还包括:获取正样本集和负样本集,所述正样本集包括多张第一人脸差异图,所述负样本集包括多张第二人脸差异图;所述多张第一人脸差异图中的每一张第一人脸差异图为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;所述多张第二人脸差异图中的每一张第二人脸差异图为分别在所述两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图;所述两个红外光照强度中的至少一个红外光照强度大于0;以所述多张第一人脸差异图和所述多张第二人脸差异图作为训练输入,以所述多张第一人脸差异图和所述多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,训练得到所述活体检测模型。
在本申请实施例中,可以采集大量的正样本和负样本作为活体检测模型的训练输入。其中,正样本可以包括多张活体人脸在不同红外光照强度下的人脸差异图(例如可以包括在两个数值大于0的红外光照强度下通过红外摄像头分别拍摄得到的人脸图像的人脸差异图,还可以包括在未打红外光情况下通过RGB摄像头采集到的人脸图像与开启红外灯情况下通过红外摄像头采集到的人脸图像的人脸差异图),负样本可以包括多张非活体人脸(比如照片、面具和视频等等)在不同红外光照强度下的人脸差异图。如此,通过大量的正、负样本可以更加高效地训练得到用于活体检测的活体检测模型,该活体检测模型可以基于输入的人脸差异图,准确判断当前进行人脸识别的是否为活体人脸,大大提高了活体检测的正确率,保证了用户的隐私和财产安全。
第二方面,本申请实施例提供的一种活体检测装置,其特征在于,应用于终端设备,所述终端设备包括红外摄像模块,所述红外摄像模块包括红外灯,所述装置包括:
第一获取单元,用于获取环境光照强度;
确定单元,用于根据所述环境光照强度,确定所述红外灯的N个红外光照强度;
采集单元,用于基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包 括目标人脸;其中,N为大于或者等于2的整数;
活体检测单元,用于对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,若所述环境光照强度小于预设值,则所述N个红外光照强度中的每一个红外光照强度均大于0;若所述环境光照强度大于或者等于所述预设值,则所述N个红外光照强度中的P个红外光照强度均等于0,所述N个红外光照强度中的K个红外光照强度均大于0;其中,P、K为大于或者等于1的整数,P与K的和为N。
在一种可能的实现方式中,所述终端设备还包括RGB摄像头,所述红外摄像模块还包括红外摄像头;所述采集单元,具体用于:
若所述环境光照强度小于所述预设值,则开启所述红外灯,并通过所述红外摄像头分别在所述N个红外光照强度下进行拍摄,采集得到所述N张人脸图像;
若所述环境光照强度大于或者等于所述预设值,则关闭所述红外灯,并通过所述RGB摄像头分别在所述P个红外光照强度下进行拍摄,采集得到P张人脸图像;以及开启所述红外灯,并通过所述红外摄像头分别在所述K个红外光照强度下进行拍摄,采集得到K张人脸图像。
在一种可能的实现方式中,所述活体检测单元,具体用于:
确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图;其中,M为大于或者等于1,且小于N的整数;
将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,所述活体检测单元,还具体用于:
对所述N张人脸图像中的每一张人脸图像进行人脸检测,得到所述每一张人脸图像中的所述目标人脸的检测框坐标;
根据所述每一张人脸图像中的所述目标人脸的检测框坐标,对所述每一张人脸图像进行人脸裁剪,确定所述每一张人脸图像中的目标人脸区域;
将第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;
对所述像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图;i为大于或者等于1,且小于M的整数。
在一种可能的实现方式中,所述活体检测单元,还具体用于:
将所述M张人脸差异图输入至所述活体检测模型中的所述深度恢复网络,得到所述M张人脸差异图对应的M张目标人脸区域的深度图;
基于所述M张目标人脸区域的深度图,通过所述分类器判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,所述装置还包括:
第二获取单元,用于获取正样本集和负样本集,所述正样本集包括多张第一人脸差异图,所述负样本集包括多张第二人脸差异图;所述多张第一人脸差异图中的每一张第一人 脸差异图为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;所述多张第二人脸差异图中的每一张第二人脸差异图为分别在所述两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图;所述两个红外光照强度中的至少一个红外光照强度大于0;
训练单元,用于以所述多张第一人脸差异图和所述多张第二人脸差异图作为训练输入,以所述多张第一人脸差异图和所述多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,训练得到所述活体检测模型。
第三方面,本申请实施例提供的一种终端设备,其特征在于,该终端设备中包括处理器,处理器被配置为支持该终端设备实现第一方面提供的活体检测方法中相应的功能。该终端设备还可以包括存储器,存储器用于与处理器耦合,其保存该终端设备必要的程序指令和数据。该终端设备还可以包括通信接口,用于该终端设备与其他设备或通信网络通信。
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述第一方面中任意一项所述的活体检测方法流程。
第五方面,本申请实施例提供了一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述第一方面中任意一项所述的活体检测方法流程。
第六方面,本本申请实施例提供了一种芯片系统,该芯片系统包括上述第一方面中任意一项所述的活体检测装置,用于实现上述第一方面中任意一项所述的活体检测方法流程所涉及的功能。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存活体检测方法必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。
图1是现有技术中的一组人脸攻击方式的示意图。
图2是现有技术中的一种活体检测方法的流程示意图。
图3是现有技术中的一种活体检测方法中的屏幕打光方案示意图。
图4是本申请实施例提供的一种终端设备的功能框图。
图5是本申请实施例提供的一种终端设备的软件结构框图。
图6a是本申请实施例提供的一种活体检测方法的应用场景示意图。
图6b是本申请实施例提供的另一种活体检测方法的应用场景示意图。
图7a-图7b是本申请实施例提供的一组界面示意图。
图8是本申请实施例提供的一种活体检测方法的流程示意图。
图9是本申请实施例提供的另一种活体检测方法的流程示意图。
图10是本申请实施例提供的一组室外真人与室外照片的实验结果对比示意图。
图11是本申请实施例提供的一组室内真人与室内照片的实验结果对比示意图。
图12是本申请实施例提供的一种活体检测的过程示意图。
图13是本申请实施例提供的一种活体检测模型的网络结构示意图。
图14是本申请实施例提供的一种活体检测装置的结构示意图。
图15是本申请实施例提供的一种终端设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例进行描述。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或计算机。通过图示,在终端设备上运行的应用和终端设备都可以是部件。一个或多个部件可驻留在进程和/或执行线程中,部件可位于一个计算机上和/或分布在2个或更多个计算机之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。部件可例如根据具有一个或多个数据分组(例如来自与本地系统、分布式系统和/或网络间的另一部件交互的二个部件的数据,例如通过信号与其它系统交互的互联网)的信号通过本地和/或远程进程来通信。
首先,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。
(1)近红外光((Near Infrared,NIR),是介于可见光(VIS)和中红外光(MIR)之间的电磁波,按美国试验和材料检测协会(American Society for Testing and Materials,ASTM)定义是指波长在780~2526nm范围内的电磁波,习惯上又将近红外区划分为近红外短波(780~1100nm)和近红外长波(1100~2526nm)两个区域。
(2)人脸识别,是基于人的脸部特征信息进行身份识别的一种生物识别技术,包括人脸检测与分析、五官定位、人脸比对与验证、人脸检索、活体检测等。用摄像机或摄像头采集含有人脸的图像或视频流,并自动在图像中检测和跟踪人脸,进而对检测到的人脸进行识别的一系列相关技术,通常也叫做人像识别、面部识别。人脸识别技术可应用在美妆美颜、面部动效合成、安防监控追逃、金融领域身份认证等场景,解决各行业客户的多种多样的人脸特效处理及用户身份确认等需求。
(3)直方图均衡化,是图像处理领域中利用图像直方图对对比度进行调整的方法。这 种方法通常用来增加许多图像的局部对比度,尤其是当图像的有用数据的对比度相当接近的时候。通过这种方法,亮度可以更好地在直方图上分布。这样就可以用于增强局部的对比度而不影响整体的对比度,直方图均衡化通过有效地扩展常用的亮度来实现这种功能。
随着人脸识别技术日趋成熟,商业化应用愈加广泛,尤其是在金融行业,人脸识别技术已逐渐用于远程开户、取款、支付等,涉及用户的切身利益。然而,请参阅图1,图1是现有技术中的一组人脸攻击方式的示意图。如图1所示,人脸极易用打印照片、电子照片、3D面具和视频等方式进行复制,因此对合法用户人脸的假冒是人脸识别与认证系统安全的重要威胁。考虑到一旦虚假人脸攻击成功,极有可能对用户造成重大损失,因此势必需要为现有的人脸识别系统开发可靠、高效的人脸活体检测技术。
为了便于理解本申请实施例,进一步分析并提出本申请所具体要解决的技术问题。在现有技术中,关于人脸识别中的活体检测技术,包括多种技术方案,以下示例性的列举如下常用的一种方案。
方案一:基于屏幕打光的人脸活体检测方案。
当前在借助外界打光以进行人脸活体检测的现有技术中,主要运用的是上述的基于屏幕打光的人脸活体检测方案。整个方案流程如图2所示,图2是现有技术中的一种活体检测方法的流程示意图,如图2所示,该方法可以包括以下步骤S10-S40:
步骤S10,接收客户端发送的第一实时视频流,对所述第一实时视频流中的待检测人脸图像进行静默活体检测,得到第一检测结果。
步骤S20,向所述客户端发送光线活体检测指令,以控制所述客户端屏幕按照预设规则进行发光。
步骤S30,在所述客户端屏幕发光过程中,接收所述客户端发送的第二实时视频流,对所述第二实时视频流中的待检测人脸图像进行光线活体检测,得到第二检测结果。
步骤S40,根据所述第一检测结果和所述第二检测结果确定所述待检测人脸图像是否为活体。
如上所述,在方案一的整个活体检测流程中实则包括两个活体检测方案,首先客户端会采集第一实时视频流,对视频流中的人脸图像进行静默活体检测,得到第一检测结果。然后,客户端控制屏幕(例如为智能手机的屏幕或者平板电脑的屏幕,等等)按照预定规则发光。例如,请参阅图3,图3是现有技术中的一种活体检测方法中的屏幕打光方案示意图,如图3所示,智能手机可以按照屏幕光源1(比如屏幕发光的光照强度为40勒克斯(lux,lx))、屏幕光源2(比如屏幕发光的光照强度为30lux)和屏幕光源3(比如屏幕发光的光照强度为50lux)等不同的光源方案进行发光。并在屏幕发光过程中采集第二实时视频流(例如包括在上述屏幕光源1、屏幕光源2和屏幕光源3下人别采集得到的多帧人脸图像)。然后,将采集的第二实时视频流中的待检测人脸图像进行光线活体检测,得到第二检测结果,如果第一检测结果与第二检测结果均为真(也即均为活体人脸)则可确定该人脸为活体人脸,否则为非活体人脸。
该方案一的缺点:方案一在触发活体检测后,首先其客户端需与服务器建立通信连接,然后客户端向服务器发送实时采集的视频流,服务器再利用该视频流中的多帧图片进行活 体检测。显然,方案一实时性不高,活体检测的流程时间会很长,也就导致了整个人脸识别所需的时间较长,用户体验较差。与此同时,方案一采用屏幕主动打光,要始终保持屏幕光源的强度大于环境光,但在室外环境光照强度较大的使用场景下,此方案便会失效。并且,最后的活体检测结果完全依赖第一次的静默活体检测结果和第二次的光线活体检测结果,在牺牲用户体验的前提下,室内场景虽然可以大幅度提升活体检测的准确率,但是由于输入信息的局限,还是存在许多问题场景,导致攻击者可以攻破人脸活体检测算法。例如,在采用的是二维(Two Dimensions,2D)摄像头情况下,攻击者可以采用灯箱攻击,高保真照片,成功攻破;纵然手机具有三维(Three Dimensions,3D)摄像头,攻击者也可以通过高仿的3D面具骗过上述人脸活体检测算法。
综上,上述方案一无法满足在各类环境光情况下实现准确、高效的活体检测,并且其输入的信息单一,容易被各种照片、面具和视频等攻破,无法保证用户在应用人脸识别技术时的安全性。因此,为了解决当前活体检测技术中不满足实际业务需求的问题,本申请实际要解决的技术问题包括如下方面:基于现有的终端设备,实现准确、高效的人脸活体检测,保证人脸识别技术在各方面应用(例如应用人脸识别技术对用户的身份进行认证,比如银行机构、保险机构、税务机构或理财机构等金融机构中的各类注册、支付场景)的安全性,保证用户的隐私和财产安全。
请参阅图4,图4是本申请实施例提供的一种终端设备的功能框图。可选地,在一个实施例中,可将终端设备100配置为完全或部分地自动拍摄模式。例如,终端设备100可以处于定时持续自动拍摄模式,或者根据计算机指令在拍摄范围内检测到预先设置的目标对象(例如人脸等等)时进行拍摄的自动拍摄模式等。在终端设备100处于自动拍摄模式中时,可以将终端设备100设置为在没有和人交互的情况下操作。
下面以终端设备100为例对实施例进行具体说明。应该理解的是,终端设备100可以具有比图4中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图4中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
终端设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对终端设备100的具体限定。在本申请另一些实施例中,终端设备100可以包括比图4所示更多或者更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置,等等。图4所示的部件可以以硬件、 软件或者软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是终端设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可以从所述存储器中直接调用。避免了指令或数据的重复存取,减少了处理器110的等待时间,因而可以大大提高系统的运作效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备100的结构限定。在本申请另一些实施例中,终端设备100也可以采用与上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
终端设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备100可以包括1个或多个显示屏194。
终端设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,对比度和人脸肤色等等进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或者视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB或者YUV等格式的图像信号。
本申请实施例中,终端设备100可以包括多个摄像头193,例如可以包括一个或多个RGB摄像头,以及一个或多个红外摄像头,等等。可选地,该红外摄像头可以为近红外摄像头(例如为2D NIR摄像头)。当应用红外摄像头进行红外拍摄时,终端设备100还可以包括用于红外摄像的一个或多个红外灯(也即红外发射器,图4中未示出),本申请实施例对此不作具体限定。在一些实施例中,可以通过处理器控制红外灯的开启和关闭,还可以调节红外灯的红外光照强度。本申请实施例中的活体检测方法,可以根据当前场景下的环境光照强度制定不同的采图策略。当用户触发人脸识别后,若当前场景为暗光环境,则处理器可以控制开启红外灯,并通过红外摄像头在多个不同红外光照强度下进行拍摄,采集多张人脸图像。若当前场景为强光环境,则处理器可以控制关闭红外灯,并通过RGB摄像头进行拍摄,采集一张或多张未打光的人脸图像;以及处理器还可以控制开启红外灯,并通过红外摄像头在一个或多个红外光照强度下进行拍摄,采集一张或者多张人脸图像。在一些实施例中,处理器110可以获取上述暗光或者强光环境下采集到的多张人脸图像,然后对该多张人脸图像中的目标人脸区域(例如为正在进行人脸识别的用户的人脸区域)进行差异计算,根据该差异判断该目标人脸是否为活体人脸。例如,处理器110可以对每相邻两张人脸图像中的目标人脸区域进行差异计算,得到每相邻两张人脸图像的人脸差异图。然后可以将得到的一张或者多张人脸差异图输入至预先训练的活体检测模型,得到该目标人脸的活体检测结果,也即判断该目标人脸是否为活体人脸。由此实现高效、准确的活体检测,保证了人脸识别技术在各方面应用的安全性,保护了用户的隐私和财产安全,满足用户的实际需求。
其中,摄像头193可以位于终端设备100的正面,例如位于触控屏的上方,也可以位于其他位置,例如位于终端设备的背面。比如,用于人脸识别的RGB摄像头和红外摄像头一般可以位于终端设备100的正面,例如位于触控屏的上方,也可以位于其他位置,例如终端设备100的背面,本申请实施例对此不做具体限制。其中,用于红外摄像的红外灯一般也位于终端设备100的正面,例如位于触控屏的上方,可以理解的是,红外灯一般与红 外摄像头位于终端设备100的同一侧,以便进行红外图像的采集。在一些实施例中,终端设备100还可以包括其他摄像头。在一些实施例中,终端设备100还可以包括点阵发射器(图4中未示出),用于发射光线。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端设备100可以支持一种或多种视频编解码器。这样,终端设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备100的智能认知等应用,例如:图像识别,人脸识别(包括活体检测、人脸检测与分析、五官定位、人脸比对与验证和人脸检索等等),语音识别,文本理解,直方图均衡化等图像处理等等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频,照片等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用,例如人脸识别功能(包括活体检测、人脸检测与分析、五官定位、人脸比对与验证和人脸检索等功能),录像功能、拍照功能、图像处理功能,等等。存储数据区可以存储终端设备100使用过程中所创建的数据等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
终端设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。
陀螺仪传感器180B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。
环境光传感器180L用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。在一些实施例中,环境光传感器180L可以用于获取当前场景下的环境光照亮度,终端设备100可以根据环境光照强度制定不同的采图策略,例如在暗光环境下(比如环境光照强度小于5勒克斯(lux,lx),或者环境光照强度小于1lux,等等),开启红外灯,并确定多个数值大于0的红外光照强度,然后通过红外摄像头在该多个红外光照强度下分别进行拍摄,采集多张人脸图像,等等,此处不再进行赘述。
指纹传感器180H用于采集指纹。终端设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。其中,该指纹传感器180H可以设置在触控屏下方,终端设备100可以接收用户在触控屏上该指纹传感器对应的区域的触摸操作,终端设备100可以响应于该触摸操作,采集用户手指的指纹信息,实现相关功能。
温度传感器180J用于检测温度。在一些实施例中,终端设备100利用温度传感器180J检测的温度,执行温度处理策略。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于终端设备100的表面,与显示屏194所处的位置不同。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端设备100可以接收按键输入,产生与终端设备100的用户设置以及功能控制有关的键信号输入。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端设备100的接触和分离。在一些实施例中,终端设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端设备100中,不能和终端设备100分离。
终端设备100可以是具备上述功能的智能手机、智能可穿戴设备、平板电脑、笔记本电脑、台式电脑和计算机等等设备,本申请实施例对此不作具体限定。
终端设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明终端设备100的软件结构。
请参阅图5,图5是本申请实施例提供的一种终端设备的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一 些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图5所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序(也可以称为应用)。还可以包括本申请涉及的相关活体检测应用,通过该活体检测应用可以运用本申请中的一种活体检测方法,高效、准确的实现人脸识别技术中的活体检测,有效阻止他人利用用户的照片或者面具等通过人脸识别,盗取用户的隐私和财产等违法犯罪行为。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图5所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。例如,在一些实施例中,可以包括相关人脸识别控件的拍照界面,通过点击该人脸识别控件可以实现运用本申请中的一种活体检测方法,根据当前场景下的环境光照强度,制定不同的采图策略,并根据制定的采图策略采集多张人脸图像,并根据该多张人脸图像中目标人脸区域的差异判断该目标人脸是否为活体人脸。从而大大提高人脸识别中活体检测的准确率,保证用户的隐私和财产安全。
电话管理器用于提供终端设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话界面形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。还例如,在进行本申请中涉及的人脸识别时,可以在人脸识别界面通过文本信息提示用户人脸识别已通过,并已通过人脸识别完成注册或者支付,等等。还例如在人脸识别无法正确进行时,例如用户戴着帽子、口罩,遮盖了脸部的大部分区域时,可以在人脸识别界面通过文本信息提示用户向镜头展示全部裸露的脸部。也例如在人脸识别的活体检测未通过时(也即通过活体检测判断出当前的目标人脸为非活体人脸,比如为照片或者视频等等),可以在人脸识别界面通过文本信息提示用户人脸识别未通过,当前人脸为非活体,请使用用户的真实活体人脸进 行人脸识别,等等,本申请实施例对此不作具体限定。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。本申请中涉及的视频格式例如可以为RM,RMVB,MOV,MTV,AVI,AMV,DMV,FLV等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,以及图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动(例如包括红外摄像头驱动和RGB摄像头驱动),音频驱动,传感器驱动。
为了便于理解本申请实施例,以下示例性列举本申请中一种活体检测方法所适用的应用场景,可以包括如下2个场景。
场景一,用户通过终端设备进行活体检测,完成人脸识别并进行线上支付。
请参阅图6a,图6a是本申请实施例提供的一种活体检测方法的应用场景示意图。如图6a所示,该应用场景包括终端设备(图6a中以智能手机为例)。并且该终端设备中可以包括相关拍摄模块、显示器和处理器等。其中,拍摄模块、显示器和处理器可以通过系统总线进行数据传输。其中,拍摄模块可以包括红外拍摄模块和RGB摄像头,该红外拍摄模块可以包括红外灯(也即红外发射器)和红外摄像头。该RGB摄像头、红外摄像头和该红外灯可以位于终端设备的正面,上述摄像头均可以将捕捉到的光源信号转化为数字信号,完成图像的采集。在本申请实施例中,在用户通过终端设备触发人脸识别后,终端设备可以根据当前场景下的环境光照强度制定相应的采图策略,并根据该采图策略通过红外摄像头采集得到多张人脸图像,或者通过红外摄像头以及RGB摄像头采集得到多张人脸图像。然后,可以通过上述系统总线将采集到的人脸图像传输至终端设备的处理器,处理器根据获取到的人脸图像,利用本申请中的一种活体检测方法对人脸图像中的目标人脸进行活体检测。例如,处理器根据采集到的多张人脸图像,通过差异计算得到一张或者多张人脸差异图(也即得到人脸差异图序列),再将该一张或者多张人脸差异图输入至预先训练的活体检测模型,判断该目标人脸是否为活体人脸,由此完成人脸识别中的活体检测部分。
在本申请实施例中,当用户想要进行人脸识别以完成相应的付款操作时,用户对终端 设备的操作过程可以参阅图7a和图7b,图7a-图7b是本申请实施例提供的一组界面示意图。如图7a所示,终端设备显示了订单支付界面701,其中,该订单支付界面701可以包括有设置控件702、立即付款控件703和其他控件(例如返回控件、付款方式选择控件、商品删除控件和商品数量选择控件,等等)。例如,如图7a所示,当用户对该购物订单确认无误,想要进行付款时,可以通过输入操作704(例如为点击)触发付款操作。此时,如图7b所示,在用户点击了立即付款控件703后,终端设备显示了人脸识别界面705,其中,该人脸识别界面可以包括开始人脸识别控件706和其他控件(例如返回控件、设置控件和输入密码控件等等)。用户可以通过输入操作707(例如为点击)开始人脸识别,该人脸识别过程中包括了活体检测,在进行活体检测时,可以运用本申请提供的一种活体检测方法,首先获取当前场景下的环境光照强度,根据环境光照强度制定合理的采图策略,确定红外灯的多个红外光照强度。然后,根据该多个红外光照强度相应的调节该红外灯,并在多个红外光照强度下分别进行拍摄,采集多张人脸图像。然后,通过对该多张人脸图像中的每相邻两张人脸图像中的目标人脸区域的差异计算,得到一张或者多张人脸差异图(也即得到人脸差异图序列),再将该一张或者多张人脸差异图输入至预先训练的活体检测模型,判断当前进行人脸识别的目标人脸(也即进行本次付款操作的用户的人脸)是否为活体人脸,由此完成人脸识别中的活体检测部分。若确定该目标人脸为活体人脸,并且本次人脸识别中的其他部分(比如人脸检测与分析、五官定位、人脸比对与验证等等)均通过,则用户的本次人脸识别通过,用户即可完成付款。可选地,用户还可以通过点击设置控件702设置默认的支付认证方式(例如为人脸识别、输入密码和输入指纹等等),用户还可以设置人脸识别的人脸数量(例如设置本购物账号的人脸识别的人脸数量上限为5个不同的人脸,等等)或者修改人脸识别的人脸(例如重新录入用户自己的人脸,添加或者删除好友、家人的人脸等),等等,本申请实施例对此不作具体限定。
可选地,在本申请实施例中,当开发人员想要进行人脸识别以测试本申请中的一种活体检测方法时,开发人员对终端设备的操作过程也可以参考图7a和图7b,此处不再进行赘述。开发人员可以根据得到的活体检测结果,不断优化本申请中的根据环境光照强度制定的采图策略,差异计算方法,以及活体检测模型,等等,从而不断提升活体检测的性能,有效提高活体检测的正确率。
如上所述,该终端设备可以为具备上述功能的智能手机、智能可穿戴设备、平板电脑、膝上计算机和台式电脑等等,本申请实施例对此不作具体限定。
场景二,用户通过终端设备以及与终端设备连接的服务器进行活体检测,完成人脸识别并进行金融注册。
请参阅图6b,图6b是本申请实施例提供的另一种活体检测方法的应用场景示意图。如图6b所示,该应用场景可以包括终端设备(图6b中以智能手机为例)以及计算设备(例如可以为某银行机构的服务器)。其中,终端设备和计算设备可以通过蓝牙、Wi-Fi或移动网络等无线通信方式或者数据线等有线通信方式进行数据传输。其中,终端设备可以包括相关拍摄模块、显示器和处理器等。其中,拍摄模块、显示器和处理器可以通过系统总线进行数据传输。其中,拍摄模块可以包括红外拍摄模块和RGB摄像头,该红外拍摄模块可以包括红外灯(也即红外发射器)和红外摄像头。该RGB摄像头、红外摄像头和该红外灯 可以位于终端设备的正面,上述摄像头均可以将捕捉到的光源信号转化为数字信号,完成图像的采集。在本申请实施例中,在用户通过终端设备触发人脸识别后,终端设备可以根据当前场景下的环境光照强度制定相应的采图策略,并根据该采图策略通过红外摄像头采集得到多张人脸图像,或者通过红外摄像头以及RGB摄像头采集得到多张人脸图像。同时,例如,如图6b所示,在用户通过终端设备触发金融注册中的人脸识别后(例如用户通过点击终端设备显示的金融注册界面当中的相关人脸识别控件),终端设备可以与相关银行机构的服务器建立即时通信连接,然后终端设备可以通过无线方式将采集到的多张人脸图像发送至该服务器,服务器根据接收到的人脸图像,利用本申请中的一种活体检测方法对人脸图像中的目标人脸进行活体检测。例如,服务器根据接收到的多张人脸图像,通过差异计算得到一张或者多张人脸差异图(也即得到人脸差异图序列),再将该一张或者多张人脸差异图输入至预先训练的活体检测,判断该目标人脸是否为活体人脸,由此完成人脸识别中的活体检测部分。并且,如图6b所示,计算设备可以将活体检测结果发送至终端设备,终端设备可以根据该活体检测结果显示相应的界面。例如,若此次人脸识别中的活体检测以及其他部分(比如人脸检测与分析、五官定位、人脸比对与验证等等)均通过,则用户的本次人脸识别通过,用户可以通过终端设备完成其在相关银行机构的金融注册,例如为创建银行账户等等。
如上所述,该终端设备可以为具备上述功能的智能手机、智能可穿戴设备、平板电脑、膝上计算机和台式电脑等等,本申请实施例对此不作具体限定;该计算设备可以为具备上述功能的平板电脑、膝上计算机、台式电脑和服务器等,该服务器可以是具备上述功能的一台服务器,也可以是由多台服务器组成的服务器集群,或者是一个云计算服务中心,等等,本申请实施例对此不作具体限定。
可以理解的是,本申请提供的一种活体检测方法还可以应用于除上述两个应用场景外的其他场景,例如为通过人脸识别进行智能手机、平板电脑等终端设备的屏幕解锁,税务机构或者动车、高铁等公共交通场所通过人脸识别对用户进行身份认证等等应用场景,此处不再进行赘述。
请参阅图8,图8是本申请实施例提供的一种活体检测方法的流程示意图,该方法可应用于上述图6a或图6b中所述的应用场景及系统架构中,以及具体可应用于上述图4的终端设备100中。下面结合附图8以执行主体为上述图4中的终端设备100为例进行描述。该方法可以包括以下步骤S801-步骤S804:
步骤S801,获取环境光照强度。
具体地,终端设备获取当前场景下的环境光照强度。可选地,终端设备可以通过以下应用程序编程接口(Application Programming Interface,API):“public static float light_strength;”获取当前场景下的环境光照强度。
可选地,请参阅图9,图9是本申请实施例提供的另一种活体检测方法的流程示意图。请参考如图9所示的步骤S11,首先,用户可以通过终端设备触发人脸识别(也即触发人脸识别中所包括的活体检测)。例如,用户可以通过点击终端设备显示的相关控件(例如人脸识别控件、人脸支付控件和身份验证控件等等),或者双击终端设备已锁住的屏幕等等操 作触发人脸识别,以触发本申请实施例中的活体检测流程,本申请实施例对此不作具体限定。在触发了活体检测后,终端设备可以通过上述的应用程序编程接口获取当前场景下的环境光照强度。比如,在室内开灯的场景下,其环境光照强度一般可以为50lux至60lux不等,又比如,在黑暗的街道或者夜晚室内不开灯等场景下,其环境光照强度一般小于5lux,甚至小于1lux,等等,此处不再进行赘述。
步骤S802,根据环境光照强度,确定红外灯的N个红外光照强度。
具体地,该终端设备可以包括红外摄像模块,该红外摄像模块可以包括红外灯(或者称之为红外发射器),该终端设备可以根据获取到的环境光照强度,制定相应的采图策略,并确定红外灯的N个红外光照强度,其中,N为大于或者等于2的整数。可选地,请参考如图9所示的步骤S12和步骤S13。例如,当环境光照强度小于预设值(例如可以为小于5lux或者1lux等等,本申请实施例对此不作具体限定)时,也即在暗光环境中,可以采取完全红外摄像的采图策略,并确定红外灯的N个红外光照强度,其中,该N个红外光照强度的数值均大于0,比如可以分别为20lux、30lux和40lux等等。又例如,当环境光照强度大于或者等于该预设值时,也即在强光环境中,可以采取部分红外摄像的采图策略,并确定红外灯的N个红外光照强度,其中,该N个红外光照强度中的P个红外光照强度的数值等于0,也即关闭红外灯,不进行红外打光;并且,该N个红外光照强度中的K个红外光照强度的数值均大于0,比如可以分别为20lux、35lux和43lux等等。其中,P、K为大于或者等于1的整数,P与K的和为N。可选地,当环境光照强度等于该预设值时,终端设备也可以采取完全红外摄像的采图策略,本申请实施例对此不作具体限定。也即在暗光环境中,其采图策略一般为采集多张在不同强度的红外光打光下的人脸图像,而在强光环境中,其采图策略一般为采集一张或者多张未打红外光的人脸图像,并且采集一张或多张打红外光的人脸图像。
步骤S803,基于N个红外光照强度调节红外灯,并分别在N个红外光照强度下进行拍摄,采集得到N张人脸图像。
具体地,终端设备基于该N个红外光照强度调节终端设备的红外灯,并分别在该N个红外光照强度下进行拍摄,采集得到N张人脸图像,该N张人脸图像中的每一张人脸图像包括目标人脸(例如为用户的人脸,或者在软件测试阶段开发人员或者实验人员的人脸)。可选地,该终端设备还可以包括RGB摄像头,该红外摄像模块还可以包括红外摄像头。可选地,可以参考图9所示的步骤S14。
例如,若获取到的环境光照强度小于预设值(例如为上述的小于5lux或者1lux等等),则终端设备控制开启该红外灯,并通过该红外摄像头分别在该N个红外光照强度下进行拍摄,采集得到该N张人脸图像。可以理解的是,在暗光环境中,由于几乎不存在可见光,因此普通的RGB摄像头无法采集到清晰的人脸图像,而此时红外拍摄具有较好的效果,则可以通过开启红外灯,并利用红外摄像头在多个红外光照强度下分别进行拍摄,采集得到多张清晰的人脸图像,用于后续的活体检测。
又例如,若获取到的环境光照强度大于或者等于该预设值,则终端设备控制关闭该红外灯,并通过该RGB摄像头分别在该P个数值等于0的红外光照强度下进行拍摄(也即在没有红外打光的情况下通过该RGB摄像头进行拍摄),采集得到P张人脸图像;以及开启 该红外灯,并通过该红外摄像头分别在该K个数值大于0的红外光照强度下进行拍摄(也即在有红外打光的情况下通过该红外摄像头进行拍摄),采集得到K张人脸图像。可以理解的是,在强光环境中,由于存在较强的可见光,红外光的效果微乎其微,因此可以采取上述的分别调用RGB摄像头和红外摄像头进行拍摄的人脸图像采集方式。可以理解的是,基于红外成像的原理,红外灯发射的红外光线用于红外摄像头进行红外拍摄,因此,在利用红外摄像头采集人脸图像时通常需要开启红外灯,而在利用RGB摄像头采集人脸图像时通常关闭该红外灯。可选地,该红外灯可以是一个或多个红外灯,本申请实施例对此不作具体限定。
可选地,终端设备可以通过如下所示的红外灯设置接口控制红外灯:
//前置时(swing),设置IR开关,即红外模式0,1 0关1开;
private void setIRF(CaptureRequest.Builder builder,int value)。
如上所述,在暗光环境中,其采图策略一般为采集多张在不同强度的红外光打光下的人脸图像,而在强光环境中,其采图策略一般为采集一张或者多张未打红外光的人脸图像,并且采集一张或多张打红外光的人脸图像。如此,根据不同的环境光照强度采取不同的采图策略,调用相应的摄像头进行拍摄,采集人脸图像,大大降低了环境光照强度对活体检测的影响,极大程度上提高了活体检测的准确率,保证了人脸识别技术应用的安全性,进而保证用户的隐私和财产安全。需要说明的是,在上述强光环境中,本申请对打红外光的人脸图像以及未打红外光的人脸图像的采集顺序不作具体限定。
步骤S804,对比N张人脸图像中的目标人脸区域,根据N张人脸图像中的目标人脸区域的差异判断目标人脸是否为活体人脸。
具体地,终端设备可以将采集到的N张人脸图像传输至处理器,处理器对比该N张人脸图像中的目标人脸区域,并根据该N张人脸图像中的目标人脸区域的差异判断该目标人脸是否为活体人脸。
可选地,上述对比N张人脸图像中的目标人脸区域,根据N张人脸图像中的目标人脸区域的差异判断目标人脸是否为活体人脸的步骤具体可以包括以下步骤S21-步骤S22:
步骤S21,确定N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图。
具体地,首先可以对该N张人脸图像分别进行预处理,其中,预处理过程可以包括人脸检测以及人脸裁剪。可选地,可以参考图9所示的步骤S15,首先可以对该N张人脸图像中的每一张人脸图像进行人脸检测,得到该每一张人脸图像中的目标人脸的检测框坐标。然后,可以根据该每一张人脸图像中的目标人脸的检测框坐标,对该每一张人脸图像进行人脸裁剪,确定该每一张人脸图像中的目标人脸区域。可选地,可以参考图9所示的步骤S16,在确定N张人脸图像中的每一张人脸图像中的目标人脸区域后,可以对其中每相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图。其中,M为大于或者等于1,且小于N的整数。例如,将N张人脸图像中的第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;然后,对像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图,如此便可以得到M张人脸差异图。其中,i为大于或者等于1,且小于M 的整数。可选地,还可以通过计算相邻两张人脸图像中目标人脸区域的像素的方差,再进行直方图均衡化的方法实现差异计算,得到人脸差异图,等等,本申请实施例对此不作具体限定。可选地,也可以对该N张人脸图像中的任意两张人脸差异图中的目标人脸区域进行差异计算,得到相应的人脸差异图。
例如,在环境光照强度为2lux(比如黑暗的街道),预设值为5lux的情况下,也即环境光照强度小于预设值的情况下,可以采取完全红外摄像的采图策略,一共采集得到三张人脸图像,该三张人脸图像分别为人脸图像a、人脸图像b和人脸图像c。其中,人脸图像a可以是在红外光照强度为30lux的情况下通过红外摄像头采集得到的人脸图像;人脸图像b可以是在红外光照强度为40lux的情况下通过红外摄像头采集得到的人脸图像;人脸图像c可以是在红外光照强度为50lux的情况下通过红外摄像头采集得到的人脸图像。此时,终端设备可以将人脸图像a与人脸图像b中的目标人脸区域的像素进行相减,再对像素相减后得到的图像进行直方图均衡化,由此得到本次活体检测的第一张人脸差异图;然后,终端设备可以将人脸图像b与人脸图像c中的目标人脸区域的像素进行相减,再对像素相减后得到的图像进行直方图均衡化,由此得到本次活体检测的第二张人脸差异图。如此,完成了人脸图像的帧间差异计算,也即完成了对每相邻两张人脸图像的差异计算。可选地,终端设备也可以仅仅选择人脸图像a与人脸图像b进行差异计算,得到人脸差异图,用于后续的活体检测;还可以仅仅选择人脸图像b与人脸图像c进行差异计算,得到人脸差异图,用于后续的活体检测;还可以仅仅选择人脸图像a与人脸图像c进行差异计算,得到人脸差异图,用于后续的活体检测,等等,本申请实施例对此不作具体限定。一般情况下,本申请实施例中的活体检测方法通常会出3帧或者4帧人脸图像(也即采集3张或者4张人脸图像),并计算得到一张或者多张人脸差异图,用于后续的活体检测,本申请实施例对此不作具体限定。
又例如,在环境光照强度为50lux(比如开灯的室内),预设值为5lux的情况下,也即环境光照强度大于预设值的情况下,可以采取部分红外摄像的采图策略,一共采集得到三张人脸图像,该三张人脸图像分别为人脸图像d、人脸图像e和人脸图像f。其中,人脸图像d可以是在红外光照强度为0lux的情况下(也即关闭红外灯的情况下)通过RGB摄像头采集得到的人脸图像;人脸图像e可以是在红外光照强度为55lux的情况下通过红外摄像头采集得到的人脸图像;人脸图像f可以是在红外光照强度为60lux的情况下通过红外摄像头采集得到的人脸图像。此时,终端设备可以将人脸图像d与人脸图像e中的目标人脸区域的像素进行相减,再对像素相减后得到的图像进行直方图均衡化,由此得到本次活体检测的第一张人脸差异图;然后,终端设备可以将人脸图像e与人脸图像f中的目标人脸区域的像素进行相减,再对像素相减后得到的图像进行直方图均衡化,由此得到本次活体检测的第二张人脸差异图。如此,完成了人脸图像的帧间差异计算,也即完成了对每相邻两张人脸图像的差异计算。可选地,如上所述,终端设备也可以仅仅选择人脸图像d与人脸图像e进行差异计算,得到人脸差异图,用于后续的活体检测;还可以仅仅选择人脸图像e与人脸图像f进行差异计算,得到人脸差异图,用于后续的活体检测;还可以仅仅选择人脸图像d与人脸图像f进行差异计算,得到人脸差异图,用于后续的活体检测,等等,本申请实施例对此不作具体限定。
可选地,请参阅图10,图10是本申请实施例提供的一组室外真人与室外照片的实验结果对比示意图。如图10所示,人脸图像1和人脸图像2可以为在同一次室外场景(例如环境光照强度为60lux)的活体检测中采集到的人脸图像。其中,人脸图像1可以为在红外光照强度1(例如为0lux,也即未开启红外光)下针对真人的目标人脸1(也即活体人脸)拍摄得到人脸图像。人脸图像2可以为在红外光照强度2(例如为65lux,也即开启红外光)下针对真人的目标人脸1拍摄得到人脸图像。在将人脸图像1与人脸图像2中的目标人脸区域的像素进行相减后得到的图像如图10所示,其整体偏暗,无法看清,此时,可以通过对其进行直方图均衡化以提高图像质量,得到如图10所示的真人的人脸差异图,显然,在如图10所示的该真人的人脸差异图中,目标人脸1的五官清晰,脸部轮廓较为明显。请一并参阅图10,如图10所示,人脸图像3和人脸图像4可以为在同一次室外场景(例如环境光照强度为60lux)的活体检测中采集到的人脸图像。其中,人脸图像3可以为在红外光照强度3(例如为0lux,也即未开启红外光)下针对照片的目标人脸2(也即非活体人脸)拍摄得到人脸图像。人脸图像4可以为在红外光照强度4(例如为65lux,也即开启红外光)下针对照片的目标人脸2拍摄得到人脸图像。在将人脸图像3与人脸图像4中的目标人脸区域的像素进行相减后得到的图像如图10所示,其整体偏暗,无法看清,此时,可以通过对其进行直方图均衡化得到如图10所示的照片的人脸差异图,显然,在如图10所示的该照片的人脸差异图中,目标人脸2的五官模糊,脸部轮廓不明显。
可选地,请参阅图11,图11是本申请实施例提供的一组室内真人与室内照片的实验结果对比示意图。如图11所示,在室内场景下进行活体检测,得到的真人的人脸差异图和照片的人脸差异图存在较大差距,其中,在如图11所示的真人的人脸差异图中,目标人脸的五官清晰,脸部轮廓较为明显,而在如图11所示的照片的人脸差异图中,目标人脸的五官模糊,脸部轮廓不明显,此处不再进行赘述。
通过上述图10以及图11相关实施例的描述可知,活体人脸与非活体人脸的人脸差异图存在明显的区分。因此,可以通人脸差异图判断当前进行活体检测的目标人脸是否为活体人脸,从而可以提升活体检测的性能,大大提高活体检测的准确率,有效阻止攻击者利用他人的照片或者面具进行人脸识别,以盗用他人的隐私信息和窃取他人财产的违法犯罪行为。
步骤S22,将M张人脸差异图输入至预先训练的活体检测模型,判断目标人脸是否为活体人脸。
具体地,终端设备将通过差异计算得到的M张人脸差异图输入至预先训练的活体检测模型,通过该活体检测模型可以判断该目标人脸是否为活体人脸。可选地,可以参考图9所示的步骤S17和步骤S18。请参阅图12,图12是本申请实施例提供的一种活体检测的过程示意图。例如,如图12所示,在该活体检测中采集了2张人脸图像,可以包括在红外光照强度5下采集到的人脸图像5,以及在红外光照强度6下采集到的人脸图像6。可选地,如图12所示的此次活体检测的环境光照强度可以为40lux,该红外光照强度5可以为0lux,也即该人脸图像5可以为关闭红外灯,利用RGB摄像头进行拍摄,采集得到的人脸图像;该红外光照强度6可以为50lux,也即该人脸图像6可以为开启红外灯,利用红外摄像头进行拍摄,采集得到的人脸图像。可选地,如图12所示,该活体检测模型可以包括深度恢复 网络和分类器。可选地,如图12所示,可以对该人脸图像5和人脸图像6中的目标人脸区域进行差异计算,得到相应的人脸差异图(图12中未示出),可选地,可以将该人脸差异图通过法向量表示(也即图12所示的法向量提示),然后将其输入至该活体检测模型中的深度恢复网络,通过深度图估计,得到目标人脸区域的深度图。然后,可以通过该分类器基于该目标人脸区域的深度图判断该目标人脸是否为活体人脸,也即可以通过该分类器直接输出本次活体检测的检测结果。显然,本申请提供的活体检测流程可以完全由终端设备完成,检测效率高,对比上述论述的现有技术中的活体检测算法具有更好的实时性,增强了用户体检。如图12所示,该分类器的输出结果可以为活体人脸或者非活体人脸(又或者,可以为真脸或者假脸,等等,本申请实施例对此不作具体限定)。可选地,若一次活体检测中通过差异计算得到多张人脸差异图,则可将该多张人脸差异图一并输入至该活体检测模型的深度恢复网络中,得到多张目标人脸区域的深度图,然后通过该分类器基于该多张目标人脸区域的深度图判断该目标人脸是否为活体人脸。
请参阅图13,图13是本申请实施例提供的一种活体检测模型的网络结构示意图。如图13所示,该活体检测模型可以包含两类输入,分别为第一类人脸差异图(image_face1)和第二类人脸差异图(image_face2)。其中,第一类人脸差异图可以为未打红外光下采集的人脸图像与红外打光下采集的人脸图像之间的人脸差异图;第二类人脸差异图可以为在不同强度的红外打光下采集的人脸图像之间的人脸差异图。可选地,样机文件(prototxt)中的输入(input)以及输入维度(input_dim)可以如下所示:
input:"image_face1"
input_dim:1
input_dim:1
input_dim:256
input_dim:256
input:"image_face2"
input_dim:1
input_dim:1
input_dim:256
input_dim:256
可选地,该活体检测模型的训练过程可以包括以下步骤S31-步骤S32:
步骤S31,获取正样本集和负样本集,该正样本集可以包括多张第一人脸差异图,该负样本集可以包括多张第二人脸差异图。其中,该多张第一人脸差异图中的每一张第一人脸差异图可以为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;该多张第二人脸差异图中的每一张第二人脸差异图可以为分别在两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图。其中,上述两个红外光照强度中的至少一个红外光照强度大于0,也即正样本集中的多张第一人脸差异图可以包括上述的第一类人脸差异图,也可以包括上述的第二类人脸差异图;并且,负样本集中的多张第二人脸差异图可以包括上述的第一类人脸差异图,也可以包括上述的第二类人脸差异图。
步骤S32,以多张第一人脸差异图和多张第二人脸差异图作为训练输入,以该多张第一人脸差异图和该多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,不断修正初始网络中的一个或多个参数,从而训练得到所述活体检测模型,此处不再进行赘述。
本申请实施例提供了一种活体检测方法,可以根据当前场景下的环境光照强度,在人脸识别的活体检测中制定不同的采图策略,设置不同的红外光照强度,并在该不同的红外光照强度(例如可以包括多个数值大于0的红外光照强度,还可以包括数值等于0的红外光照强度,也即关闭红外灯)下分别进行拍摄,采集得到多张人脸图像。然后根据该多张人脸图像中的目标人脸区域之间的差异,判断该目标人脸是否为活体人脸。如此,对比现有技术中,不考虑环境光照强度,仅仅根据预设的方案通过屏幕光源打光或者红外打光的方式采集人脸图像,然后根据采集到的图像进行活体检测,容易被攻击者用人脸照片、面具或者视频等方法攻破的方案而言。本申请实施例不仅考虑到了环境光照强度的影响,还通过不同打光下采集到的人脸图像之间的差异进行活体检测,大大降低了环境光照强度对活体检测的影响,极大程度上提高了活体检测的准确率,保证了人脸识别技术应用的安全性,进而保证用户的隐私和财产安全。
除此之外,需要说明的是,本申请旨在灵活的地根据不同的环境光照强度采取不同的采图策略,进一步调用相应的摄像头在不打红外光或者在不同强度的红外打光的情况下进行拍摄,采集得到用于活体检测的多张图像,从而进一步通过采集得到的图像之间的差异判断该活体检的对象是否为活体。因此,进一步地,本申请实施例所提供的一种活体检测方法还可以应用于除人脸外的其他活体检测,例如家禽、野生动物等的活体检测,等等,本申请实施例对此不作具体限定。
请参阅图14,图14是本申请实施例提供的一种活体检测装置的结构示意图,该活体检测装置可以应用于终端设备,所述终端设备可以包括红外摄像模块,所述红外摄像模块可以包括红外灯。该活体检测装置可以包括装置30,该装置30可以包括第一获取单元301、确定单元302、采集单元303和活体检测单元304,其中,各个单元的详细描述如下。
第一获取单元301,用于获取环境光照强度;
确定单元302,用于根据所述环境光照强度,确定所述红外灯的N个红外光照强度;
采集单元303,用于基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;其中,N为大于或者等于2的整数;
活体检测单元304,用于对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,若所述环境光照强度小于预设值,则所述N个红外光照强度中的每一个红外光照强度均大于0;若所述环境光照强度大于或者等于所述预设值,则所述N个红外光照强度中的P个红外光照强度均等于0,所述N个红外光照强度中的K个红外光照强度均大于0;其中,P、K为大于或者等于1的整数,P与K的和为N。
在一种可能的实现方式中,所述终端设备还包括RGB摄像头,所述红外摄像模块还包括红外摄像头;所述采集单元303,具体用于:
若所述环境光照强度小于所述预设值,则开启所述红外灯,并通过所述红外摄像头分别在所述N个红外光照强度下进行拍摄,采集得到所述N张人脸图像;
若所述环境光照强度大于或者等于所述预设值,则关闭所述红外灯,并通过所述RGB摄像头分别在所述P个红外光照强度下进行拍摄,采集得到P张人脸图像;以及开启所述红外灯,并通过所述红外摄像头分别在所述K个红外光照强度下进行拍摄,采集得到K张人脸图像。
在一种可能的实现方式中,所述活体检测单元304,具体用于:
确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图;其中,M为大于或者等于1,且小于N的整数;
将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,所述活体检测单元304,还具体用于:
对所述N张人脸图像中的每一张人脸图像进行人脸检测,得到所述每一张人脸图像中的所述目标人脸的检测框坐标;
根据所述每一张人脸图像中的所述目标人脸的检测框坐标,对所述每一张人脸图像进行人脸裁剪,确定所述每一张人脸图像中的目标人脸区域;
将第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;
对所述像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图;i为大于或者等于1,且小于M的整数。
在一种可能的实现方式中,所述活体检测单元304,还具体用于:
将所述M张人脸差异图输入至所述活体检测模型中的所述深度恢复网络,得到所述M张人脸差异图对应的M张目标人脸区域的深度图;
基于所述M张目标人脸区域的深度图,通过所述分类器判断所述目标人脸是否为活体人脸。
在一种可能的实现方式中,所述装置30还包括:
第二获取单元305,用于获取正样本集和负样本集,所述正样本集包括多张第一人脸差异图,所述负样本集包括多张第二人脸差异图;所述多张第一人脸差异图中的每一张第一人脸差异图为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;所述多张第二人脸差异图中的每一张第二人脸差异图为分别在所述两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图;所述两个红外光照强度中的至少一个红外光照强度大于0;
训练单元306,用于以所述多张第一人脸差异图和所述多张第二人脸差异图作为训练输入,以所述多张第一人脸差异图和所述多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,训练得到所述活体检测模型。
需要说明的是,本申请实施例中所描述的活体检测装置中各功能单元的功能可参见上述图8中所述的方法实施例中步骤S801-步骤S804的相关描述,此处不再进行赘述。
图14中每个单元可以以软件、硬件、或其结合实现。以硬件实现的单元可以包括路及电炉、算法电路或模拟电路等。以软件实现的单元可以包括程序指令,被视为是一种软件产品,被存储于存储器中,并可以被处理器运行以实现相关功能,具体参见之前的介绍。
基于上述方法实施例以及装置实施例的描述,本申请实施例还提供一种终端设备。请参阅图15,图15是本申请实施例提供的一种终端设备的结构示意图,该终端设备至少包括处理器401,输入设备402、输出设备403和计算机可读存储介质404,该终端设备还可以包括其他通用部件,在此不再详述。其中,终端设备内的处理器401,输入设备402、输出设备403和计算机可读存储介质404可通过总线或其他方式连接。该输入设备402可以包括红外摄像模块,该红外摄像模块可以包括红外摄像头和红外灯,可以在弱光环境或者强光环境下开启红外灯,并调节不同的红外光照强度利用该红外摄像头进行红外摄像,采集多张用于活体检测的人脸图像。该输入设备402还可以包括RGB摄像头,可以在强光环境下利用该RGB摄像头进行拍摄,采集一张或多张用于活体检测的人脸图像。可选地,该红外摄像头可以为2D近红外摄像头,或者其他可实现上述功能的摄像头,等等。本申请实施例对此不作具体限定。
处理器401可以是通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制以上方案程序执行的集成电路。
该终端设备内的存储器可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
计算机可读存储介质404可以存储在终端设备的存储器中,所述计算机可读存储介质404用于存储计算机程序,所述计算机程序包括程序指令,所述处理器401用于执行所述计算机可读存储介质404存储的程序指令。处理器401(或称CPU(Central Processing Unit,中央处理器))是终端设备的计算核心以及控制核心,其适于实现一条或一条以上指令,具体适于加载并执行一条或一条以上指令从而实现相应方法流程或相应功能;在一个实施例中,本申请实施例所述的处理器401可以用于进行活体检测的一系列处理,包括:获取环境光照强度;根据所述环境光照强度,确定红外灯的N个红外光照强度;基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;其中,N为大于或者等于2的整数;对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸,等等。
需要说明的是,本申请实施例中所描述的终端设备中各功能单元的功能可参见上述图8中所述的方法实施例中的步骤S801-步骤S804的相关描述,此处不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
本申请实施例还提供了一种计算机可读存储介质(Memory),所述计算机可读存储介质是终端设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机可读存储介质既可以包括终端设备中的内置存储介质,当然也可以包括终端设备所支持的扩展存储介质。计算机可读存储介质提供存储空间,该存储空间存储了终端设备的操作系统。并且,在该存储空间中还存放了适于被处理器401加载并执行的一条或一条以上的指令,这些指令可以是一个或一个以上的计算机程序(包括程序代码)。需要说明的是,此处的计算机可读存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选地还可以是至少一个位于远离前述处理器的计算机可读存储介质。
本申请实施例还提供一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行任意一种活体检测方法的部分或全部步骤。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可能可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者 说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以为个人计算机、服务端或者网络设备等,具体可以是计算机设备中的处理器)执行本申请各个实施例上述方法的全部或部分步骤。其中,而前述的存储介质可包括:U盘、移动硬盘、磁碟、光盘、只读存储器(Read-OnlyMemory,缩写:ROM)或者随机存取存储器(RandomAccessMemory,缩写:RAM)等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (17)

  1. 一种活体检测方法,其特征在于,应用于终端设备,所述终端设备包括红外摄像模块,所述红外摄像模块包括红外灯,所述方法包括:
    获取环境光照强度;
    根据所述环境光照强度,确定所述红外灯的N个红外光照强度;
    基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;其中,N为大于或者等于2的整数;
    对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸。
  2. 根据权利要求1所述的方法,其特征在于,若所述环境光照强度小于预设值,则所述N个红外光照强度中的每一个红外光照强度均大于0;若所述环境光照强度大于或者等于所述预设值,则所述N个红外光照强度中的P个红外光照强度均等于0,所述N个红外光照强度中的K个红外光照强度均大于0;其中,P、K为大于或者等于1的整数,P与K的和为N。
  3. 根据权利要求2所述的方法,其特征在于,所述终端设备还包括RGB摄像头,所述红外摄像模块还包括红外摄像头;所述基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像,包括:
    若所述环境光照强度小于所述预设值,则开启所述红外灯,并通过所述红外摄像头分别在所述N个红外光照强度下进行拍摄,采集得到所述N张人脸图像;
    若所述环境光照强度大于或者等于所述预设值,则关闭所述红外灯,并通过所述RGB摄像头分别在所述P个红外光照强度下进行拍摄,采集得到P张人脸图像;以及开启所述红外灯,并通过所述红外摄像头分别在所述K个红外光照强度下进行拍摄,采集得到K张人脸图像。
  4. 根据权利要求1-3任意一项所述的方法,其特征在于,对比所述N张人脸图像中的目标人脸区域,并根据所述N张人脸图像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸,包括:
    确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图;其中,M为大于或者等于1,且小于N的整数;
    将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。
  5. 根据权利要求4所述的方法,其特征在于,所述确定所述N张人脸图像中的每一张 人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图,包括:
    对所述N张人脸图像中的每一张人脸图像进行人脸检测,得到所述每一张人脸图像中的所述目标人脸的检测框坐标;
    根据所述每一张人脸图像中的所述目标人脸的检测框坐标,对所述每一张人脸图像进行人脸裁剪,确定所述每一张人脸图像中的目标人脸区域;
    将第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;
    对所述像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图;i为大于或者等于1,且小于M的整数。
  6. 根据权利要求4-5任意一项所述的方法,其特征在于,所述活体检测模型包括深度恢复网络和分类器;所述将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸,包括:
    将所述M张人脸差异图输入至所述活体检测模型中的所述深度恢复网络,得到所述M张人脸差异图对应的M张目标人脸区域的深度图;
    基于所述M张目标人脸区域的深度图,通过所述分类器判断所述目标人脸是否为活体人脸。
  7. 根据权利要求4-6任意一项所述的方法,其特征在于,所述方法还包括:
    获取正样本集和负样本集,所述正样本集包括多张第一人脸差异图,所述负样本集包括多张第二人脸差异图;所述多张第一人脸差异图中的每一张第一人脸差异图为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;所述多张第二人脸差异图中的每一张第二人脸差异图为分别在所述两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图;所述两个红外光照强度中的至少一个红外光照强度大于0;
    以所述多张第一人脸差异图和所述多张第二人脸差异图作为训练输入,以所述多张第一人脸差异图和所述多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,训练得到所述活体检测模型。
  8. 一种活体检测装置,其特征在于,应用于终端设备,所述终端设备包括红外摄像模块,所述红外摄像模块包括红外灯,所述装置包括:
    第一获取单元,用于获取环境光照强度;
    确定单元,用于根据所述环境光照强度,确定所述红外灯的N个红外光照强度;
    采集单元,用于基于所述N个红外光照强度调节所述红外灯,并分别在所述N个红外光照强度下进行拍摄,采集得到N张人脸图像;所述N张人脸图像中的每一张人脸图像包括目标人脸;其中,N为大于或者等于2的整数;
    活体检测单元,用于对比所述N张人脸图像中的目标人脸区域,根据所述N张人脸图 像中的目标人脸区域的差异判断所述目标人脸是否为活体人脸。
  9. 根据权利要求8所述的装置,其特征在于,若所述环境光照强度小于预设值,则所述N个红外光照强度中的每一个红外光照强度均大于0;若所述环境光照强度大于或者等于所述预设值,则所述N个红外光照强度中的P个红外光照强度均等于0,所述N个红外光照强度中的K个红外光照强度均大于0;其中,P、K为大于或者等于1的整数,P与K的和为N。
  10. 根据权利要求9所述的装置,其特征在于,所述终端设备还包括RGB摄像头,所述红外摄像模块还包括红外摄像头;所述采集单元,具体用于:
    若所述环境光照强度小于所述预设值,则开启所述红外灯,并通过所述红外摄像头分别在所述N个红外光照强度下进行拍摄,采集得到所述N张人脸图像;
    若所述环境光照强度大于或者等于所述预设值,则关闭所述红外灯,并通过所述RGB摄像头分别在所述P个红外光照强度下进行拍摄,采集得到P张人脸图像;以及开启所述红外灯,并通过所述红外摄像头分别在所述K个红外光照强度下进行拍摄,采集得到K张人脸图像。
  11. 根据权利要求8-10任意一项所述的装置,其特征在于,所述活体检测单元,具体用于:
    确定所述N张人脸图像中的每一张人脸图像中的目标人脸区域,并对相邻两张人脸图像中的目标人脸区域进行差异计算,得到M张人脸差异图;其中,M为大于或者等于1,且小于N的整数;
    将所述M张人脸差异图输入至预先训练的活体检测模型,判断所述目标人脸是否为活体人脸。
  12. 根据权利要求11所述的装置,其特征在于,所述活体检测单元,还具体用于:
    对所述N张人脸图像中的每一张人脸图像进行人脸检测,得到所述每一张人脸图像中的所述目标人脸的检测框坐标;
    根据所述每一张人脸图像中的所述目标人脸的检测框坐标,对所述每一张人脸图像进行人脸裁剪,确定所述每一张人脸图像中的目标人脸区域;
    将第i张人脸图像中的目标人脸区域与第i+1张人脸图像中的目标人脸区域的像素相减,得到像素相减后的人脸图像;
    对所述像素相减后的人脸图像进行直方图均衡化,得到第i张人脸图像和第i+1张人脸图像对应的人脸差异图;i为大于或者等于1,且小于M的整数。
  13. 根据权利要求11-12任意一项所述的装置,其特征在于,所述活体检测单元,还具体用于:
    将所述M张人脸差异图输入至所述活体检测模型中的所述深度恢复网络,得到所述M 张人脸差异图对应的M张目标人脸区域的深度图;
    基于所述M张目标人脸区域的深度图,通过所述分类器判断所述目标人脸是否为活体人脸。
  14. 根据权利要求11-13任意一项所述的装置,其特征在于,所述装置还包括:
    第二获取单元,用于获取正样本集和负样本集,所述正样本集包括多张第一人脸差异图,所述负样本集包括多张第二人脸差异图;所述多张第一人脸差异图中的每一张第一人脸差异图为分别在两个红外光照强度下对活体人脸进行拍摄,采集得到的两张活体人脸图像的人脸差异图;所述多张第二人脸差异图中的每一张第二人脸差异图为分别在所述两个红外光照强度下对非活体人脸进行拍摄,采集得到的两张非活体人脸图像的人脸差异图;所述两个红外光照强度中的至少一个红外光照强度大于0;
    训练单元,用于以所述多张第一人脸差异图和所述多张第二人脸差异图作为训练输入,以所述多张第一人脸差异图和所述多张第二人脸差异图各自对应于活体人脸或非活体人脸为标签,训练得到所述活体检测模型。
  15. 一种终端设备,其特征在于,包括处理器和存储器,所述处理器和存储器相连,其中,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码,以执行如权利要求1至7任意一项所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述权利要求1至7任意一项所述的方法。
  17. 一种计算机程序,其特征在于,所述计算机程序包括指令,当所述计算机程序被计算机执行时,使得所述计算机执行如权利要求1至7任意一项所述的方法。
PCT/CN2021/091118 2020-04-30 2021-04-29 一种活体检测方法及相关设备 WO2021219095A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010366189.1A CN113591517A (zh) 2020-04-30 2020-04-30 一种活体检测方法及相关设备
CN202010366189.1 2020-04-30

Publications (1)

Publication Number Publication Date
WO2021219095A1 true WO2021219095A1 (zh) 2021-11-04

Family

ID=78237507

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091118 WO2021219095A1 (zh) 2020-04-30 2021-04-29 一种活体检测方法及相关设备

Country Status (2)

Country Link
CN (1) CN113591517A (zh)
WO (1) WO2021219095A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114202806A (zh) * 2021-11-26 2022-03-18 北京百度网讯科技有限公司 活体检测方法、装置、电子设备和存储介质
CN116110111A (zh) * 2023-03-23 2023-05-12 平安银行股份有限公司 人脸识别方法、电子设备及存储介质
CN116597527A (zh) * 2023-07-18 2023-08-15 第六镜科技(成都)有限公司 活体检测方法、装置、电子设备和计算机可读存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237470A (zh) * 2021-12-21 2022-03-25 游密科技(深圳)有限公司 目标图像的尺寸调整方法、装置、计算机设备和存储介质
CN114596683A (zh) * 2022-02-09 2022-06-07 青岛海信日立空调系统有限公司 入侵检测方法及装置
CN117636484A (zh) * 2022-08-12 2024-03-01 北京字跳网络技术有限公司 活体检测方法、装置、电子设备及存储介质
CN115798002A (zh) * 2022-11-24 2023-03-14 北京的卢铭视科技有限公司 人脸检测方法、系统、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204131599U (zh) * 2014-05-13 2015-01-28 深圳市景阳科技股份有限公司 一种自动监控摄像装置
CN105518711A (zh) * 2015-06-29 2016-04-20 北京旷视科技有限公司 活体检测方法、活体检测系统以及计算机程序产品
CN206948459U (zh) * 2017-07-05 2018-01-30 深圳市联合影像有限公司 一种安防双摄像头模组
CN110933260A (zh) * 2018-09-20 2020-03-27 深圳技威时代科技有限公司 一种光源的选择方法以及三源摄像机

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106778518B (zh) * 2016-11-24 2021-01-08 汉王科技股份有限公司 一种人脸活体检测方法及装置
CN109427124A (zh) * 2017-09-05 2019-03-05 北京中科奥森数据科技有限公司 一种双目摄像头人脸识别门禁设备及其控制方法
CN110321790B (zh) * 2019-05-21 2023-05-12 华为技术有限公司 一种对抗样本的检测方法及电子设备
CN110765923B (zh) * 2019-10-18 2024-05-24 腾讯科技(深圳)有限公司 一种人脸活体检测方法、装置、设备及存储介质
CN111079576B (zh) * 2019-11-30 2023-07-28 腾讯科技(深圳)有限公司 活体检测方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204131599U (zh) * 2014-05-13 2015-01-28 深圳市景阳科技股份有限公司 一种自动监控摄像装置
CN105518711A (zh) * 2015-06-29 2016-04-20 北京旷视科技有限公司 活体检测方法、活体检测系统以及计算机程序产品
CN206948459U (zh) * 2017-07-05 2018-01-30 深圳市联合影像有限公司 一种安防双摄像头模组
CN110933260A (zh) * 2018-09-20 2020-03-27 深圳技威时代科技有限公司 一种光源的选择方法以及三源摄像机

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114202806A (zh) * 2021-11-26 2022-03-18 北京百度网讯科技有限公司 活体检测方法、装置、电子设备和存储介质
CN116110111A (zh) * 2023-03-23 2023-05-12 平安银行股份有限公司 人脸识别方法、电子设备及存储介质
CN116110111B (zh) * 2023-03-23 2023-09-08 平安银行股份有限公司 人脸识别方法、电子设备及存储介质
CN116597527A (zh) * 2023-07-18 2023-08-15 第六镜科技(成都)有限公司 活体检测方法、装置、电子设备和计算机可读存储介质
CN116597527B (zh) * 2023-07-18 2023-09-19 第六镜科技(成都)有限公司 活体检测方法、装置、电子设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN113591517A (zh) 2021-11-02

Similar Documents

Publication Publication Date Title
WO2021219095A1 (zh) 一种活体检测方法及相关设备
WO2021078001A1 (zh) 一种图像增强方法及装置
WO2021008551A1 (zh) 一种指纹防伪方法和电子设备
CN113706414B (zh) 视频优化模型的训练方法和电子设备
CN114140365B (zh) 基于事件帧的特征点匹配方法及电子设备
CN113170037B (zh) 一种拍摄长曝光图像的方法和电子设备
CN113452969B (zh) 图像处理方法和装置
CN113723144A (zh) 一种人脸注视解锁方法及电子设备
WO2022156473A1 (zh) 一种播放视频的方法及电子设备
WO2024016564A9 (zh) 二维码识别方法、电子设备以及存储介质
CN111103922A (zh) 摄像头、电子设备和身份验证方法
CN113705665A (zh) 图像变换网络模型的训练方法和电子设备
CN115272138B (zh) 图像处理方法及其相关设备
CN116311388A (zh) 指纹识别的方法和装置
CN113538227A (zh) 一种基于语义分割的图像处理方法及相关设备
CN115633255B (zh) 视频处理方法和电子设备
CN117499779B (zh) 一种图像预览方法、设备以及存储介质
CN117201930B (zh) 一种拍照方法和电子设备
CN116916151A (zh) 拍摄方法、电子设备和存储介质
CN117148959B (zh) 眼动追踪的帧率调整方法及相关装置
CN115623318B (zh) 对焦方法及相关装置
CN115580690B (zh) 图像处理的方法和电子设备
CN114399622A (zh) 图像处理方法和相关装置
CN115083424A (zh) 人物分析系统、方法及相关装置
CN113891008A (zh) 一种曝光强度调节方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21797715

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21797715

Country of ref document: EP

Kind code of ref document: A1