[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112307973B - Living body detection method, living body detection system, electronic device, and storage medium - Google Patents

Living body detection method, living body detection system, electronic device, and storage medium Download PDF

Info

Publication number
CN112307973B
CN112307973B CN202011196654.8A CN202011196654A CN112307973B CN 112307973 B CN112307973 B CN 112307973B CN 202011196654 A CN202011196654 A CN 202011196654A CN 112307973 B CN112307973 B CN 112307973B
Authority
CN
China
Prior art keywords
neural network
living body
auxiliary
main
output result
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011196654.8A
Other languages
Chinese (zh)
Other versions
CN112307973A (en
Inventor
何超超
浦贵阳
程耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011196654.8A priority Critical patent/CN112307973B/en
Publication of CN112307973A publication Critical patent/CN112307973A/en
Application granted granted Critical
Publication of CN112307973B publication Critical patent/CN112307973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • 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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention relates to the field of face recognition, and discloses a method, a system, electronic equipment and a storage medium for detecting a living body. The invention is applied to electronic equipment with at least two image acquisition devices, wherein the at least two image acquisition devices acquire images at the same position, and the method comprises the following steps: simultaneously acquiring at least two pictures through the image acquisition device; and respectively sending the pictures to at least one main neural network and at least one auxiliary neural network, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network. Outputting the living body characteristics through the main neural network and the auxiliary neural network, and sending the living body characteristics to a full connection layer; outputting the category of the living body characteristic as the result of the living body detection through the full connection layer and the softmax layer. The living body detection through the multi-input flow neural network architecture has higher precision and speed.

Description

活体检测方法、系统、电子设备和存储介质Liveness detection method, system, electronic device and storage medium

技术领域technical field

本发明实施例涉及人脸识别领域,特别涉及活体检测方法、系统、电子设备和存储介质。Embodiments of the present invention relate to the field of face recognition, and in particular to a living body detection method, system, electronic device and storage medium.

背景技术Background technique

人脸识别广泛应用于刷脸支付、人脸门禁、人脸考勤、人证核验等场景中,通常人脸识别系统包括人脸照片的采集、人脸检测、人脸特征提取、人脸搜索/比对等功能模块。当采集的照片为打印、电子屏输出或戴面具的人脸图像时,系统很容易就会被外部人员伪造的人脸侵入。为了避免伪造的人脸欺诈,在人脸识别系统中加入人脸活体检测模块能够提升系统的安全性,人脸活体检测的主要功能是判别待识别的人脸是否为真人,并给出人脸为真人的置信度信息。Face recognition is widely used in face recognition payment, face access control, face attendance, witness verification and other scenarios. Usually face recognition systems include face photo collection, face detection, face feature extraction, face search/ Compared with other functional modules. When the collected photos are printed, electronic screen output or face images wearing masks, the system can easily be invaded by forged faces by outsiders. In order to avoid fake face fraud, adding a live face detection module to the face recognition system can improve the security of the system. The main function of live face detection is to judge whether the face to be recognized is a real person and give is the confidence information of the real person.

然而,相关技术通常采用单输入流深度神经网络架构的活体检测方法,输入图片为RGB图、深度图、近红外图等中的一种,网络结构相对简单,但是由于输入的是单类图片信息,活体检测的准确率达到一定值后很难再提升。However, related technologies usually use a single-input stream deep neural network architecture for live detection. The input image is one of RGB images, depth images, and near-infrared images. The network structure is relatively simple, but since the input is a single type of image information , it is difficult to improve the accuracy of liveness detection after reaching a certain value.

发明内容Contents of the invention

本发明实施方式的目的在于提供一种活体检测方法、系统、电子设备和存储介质,通过多输入流神经网络架构是的活体检测的精度更高、速度更快。The purpose of the embodiment of the present invention is to provide a living body detection method, system, electronic device and storage medium, and the precision and speed of the living body detection through the multi-input stream neural network architecture are higher.

为解决上述技术问题,本发明的实施方式提供了一种活体检测方法,包括以下步骤:In order to solve the above technical problems, an embodiment of the present invention provides a living body detection method, comprising the following steps:

通过所述图像采集装置同时获取至少两张图片;Obtain at least two pictures simultaneously through the image acquisition device;

将所述图片分别发送至至少一个主神经网络和至少一个辅神经网络中,其中,所述主神经网络的输出结果融合所述辅神经网络的输出结果。The pictures are respectively sent to at least one main neural network and at least one auxiliary neural network, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network.

通过所述主神经网络和所述辅神经网络输出活体特征,并发送至全连接层;Output living body features through the main neural network and the auxiliary neural network, and send to the fully connected layer;

通过所述全连接层和softmax层输出所述活体特征的类别作为所述活体检测的结果。The category of the living body feature is output through the fully connected layer and the softmax layer as the result of the living body detection.

本发明的实施方式还提供了一种活体检测系统,包括:Embodiments of the present invention also provide a living body detection system, including:

图片获取模块,用于通过所述图像采集装置同时获取至少两张图片;An image acquisition module, configured to simultaneously acquire at least two images through the image acquisition device;

活体检测模块,用于将所述图片分别发送至至少一个主神经网络和至少一个辅神经网络中,其中,所述主神经网络的输出结果融合所述辅神经网络的输出结果;通过所述主神经网络和所述辅神经网络输出活体特征,并发送至全连接层;A living body detection module, configured to send the pictures to at least one main neural network and at least one auxiliary neural network, wherein the output of the main neural network is fused with the output of the auxiliary neural network; through the main The neural network and the auxiliary neural network output the living body features and send them to the fully connected layer;

结果输出模块,用于通过所述全连接层和softmax层输出所述活体特征的类别。The result output module is used to output the category of the living body feature through the fully connected layer and the softmax layer.

本发明的实施方式还提供了一种电子设备,包括:Embodiments of the present invention also provide an electronic device, including:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行活体检测方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the living body detection method.

本发明的实施方式还提供了一种计算机存储介质,包括:存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现活体检测方法。The embodiment of the present invention also provides a computer storage medium, including: a computer program is stored, and it is characterized in that, when the computer program is executed by a processor, a living body detection method is realized.

本发明实施方式相对于现有技术而言,采用多设备采集图片多网络检测图片,比以往的只是用单张图片检测具有更高的准确性,同时可以根据需要设置不同的神经网络作为主辅神经网络,尤其可以在主辅神经网络分别设置精度更高的网络模型和速度更快的网络模型,使活体检测兼具精度与速度的优势,提高了准确性和速度。并且可以根据需要设置多条神经网络以适应多种应用场景。Compared with the prior art, the embodiment of the present invention adopts multi-device to collect pictures and multi-network to detect pictures, which has higher accuracy than the previous one which only uses a single picture to detect, and at the same time, different neural networks can be set as the main and auxiliary according to the needs. The neural network, especially the network model with higher accuracy and faster speed can be set in the main and auxiliary neural network respectively, so that the living body detection has the advantages of both accuracy and speed, and improves the accuracy and speed. And multiple neural networks can be set as needed to adapt to various application scenarios.

另外,本发明提供的活体检测方法,在所述通过所述图像采集装置同时获取至少两张图片后,包括:检测所述图片中是否具有人脸图像;所述图片具有所述人脸图像则将所述人脸图像发送至所述主神经网络。在进行活体检测前,先对图像进行筛选,仅对有人像的图片进行进一步的活体检测,减少了检测的数量,加快了处理速度。In addition, the living body detection method provided by the present invention, after simultaneously acquiring at least two pictures by the image acquisition device, includes: detecting whether there is a human face image in the picture; if the picture has the human face image, then Send the face image to the main neural network. Before the liveness detection, the images are first screened, and only the pictures with portraits are subjected to further liveness detection, which reduces the number of detections and speeds up the processing.

另外,本发明提供的活体检测方法,在所述主神经网络的输出结果融合所述辅神经网络的输出结果中,所述主神经网络和所述辅神经网络都包括多个Block;所述方法包括:将所述主神经网络中每一个所述Block的输出结果融合所述辅神经网络中同级所述Block的输出结果;将所述输出结果发送至所述主神经网络中下一个Block。将主神经网络中每一个Block的输出结果与辅神经网络的输出结果进行融合,使输出结果兼具主神经网络和辅神经网络应用的网络模型的优势,使活体检测速度更快,效率更高。In addition, in the living body detection method provided by the present invention, when the output result of the main neural network is fused with the output result of the auxiliary neural network, both the main neural network and the auxiliary neural network include a plurality of Blocks; the method The method includes: fusing the output result of each block in the main neural network with the output result of the same block in the auxiliary neural network; sending the output result to the next Block in the main neural network. The output of each Block in the main neural network is fused with the output of the auxiliary neural network, so that the output results have both the advantages of the network model applied by the main neural network and the auxiliary neural network, making the detection of living body faster and more efficient .

另外,本发明提供的活体检测方法,所述通过所述主神经网络和所述辅神经网络输出活体特征,并发送至全连接层,包括:将所述主神经网络输出的特征与所述辅神经网络输出的特征进行融合;将所述融合结果发送至所述全连接层。将主辅网络输出的特征进行融合,最终得到整个用于活体检测的网络模型得出一个最终的结果,使这个最终的结果可以与预先设置的类别进行对比。In addition, in the living body detection method provided by the present invention, the live body features are output through the main neural network and the auxiliary neural network and sent to the fully connected layer, including: combining the features output by the main neural network with the auxiliary neural network The features output by the neural network are fused; and the fused result is sent to the fully connected layer. The features output by the main and auxiliary networks are fused, and finally the entire network model for liveness detection is obtained to obtain a final result, so that the final result can be compared with the preset category.

附图说明Description of drawings

一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the drawings in the drawings are not limited to scale.

图1是本发明第一实施方式提供的活体检测方法的流程图1;Fig. 1 is a flow chart 1 of the living body detection method provided by the first embodiment of the present invention;

图2是本发明第一实施方式提供的活体检测方法的流程图2;Fig. 2 is a flow chart 2 of the living body detection method provided by the first embodiment of the present invention;

图3是本发明第二实施方式提供的活体检测模型的训练的流程图;Fig. 3 is a flowchart of the training of the living body detection model provided by the second embodiment of the present invention;

图4是本发明第三实施方式提供的活体检测系统的流程图;Fig. 4 is a flow chart of the living body detection system provided by the third embodiment of the present invention;

图5是本发明第四实施方式提供的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by a fourth embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, various implementation modes of the present invention will be described in detail below in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that, in each implementation manner of the present invention, many technical details are provided for readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following implementation modes, the technical solution claimed in this application can also be realized.

以下各个实施例的划分是为了描述方便,不应对本发明的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。The division of the following embodiments is for the convenience of description, and should not constitute any limitation to the specific implementation of the present invention, and the various embodiments can be combined and referred to each other on the premise of no contradiction.

本发明的第一实施方式涉及一种活体检测方法。具体流程如图1所示。The first embodiment of the present invention relates to a living body detection method. The specific process is shown in Figure 1.

步骤101,通过所述图像采集装置同时获取至少两张图片。Step 101, simultaneously acquire at least two pictures through the image acquisition device.

在本实施方式中,在活体检测设备上设置至少两个图像采集装置,图像采集装置可以是摄像头,或其他可用于图像采集的装置。图像采集设备相对固定,并能同时采集图片。In this embodiment, at least two image acquisition devices are provided on the living body detection device, and the image acquisition devices may be cameras, or other devices that can be used for image acquisition. The image acquisition equipment is relatively fixed and can simultaneously acquire pictures.

具体地,获取的图片可以为彩色(RGB)图片、近红外图片、深度图等,具体实践中一般至少使用一张RGB图片,但此处并不对获取的图片类型作出限制。Specifically, the acquired picture may be a color (RGB) picture, a near-infrared picture, a depth map, etc. In practice, at least one RGB picture is generally used, but there is no limitation on the type of picture to be acquired here.

进一步地,需要在进入到主辅神经网络之前,需要对图片进行人脸检测,如果在图片中没有人脸,则不必再进行后续的活体检测。具体流程如图2所示:Furthermore, it is necessary to perform face detection on the picture before entering the main and auxiliary neural networks. If there is no face in the picture, it is not necessary to perform subsequent liveness detection. The specific process is shown in Figure 2:

步骤201,将第一图片发送至人脸检测模块。Step 201, sending the first picture to the face detection module.

具体地,人脸检测模块使用的是现有的用于人脸检测的深度神经网络,如MTCNN、YOLO、RetinaNet等。Specifically, the face detection module uses existing deep neural networks for face detection, such as MTCNN, YOLO, RetinaNet, etc.

步骤202,人脸检测模块将第一图片中人脸图像发送至主神经网络。Step 202, the face detection module sends the face image in the first picture to the main neural network.

步骤203,人脸检测模块将第一图片中人脸所在位置坐标发送至O-Net模块。In step 203, the face detection module sends the position coordinates of the face in the first picture to the O-Net module.

具体地,O-Net模块包括O-Net架构和其他逻辑功能,为独立的逻辑模块,用于处理第二图片,即回归第二图片中的人脸图像。Specifically, the O-Net module includes an O-Net architecture and other logic functions, and is an independent logic module for processing the second picture, that is, returning the face image in the second picture.

步骤204,O-Net模块结合位置坐标回归第二图片中人脸图像。In step 204, the O-Net module combines the position coordinates to return the face image in the second picture.

步骤205,将第二图片中人脸图像发送至辅神经网络。Step 205, sending the face image in the second picture to the auxiliary neural network.

具体地,主神经网络接收经过人脸检测模块处理的第一图片,辅神经网络接收经过O-Net模块处理的第二图片。Specifically, the main neural network receives the first picture processed by the face detection module, and the auxiliary neural network receives the second picture processed by the O-Net module.

需要说明的是,在具体实践中,一般将主神经网络设置为精度更高的神经网络,将辅神经网络设置为速度更快的神经网络,原因在于主神经网络中Block的结果需要融合辅神经网络中Block的结果,被融合的辅神经网络一般不能慢于主神经网络,否则将拖慢主神经网络的工作及整个活体检测的速度。由于在具体实践中有这样的设置,所以在辅神经网络采用了回归速度比较快的O-Net模块,加快了辅神经网络的处理速度。It should be noted that in practice, the main neural network is generally set to a higher-precision neural network, and the auxiliary neural network is set to a faster neural network. The reason is that the results of Block in the main neural network need to be fused with the auxiliary neural network. As a result of the Block in the network, the fused auxiliary neural network cannot generally be slower than the main neural network, otherwise it will slow down the work of the main neural network and the speed of the entire living body detection. Due to this setting in practice, the O-Net module with a relatively fast regression speed is used in the auxiliary neural network to speed up the processing speed of the auxiliary neural network.

步骤102,将所述图片分别发送至至少一个主神经网络和至少一个辅神经网络中,其中,所述主神经网络的输出结果融合所述辅神经网络的输出结果。Step 102, sending the pictures to at least one main neural network and at least one auxiliary neural network respectively, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network.

在本实施方式中,主神经网络一般采用精度更高的神经网络架构,辅神经网络一般采用处理速度更快的神经网络架构,但可以根据本发明所述的活体检测方法应用场景的不同使用不同的神经网络架构,此处不做具体限定。In this embodiment, the main neural network generally adopts a neural network architecture with higher precision, and the auxiliary neural network generally adopts a neural network architecture with faster processing speed, but it can be used differently according to different application scenarios of the living body detection method described in the present invention. The neural network architecture of , which is not specifically limited here.

例如,主神经网络采用基于残差网络(ResNet,Residual Network)的BlockA结构,辅神经网络采用基于MobileNet的BlockB结构:For example, the main neural network adopts the BlockA structure based on ResNet (Residual Network), and the auxiliary neural network adopts the BlockB structure based on MobileNet:

具体地,BlockA中一般使用4个卷积层,在第2个和第4个卷积的输出加上residual,BlockB中一般使用6个卷积层,在第3个卷积层后面加上了residual,这种方式有效的解决了网络退化的问题。Specifically, 4 convolutional layers are generally used in BlockA, and residual is added to the output of the 2nd and 4th convolutions, and 6 convolutional layers are generally used in BlockB, and a residual is added after the 3rd convolutional layer residual, this method effectively solves the problem of network degradation.

进一步地,BlockB的卷积采用depthwise(dw)和pointwise(pw)的分离结构提取特征,相比于常规的卷积操作,参数数量和运算成本比较低,极大的降低计算量。Furthermore, the convolution of BlockB uses the separation structure of depthwise (dw) and pointwise (pw) to extract features. Compared with conventional convolution operations, the number of parameters and computational cost are relatively low, which greatly reduces the amount of calculation.

在本实施方式中,主神经网络中每一个BlockA结构的输出都会融合同级BlockB的输出结果,并将融合后的结果发送至下一个BlockA的结构,例如,BlockA_1的输出结果融合BlockB_1的输出结果,并将融合后的结果发送至BlockA_2。In this embodiment, the output of each BlockA structure in the main neural network will be fused with the output result of BlockB at the same level, and the fused result will be sent to the next BlockA structure, for example, the output result of BlockA_1 will be fused with the output result of BlockB_1 , and send the fused result to BlockA_2.

具体的,融合方式可以为通道维的连接(concatenation)或对应元素相加(element-wise add),卷积神经网络中的其他特征融合方式都可使用,此处不做具体限定。Specifically, the fusion method can be concatenation of the channel dimension or element-wise add, and other feature fusion methods in the convolutional neural network can be used, which are not specifically limited here.

步骤103,通过所述主神经网络和所述辅神经网络输出活体特征,并发送至全连接层。Step 103, output the living body features through the main neural network and the auxiliary neural network, and send to the fully connected layer.

在本实施方式中,主神经网络与辅神经网络分别输出特征,并将特征进行融合,融合方式可以为concatenation。In this embodiment, the main neural network and the auxiliary neural network respectively output features and fuse the features, and the fusion method may be concatenation.

步骤104,通过所述全连接层和softmax层输出所述活体特征的类别作为活体检测的结果。Step 104, output the category of the living body feature through the fully connected layer and the softmax layer as the result of the living body detection.

在本实施方式中,神经网络级联全连接层和softmax层,用于处理神经网络输出的特征。In this embodiment, the neural network is cascaded with a fully connected layer and a softmax layer to process the features output by the neural network.

具体地,全连接层用于减少特征位置对分类的影响,softmax层用于输出特征的类别。Specifically, the fully connected layer is used to reduce the influence of the feature position on the classification, and the softmax layer is used to output the category of the feature.

上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The step division of the above various methods is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.

本发明的第二实施方式涉及一种活体检测模型的训练,如图3所示,包括:The second embodiment of the present invention relates to the training of a living body detection model, as shown in FIG. 3 , including:

步骤301,通过图像采集设备获取图片。Step 301, acquire a picture through an image acquisition device.

在本实施方式中,获取的图片包括活体图片和非活体图片,活体图片为真人图片,非活体图片但不限于打印的人脸照片、电子屏幕显示的人脸照片、戴面具的人脸、卡通人物的人脸等。由于本实施例的目的在于训练活体检测模型,因而训练的样本越多则训练的效果越好,活体检测的准确率会越高。In this embodiment, the pictures acquired include living body pictures and non-living body pictures. The living body pictures are pictures of real people, and non-living body pictures are not limited to printed face photos, face photos displayed on electronic screens, faces wearing masks, cartoons, etc. The face of a person, etc. Since the purpose of this embodiment is to train the living body detection model, the more training samples are, the better the training effect will be, and the higher the accuracy of the living body detection will be.

步骤302,对获取的图片进行分类标注。Step 302, classifying and labeling the acquired pictures.

在本实施方式中,根据被采集的对象将采集的图片标注为对应的类别。例如将类别分为真人活体、打印的照片、电子屏的照片、戴面具的照片、其他非活体。In this embodiment, the captured pictures are marked as corresponding categories according to the captured objects. For example, the categories are divided into real people, printed photos, photos of electronic screens, photos wearing masks, and other non-living objects.

具体地,标注的标签可以为one-hot向量,即在图片对应的类别下标注数值为1,其他为0。Specifically, the labeled label can be a one-hot vector, that is, the labeled value is 1 for the category corresponding to the picture, and 0 for others.

步骤303,对图片做预先处理构建训练集。Step 303, pre-processing the pictures to construct a training set.

在本实施方式中,预先处理的方式如步骤201和步骤203-204所示,此处不再一一赘述。In this embodiment, the manner of pre-processing is shown in step 201 and steps 203-204, which will not be repeated here.

将步骤201处理的第一图片和步骤204处理的第二图片添加到训练集并标记该组图片的类别。The first picture processed in step 201 and the second picture processed in step 204 are added to the training set and the category of the group of pictures is marked.

步骤304,通过训练集训练网络模型。Step 304, train the network model through the training set.

在本实施方式中,网络模型的架构如步骤102所示,此处不再一一赘述。In this embodiment, the structure of the network model is as shown in step 102, which will not be repeated here.

具体地,对主辅神经网络输出的特征进行融合,通过全连接层和softmax层输出网络模型得出的特征类别,并与预先标注好的类别输出损失函数,如公式(1)所示:Specifically, the features output by the main and auxiliary neural networks are fused, the feature categories obtained by the network model are output through the fully connected layer and the softmax layer, and the loss function is output with the pre-marked category, as shown in formula (1):

Figure GDA0003915413480000061
Figure GDA0003915413480000061

其中,yi为该输入图片对的类别,Oi为softmax的输出类别。Among them, y i is the category of the input picture pair, and O i is the output category of softmax.

进一步地,通过随机梯度下降方法(SGD)训练网络模型,保存网络模型和最优参数。Further, the network model is trained by the stochastic gradient descent method (SGD), and the network model and optimal parameters are saved.

本发明第三实施方式涉及一种活体检测系统,如图4所示,包括:The third embodiment of the present invention relates to a living body detection system, as shown in FIG. 4 , including:

图片获取模块401,用于通过所述图像采集装置同时获取至少两张图片。The picture acquisition module 401 is configured to simultaneously acquire at least two pictures through the image acquisition device.

在本实施方式中,图片获取模块401包括图片采集模块和人脸识别模块。In this embodiment, the picture acquisition module 401 includes a picture acquisition module and a face recognition module.

具体地,图片采集模块中包括至少两个图像采集装置,图像采集装置相对固定,且采集的是相同位置的图像。Specifically, the image acquisition module includes at least two image acquisition devices, and the image acquisition devices are relatively fixed and acquire images of the same position.

人脸识别模块包括人脸检测模块和O-Net模块,其中,人脸检测模块处理第一图片并发送至主神经网络,O-Net模块处理第二图片并发送至辅神经网络。The face recognition module includes a face detection module and an O-Net module, wherein the face detection module processes the first picture and sends it to the main neural network, and the O-Net module processes the second picture and sends it to the auxiliary neural network.

活体检测模块402,用于将所述图片分别发送至至少一个主神经网络和至少一个辅神经网络中,其中,所述主神经网络的输出结果融合所述辅神经网络的输出结果;通过所述主神经网络和所述辅神经网络输出活体特征,并发送至全连接层;The living body detection module 402 is configured to send the pictures to at least one main neural network and at least one auxiliary neural network, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network; through the The main neural network and the auxiliary neural network output the living body features and send them to the fully connected layer;

具体地,活体检测模块包括至少一个主神经网络和至少一个辅神经网络,以及与神经网络级联的全连接层和softmax层,其中,每一层都为级联的方式连接。Specifically, the living body detection module includes at least one main neural network and at least one auxiliary neural network, and a fully connected layer and a softmax layer cascaded with the neural network, wherein each layer is connected in a cascaded manner.

结果输出模块403,用于通过所述全连接层和softmax层输出所述活体特征的类别作为所述活体检测的结果。The result output module 403 is configured to output the category of the living body feature as the result of the living body detection through the fully connected layer and the softmax layer.

具体地,结果输出模块将按照预先设置的类别输出活体检测结果。Specifically, the result output module will output the living body detection results according to the preset categories.

不难发现,本实施方式为与第一实施方式相对应的系统实施例,本实施方式可与第一实施方式互相配合实施。第一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中。It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in cooperation with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and will not be repeated here in order to reduce repetition. Correspondingly, the relevant technical details mentioned in this implementation manner can also be applied in the first implementation manner.

值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that all the modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units. In addition, in order to highlight the innovative part of the present invention, units that are not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.

本发明第五实施方式涉及一种电子设备,如图5所示,包括:The fifth embodiment of the present invention relates to an electronic device, as shown in FIG. 5 , including:

至少一个处理器501;以及,与所述至少一个处理器501通信连接的存储器502;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行任一所述的活体检测方法。At least one processor 501; and, a memory 502 communicatively connected to the at least one processor 501; wherein, the memory stores instructions executable by the at least one processor, and the instructions are processed by the at least one processor implemented by a processor, so that the at least one processor can execute any one of the living body detection methods.

其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路链接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。Wherein, the memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus links one or more processors and various circuits of the memory together. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein. The bus interface provides an interface between the bus and the transceivers. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, further, the antenna also receives the data and transmits the data to the processor.

处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory can be used to store data that the processor uses when performing operations.

本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program. The program is stored in a storage medium and includes several instructions to make a device (which can be a single-chip , chip, etc.) or a processor (processor) executes all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.

本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes can be made to it in form and details without departing from the spirit and spirit of the present invention. scope.

Claims (9)

1. A method for detecting a living body, applied to an electronic device having at least two image capturing devices, wherein the at least two image capturing devices capture images of a same position, comprises:
simultaneously acquiring at least two pictures through the image acquisition device;
respectively sending the pictures to at least one main neural network and at least one auxiliary neural network, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network;
outputting the living body characteristics through the main neural network and the auxiliary neural network, and sending the living body characteristics to a full connection layer;
outputting the category of the living body characteristic as a result of the living body detection through the full connection layer and the softmax layer;
in the process of fusing the output result of the main neural network with the output result of the auxiliary neural network, the main neural network and the auxiliary neural network both comprise a plurality of blocks; the method comprises the following steps:
fusing the output result of each Block in the primary neural network with the output result of the Block in the same stage in the auxiliary neural network;
and sending the output result to the next Block in the master neural network.
2. The in-vivo detection method according to claim 1, comprising, after said simultaneously acquiring at least two pictures by said image acquisition device:
detecting whether the first picture has a face image;
and if the first picture has the face image, the face image is sent to the main neural network.
3. The in-vivo detection method according to claim 2, wherein the first picture having the face image sends the face image to the autonomic neural network, further comprising:
and sending the position coordinates of the human face.
4. The in-vivo detection method according to claim 3, after the sending of the coordinates of the position of the face, comprising:
regressing the face image in the second picture by combining the position coordinates;
and sending the face image in the second picture to the auxiliary neural network.
5. The in-vivo detection method according to claim 1, wherein said sending the pictures to at least one primary neural network and at least one secondary neural network respectively comprises:
and training the main neural network and the auxiliary neural network according to preset classification, wherein the classification at least comprises a live human living body class.
6. The in-vivo detection method according to claim 1, wherein the outputting of the in-vivo characteristics through the main neural network and the auxiliary neural network and the sending to a full connection layer comprises:
fusing the characteristics output by the main neural network and the characteristics output by the auxiliary neural network;
and sending the fusion result to the full connection layer.
7. A living body detection system, comprising:
the image acquisition module is used for acquiring at least two images simultaneously through the image acquisition device;
the living body detection module is used for respectively sending the pictures to at least one main neural network and at least one auxiliary neural network, wherein the output result of the main neural network is fused with the output result of the auxiliary neural network; outputting the living body characteristics through the main neural network and the auxiliary neural network, and sending the living body characteristics to a full connection layer;
a result output module for outputting the category of the living body feature as a result of the living body detection through the full connection layer and the softmax layer;
wherein, the in vivo detection module is specifically configured to: in the process of fusing the output result of the main neural network with the output result of the auxiliary neural network, the main neural network and the auxiliary neural network both comprise a plurality of blocks;
Fusing the output result of each Block in the main neural network with the output result of the Block in the same level in the auxiliary neural network;
and sending the output result to the next Block in the master neural network.
8. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the liveness detection method of any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the in-vivo detection method according to any one of claims 1 to 6.
CN202011196654.8A 2020-10-30 2020-10-30 Living body detection method, living body detection system, electronic device, and storage medium Active CN112307973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011196654.8A CN112307973B (en) 2020-10-30 2020-10-30 Living body detection method, living body detection system, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011196654.8A CN112307973B (en) 2020-10-30 2020-10-30 Living body detection method, living body detection system, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN112307973A CN112307973A (en) 2021-02-02
CN112307973B true CN112307973B (en) 2023-04-18

Family

ID=74333508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011196654.8A Active CN112307973B (en) 2020-10-30 2020-10-30 Living body detection method, living body detection system, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN112307973B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169867A (en) * 2007-12-04 2008-04-30 北京中星微电子有限公司 Image dividing method, image processing apparatus and system
CN103136893A (en) * 2013-01-24 2013-06-05 浙江工业大学 Tunnel fire early-warning controlling method based on multi-sensor data fusion technology and system using the same
CN108229325A (en) * 2017-03-16 2018-06-29 北京市商汤科技开发有限公司 Method for detecting human face and system, electronic equipment, program and medium
CN108345818A (en) * 2017-01-23 2018-07-31 北京中科奥森数据科技有限公司 A kind of human face in-vivo detection method and device
CN109034102A (en) * 2018-08-14 2018-12-18 腾讯科技(深圳)有限公司 Human face in-vivo detection method, device, equipment and storage medium
CN110705365A (en) * 2019-09-06 2020-01-17 北京达佳互联信息技术有限公司 Human body key point detection method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019100436A1 (en) * 2017-11-22 2019-05-31 Zhejiang Dahua Technology Co., Ltd. Methods and systems for face recognition

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169867A (en) * 2007-12-04 2008-04-30 北京中星微电子有限公司 Image dividing method, image processing apparatus and system
CN103136893A (en) * 2013-01-24 2013-06-05 浙江工业大学 Tunnel fire early-warning controlling method based on multi-sensor data fusion technology and system using the same
CN108345818A (en) * 2017-01-23 2018-07-31 北京中科奥森数据科技有限公司 A kind of human face in-vivo detection method and device
CN108229325A (en) * 2017-03-16 2018-06-29 北京市商汤科技开发有限公司 Method for detecting human face and system, electronic equipment, program and medium
CN109034102A (en) * 2018-08-14 2018-12-18 腾讯科技(深圳)有限公司 Human face in-vivo detection method, device, equipment and storage medium
CN110705365A (en) * 2019-09-06 2020-01-17 北京达佳互联信息技术有限公司 Human body key point detection method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Dual-station radar-based living body detection and localisation;Chao Yan等;《The Journal of Engineering》;20191231;第7880-7884页 *
神经网络方法在证券市场预测中的应用研究;杨楠 等;《金融经济》;20160930;第63-64页 *

Also Published As

Publication number Publication date
CN112307973A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
WO2021248859A1 (en) Video classification method and apparatus, and device, and computer readable storage medium
US20230086552A1 (en) Image processing method and apparatus, device, storage medium, and computer program product
WO2021196873A1 (en) License plate character recognition method and apparatus, electronic device, and storage medium
WO2021051547A1 (en) Violent behavior detection method and system
CN109284733A (en) A method for monitoring negative behavior of shopping guide based on yolo and multi-task convolutional neural network
CN116503703A (en) Infrared light and visible light image fusion system based on shunt attention transducer
CN110348322A (en) Human face in-vivo detection method and equipment based on multi-feature fusion
CN110633698A (en) Infrared picture identification method, equipment and medium based on loop generation countermeasure network
CN112949507A (en) Face detection method and device, computer equipment and storage medium
CN110222718A (en) The method and device of image procossing
CN111597933A (en) Face recognition method and device
CN117576567B (en) Remote sensing image change detection method using multi-level difference characteristic self-adaptive fusion
CN117275074A (en) Facial expression recognition method based on broad attention and multi-scale fusion mechanism
CN114926876A (en) Image key point detection method and device, computer equipment and storage medium
CN112766176A (en) Training method of lightweight convolutional neural network and face attribute recognition method
CN116092201A (en) A Lightweight Monocular Near-infrared Silent Face Liveness Discrimination Method
CN109002776A (en) Face identification method, system, computer equipment and computer readable storage medium
CN114022748B (en) Target identification method, device, equipment and storage medium
US20220198224A1 (en) Face recognition method, terminal device using the same, and computer readable storage medium
CN112307973B (en) Living body detection method, living body detection system, electronic device, and storage medium
US12051180B2 (en) Method for generating images with high dynamic range during multiple exposures and times of capture, device employing method, and storage medium
CN118691804A (en) Target detection method, electronic device and storage medium
US11507798B2 (en) Object recognition method and apparatus and single step object recognition neural network
CN118470557A (en) Small target detection method and system based on visible light and infrared multi-mode fusion
CN117935365A (en) Driver gesture recognition method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant