WO2021169616A1 - Method and apparatus for detecting face of non-living body, and computer device and storage medium - Google Patents

Method and apparatus for detecting face of non-living body, and computer device and storage medium Download PDF

Info

Publication number
WO2021169616A1
WO2021169616A1 PCT/CN2021/070470 CN2021070470W WO2021169616A1 WO 2021169616 A1 WO2021169616 A1 WO 2021169616A1 CN 2021070470 W CN2021070470 W CN 2021070470W WO 2021169616 A1 WO2021169616 A1 WO 2021169616A1
Authority
WO
WIPO (PCT)
Prior art keywords
category
image
detected
face
picture
Prior art date
Application number
PCT/CN2021/070470
Other languages
French (fr)
Chinese (zh)
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 WO2021169616A1 publication Critical patent/WO2021169616A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Definitions

  • This application relates to the technical field of face detection, in particular to a method, device, computer equipment and storage medium for detecting a non-living human face.
  • the user needs to be identified in vivo through the camera of the terminal device. Only when a living user is identified, is it allowed to access certain functions in the application.
  • the embodiments of the present application provide a method, a device, a computer device, and a storage medium for detecting a non-living human face, which can improve the accuracy of living face recognition.
  • a method for detecting a non-living human face includes:
  • the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category.
  • the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  • a device for detecting a non-living human face comprising:
  • the video acquisition module is used to acquire a video image, and extract multiple pictures to be detected from the video image;
  • the input module is configured to input the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
  • the first judgment module is used to sequentially judge whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes a category Environmental components of the preset abnormal category;
  • the second determining module is configured to determine the person in the image to be detected if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range
  • the face is a non-living human face.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the program:
  • the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category.
  • the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  • one or more readable storage media storing computer-readable instructions
  • the computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are controlled by one or When multiple processors are executed, the one or more processors are caused to execute the following steps:
  • the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category.
  • the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  • the method, device, computer equipment, and storage medium for detecting non-living human faces add an abnormal environmental element detection technology, and let the target image detection model learn the abnormal environmental elements in advance, so that the person to be detected can be identified
  • the standard picture detection model can first identify whether there are abnormal environmental elements in the picture or video to be detected, and then determine the positional relationship between the environmental elements and the face area to determine the to-be-detected Whether the face in the picture is a non-living face, which improves the accuracy of live face recognition.
  • FIG. 1 is a schematic diagram of an application environment of a method for detecting a non-living human face in an embodiment of this application;
  • Fig. 2 is a flowchart of a method for detecting a non-living human face according to an embodiment of the present application
  • FIG. 3 is a flowchart of judging whether the target image includes environmental elements whose category is a preset abnormal category
  • Figure 4 is a flowchart of training the target picture detection model
  • Fig. 5 is a flowchart of a method for detecting a non-living human face according to another embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application environment of a method for detecting a non-living human face in an embodiment of this application.
  • the method for detecting a non-living human face provided by this application can be applied in the application environment of FIG. 1 .
  • non-living human face detection equipment includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, etc., and the computer equipment is equipped with a camera for acquiring video images.
  • the video image is a video image collected by a camera of the terminal device.
  • the method for detecting a non-living human face further includes the following steps:
  • Output a prompt message that allows the user to perform preset facial actions on the camera
  • the preset facial actions include, but are not limited to, blinking, raising the head, opening the mouth, and so on.
  • the target picture detection model may be an SSD (Single Shot MultiBox Detector) model.
  • the picture to be detected includes not only pictures of non-living human faces, but also pictures of non-living human faces, as well as ordinary environmental elements, including but not limited to monitors, televisions, projector screens, computers, etc. .
  • the facial feature image corresponding to blinking is an image of a human eye area
  • the facial feature image corresponding to an open mouth is an image of a person's mouth area
  • the facial feature image corresponding to a head-up is an image of a person's chin area.
  • S103 Determine in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes an abnormality whose category is a preset Category of environmental components.
  • the abnormal environmental components include, but are not limited to, the frame of the display, the frame of the tablet/computer, the TV, and the projection screen.
  • the abnormal environmental element is the original environmental element that can be detected by the target image detection model, which can be specifically the border of the display or TV, the border of the projection screen, the border of the projection area projected on the wall, etc. .
  • Fig. 3 is a flowchart of determining whether the target image includes environmental elements whose category is a preset abnormal category. As shown in Fig. 3, the determination of whether the target image corresponding to the picture to be detected includes a predetermined category of environmental elements The steps of the environmental element of the abnormal category include the following steps S301 and S302.
  • S301 Acquire the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of a preset abnormal environmental element;
  • the face area is within the area range of the abnormal environmental element, that is, the area of the abnormal environmental element completely includes the human face.
  • the area or part includes the face area.
  • step S104 if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range, then it is determined that the The steps for the face in the picture to be detected as a non-living face include:
  • the target image includes facial feature images such as eyes, mouth, etc., before the step of determining that the face in the image to be detected is a non-living face, and after the step S102, the method further includes :
  • Fig. 4 is a flowchart of training the target picture detection model.
  • the steps of training the target picture detection model include the following steps S401 to S404.
  • S401 Receive multiple sample pictures.
  • the sample pictures include, but are not limited to, pictures actually taken by photographers, pictures downloaded from the Internet, and images extracted from video picture frames.
  • the sample picture may be a picture containing a human face area, a picture containing a display frame, a projection screen, and other sample pictures that need to be learned by a target picture detection model.
  • S402 Mark the image area in the sample picture and the category to which the image area belongs according to the received instruction.
  • the marked image area in the sample picture includes the face area, the area of the normal environmental original, and the area of the abnormal environmental original.
  • the area of the original abnormal environment includes, but is not limited to, monitors, tablets/computers, televisions, projection screens, etc.
  • the category to which the face area belongs is a face
  • the category of the original anomalous environment includes a display, a tablet/computer, a TV, and a projection screen.
  • S404 Learning the image area and the category to which the image area belongs through the target picture detection model, to obtain the trained target picture detection model.
  • Fig. 5 is a flowchart of a method for detecting a non-living human face according to another embodiment of the present application.
  • the method for detecting a non-living human face according to another embodiment of the present application will be described in detail below in conjunction with Fig. 5, as shown in Fig. 5
  • the method further includes:
  • S501 Output a prompt message that allows the user to move from far to near or from near to far or approach a camera, where the camera is a camera that collects the video image;
  • S502 Output a prompt message that allows the user to perform a preset facial motion on the camera.
  • step S101 is further the following step S503:
  • S503 Acquire a video image in which the face area of the user changes from large to small or from small to large and contains preset facial actions, and extracts multiple pictures to be detected from the video images.
  • the method for detecting a non-living human face allows the target picture detection model to learn human faces and abnormal environmental elements, so that when identifying whether the face to be detected is a non-living human face, the target image is first passed through.
  • the detection model recognizes whether the picture or video to be detected includes a human face, then distinguishes whether there are abnormal environmental elements in the picture or video to be detected, and then judges the picture to be detected by judging the positional relationship between the environmental element and the face area Whether the face in is a non-living face, which improves the accuracy of live face recognition.
  • the numbers of the above steps S101 to S503 are not used to limit the sequence of the steps in this embodiment, and the numbers of the steps are just to make it easy to refer to the numbers of the steps when describing each step. It means that, for example, the above-mentioned step S501 may be before the step of S502 or after the step of step S502, as long as the order of execution of each step does not affect the logical relationship of this embodiment.
  • Fig. 6 is an exemplary structural block diagram of a non-living face detection device according to an embodiment of the present application. The following describes in detail the non-living face detection device according to an embodiment of the present application in conjunction with Fig. 6, as shown in Fig. 6 As shown, the device 100 for detecting a non-living human face includes a video acquisition module 11, an input module 12, a first judgment module 13 and a second judgment module 14.
  • the video acquisition module 11 is used to acquire a video image, and extract multiple pictures to be detected from the video image.
  • the video image is a video image collected by a camera of the terminal device.
  • the input module 12 is configured to input the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs.
  • the target picture detection model may be an SSD (Single Shot MultiBox Detector) model.
  • the picture to be detected includes not only pictures of non-living human faces, but also pictures of non-living human faces, as well as ordinary environmental elements, including but not limited to monitors, televisions, projector screens, computers, etc. .
  • the facial feature image corresponding to blinking is an image of a human eye area
  • the facial feature image corresponding to an open mouth is an image of a person's mouth area
  • the facial feature image corresponding to a head-up is an image of a person's chin area.
  • the first judgment module 13 is used to sequentially judge whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes a target image
  • the category is an environmental component of a preset abnormal category.
  • the abnormal environmental components include, but are not limited to, the frame of the display, the frame of the tablet/computer, the TV, and the projection screen.
  • the abnormal environmental element is the original environmental element that can be detected by the target image detection model, which can be specifically the border of the display or TV, the border of the projection screen, the border of the projection area projected on the wall, etc. .
  • the second judging module 14 is used for judging whether the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range
  • the human face is a non-living human face.
  • the face area is within the area range of the abnormal environmental element, that is, the area of the abnormal environmental element completely includes the human face.
  • the area or part includes the face area.
  • the first judgment module 13 further includes:
  • the category acquisition unit is configured to acquire the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
  • the first judging unit is configured to judge whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, judging that the target image includes an abnormal environmental element.
  • the second judgment module is specifically used for:
  • the target image includes facial feature images such as eyes and mouth.
  • the device 100 for detecting a non-living human face further includes:
  • the picture receiving module is used to receive multiple sample pictures.
  • the sample pictures include, but are not limited to, pictures actually taken by photographers, pictures downloaded from the Internet, and images extracted from video picture frames.
  • the sample picture may be a picture containing a human face area, a picture containing a display frame, a projection screen, and various sample pictures that need to be learned by a target picture detection model;
  • the labeling module is configured to label the image area in the sample picture and the category to which the image area belongs according to the received instruction.
  • the marked image area in the sample picture includes the face area, the area of the normal environmental original, and the area of the abnormal environmental original.
  • the area of the original abnormal environment includes, but is not limited to, monitors, tablets/computers, televisions, projection screens, etc.
  • the category to which the face area belongs is a face
  • the category of the original anomalous environment includes a display, a tablet/computer, a TV, and a projection screen;
  • the learning module is used to learn the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
  • the device 100 for detecting a non-living human face further includes:
  • the first output module is configured to output a prompt message that allows the user to move from far to near or from near to far or approach a camera, where the camera is a camera that collects the video image;
  • the second output module is used to output a prompt message that allows the user to perform a preset facial motion on the camera;
  • the video acquisition module 11 is specifically configured to acquire a video image that includes a user's face area from large to small or from small to large and contains preset facial actions.
  • the preset facial actions include, but are not limited to, blinking, raising the head, opening the mouth, and so on.
  • first and second judgment module and second judgment module are only to distinguish two different modules, and is not used to limit the priority of the determining module of which preselected area Higher or other restrictive meaning.
  • the terms “including” and “having” and any variations of them are intended to cover non-exclusive inclusions.
  • a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to what is clearly listed. Those steps or modules may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products, or equipment.
  • the division of modules in this application is only a logical division , There can be other division methods when realizing in practical applications.
  • each module included in the device for detecting a non-living human face can be implemented in whole or in part by software, hardware, or a combination thereof. Further, each module in the device for detecting a non-living human face may be a program segment for realizing corresponding functions.
  • the device for detecting a non-living human face allows the target picture detection model to learn human faces and abnormal environmental elements, so that when identifying whether the face to be detected is a non-living human face, the target picture is first passed through.
  • the detection model recognizes whether the picture or video to be detected includes a human face, then distinguishes whether there are abnormal environmental elements in the picture or video to be detected, and then judges the picture to be detected by judging the positional relationship between the environmental element and the face area Whether the face in is a non-living face, which improves the accuracy of live face recognition.
  • the foregoing apparatus for detecting a non-living human face may be implemented in a form of computer-readable instructions, and the computer-readable instructions may run on the computer device as shown in FIG. 7.
  • each module in the above-mentioned non-living human face detection device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 7.
  • the computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium stores an operating system and computer readable instructions.
  • the internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium.
  • the network interface of the computer device is used to communicate with the controlled device through a network connection. When the computer-readable instructions are executed by the processor, a device for detecting a non-living human face is realized.
  • the readable storage medium may be a non-volatile readable storage medium or a volatile readable storage medium.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor.
  • the steps of the method for detecting a living human face are, for example, step 101 to step 104 shown in FIG. 2.
  • the processor executes the computer-readable instructions, the functions of the modules/units of the non-living human face detection apparatus in the above-mentioned embodiment are implemented, for example, the functions of the modules 11 to 14 shown in FIG. 6. To avoid repetition, I won’t repeat them here.
  • the processor may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
  • the processor is the control center of the computer device, and various interfaces and lines are used to connect various parts of the entire computer device.
  • the memory may be used to store the computer-readable instructions and/or modules, and the processor may run or execute the computer-readable instructions and/or modules stored in the memory, and call data stored in the memory, Realize various functions of the computer device.
  • the memory may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store Data created based on the use of mobile phones (such as audio data, video data, etc.), etc.
  • the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, memory, plug-in hard disks, smart media cards (SMC), and secure digital (SD) cards.
  • non-volatile memory such as hard disks, memory, plug-in hard disks, smart media cards (SMC), and secure digital (SD) cards.
  • Flash Card at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • the memory may be integrated in the processor, or may be provided separately from the processor.
  • one or more readable storage media storing computer readable instructions are provided.
  • the computer readable storage medium stores computer readable instructions, wherein the computer readable instructions are stored by one or more
  • the one or more processors are caused to execute the steps of the method for detecting non-living human faces in the foregoing embodiment, for example, step 101 to step 104 shown in FIG. 2.
  • the functions of the modules/units of the non-living human face detection apparatus in the foregoing embodiments are realized, for example, the functions of the modules 11 to 14 shown in FIG. 6. To avoid repetition, I won’t repeat them here.
  • the method, device, computer equipment, and storage medium for detecting non-living human faces add an abnormal environmental element detection technology, and let the target image detection model learn abnormal environmental elements in advance, so that the object to be detected is recognized
  • the standard picture detection model can first identify whether there are abnormal environmental elements in the picture or video to be detected, and then determine the positional relationship between the environmental elements and the face area. It detects whether the face in the picture is a non-living face, which improves the accuracy of live face recognition.

Abstract

The present application provides a method and apparatus for detecting the face of a non-living body, and a computer device and a storage medium, which belong to the field of facial detection technology. The present application is used for improving the accuracy of recognizing the face of a living body. The method for detecting the face of a non-living body comprises: acquiring a video image, and extracting, from the video image, a plurality of pictures to be detected; inputting said pictures into a pre-trained target picture detection model, to obtain a target image included in each of said pictures and a category to which the target image belongs; sequentially determining whether the target image of each of said pictures comprises a target image the category of which is a facial region, if so, further determining whether the target image of the corresponding picture comprises an environmental element the category of which is a preset abnormal category; and if the relative position relationship between the facial region of at least one of said pictures and the abnormal environment element is within a preset range, determining that the face in said picture is the face of a non-living body.

Description

非活体人脸的检测方法、装置、计算机设备及存储介质Method, device, computer equipment and storage medium for detecting non-living human face
本申请要求于2020年02月27日提交中国专利局、申请号为202010122186.3,发明名称为“非活体人脸的检测方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on February 27, 2020, the application number is 202010122186.3, and the invention title is "Methods, devices, computer equipment and storage media for detecting non-living human faces", all of which The content is incorporated in this application by reference.
技术领域Technical field
本申请涉及人脸检测技术领域,特别是涉及一种非活体人脸的检测方法、装置、计算机设备及存储介质。This application relates to the technical field of face detection, in particular to a method, device, computer equipment and storage medium for detecting a non-living human face.
背景技术Background technique
基于对用户的隐私或财产等方面的保护,在有些场景中需要通过终端设备的摄像头对用户进行活体识别,只有在识别到活体用户时,才允许访问应用程序中的某些功能。Based on the protection of the user's privacy or property, in some scenarios, the user needs to be identified in vivo through the camera of the terminal device. Only when a living user is identified, is it allowed to access certain functions in the application.
现有的基于人脸动态关键点的活体检测方案一般是在识别活体的时候,让用户眨眼、张嘴或抬头等操作,但是现有的活体识别技术存在被伪造动画攻破的风险,如果伪造的人脸动画很逼真那么可以通过现有的活体目标检测。Existing live detection solutions based on dynamic key points of human faces generally allow users to blink, open their mouths, or raise their heads when recognizing a living body. However, the existing living body recognition technology has the risk of being compromised by fake animations. Face animation is very realistic and can be detected by existing living targets.
由于动画制作技术的快速发展使得现有的活体识别技术存在被伪造动画攻破的风险,现有的活体识别技术亟待改进。Due to the rapid development of animation production technology, the existing living body recognition technology is at risk of being compromised by fake animations, and the existing living body recognition technology needs to be improved urgently.
发明内容Summary of the invention
本申请实施例提供一种非活体人脸的检测方法、装置、计算机设备及存储介质,可以提高活体人脸识别的准确性。The embodiments of the present application provide a method, a device, a computer device, and a storage medium for detecting a non-living human face, which can improve the accuracy of living face recognition.
根据本申请的一个方面提供的一种非活体人脸的检测方法,所述方法包括:According to an aspect of the present application, a method for detecting a non-living human face is provided, and the method includes:
获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;It is determined in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
根据本申请的另一个方面提供的一种非活体人脸的检测装置,所述装置包括:According to another aspect of the present application, a device for detecting a non-living human face is provided, the device comprising:
视频获取模块,用于获取视频图像,从所述视频图像中提取多张待检测图片;The video acquisition module is used to acquire a video image, and extract multiple pictures to be detected from the video image;
输入模块,用于将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;The input module is configured to input the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
第一判断模块,用于依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;The first judgment module is used to sequentially judge whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes a category Environmental components of the preset abnormal category;
第二判断模块,用于若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。The second determining module is configured to determine the person in the image to be detected if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range The face is a non-living human face.
根据本申请的又一个方面提供的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述程序时实现如下步骤:A computer device provided according to another aspect of the present application includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the program:
获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类 别的环境元件;It is determined in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
根据本申请的还一个方面提供的一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:According to another aspect of the present application, one or more readable storage media storing computer-readable instructions are provided, and the computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are controlled by one or When multiple processors are executed, the one or more processors are caused to execute the following steps:
获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;It is determined in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
本申请提供的非活体人脸的检测方法、装置、计算机设备及存储介质通过增加了异常环境元件检测技术,并预先让目标图片检测模型对异常的环境元件进行学习,使得在识别待检测的人脸是否为非活体人脸时,通过该标图片检测模型可以通过先识别出待检测的图片或视频中是否有异常的环境元件,再通过判断环境元件与人脸区域的位置关系判断该待检测图片中的人脸是否为非活体人脸,提高了活体人脸识别的准确性。The method, device, computer equipment, and storage medium for detecting non-living human faces provided in this application add an abnormal environmental element detection technology, and let the target image detection model learn the abnormal environmental elements in advance, so that the person to be detected can be identified When the face is a non-living human face, the standard picture detection model can first identify whether there are abnormal environmental elements in the picture or video to be detected, and then determine the positional relationship between the environmental elements and the face area to determine the to-be-detected Whether the face in the picture is a non-living face, which improves the accuracy of live face recognition.
附图说明Description of the drawings
图1为本申请一实施例中非活体人脸的检测方法的一应用环境示意图;FIG. 1 is a schematic diagram of an application environment of a method for detecting a non-living human face in an embodiment of this application;
图2为根据本申请的一个实施例的非活体人脸的检测方法的流程图;Fig. 2 is a flowchart of a method for detecting a non-living human face according to an embodiment of the present application;
图3为判断目标图像中是否包括有所属类别为预设的异常类别的环境元件的流程图;FIG. 3 is a flowchart of judging whether the target image includes environmental elements whose category is a preset abnormal category;
图4为训练该目标图片检测模型的流程图;Figure 4 is a flowchart of training the target picture detection model;
图5为根据本申请的另一实施例的非活体人脸的检测方法的流程图;Fig. 5 is a flowchart of a method for detecting a non-living human face according to another embodiment of the present application;
图6为根据本申请的一个实施例的非活体人脸的检测装置的示范性结构框图;Fig. 6 is an exemplary structural block diagram of a non-living human face detection device according to an embodiment of the present application;
图7为根据本申请的一个实施例的计算机设备的内部结构示意图。Fig. 7 is a schematic diagram of the internal structure of a computer device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
图1为本申请一实施例中非活体人脸的检测方法的一应用环境示意图,如图1所示,本申请提供的非活体人脸的检测方法,可应用在如图1的应用环境中。其中,非活体人脸的检测设备包括但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑等,该计算机设备设有摄像头用于获取视频图像。FIG. 1 is a schematic diagram of an application environment of a method for detecting a non-living human face in an embodiment of this application. As shown in FIG. 1, the method for detecting a non-living human face provided by this application can be applied in the application environment of FIG. 1 . Among them, non-living human face detection equipment includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, etc., and the computer equipment is equipped with a camera for acquiring video images.
图2为根据本申请的一个实施例的非活体人脸的检测方法的流程图,下面结合图2详细描述根据本申请的一个实施例的非活体人脸的检测方法,如图2所示,该方法包括以下步骤S101至S104。Fig. 2 is a flowchart of a method for detecting a non-living human face according to an embodiment of the present application. The method for detecting a non-living human face according to an embodiment of the present application will be described in detail below with reference to Fig. 2, as shown in Fig. 2, The method includes the following steps S101 to S104.
S101、获取视频图像,从所述视频图像中提取多张待检测图片。S101. Obtain a video image, and extract multiple pictures to be detected from the video image.
在其中的一个实施例中,该视频图像为终端设备的摄像头采集到的视频图像。In one of the embodiments, the video image is a video image collected by a camera of the terminal device.
在其中一个实施例中,在所述步骤S101的步骤之前,所述非活体人脸的检测方法还包括以下步骤:In one of the embodiments, before the step of step S101, the method for detecting a non-living human face further includes the following steps:
输出让用户对着摄像头做预设面部动作的提示消息;Output a prompt message that allows the user to perform preset facial actions on the camera;
获取包括有所述预设面部动作的视频图像。Obtain a video image including the preset facial motion.
在该实施例中,该预设面部动作包括但不限于眨眼、抬头、张嘴等等。In this embodiment, the preset facial actions include, but are not limited to, blinking, raising the head, opening the mouth, and so on.
S102、将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别。S102. Input the pictures to be detected into a pre-trained target picture detection model to obtain target images included in each picture to be detected and a category to which the target images belong.
其中,该目标图片检测模型可以是SSD(Single Shot MultiBox Detector,单镜头多盒检测器)模型。该待检测的图片既包括非非活体人脸的图片,也包括非活体人脸的图片,还包括普通的环境元件,该环境元件包括但不限于显示器、电视机、投影仪幕布、电脑等等。Wherein, the target picture detection model may be an SSD (Single Shot MultiBox Detector) model. The picture to be detected includes not only pictures of non-living human faces, but also pictures of non-living human faces, as well as ordinary environmental elements, including but not limited to monitors, televisions, projector screens, computers, etc. .
在其中的一个实施例中,与眨眼对应的面部特征图像为人眼区域的图像,与张嘴对应的面部特征图像为人的嘴巴区域的图像,与抬头对应的面部特征图像为人的下巴区域的头像。In one of the embodiments, the facial feature image corresponding to blinking is an image of a human eye area, the facial feature image corresponding to an open mouth is an image of a person's mouth area, and the facial feature image corresponding to a head-up is an image of a person's chin area.
S103、依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件。S103. Determine in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes an abnormality whose category is a preset Category of environmental components.
在该实施中,哪些环境元件为异常的环境元件可以人为设定。该异常的环境元件包括但不限于显示器的边框、平板电脑/电脑的边框、电视、投影幕布等。In this implementation, which environmental elements are abnormal environmental elements can be manually set. The abnormal environmental components include, but are not limited to, the frame of the display, the frame of the tablet/computer, the TV, and the projection screen.
在其中的一个实施例中,该异常的环境元件为目标图片检测模型能够检测出来的环境原件,具体可以是显示器或电视机的边框、投影幕布的边界、投影在墙上的投影区域的边界等。In one of the embodiments, the abnormal environmental element is the original environmental element that can be detected by the target image detection model, which can be specifically the border of the display or TV, the border of the projection screen, the border of the projection area projected on the wall, etc. .
图3为判断目标图像中是否包括有所属类别为预设的异常类别的环境元件的流程图,如图3所示,该判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件的步骤包括以下步骤S301和S302。Fig. 3 is a flowchart of determining whether the target image includes environmental elements whose category is a preset abnormal category. As shown in Fig. 3, the determination of whether the target image corresponding to the picture to be detected includes a predetermined category of environmental elements The steps of the environmental element of the abnormal category include the following steps S301 and S302.
S301、获取从每张所述待检测图片中得到的每个目标图像所属的类别及预设的异常环境元件的类别;S301: Acquire the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of a preset abnormal environmental element;
S302、判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。S302. Determine whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, determine that the target image includes an abnormal environmental element.
S104、若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。S104. If the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range, determine that the face in the image to be detected is a non-living person Face.
在其中一个实施例中,该相对位置关系在预设的范围之内的情况例如该人脸区域在该异常的环境元件的区域范围之内,即该异常的环境元件的区域完全包括了人脸区域或部分包括了人脸区域。In one of the embodiments, when the relative position relationship is within a preset range, for example, the face area is within the area range of the abnormal environmental element, that is, the area of the abnormal environmental element completely includes the human face. The area or part includes the face area.
在其中一个实施例中,该步骤S104中所述若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸的步骤包括:In one of the embodiments, in step S104, if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range, then it is determined that the The steps for the face in the picture to be detected as a non-living face include:
判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
在其中一个实施例中,所述目标图像包括眼睛、嘴巴等面部特征图像,在判断所述待检测图片中的人脸为非活体人脸的步骤之前,所述步骤S102之后,该方法还包括:In one of the embodiments, the target image includes facial feature images such as eyes, mouth, etc., before the step of determining that the face in the image to be detected is a non-living face, and after the step S102, the method further includes :
识别不同的待检测图片中与所述面部动作对应的同一面部特征图像;Identifying the same facial feature image corresponding to the facial action in different pictures to be detected;
判断所述面部特征图像在不同的待检测图片中是否做了对应的变化,若否,则跳转至上述步骤S103。It is determined whether the facial feature image has been changed correspondingly in different pictures to be detected, and if not, skip to the above step S103.
图4为训练该目标图片检测模型的流程图,根据本申请的一个实施例如图4所示,训练所述目标图片检测模型的步骤包括以下步骤S401至S404。Fig. 4 is a flowchart of training the target picture detection model. According to an embodiment of the present application, as shown in Fig. 4, the steps of training the target picture detection model include the following steps S401 to S404.
S401、接收多张样本图片。S401. Receive multiple sample pictures.
在其中一个实施例中,该样本图片包括但不限于摄影师实际拍摄到的图片、从网上下载的图片、根据视频图片帧提取出的图像。In one of the embodiments, the sample pictures include, but are not limited to, pictures actually taken by photographers, pictures downloaded from the Internet, and images extracted from video picture frames.
在该实施例中,该样本图片可以是包含有人脸区域的图片,包含有显示器边框的图片、包含有投影幕布等各种需要目标图片检测模型学习的样本图片。In this embodiment, the sample picture may be a picture containing a human face area, a picture containing a display frame, a projection screen, and other sample pictures that need to be learned by a target picture detection model.
S402、根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标 注。S402: Mark the image area in the sample picture and the category to which the image area belongs according to the received instruction.
在该实施例中,标注的所述样本图片中的图像区域包括人脸区域、普通环境原件的区域及异常环境原件的区域。其中,该异常环境原件的区域包括但不限于显示器、平板电脑/电脑、电视、投影幕布等。In this embodiment, the marked image area in the sample picture includes the face area, the area of the normal environmental original, and the area of the abnormal environmental original. Among them, the area of the original abnormal environment includes, but is not limited to, monitors, tablets/computers, televisions, projection screens, etc.
进一步地,该人脸区域所属的类别为人脸、该异常环境原件的类别包括显示器的、平板电脑/电脑的、电视、投影幕布。Further, the category to which the face area belongs is a face, and the category of the original anomalous environment includes a display, a tablet/computer, a TV, and a projection screen.
S403、将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中。S403. Input the marked image area and the category to which the image area belongs into the target picture detection model.
S404、通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。S404: Learning the image area and the category to which the image area belongs through the target picture detection model, to obtain the trained target picture detection model.
图5为根据本申请的另一实施例的非活体人脸的检测方法的流程图,下面结合图5详细描述根据本申请的另一实施例的非活体人脸的检测方法,如图5所示,在上述步骤S101中获取视频图像的步骤之前,所述方法还包括:Fig. 5 is a flowchart of a method for detecting a non-living human face according to another embodiment of the present application. The method for detecting a non-living human face according to another embodiment of the present application will be described in detail below in conjunction with Fig. 5, as shown in Fig. 5 As shown, before the step of obtaining a video image in step S101, the method further includes:
S501、输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;S501: Output a prompt message that allows the user to move from far to near or from near to far or approach a camera, where the camera is a camera that collects the video image;
S502、输出让用户对着摄像头做预设面部动作的提示消息。S502: Output a prompt message that allows the user to perform a preset facial motion on the camera.
上述步骤S101进一步为以下步骤S503:The above step S101 is further the following step S503:
S503、获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像,从所述视频图像中提取多张待检测图片。S503: Acquire a video image in which the face area of the user changes from large to small or from small to large and contains preset facial actions, and extracts multiple pictures to be detected from the video images.
本实施例提供的非活体人脸的检测方法通过让目标图片检测模型对人脸以及异常的环境元件进行学习,使得在识别待检测的人脸是否为非活体人脸时,首先通过该标图片检测模型识别出该待检测图片或视频中是否包括有人脸,再别出待检测的图片或视频中是否有异常的环境元件,再通过判断环境元件与人脸区域的位置关系判断该待检测图片中的人脸是否为非活体人脸,提高了活体人脸识别的准确性。The method for detecting a non-living human face provided in this embodiment allows the target picture detection model to learn human faces and abnormal environmental elements, so that when identifying whether the face to be detected is a non-living human face, the target image is first passed through. The detection model recognizes whether the picture or video to be detected includes a human face, then distinguishes whether there are abnormal environmental elements in the picture or video to be detected, and then judges the picture to be detected by judging the positional relationship between the environmental element and the face area Whether the face in is a non-living face, which improves the accuracy of live face recognition.
根据本实施例的一个示例,上述步骤S101~S503的标号并不用于限定本实施例中各个步骤的先后顺序,各个步骤的编号只是为了使得描述各个步骤时可以通用引用该步骤的标号进行便捷的指代,例如上述步骤S501可以在S502的步骤之前,也可以在步骤S502的步骤之后,只要各个步骤执行的顺序不影响本实施例的逻辑关系即可。According to an example of this embodiment, the numbers of the above steps S101 to S503 are not used to limit the sequence of the steps in this embodiment, and the numbers of the steps are just to make it easy to refer to the numbers of the steps when describing each step. It means that, for example, the above-mentioned step S501 may be before the step of S502 or after the step of step S502, as long as the order of execution of each step does not affect the logical relationship of this embodiment.
图6为根据本申请的一个实施例的非活体人脸的检测装置的示范性结构框图,下面结合图6详细描述根据本申请的一个实施例的非活体人脸的检测装置,如图6所示,该非活体人脸的检测装置100包括视频获取模块11、输入模块12、第一判断模块13和第二判断模块14。Fig. 6 is an exemplary structural block diagram of a non-living face detection device according to an embodiment of the present application. The following describes in detail the non-living face detection device according to an embodiment of the present application in conjunction with Fig. 6, as shown in Fig. 6 As shown, the device 100 for detecting a non-living human face includes a video acquisition module 11, an input module 12, a first judgment module 13 and a second judgment module 14.
视频获取模块11,用于获取视频图像,从所述视频图像中提取多张待检测图片。The video acquisition module 11 is used to acquire a video image, and extract multiple pictures to be detected from the video image.
在其中的一个实施例中,该视频图像为终端设备的摄像头采集到的视频图像。In one of the embodiments, the video image is a video image collected by a camera of the terminal device.
输入模块12,用于将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别。The input module 12 is configured to input the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs.
其中,该目标图片检测模型可以是SSD(Single Shot MultiBox Detector,单镜头多盒检测器)模型。该待检测的图片既包括非非活体人脸的图片,也包括非活体人脸的图片,还包括普通的环境元件,该环境元件包括但不限于显示器、电视机、投影仪幕布、电脑等等。Wherein, the target picture detection model may be an SSD (Single Shot MultiBox Detector) model. The picture to be detected includes not only pictures of non-living human faces, but also pictures of non-living human faces, as well as ordinary environmental elements, including but not limited to monitors, televisions, projector screens, computers, etc. .
在其中的一个实施例中,与眨眼对应的面部特征图像为人眼区域的图像,与张嘴对应的面部特征图像为人的嘴巴区域的图像,与抬头对应的面部特征图像为人的下巴区域的头像。In one of the embodiments, the facial feature image corresponding to blinking is an image of a human eye area, the facial feature image corresponding to an open mouth is an image of a person's mouth area, and the facial feature image corresponding to a head-up is an image of a person's chin area.
第一判断模块13,用于依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件。The first judgment module 13 is used to sequentially judge whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes a target image The category is an environmental component of a preset abnormal category.
在该实施中,哪些环境元件为异常的环境元件可以人为设定。该异常的环境元件包括但不限于显示器的边框、平板电脑/电脑的边框、电视、投影幕布等。In this implementation, which environmental elements are abnormal environmental elements can be manually set. The abnormal environmental components include, but are not limited to, the frame of the display, the frame of the tablet/computer, the TV, and the projection screen.
在其中的一个实施例中,该异常的环境元件为目标图片检测模型能够检测出来的环境原 件,具体可以是显示器或电视机的边框、投影幕布的边界、投影在墙上的投影区域的边界等。In one of the embodiments, the abnormal environmental element is the original environmental element that can be detected by the target image detection model, which can be specifically the border of the display or TV, the border of the projection screen, the border of the projection area projected on the wall, etc. .
第二判断模块14,用于若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。The second judging module 14 is used for judging whether the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range The human face is a non-living human face.
在其中一个实施例中,该相对位置关系在预设的范围之内的情况例如该人脸区域在该异常的环境元件的区域范围之内,即该异常的环境元件的区域完全包括了人脸区域或部分包括了人脸区域。In one of the embodiments, when the relative position relationship is within a preset range, for example, the face area is within the area range of the abnormal environmental element, that is, the area of the abnormal environmental element completely includes the human face. The area or part includes the face area.
在其中一个实施例中,该第一判断模块13还包括:In one of the embodiments, the first judgment module 13 further includes:
类别获取单元,用于获取从每张所述待检测图片中得到的每个目标图像所属的类别及预设的异常环境元件的类别;The category acquisition unit is configured to acquire the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
第一判断单元,用于判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。The first judging unit is configured to judge whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, judging that the target image includes an abnormal environmental element.
在其中一个实施例中,该第二判断模块具体用于:In one of the embodiments, the second judgment module is specifically used for:
判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
在其中一个实施例中,所述目标图像包括眼睛、嘴巴等面部特征图像。In one of the embodiments, the target image includes facial feature images such as eyes and mouth.
在其中一个实施例中,该非活体人脸的检测装置100还包括:In one of the embodiments, the device 100 for detecting a non-living human face further includes:
图片接收模块,用于接收多张样本图片。作为可选地,该样本图片包括但不限于摄影师实际拍摄到的图片、从网上下载的图片、根据视频图片帧提取出的图像。在该实施例中,该样本图片可以是包含有人脸区域的图片,包含有显示器边框的图片、包含有投影幕布等各种需要目标图片检测模型学习的样本图片;The picture receiving module is used to receive multiple sample pictures. Optionally, the sample pictures include, but are not limited to, pictures actually taken by photographers, pictures downloaded from the Internet, and images extracted from video picture frames. In this embodiment, the sample picture may be a picture containing a human face area, a picture containing a display frame, a projection screen, and various sample pictures that need to be learned by a target picture detection model;
标注模块,用于根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标注。在该实施例中,标注的所述样本图片中的图像区域包括人脸区域、普通环境原件的区域及异常环境原件的区域。其中,该异常环境原件的区域包括但不限于显示器、平板电脑/电脑、电视、投影幕布等。进一步地,该人脸区域所属的类别为人脸、该异常环境原件的类别包括显示器的、平板电脑/电脑的、电视、投影幕布;The labeling module is configured to label the image area in the sample picture and the category to which the image area belongs according to the received instruction. In this embodiment, the marked image area in the sample picture includes the face area, the area of the normal environmental original, and the area of the abnormal environmental original. Among them, the area of the original abnormal environment includes, but is not limited to, monitors, tablets/computers, televisions, projection screens, etc. Further, the category to which the face area belongs is a face, and the category of the original anomalous environment includes a display, a tablet/computer, a TV, and a projection screen;
所述输入模块还用于将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中;The input module is also used to input the marked image area and the category to which the image area belongs into the target picture detection model;
学习模块,用于通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。The learning module is used to learn the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
在其中的一个实施例中,该非活体人脸的检测装置100还包括:In one of the embodiments, the device 100 for detecting a non-living human face further includes:
第一输出模块,用于输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;The first output module is configured to output a prompt message that allows the user to move from far to near or from near to far or approach a camera, where the camera is a camera that collects the video image;
第二输出模块,用于输出让用户对着摄像头做预设面部动作的提示消息;The second output module is used to output a prompt message that allows the user to perform a preset facial motion on the camera;
该视频获取模块11具体用于获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像。The video acquisition module 11 is specifically configured to acquire a video image that includes a user's face area from large to small or from small to large and contains preset facial actions.
在该实施例中,该预设面部动作包括但不限于眨眼、抬头、张嘴等等。In this embodiment, the preset facial actions include, but are not limited to, blinking, raising the head, opening the mouth, and so on.
其中上述第一判断模块及第二判断模块等模块中的“第一”和“第二”的意义仅在于将两个不同的模块加以区分,并不用于限定哪个预选区域的确定模块的优先级更高或者其它的限定意义。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块,本申请中所出现的模块的划分,仅仅是一种逻辑上的划分,实际应用中实现时可以有另外的划分方式。Among them, the meaning of "first" and "second" in the above-mentioned first judgment module and second judgment module is only to distinguish two different modules, and is not used to limit the priority of the determining module of which preselected area Higher or other restrictive meaning. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to what is clearly listed. Those steps or modules may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products, or equipment. The division of modules in this application is only a logical division , There can be other division methods when realizing in practical applications.
其中,该非活体人脸的检测装置中包括的各个模块可全部或部分通过软件、硬件或其组合来实现。进一步地,该非活体人脸的检测装置中的各个模块可以是用于实现对应功能的程序段。Wherein, each module included in the device for detecting a non-living human face can be implemented in whole or in part by software, hardware, or a combination thereof. Further, each module in the device for detecting a non-living human face may be a program segment for realizing corresponding functions.
本实施例提供的非活体人脸的检测装置通过让目标图片检测模型对人脸以及异常的环境元件进行学习,使得在识别待检测的人脸是否为非活体人脸时,首先通过该标图片检测模型识别出该待检测图片或视频中是否包括有人脸,再别出待检测的图片或视频中是否有异常的环境元件,再通过判断环境元件与人脸区域的位置关系判断该待检测图片中的人脸是否为非活体人脸,提高了活体人脸识别的准确性。The device for detecting a non-living human face provided in this embodiment allows the target picture detection model to learn human faces and abnormal environmental elements, so that when identifying whether the face to be detected is a non-living human face, the target picture is first passed through. The detection model recognizes whether the picture or video to be detected includes a human face, then distinguishes whether there are abnormal environmental elements in the picture or video to be detected, and then judges the picture to be detected by judging the positional relationship between the environmental element and the face area Whether the face in is a non-living face, which improves the accuracy of live face recognition.
上述非活体人脸的检测装置可以实现为一种计算机可读指令的形式,计算机可读指令可以在如图7所示的计算机设备上运行。The foregoing apparatus for detecting a non-living human face may be implemented in a form of computer-readable instructions, and the computer-readable instructions may run on the computer device as shown in FIG. 7.
关于非活体人脸的检测装置的具体限定可以参见上文中对于非活体人脸的检测方法的限定,在此不再赘述。上述非活体人脸的检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the detection device for non-living human face, please refer to the above limitation on the detection method of non-living human face, which will not be repeated here. Each module in the above-mentioned non-living human face detection device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统和计算机可读指令。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与被控设备通过网络连接通信。该计算机可读指令被处理器执行时以实现一种非活体人脸的检测装置。本示例中,可读存储介质可以是非易失性可读存储介质,也可以是易失性可读存储介质。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 7. The computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system and computer readable instructions. The internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with the controlled device through a network connection. When the computer-readable instructions are executed by the processor, a device for detecting a non-living human face is realized. In this example, the readable storage medium may be a non-volatile readable storage medium or a volatile readable storage medium.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例中非活体人脸的检测方法的步骤,例如图2所示的步骤101至步骤104。或者,处理器执行计算机可读指令时实现上述实施例中非活体人脸的检测装置的各模块/单元的功能,例如图6所示模块11至模块14的功能。为避免重复,这里不再赘述。In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor. The steps of the method for detecting a living human face are, for example, step 101 to step 104 shown in FIG. 2. Or, when the processor executes the computer-readable instructions, the functions of the modules/units of the non-living human face detection apparatus in the above-mentioned embodiment are implemented, for example, the functions of the modules 11 to 14 shown in FIG. 6. To avoid repetition, I won’t repeat them here.
所述处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述计算机装置的控制中心,利用各种接口和线路连接整个计算机装置的各个部分。The processor may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the computer device, and various interfaces and lines are used to connect various parts of the entire computer device.
所述存储器可用于存储所述计算机可读指令和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机可读指令和/或模块,以及调用存储在存储器内的数据,实现所述计算机装置的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、视频数据等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory may be used to store the computer-readable instructions and/or modules, and the processor may run or execute the computer-readable instructions and/or modules stored in the memory, and call data stored in the memory, Realize various functions of the computer device. The memory may mainly include a storage program area and a storage data area. The storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store Data created based on the use of mobile phones (such as audio data, video data, etc.), etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, memory, plug-in hard disks, smart media cards (SMC), and secure digital (SD) cards. , Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
所述存储器可以集成在所述处理器中,也可以与所述处理器分开设置。The memory may be integrated in the processor, or may be provided separately from the processor.
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行上述实施例中非活体人脸的检测方法的步骤,例如图2所示的步骤101至步骤104。或者,计算机可读指令被处理器执行时实现上述实施例中非活体人脸的检测装置的各模块/单元的功能,例如图6所示模块11至模块14的功能。为避免重复,这里不再赘述。In one embodiment, one or more readable storage media storing computer readable instructions are provided. The computer readable storage medium stores computer readable instructions, wherein the computer readable instructions are stored by one or more When executed by the two processors, the one or more processors are caused to execute the steps of the method for detecting non-living human faces in the foregoing embodiment, for example, step 101 to step 104 shown in FIG. 2. Or, when the computer-readable instructions are executed by the processor, the functions of the modules/units of the non-living human face detection apparatus in the foregoing embodiments are realized, for example, the functions of the modules 11 to 14 shown in FIG. 6. To avoid repetition, I won’t repeat them here.
本实施例提供的非活体人脸的检测方法、装置、计算机设备及存储介质通过增加了异常环境元件检测技术,并预先让目标图片检测模型对异常的环境元件进行学习,使得在识别待检测的人脸是否为非活体人脸时,通过该标图片检测模型可以通过先识别出待检测的图片或视频中是否有异常的环境元件,再通过判断环境元件与人脸区域的位置关系判断该待检测图片中的人脸是否为非活体人脸,提高了活体人脸识别的准确性。The method, device, computer equipment, and storage medium for detecting non-living human faces provided in this embodiment add an abnormal environmental element detection technology, and let the target image detection model learn abnormal environmental elements in advance, so that the object to be detected is recognized When the human face is a non-living human face, the standard picture detection model can first identify whether there are abnormal environmental elements in the picture or video to be detected, and then determine the positional relationship between the environmental elements and the face area. It detects whether the face in the picture is a non-living face, which improves the accuracy of live face recognition.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation manners, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM), including Several instructions are used to make a terminal (which can be a mobile phone, a computer, a server or a network device, etc.) execute the methods described in the various embodiments of the present application.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the various technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered as the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.

Claims (20)

  1. 一种非活体人脸的检测方法,其中,所述方法包括:A method for detecting a non-living human face, wherein the method includes:
    获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
    将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
    依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;It is determined in turn whether the target image of each picture to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
    若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  2. 根据权利要求1所述的非活体人脸的检测方法,其中,所述判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件的步骤包括:The method for detecting a non-living human face according to claim 1, wherein the step of determining whether the target image corresponding to the picture to be detected includes an environmental element whose category is a preset abnormal category comprises:
    获取从每张所述待检测图片中得到的每个目标图像所属的类别及预设的异常环境元件的类别;Acquiring the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
    判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。It is determined whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, it is determined that the target image includes an abnormal environmental element.
  3. 根据权利要求1所述的非活体人脸的检测方法,其中,非活体人脸的检测方法还包括:The method for detecting a non-living human face according to claim 1, wherein the method for detecting a non-living human face further comprises:
    接收多张样本图片;Receive multiple sample pictures;
    根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标注;Mark the image area in the sample picture and the category to which the image area belongs according to the received instruction;
    将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中;Input the marked image area and the category to which the image area belongs into the target picture detection model;
    通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。Learning the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
  4. 根据权利要求1所述的非活体人脸的检测方法,其中,所述若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸的步骤包括:The method for detecting a non-living human face according to claim 1, wherein the relative positional relationship between the face area of the to-be-detected image and the abnormal environmental element is within a preset range if there is at least one image to be detected. , The step of determining that the face in the picture to be detected is a non-living face includes:
    判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
  5. 根据权利要求1至4任一项所述的非活体人脸的检测方法,其中,在所述获取视频图像的步骤之前,所述方法还包括:The method for detecting a non-living human face according to any one of claims 1 to 4, wherein, before the step of obtaining a video image, the method further comprises:
    输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;Outputting a prompt message that allows the user to move from far to near or from near to far or get close to a camera, where the camera is a camera that collects the video image;
    输出让用户对着摄像头做预设面部动作的提示消息;Output a prompt message that allows the user to perform preset facial actions on the camera;
    获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像。Obtain a video image that includes the user's face area from large to small or from small to large and contains preset facial actions.
  6. 一种非活体人脸的检测装置,其中,所述装置包括:A detection device for a non-living human face, wherein the device includes:
    视频获取模块,用于获取视频图像,从所述视频图像中提取多张待检测图片;The video acquisition module is used to acquire a video image, and extract multiple pictures to be detected from the video image;
    输入模块,用于将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;The input module is configured to input the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
    第一判断模块,用于依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;The first judgment module is used to sequentially judge whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, further determine whether the target image corresponding to the picture to be detected includes a category Environmental components of the preset abnormal category;
    第二判断模块,用于若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。The second determining module is configured to determine the person in the image to be detected if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range The face is a non-living human face.
  7. 根据权利要求6所述的非活体人脸的检测装置,其中,所述第一判断模块还包括:The device for detecting a non-living human face according to claim 6, wherein the first judgment module further comprises:
    类别获取单元,用于获取从每张所述待检测图片中得到的每个目标图像所属的类别及预 设的异常环境元件的类别;The category acquisition unit is configured to acquire the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
    第一判断单元,用于判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。The first judging unit is configured to judge whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, judging that the target image includes an abnormal environmental element.
  8. 根据权利要求6所述的非活体人脸的检测装置,其中,所述非活体人脸的检测装置还包括:The device for detecting a non-living human face according to claim 6, wherein the device for detecting a non-living human face further comprises:
    图片接收模块,用于接收多张样本图片;The picture receiving module is used to receive multiple sample pictures;
    标注模块,用于根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标注;An annotation module, configured to annotate the image area in the sample picture and the category to which the image area belongs according to the received instruction;
    所述输入模块,还用于将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中;The input module is further configured to input the marked image area and the category to which the image area belongs into the target picture detection model;
    学习模块,用于通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。The learning module is used to learn the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
  9. 根据权利要求6所述的非活体人脸的检测装置,其中,所述第二判断模块具体用于:The device for detecting a non-living human face according to claim 6, wherein the second judgment module is specifically configured to:
    判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
  10. 根据权利要求6至9任一项所述的非活体人脸的检测装置,其中,所述非活体人脸的检测装置还包括:The device for detecting a non-living human face according to any one of claims 6 to 9, wherein the device for detecting a non-living human face further comprises:
    第一输出模块,用于输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;The first output module is configured to output a prompt message that allows the user to move from far to near or from near to far or approach a camera, where the camera is a camera that collects the video image;
    第二输出模块,用于输出让用户对着摄像头做预设面部动作的提示消息;The second output module is used to output a prompt message that allows the user to perform a preset facial motion on the camera;
    视频获取模块,用于获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像。The video acquisition module is used to acquire a video image in which the face area of the user changes from large to small or from small to large and contains preset facial actions.
  11. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其中,所述处理器执行所述程序时实现如下步骤:A computer device includes a memory, a processor, and computer readable instructions stored on the memory and running on the processor, wherein the processor implements the following steps when the program is executed:
    获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
    将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
    依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;It is determined in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
    若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  12. 根据权利要求11所述的计算机设备,其中,所述判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件的步骤包括:11. The computer device according to claim 11, wherein the step of determining whether the target image corresponding to the picture to be detected includes an environmental element whose category is a preset abnormal category comprises:
    获取从每张所述待检测图片中得到的每个目标图像所属的类别及预设的异常环境元件的类别;Acquiring the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
    判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。It is determined whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, it is determined that the target image includes an abnormal environmental element.
  13. 根据权利要求11所述的计算机设备,其中,所述处理器执行所述程序时还实现如下步骤:The computer device according to claim 11, wherein the processor further implements the following steps when executing the program:
    接收多张样本图片;Receive multiple sample pictures;
    根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标注;Mark the image area in the sample picture and the category to which the image area belongs according to the received instruction;
    将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中;Input the marked image area and the category to which the image area belongs into the target picture detection model;
    通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。Learning the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
  14. 根据权利要求11所述的计算机设备,其中,所述若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸的步骤包括:The computer device according to claim 11, wherein if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range, it is determined that The step of stating that the face in the picture to be detected is a non-living face includes:
    判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
  15. 根据权利要求11至14任一项所述的计算机设备,其中,在所述获取视频图像的步骤之前,所述处理器执行所述程序时还实现如下步骤:The computer device according to any one of claims 11 to 14, wherein, before the step of obtaining a video image, the processor further implements the following steps when executing the program:
    输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;Outputting a prompt message that allows the user to move from far to near or from near to far or get close to a camera, where the camera is a camera that collects the video image;
    输出让用户对着摄像头做预设面部动作的提示消息;Output a prompt message that allows the user to perform preset facial actions on the camera;
    获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像。Obtain a video image that includes the user's face area from large to small or from small to large and contains preset facial actions.
  16. 一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer readable instructions. The computer readable storage medium stores computer readable instructions. When the computer readable instructions are executed by one or more processors, the The one or more processors execute the following steps:
    获取视频图像,从所述视频图像中提取多张待检测图片;Acquiring a video image, and extracting multiple pictures to be detected from the video image;
    将所述待检测图片分别输入至预先训练好的目标图片检测模型中,得到每个所述待检测图片包括的目标图像及所述目标图像所属的类别;Inputting the pictures to be detected into a pre-trained target picture detection model to obtain the target image included in each picture to be detected and the category to which the target image belongs;
    依次判断每个所述待检测图片的目标图像中是否包括有所属类别为人脸区域的目标图像,若是,则进一步判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件;It is determined in turn whether the target image of each of the pictures to be detected includes a target image whose category is a face area, and if so, it is further determined whether the target image corresponding to the picture to be detected includes a predetermined abnormal category. Environmental components
    若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸。If the relative positional relationship between at least one face area of the to-be-detected image and the abnormal environmental element is within a preset range, it is determined that the human face in the to-be-detected image is a non-living human face.
  17. 根据权利要求16所述的可读存储介质,其中,所述判断对应待检测图片的目标图像中是否包括有所属类别为预设的异常类别的环境元件的步骤包括:The readable storage medium according to claim 16, wherein the step of determining whether the target image corresponding to the picture to be detected includes an environmental element whose category is a preset abnormal category comprises:
    获取从每张所述待检测图片中得到的每个目标图像所属的类别及预设的异常环境元件的类别;Acquiring the category to which each target image obtained from each of the to-be-detected pictures belongs and the category of the preset abnormal environmental element;
    判断每个所述目标图像所属的类别中是否包含有至少一个所述异常环境元件的类别,若是,则判断所述目标图像中包括有异常的环境元件。It is determined whether the category to which each target image belongs includes at least one category of the abnormal environmental element, and if so, it is determined that the target image includes an abnormal environmental element.
  18. 根据权利要求16所述的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The readable storage medium according to claim 16, wherein, when the computer-readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
    接收多张样本图片;Receive multiple sample pictures;
    根据接收的指令对所述样本图片中的图像区域及所述图像区域所属的类别进行标注;Mark the image area in the sample picture and the category to which the image area belongs according to the received instruction;
    将标注的所述图像区域及所述图像区域所属的类别输入到所述目标图片检测模型中;Input the marked image area and the category to which the image area belongs into the target picture detection model;
    通过所述目标图片检测模型对所述图像区域及所述图像区域所属的类别进行学习,得到所述训练好的目标图片检测模型。Learning the image area and the category to which the image area belongs through the target picture detection model to obtain the trained target picture detection model.
  19. 根据权利要求16所述的可读存储介质,其中,所述若存在至少一张所述待检测图的人脸区域与所述异常的环境元件的相对位置关系在预设的范围之内,则判断所述待检测图片中的人脸为非活体人脸的步骤包括:The readable storage medium according to claim 16, wherein if the relative positional relationship between the face area of the at least one image to be detected and the abnormal environmental element is within a preset range, then The step of determining that the human face in the picture to be detected is a non-living human face includes:
    判断所述异常环境元件的显示区域与所述人脸区域是否具有重合的部分,若是,则判断所述待检测图片中的人脸为非活体人脸。It is determined whether the display area of the abnormal environment element and the face area overlap, and if so, it is determined that the face in the picture to be detected is a non-living face.
  20. 根据权利要求16至19任一项所述的可读存储介质,其中,在所述获取视频图像的步骤之前所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The readable storage medium according to any one of claims 16 to 19, wherein, when the computer-readable instructions are executed by one or more processors before the step of obtaining a video image, the one or more Each processor also performs the following steps:
    输出让用户由远至近或由近至远地移动或靠近摄像头的提示消息,所述摄像头为采集所述视频图像的摄像头;Outputting a prompt message that allows the user to move from far to near or from near to far or get close to a camera, where the camera is a camera that collects the video image;
    输出让用户对着摄像头做预设面部动作的提示消息;Output a prompt message that allows the user to perform preset facial actions on the camera;
    获取包括有用户的人脸区域由大变小或由小变大并包含有预设面部动作的视频图像。Obtain a video image that includes the user's face area from large to small or from small to large and contains preset facial actions.
PCT/CN2021/070470 2020-02-27 2021-01-06 Method and apparatus for detecting face of non-living body, and computer device and storage medium WO2021169616A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010122186.3A CN111428570A (en) 2020-02-27 2020-02-27 Detection method and device for non-living human face, computer equipment and storage medium
CN202010122186.3 2020-02-27

Publications (1)

Publication Number Publication Date
WO2021169616A1 true WO2021169616A1 (en) 2021-09-02

Family

ID=71547309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/070470 WO2021169616A1 (en) 2020-02-27 2021-01-06 Method and apparatus for detecting face of non-living body, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN111428570A (en)
WO (1) WO2021169616A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428570A (en) * 2020-02-27 2020-07-17 深圳壹账通智能科技有限公司 Detection method and device for non-living human face, computer equipment and storage medium
CN112069917B (en) * 2020-08-14 2024-02-02 武汉轻工大学 Face recognition system for fixed scene
CN113420615A (en) * 2021-06-03 2021-09-21 深圳海翼智新科技有限公司 Face living body detection method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169067A1 (en) * 2007-12-26 2009-07-02 Altek Corporation Face detection and tracking method
CN105518714A (en) * 2015-06-30 2016-04-20 北京旷视科技有限公司 Vivo detection method and equipment, and computer program product
CN107688781A (en) * 2017-08-22 2018-02-13 北京小米移动软件有限公司 Face identification method and device
CN108734057A (en) * 2017-04-18 2018-11-02 北京旷视科技有限公司 The method, apparatus and computer storage media of In vivo detection
CN110569808A (en) * 2019-09-11 2019-12-13 腾讯科技(深圳)有限公司 Living body detection method and device and computer equipment
CN111428570A (en) * 2020-02-27 2020-07-17 深圳壹账通智能科技有限公司 Detection method and device for non-living human face, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169067A1 (en) * 2007-12-26 2009-07-02 Altek Corporation Face detection and tracking method
CN105518714A (en) * 2015-06-30 2016-04-20 北京旷视科技有限公司 Vivo detection method and equipment, and computer program product
CN108734057A (en) * 2017-04-18 2018-11-02 北京旷视科技有限公司 The method, apparatus and computer storage media of In vivo detection
CN107688781A (en) * 2017-08-22 2018-02-13 北京小米移动软件有限公司 Face identification method and device
CN110569808A (en) * 2019-09-11 2019-12-13 腾讯科技(深圳)有限公司 Living body detection method and device and computer equipment
CN111428570A (en) * 2020-02-27 2020-07-17 深圳壹账通智能科技有限公司 Detection method and device for non-living human face, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111428570A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
US10438077B2 (en) Face liveness detection method, terminal, server and storage medium
WO2021169616A1 (en) Method and apparatus for detecting face of non-living body, and computer device and storage medium
JP6878572B2 (en) Authentication based on face recognition
US11210541B2 (en) Liveness detection method, apparatus and computer-readable storage medium
US9323982B2 (en) Display apparatus for performing user certification and method thereof
WO2019101038A1 (en) Bullet screen content control method, computer device and storage medium
US20190362171A1 (en) Living body detection method, electronic device and computer readable medium
JP2015529354A (en) Method and apparatus for face recognition
GB2513218A (en) Object detection metadata
JP2017534090A (en) Face recognition method, apparatus and terminal
CN109670444B (en) Attitude detection model generation method, attitude detection device, attitude detection equipment and attitude detection medium
TW202105239A (en) Image processing methods, electronic devices and storage medium
US9819906B2 (en) Selective data content sharing
US20230045306A1 (en) Face liveness detection method, system, apparatus, computer device, and storage medium
WO2020052062A1 (en) Detection method and device
WO2020211396A1 (en) Silent living body image recognition method and apparatus, computer device and storage medium
WO2021179719A1 (en) Face detection method, apparatus, medium, and electronic device
CN107977636B (en) Face detection method and device, terminal and storage medium
US20220270352A1 (en) Methods, apparatuses, devices, storage media and program products for determining performance parameters
TW201504839A (en) Portable electronic apparatus and interactive human face login method
WO2022222806A1 (en) Insurance verification method and apparatus for electronic device
CN113255516A (en) Living body detection method and device and electronic equipment
CN111881740A (en) Face recognition method, face recognition device, electronic equipment and medium
WO2021047069A1 (en) Face recognition method and electronic terminal device
EP3975046B1 (en) Method and apparatus for detecting occluded image and medium

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: 21759587

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.01.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21759587

Country of ref document: EP

Kind code of ref document: A1