CN114758369A - Living body detection model training method, system, equipment and storage medium - Google Patents

Living body detection model training method, system, equipment and storage medium Download PDF

Info

Publication number
CN114758369A
CN114758369A CN202011582603.9A CN202011582603A CN114758369A CN 114758369 A CN114758369 A CN 114758369A CN 202011582603 A CN202011582603 A CN 202011582603A CN 114758369 A CN114758369 A CN 114758369A
Authority
CN
China
Prior art keywords
face frame
training
data
detection model
random
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.)
Pending
Application number
CN202011582603.9A
Other languages
Chinese (zh)
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.)
Shenzhen Guangjian Technology Co Ltd
Original Assignee
Shenzhen Guangjian 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 Shenzhen Guangjian Technology Co Ltd filed Critical Shenzhen Guangjian Technology Co Ltd
Priority to CN202011582603.9A priority Critical patent/CN114758369A/en
Publication of CN114758369A publication Critical patent/CN114758369A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供了一种基于训练数据增广的活体检测模型训练方法、系统、设备及存储介质,包括如下步骤:读取深度数据和对应的RGB图像;对所述RGB图像进行人脸检测生成基准人脸框,根据所述基准人脸框构建随机人脸框;根据所述随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集。根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。本发明中根据对RGB图像进行人脸检测生成基准人脸框生成多个随机人脸框,进而根据随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集,采用该负样本训练集训练3D活体检测模型,能够降低人脸虚检给3D活体检测模型所带来的不稳定性。

Figure 202011582603

The present invention provides a training method, system, device and storage medium for a living body detection model based on training data augmentation, comprising the following steps: reading depth data and corresponding RGB images; performing face detection on the RGB images to generate a benchmark A face frame, a random face frame is constructed according to the reference face frame; a negative sample training set is generated by taking a screenshot of the depth region corresponding to the depth data according to the random face frame. The 3D living body detection model is trained according to the negative sample training set to generate the target 3D living body detection model. In the present invention, a plurality of random face frames are generated by performing face detection on RGB images to generate a reference face frame, and then a screenshot of the depth region corresponding to the depth data is performed according to the random face frame to generate a negative sample training set. The sample training set trains the 3D live detection model, which can reduce the instability caused by the false face detection to the 3D live detection model.

Figure 202011582603

Description

活体检测模型训练方法、系统、设备及存储介质Liveness detection model training method, system, device and storage medium

技术领域technical field

本发明涉及人脸检测,具体地,涉及一种基于训练数据增广的活体检测模型训练方法、系统、设备及存储介质。The present invention relates to face detection, and in particular, to a training method, system, device and storage medium of a living body detection model based on training data augmentation.

背景技术Background technique

人脸检测方法大致可以分为两类:基于2D人脸图像的人脸检测和基于3D人脸图像的人脸检测。其中2D人脸检测是通过2D摄像头平面成像,无法接收物理世界中的第三位信息(尺寸和距离等几何数据),即使算法及软件再先进,在有限的信息接收状态下,安全级别终究不够高,通过照片、视频、化妆、人皮面具等方式可以很容易进行破解,无法满足智能手机安全级别的需求。Face detection methods can be roughly divided into two categories: face detection based on 2D face images and face detection based on 3D face images. Among them, 2D face detection is made by 2D camera plane imaging, which cannot receive the third information in the physical world (geometric data such as size and distance). High, it can be easily cracked through photos, videos, makeup, human skin masks, etc., which cannot meet the requirements of the security level of smartphones.

3D人脸检测则是通过3D摄像头立体成像,能够检测视野内空间每个点位的三维坐标信息,从而使得计算机得到空间的3D数据并能够复原完整的三维世界,并实现各种智能的三维定位。简单的说就是机器获取的信息多了,分析判断的准确性有了极大的提升,人脸检测功能可以分辨出平面图像、视频、化妆、皮面具以及双胞胎等状态,适合金融领域和智能手机等安全级别要求高的应用场景。3D face detection is through 3D camera stereo imaging, which can detect the three-dimensional coordinate information of each point in the field of view, so that the computer can obtain the 3D data of the space and restore the complete three-dimensional world, and realize various intelligent three-dimensional positioning. . To put it simply, the machine obtains more information, and the accuracy of analysis and judgment has been greatly improved. The face detection function can distinguish plane images, videos, makeup, leather masks, and twins. It is suitable for the financial field and smart phones. and other application scenarios with high security level requirements.

由于人脸检测,人脸对齐等技术在RGB图像上的发展日趋成熟,所以3D活体算法的设计过程中通常会借助RGB来进行人脸检测和人脸对齐,然后对齐到深度图上获取人脸,再进行3D人脸活体识别。As the development of face detection, face alignment and other technologies on RGB images is becoming more and more mature, RGB is usually used for face detection and face alignment in the design process of 3D in vivo algorithms, and then aligned to the depth map to obtain the face. , and then perform 3D face living recognition.

由于3D活体算法使用场景的复杂性,在3D活体算法的使用过程中,会出现大量人脸区域的虚检情况,如图1所示。由于人脸区域的虚检,导致进入到3D活体判定算法的区域可能非目标区域外的其他区域,如背景、头部区域、脸部的部分区域等,如图2所示,会给人脸活体判定算法的使用带来不可预知的后果。Due to the complexity of the scene where the 3D in vivo algorithm is used, during the use of the 3D in vivo algorithm, there will be a large number of false detections in the face area, as shown in Figure 1. Due to the false detection of the face area, the area entering the 3D living body determination algorithm may not be other areas outside the target area, such as the background, head area, part of the face, etc. As shown in Figure 2, it will give the face The use of liveness determination algorithms has unpredictable consequences.

发明内容SUMMARY OF THE INVENTION

针对现有技术中的缺陷,本发明的目的是提供一种基于训练数据增广的活体检测模型训练方法、系统、设备及存储介质。In view of the defects in the prior art, the purpose of the present invention is to provide a training method, system, device and storage medium of a living body detection model based on training data augmentation.

根据本发明提供的基于训练数据增广的活体检测模型训练方法,包括如下步骤:The method for training a living body detection model based on training data augmentation provided by the present invention includes the following steps:

步骤S1:读取深度数据和对应的RGB图像;Step S1: read the depth data and the corresponding RGB image;

步骤S2:对所述RGB图像进行人脸检测生成基准人脸框,根据所述基准人脸框构建随机人脸框;Step S2: performing face detection on the RGB image to generate a reference face frame, and constructing a random face frame according to the reference face frame;

步骤S3:根据所述随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集;Step S3: taking a screenshot of the depth region corresponding to the depth data according to the random face frame to generate a negative sample training set;

步骤S4:根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。Step S4: Train the 3D living body detection model according to the negative sample training set to generate a target 3D living body detection model.

优选地,所述目标3D活体检测模型采用神经网络模型训练生成;Preferably, the target 3D living detection model is generated by training a neural network model;

所述神经网络模型包括顺次设置的特征提取层、全连接层、随机丢弃层、分类层以及损失计算层。The neural network model includes a feature extraction layer, a full connection layer, a random drop layer, a classification layer and a loss calculation layer that are set in sequence.

优选地,所述步骤S2包括如下步骤:Preferably, the step S2 includes the following steps:

步骤S201:对所述RGB图像进行人脸检测生成基准人脸框,所述基准人脸框表示为g=(x1,y1,W,H),(x1,y1)为所述基准人脸框的一角点坐标,W为基准人脸框的宽度,H为基准人脸框的高度;Step S201: Perform face detection on the RGB image to generate a reference face frame, where the reference face frame is expressed as g=(x1, y1, W, H), and (x1, y1) is the reference face frame The coordinates of a corner point, W is the width of the reference face frame, and H is the height of the reference face frame;

步骤S202:取所述基准人脸框的宽度和高度中较小值为生成随机人脸框的最大尺寸S;Step S202: take the smaller value of the width and height of the reference face frame as the maximum size S for generating a random face frame;

步骤S203:在[0,W-S)的范围内随机获取一值nx,在[0,H-S)的范围内随机获取一值ny,在所述RGB图像内生成的一组目标人脸框c=(nx,ny,S,S),其中,(nx,ny)为所述目标人脸框的一角点坐标,S为目标人脸框的宽度和高度;Step S203: randomly obtain a value nx in the range of [0, W-S), randomly obtain a value ny in the range of [0, H-S), a group of target face frames generated in the RGB image c=( nx,ny,S,S), wherein, (nx,ny) is the corner coordinate of the target face frame, and S is the width and height of the target face frame;

步骤S204:判断所述目标人脸框与所述基准人脸框之间的交并比是否小于预设置的交并比阈值,且当所述目标人脸框与所述基准人脸框之间的交并比小于预设置的交并比阈值时确定所述目标人脸框为随机人脸框。Step S204: Determine whether the intersection ratio between the target face frame and the reference face frame is less than a preset intersection ratio threshold, and when the intersection ratio between the target face frame and the reference face frame is The target face frame is determined to be a random face frame when the intersection ratio is less than a preset intersection ratio threshold.

优选地,所述步骤S3包括如下步骤:Preferably, the step S3 includes the following steps:

步骤S301:根据所述随机人脸框对所述深度数据对应的深度区域进行截取生成2D深度数据;Step S301: According to the random face frame, the depth region corresponding to the depth data is intercepted to generate 2D depth data;

步骤S302:获取预设置的关键点信息;Step S302: obtaining preset key point information;

步骤S303:将关键点信息对应到所述2D深度数据中,并进而归一化处理生成所述负样本训练集。Step S303: Corresponding the key point information to the 2D depth data, and then performing normalization processing to generate the negative sample training set.

优选地,还包括如下步骤:Preferably, it also includes the following steps:

-步骤S4:根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。- Step S4 : training the 3D living body detection model according to the negative sample training set to generate the target 3D living body detection model.

优选地,所述步骤S4包括如下步骤:Preferably, the step S4 includes the following steps:

步骤S401:对所述RGB图像进行关键点检测,在所述基准人脸框内确定的多个人脸关键点;Step S401: perform key point detection on the RGB image, and determine a plurality of face key points in the reference face frame;

步骤S402:将所述RGB图像中的人脸关键点映射到归一化处理至预设定的尺寸的深度数据中生成正样本训练集;Step S402: Map the face key points in the RGB image to the depth data normalized to a preset size to generate a positive sample training set;

步骤S403:根据所述负样本训练集和所述正样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。Step S403: Train a 3D living body detection model according to the negative sample training set and the positive sample training set to generate a target 3D living body detection model.

优选地,所述步骤S204包括如下步骤:Preferably, the step S204 includes the following steps:

步骤S2041:获取一目标人脸框;Step S2041: obtaining a target face frame;

步骤S2042:获取预设置的交并比阈值,判断所述目标人脸框与所述基准人脸框之间的交并比是否小于预设置的交并比阈值,当所述目标人脸框与所述基准人脸框之间的交并比小于等于预设置的交并比阈值时触发步骤S2043,当所述目标人脸框与所述基准人脸框之间的交并比大于预设置的交并比阈值时则触发步骤S2041;Step S2042: Obtain a preset intersection ratio threshold, determine whether the intersection ratio between the target face frame and the reference face frame is less than the preset intersection ratio threshold, when the target face frame and Step S2043 is triggered when the intersection ratio between the reference face frames is less than or equal to the preset intersection ratio threshold, and when the intersection ratio between the target face frame and the reference face frame is greater than the preset intersection ratio Step S2041 is triggered when the cross-union ratio is the threshold;

步骤S2043:确定所述目标人脸框为随机人脸框。Step S2043: Determine that the target face frame is a random face frame.

优选地,所述步骤S301包括如下步骤:Preferably, the step S301 includes the following steps:

步骤S3011:根据一所述随机人脸框确定所述深度数据对应的深度区域数据;Step S3011: Determine the depth region data corresponding to the depth data according to a random face frame;

步骤S3012:判断所述深度区域数据中在深度方向上是否存在零值数据,当存在所述零值数据且所述零值数据的数量与深度区域数据总数据的比值大于预设置的比例阈值时,则丢弃所述随机人脸框并返回步骤S3011,否则触发步骤S3013;Step S3012: judging whether there is zero-valued data in the depth direction in the depth area data, when the zero-valued data exists and the ratio of the number of the zero-valued data to the total data of the depth area data is greater than a preset proportional threshold , then discard the random face frame and return to step S3011, otherwise trigger step S3013;

步骤S3013:根据该随机人脸框对所述深度数据对应的深度区域进行截取生成2D深度数据。Step S3013: Intercept the depth region corresponding to the depth data according to the random face frame to generate 2D depth data.

根据本发明提供的基于训练数据增广的活体检测模型训练系统,包括如下模块:The training system for living detection model based on training data augmentation provided by the present invention includes the following modules:

数据读取模块,用于读取深度数据和对应的RGB图像;Data reading module, used to read depth data and corresponding RGB images;

随机人脸框生成模块,用于对所述RGB图像进行人脸检测生成基准人脸框,根据所述基准人脸框构建随机人脸框;a random face frame generation module, for performing face detection on the RGB image to generate a reference face frame, and constructing a random face frame according to the reference face frame;

训练集生成模块,用于根据所述随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集;A training set generation module is used to generate a negative sample training set by taking a screenshot of the depth region corresponding to the depth data according to the random face frame;

模型训练模块,用于根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。The model training module is used for training the 3D living body detection model according to the negative sample training set to generate the target 3D living body detection model.

根据本发明提供的基于训练数据增广的活体检测模型训练设备,包括:The live detection model training device based on training data augmentation provided according to the present invention includes:

处理器;processor;

存储器,其中存储有所述处理器的可执行指令;a memory in which executable instructions for the processor are stored;

其中,所述处理器配置为经由执行所述可执行指令来执行所述基于训练数据增广的活体检测模型训练方法的步骤。Wherein, the processor is configured to execute the steps of the method for training a living body detection model based on training data augmentation by executing the executable instructions.

根据本发明提供的计算机可读存储介质,用于存储程序,所述程序被执行时实现所述基于训练数据增广的活体检测模型训练方法的步骤。The computer-readable storage medium provided according to the present invention is used for storing a program, and when the program is executed, the steps of the method for training a living body detection model based on training data augmentation are implemented.

与现有技术相比,本发明具有如下的有益效果:Compared with the prior art, the present invention has the following beneficial effects:

本发明中根据对RGB图像进行人脸检测生成基准人脸框生成多个随机人脸框,进而根据随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集,采用该负样本训练集训练3D活体检测模型,能够降低人脸虚检给3D活体检测模型所带来的不稳定性。In the present invention, a plurality of random face frames are generated by performing face detection on RGB images to generate a reference face frame, and then a negative sample training set is generated by taking a screenshot of the depth region corresponding to the depth data according to the random face frame. The sample training set trains the 3D live detection model, which can reduce the instability caused by the false face detection to the 3D live detection model.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。通过阅读参照以下附图对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without creative work. Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments with reference to the following drawings:

图1为现有技术中人脸检测时人脸区域虚检的示意图;Fig. 1 is the schematic diagram of the false detection of human face area during human face detection in the prior art;

图2为现有技术中人脸区域虚检对3D活体检测模型训练影响的示意图;Fig. 2 is a schematic diagram of the influence of false detection of face region on the training of 3D living body detection model in the prior art;

图3为本发明实施例中基于训练数据增广的活体检测模型训练方法的步骤流程图;3 is a flowchart of steps of a training method for a living body detection model based on training data augmentation in an embodiment of the present invention;

图4为本发明实施例中根据所述基准人脸框构建随机人脸框的步骤流程图4 is a flow chart of steps for constructing a random face frame according to the reference face frame in an embodiment of the present invention

图5为本发明实施例中生成负样本训练集的步骤流程图;5 is a flowchart of steps for generating a negative sample training set in an embodiment of the present invention;

图6(a)为本发明实施例中活体检测模型训练阶段的结构示意图;6(a) is a schematic structural diagram of a training stage of a living body detection model according to an embodiment of the present invention;

图6(b)为本发明实施例中活体检测模型推理阶段的结构示意图;FIG. 6(b) is a schematic structural diagram of the inference stage of the in vivo detection model in the embodiment of the present invention;

图7为本发明实施例中生成目标3D活体检测模型的步骤流程图;7 is a flowchart of steps for generating a target 3D living detection model in an embodiment of the present invention;

图8为本发明实施例中确定随机人脸框的步骤流程图;8 is a flowchart of steps for determining a random face frame in an embodiment of the present invention;

图9为本发明实施例中生成2D深度数据的步骤流程图;9 is a flowchart of steps for generating 2D depth data in an embodiment of the present invention;

图10为本发明实施例中深度图像中随机人脸框的示意图;10 is a schematic diagram of a random face frame in a depth image according to an embodiment of the present invention;

图11为本发明实施例中离线增广方法的步骤流程图;11 is a flowchart of steps of an offline augmentation method in an embodiment of the present invention;

图12为本发明实施例中在线增广方法的步骤流程图;12 is a flowchart of steps of an online augmentation method in an embodiment of the present invention;

图13为本发明实施例中基于训练数据增广的活体检测模型训练系统的模块示意图;13 is a schematic diagram of a module of a training system based on training data augmentation for a living body detection model training system according to an embodiment of the present invention;

图14为本发明实施例中基于训练数据增广的活体检测模型训练设备的结构示意图;以及14 is a schematic structural diagram of an apparatus for training a living body detection model based on training data augmentation according to an embodiment of the present invention; and

图15为本发明实施例中计算机可读存储介质的结构示意图。FIG. 15 is a schematic structural diagram of a computer-readable storage medium in an embodiment of the present invention.

具体实施方式Detailed ways

下面结合具体实施例对本发明进行详细说明。以下实施例将有助于本领域的技术人员进一步理解本发明,但不以任何形式限制本发明。应当指出的是,对本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进。这些都属于本发明的保护范围。The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例,例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances so that the embodiments of the invention described herein can, for example, be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。The technical solutions of the present invention will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

本发明提供的基于训练数据增广的活体检测模型训练方法,旨在解决现有技术中存在的问题。The method for training a living body detection model based on training data augmentation provided by the present invention aims to solve the problems existing in the prior art.

下面以具体地实施例对本发明的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本发明的实施例进行描述。The technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.

图3为本发明实施例中基于训练数据增广的活体检测模型训练方法的步骤流程图,如图3所示,本发明提供的基于训练数据增广的活体检测模型训练方法,包括如下步骤:3 is a flowchart of steps of a training method for a living body detection model based on training data augmentation in an embodiment of the present invention. As shown in FIG. 3 , the training method for a living body detection model based on training data augmentation provided by the present invention includes the following steps:

步骤S1:读取深度数据和对应的RGB图像;Step S1: read the depth data and the corresponding RGB image;

在本发明实施例中,所述深度数据与所述RGB图像像素级对齐。In an embodiment of the present invention, the depth data is aligned at the pixel level of the RGB image.

步骤S2:对所述RGB图像进行人脸检测生成基准人脸框,根据所述基准人脸框构建随机人脸框;Step S2: performing face detection on the RGB image to generate a reference face frame, and constructing a random face frame according to the reference face frame;

图4为本发明实施例中根据所述基准人脸框构建随机人脸框的步骤流程图,如图4所示,所述步骤S2包括如下步骤:4 is a flowchart of steps for constructing a random face frame according to the reference face frame in an embodiment of the present invention. As shown in FIG. 4 , the step S2 includes the following steps:

步骤S201:对所述RGB图像进行人脸检测生成基准人脸框,所述基准人脸框表示为g=(x1,y1,W,H),(x1,y1)为所述基准人脸框的一角点坐标,W为基准人脸框的宽度,H为基准人脸框的高度;Step S201: Perform face detection on the RGB image to generate a reference face frame, where the reference face frame is expressed as g=(x1, y1, W, H), and (x1, y1) is the reference face frame The coordinates of a corner point, W is the width of the reference face frame, and H is the height of the reference face frame;

在本发明实施例中,所述(x1,y1)为所述基准人脸框的上角点坐标。In the embodiment of the present invention, the (x1, y1) is the coordinates of the upper corner of the reference face frame.

步骤S202:取所述基准人脸框的宽度和高度中较小值为生成随机人脸框的最大尺寸S;Step S202: take the smaller value of the width and height of the reference face frame as the maximum size S for generating a random face frame;

步骤S203:在[0,W-S)的范围内随机获取一值nx,在[0,H-S)的范围内随机获取一值ny,在所述RGB图像内生成的一组目标人脸框c=(nx,ny,S,S),其中,(nx,ny)为所述目标人脸框的一角点坐标,S为目标人脸框的宽度和高度;Step S203: randomly obtain a value nx in the range of [0, W-S), randomly obtain a value ny in the range of [0, H-S), a group of target face frames generated in the RGB image c=( nx,ny,S,S), wherein, (nx,ny) is the corner coordinate of the target face frame, and S is the width and height of the target face frame;

步骤S204:判断所述目标人脸框与所述基准人脸框之间的交并比是否小于预设置的交并比阈值,且当所述目标人脸框与所述基准人脸框之间的交并比小于预设置的交并比阈值时确定所述目标人脸框为随机人脸框。Step S204: Determine whether the intersection ratio between the target face frame and the reference face frame is less than a preset intersection ratio threshold, and when the intersection ratio between the target face frame and the reference face frame is The target face frame is determined to be a random face frame when the intersection ratio is less than a preset intersection ratio threshold.

在本发明实施例中,所述交并比(Intersection over Union,IoU)为:(W1∩W2)/(W1+W2-W1∩W2),W1可以为目标人脸框,W2可以为基准人脸框。在本发明实施例中,所述预设置的交并比阈值为0.2至0.4之间的任意数值,优选为0.3。In the embodiment of the present invention, the Intersection over Union (IoU) is: (W1∩W2)/(W1+W2-W1∩W2), W1 may be the target face frame, and W2 may be the reference person face frame. In this embodiment of the present invention, the preset intersection ratio threshold is any value between 0.2 and 0.4, preferably 0.3.

在本发明实施例中,基于标准人脸框生成10个左右的随机人脸框。In the embodiment of the present invention, about 10 random face frames are generated based on the standard face frame.

步骤S3:根据所述随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集。Step S3: taking a screenshot of the depth region corresponding to the depth data according to the random face frame to generate a negative sample training set.

图5为本发明实施例中生成负样本训练集的步骤流程图,如图5所示,所述步骤S3包括如下步骤:FIG. 5 is a flowchart of steps for generating a negative sample training set in an embodiment of the present invention. As shown in FIG. 5 , the step S3 includes the following steps:

步骤S301:根据所述随机人脸框对所述深度数据对应的深度区域进行截取生成2D深度数据;Step S301: According to the random face frame, the depth region corresponding to the depth data is intercepted to generate 2D depth data;

步骤S302:获取预设置的关键点信息;Step S302: obtaining preset key point information;

步骤S303:将关键点信息对应到所述2D深度数据中,并进而归一化处理生成所述负样本训练集。Step S303: Corresponding the key point information to the 2D depth data, and then performing normalization processing to generate the negative sample training set.

在本发明实施例中,所述归一化后的统一尺寸为宽180个像素,高220个像素。预设置的关键点信息可以根据人脸特点进行设置,如取四个位置(70.5,116.5)、(109.5,116.5)、(90.5,137.5)、(90,159)分别作为左眼,右眼,鼻子,嘴巴的位置,进行预设置关键点。In the embodiment of the present invention, the normalized uniform size is 180 pixels wide and 220 pixels high. The preset key point information can be set according to the characteristics of the face, such as taking four positions (70.5, 116.5), (109.5, 116.5), (90.5, 137.5), (90, 159) as the left eye, right eye, The position of the nose, mouth, and pre-set key points.

步骤S4:根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。Step S4: Train the 3D living body detection model according to the negative sample training set to generate a target 3D living body detection model.

图6(a)为本发明实施例中活体检测模型训练阶段的结构示意图,图6(b)为本发明实施例中活体检测模型推理阶段的结构示意图,如图6(a)、图6(b)所示,在本发明实施例中,所述目标3D活体检测模型采用神经网络模型训练生成,所述神经网络模型包括顺次设置的特征提取层、全连接层、随机丢弃层、分类层以及损失计算层。Fig. 6(a) is a schematic structural diagram of the training stage of the living body detection model in the embodiment of the present invention, and Fig. 6(b) is a schematic structural diagram of the inference stage of the living body detection model according to the embodiment of the present invention, as shown in Figs. 6(a) and 6( b), in the embodiment of the present invention, the target 3D living body detection model is generated by training a neural network model, and the neural network model includes a feature extraction layer, a fully connected layer, a random discarding layer, and a classification layer that are set in sequence. and the loss computation layer.

图7为本发明实施例中生成目标3D活体检测模型的步骤流程图,如图7所示,所述步骤S4包括如下步骤:FIG. 7 is a flowchart of steps for generating a target 3D live detection model in an embodiment of the present invention. As shown in FIG. 7 , the step S4 includes the following steps:

步骤S401:对所述RGB图像进行关键点检测,在所述基准人脸框内确定的多个人脸关键点;Step S401: perform key point detection on the RGB image, and determine a plurality of face key points in the reference face frame;

步骤S402:将所述RGB图像中的人脸关键点映射到归一化处理至预设定的尺寸的深度数据中生成正样本训练集;Step S402: Map the face key points in the RGB image to the depth data normalized to a preset size to generate a positive sample training set;

步骤S403:根据所述负样本训练集和所述正样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。Step S403: Train a 3D living body detection model according to the negative sample training set and the positive sample training set to generate a target 3D living body detection model.

图8为本发明实施例中确定随机人脸框的步骤流程图,如图8所示,所述步骤S204包括如下步骤:FIG. 8 is a flowchart of steps for determining a random face frame in an embodiment of the present invention. As shown in FIG. 8 , the step S204 includes the following steps:

步骤S2041:获取一目标人脸框;Step S2041: obtaining a target face frame;

步骤S2042:获取预设置的交并比阈值,判断所述目标人脸框与所述基准人脸框之间的交并比是否小于预设置的交并比阈值,当所述目标人脸框与所述基准人脸框之间的交并比小于等于预设置的交并比阈值时触发步骤S2043,当所述目标人脸框与所述基准人脸框之间的交并比大于预设置的交并比阈值时则触发步骤S2041;Step S2042: Obtain a preset intersection ratio threshold, determine whether the intersection ratio between the target face frame and the reference face frame is less than the preset intersection ratio threshold, when the target face frame and Step S2043 is triggered when the intersection ratio between the reference face frames is less than or equal to the preset intersection ratio threshold, and when the intersection ratio between the target face frame and the reference face frame is greater than the preset intersection ratio Step S2041 is triggered when the cross-union ratio is the threshold;

步骤S2043:确定所述目标人脸框为随机人脸框。Step S2043: Determine that the target face frame is a random face frame.

图10为本发明实施例中深度图像中随机人脸框的示意图,如图10所示,可以看到根据基准人脸框生成的随机人脸框。FIG. 10 is a schematic diagram of a random face frame in a depth image according to an embodiment of the present invention. As shown in FIG. 10 , a random face frame generated according to a reference face frame can be seen.

图9为本发明实施例中生成2D深度数据的步骤流程图,如图9所示,所述步骤S301包括如下步骤:FIG. 9 is a flowchart of steps for generating 2D depth data in an embodiment of the present invention. As shown in FIG. 9 , the step S301 includes the following steps:

步骤S3011:根据一所述随机人脸框确定所述深度数据对应的深度区域数据;Step S3011: Determine the depth region data corresponding to the depth data according to a random face frame;

步骤S3012:判断所述深度区域数据中在深度方向上是否存在零值数据,当存在所述零值数据且所述零值数据的数量与深度区域数据总数据的比值大于预设置的比例阈值时,则丢弃所述随机人脸框并返回步骤S3011,否则触发步骤S3013;Step S3012: judging whether there is zero-valued data in the depth direction in the depth area data, when the zero-valued data exists and the ratio of the number of the zero-valued data to the total data of the depth area data is greater than a preset proportional threshold , then discard the random face frame and return to step S3011, otherwise trigger step S3013;

步骤S3013:根据该随机人脸框对所述深度数据对应的深度区域进行截取生成2D深度数据。Step S3013: Intercept the depth region corresponding to the depth data according to the random face frame to generate 2D depth data.

在本发明实施例中,所述预设置的比例阈值为20%至40%,优选为30%。In this embodiment of the present invention, the preset ratio threshold is 20% to 40%, preferably 30%.

图11为本发明实施例中离线增广方法的步骤流程图,如图11所示,如图11所示,在离线增广的过程中,会基于训练集中每一深度数据对应的RGB图像进行单独的增广生成2D深度数据,将增广得到的负样本加入到训练列表和训练的数据集中,就可以得到构成一个新的负样本训练集,基于这个新的更大的训练集进行训练,就可以得到抗虚检鲁棒性更强的算法。FIG. 11 is a flow chart of steps of an offline augmentation method in an embodiment of the present invention. As shown in FIG. 11 , as shown in FIG. 11 , in the process of offline augmentation, the process is performed based on the RGB image corresponding to each depth data in the training set. A separate augmentation generates 2D depth data, and the augmented negative samples are added to the training list and the training data set, and a new negative sample training set can be obtained. Based on this new larger training set, training is performed. A more robust algorithm against false detection can be obtained.

图12为本发明实施例中在线增广方法的步骤流程图,如图12所示,如图12所示,在线增广模式是在训练的过程中实时的进行数据的增广,不需要额外的花费内存去对增广的样本进行存储,在线增广模式下,需要有一个随机控制开光,该随机控制开光按照一定的概率随机的开启和关闭。当随机开关打开时,第一通路和第二通路同时接通,基于预存储的深度数据可以同时产生基于真人活体的正样本和增广的假体样本;当随机开关关闭时,只有第二通路打开,训练过程中不进行负样本的数据增广,仅采用真人活体的深度数据只作为正样本参与训练。FIG. 12 is a flowchart of steps of an online augmentation method in an embodiment of the present invention. As shown in FIG. 12 , as shown in FIG. 12 , the online augmentation mode is to perform data augmentation in real time during the training process, and no additional The memory is spent to store the augmented samples. In the online augmentation mode, a random control switch is required, and the random control switch is turned on and off randomly according to a certain probability. When the random switch is turned on, the first channel and the second channel are turned on at the same time, and based on the pre-stored depth data, the positive samples and augmented prosthesis samples based on the real life can be generated simultaneously; when the random switch is off, only the second channel is Open, data augmentation of negative samples is not performed during the training process, and only the depth data of real people is used to participate in training as positive samples.

图13为本发明实施例中基于训练数据增广的活体检测模型训练系统的模块示意图,如图13所示,本发明提供的基于训练数据增广的活体检测模型训练系统,包括如下模块:13 is a schematic diagram of a module of a training system for a living body detection model based on training data augmentation in an embodiment of the present invention. As shown in FIG. 13 , the living body detection model training system based on training data augmentation provided by the present invention includes the following modules:

数据读取模块,用于读取深度数据和对应的RGB图像;Data reading module, used to read depth data and corresponding RGB images;

随机人脸框生成模块,用于对所述RGB图像进行人脸检测生成基准人脸框,根据所述基准人脸框构建随机人脸框;a random face frame generation module, for performing face detection on the RGB image to generate a reference face frame, and constructing a random face frame according to the reference face frame;

训练集生成模块,用于根据所述随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集。A training set generation module is configured to take a screenshot of the depth region corresponding to the depth data according to the random face frame to generate a negative sample training set.

模型训练模块,用于根据所述负样本训练集对3D活体检测模型进行训练生成目标3D活体检测模型。The model training module is used for training the 3D living body detection model according to the negative sample training set to generate the target 3D living body detection model.

本发明实施例中还提供一种基于训练数据增广的活体检测模型训练设备,包括处理器。存储器,其中存储有处理器的可执行指令。其中,处理器配置为经由执行可执行指令来执行的基于训练数据增广的活体检测模型训练方法的步骤。An embodiment of the present invention further provides a training device for training a living body detection model based on training data augmentation, including a processor. A memory in which executable instructions for the processor are stored. Wherein, the processor is configured to execute the steps of the training method for training a living body detection model based on training data augmentation by executing the executable instructions.

如上,该实施例能够根据对RGB图像进行人脸检测生成基准人脸框生成多个随机人脸框,进而根据随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集,采用该负样本训练集训练3D活体检测模型,能够降低人脸虚检给3D活体检测模型所带来的不稳定性。As above, in this embodiment, a plurality of random face frames can be generated by performing face detection on an RGB image to generate a reference face frame, and then a negative sample training set can be generated by taking a screenshot of the depth region corresponding to the depth data according to the random face frame, Using the negative sample training set to train the 3D live detection model can reduce the instability caused by the false face detection to the 3D live detection model.

所属技术领域的技术人员能够理解,本发明的各个方面可以实现为系统、方法或程序产品。因此,本发明的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“平台”。As will be appreciated by one skilled in the art, various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention can be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "Circuit", "Module" or "Platform".

图14是本发明实施例中的基于训练数据增广的活体检测模型训练设备的结构示意图。下面参照图14来描述根据本发明的这种实施方式的电子设备600。图14显示的电子设备600仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 14 is a schematic structural diagram of an apparatus for training a living body detection model based on training data augmentation in an embodiment of the present invention. The electronic device 600 according to this embodiment of the present invention is described below with reference to FIG. 14 . The electronic device 600 shown in FIG. 14 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present invention.

如图14所示,电子设备600以通用计算设备的形式表现。电子设备600的组件可以包括但不限于:至少一个处理单元610、至少一个存储单元620、连接不同平台组件(包括存储单元620和处理单元610)的总线630、显示单元640等。As shown in FIG. 14, electronic device 600 takes the form of a general-purpose computing device. Components of the electronic device 600 may include, but are not limited to, at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, and the like.

其中,存储单元存储有程序代码,程序代码可以被处理单元610执行,使得处理单元610执行本说明书上述基于训练数据增广的活体检测模型训练方法部分中描述的根据本发明各种示例性实施方式的步骤。例如,处理单元610可以执行如图1中所示的步骤。Wherein, the storage unit stores program codes, and the program codes can be executed by the processing unit 610, so that the processing unit 610 executes the various exemplary embodiments of the present invention described in the above-mentioned section of the training method for training a living body detection model based on training data augmentation. A step of. For example, the processing unit 610 may perform the steps shown in FIG. 1 .

存储单元620可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)6201和/或高速缓存存储单元6202,还可以进一步包括只读存储单元(ROM)6203。The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and/or a cache storage unit 6202 , and may further include a read only storage unit (ROM) 6203 .

存储单元620还可以包括具有一组(至少一个)程序模块6205的程序/实用工具6204,这样的程序模块6205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, An implementation of a network environment may be included in each or some combination of these examples.

总线630可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。The bus 630 may be representative of one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any of a variety of bus structures. bus.

电子设备600也可以与一个或多个外部设备700(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备600交互的设备通信,和/或与使得该电子设备600能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口650进行。并且,电子设备600还可以通过网络适配器660与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器660可以通过总线630与电子设备600的其它模块通信。应当明白,尽管图14中未示出,可以结合电子设备600使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储平台等。The electronic device 600 may also communicate with one or more external devices 700 (eg, keyboards, pointing devices, Bluetooth devices, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with Any device (eg, router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 650 . Also, the electronic device 600 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 660 . Network adapter 660 may communicate with other modules of electronic device 600 through bus 630 . It should be appreciated that, although not shown in FIG. 14, other hardware and/or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tapes drives and data backup storage platforms, etc.

本发明实施例中还提供一种计算机可读存储介质,用于存储程序,程序被执行时实现的基于训练数据增广的活体检测模型训练方法的步骤。在一些可能的实施方式中,本发明的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本说明书上述基于训练数据增广的活体检测模型训练方法部分中描述的根据本发明各种示例性实施方式的步骤。Embodiments of the present invention further provide a computer-readable storage medium for storing a program, and the steps of a training method for training a living body detection model based on training data augmentation are implemented when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes program code, when the program product runs on a terminal device, the program code is used to cause the terminal device to execute the above-mentioned description in this specification. The steps according to the various exemplary embodiments of the present invention are described in the section of training method for in vivo detection model augmentation based on training data.

如上所示,该实施例的计算机可读存储介质的程序在执行时,本发明中根据对RGB图像进行人脸检测生成基准人脸框生成多个随机人脸框,进而根据随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集,采用该负样本训练集训练3D活体检测模型,能够降低人脸虚检给3D活体检测模型所带来的不稳定性。As shown above, when the program of the computer-readable storage medium of this embodiment is executed, in the present invention, a plurality of random face frames are generated according to the face detection on the RGB image and the reference face frame is generated, and then according to the random face frame, a plurality of random face frames are generated. Taking a screenshot of the depth region corresponding to the depth data to generate a negative sample training set, and using the negative sample training set to train a 3D living body detection model can reduce the instability brought by false face detection to the 3D living body detection model.

图15是本发明实施例中的计算机可读存储介质的结构示意图。参考图15所示,描述了根据本发明的实施方式的用于实现上述方法的程序产品800,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。FIG. 15 is a schematic structural diagram of a computer-readable storage medium in an embodiment of the present invention. Referring to FIG. 15, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read only memory (CD-ROM) and include program codes, and can be stored in a terminal device, For example running on a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读存储介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。A computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable storage medium can also be any readable medium other than a readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming Language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (eg, using an Internet service provider business via an Internet connection).

本发明实施例中,根据对RGB图像进行人脸检测生成基准人脸框生成多个随机人脸框,进而根据随机人脸框对所述深度数据对应的深度区域进行截图生成负样本训练集,采用该负样本训练集训练3D活体检测模型,能够降低人脸虚检给3D活体检测模型所带来的不稳定性。In the embodiment of the present invention, a plurality of random face frames are generated according to face detection on an RGB image to generate a reference face frame, and then a negative sample training set is generated by taking a screenshot of the depth region corresponding to the depth data according to the random face frame, Using the negative sample training set to train the 3D living body detection model can reduce the instability brought by the false face detection to the 3D living body detection model.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. The above description of the disclosed embodiments enables any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

以上对本发明的具体实施例进行了描述。需要理解的是,本发明并不局限于上述特定实施方式,本领域技术人员可以在权利要求的范围内做出各种变形或修改,这并不影响本发明的实质内容。The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above-mentioned specific embodiments, and those skilled in the art can make various variations or modifications within the scope of the claims, which do not affect the essential content of the present invention.

Claims (10)

1. A living body detection model training method based on training data augmentation is characterized by comprising the following steps:
step S1: reading depth data and a corresponding RGB image;
step S2: performing face detection on the RGB image to generate a reference face frame, and constructing a random face frame according to the reference face frame;
step S3: screenshot is carried out on a depth area corresponding to the depth data according to the random face frame to generate a negative sample training set;
step S4: and training the 3D in-vivo detection model according to the negative sample training set to generate a target 3D in-vivo detection model.
2. The training data augmentation-based in vivo detection model training method according to claim 1, wherein the target 3D in vivo detection model is generated by adopting neural network model training;
the neural network model comprises a feature extraction layer, a full connection layer, a random discarding layer, a classification layer and a loss calculation layer which are sequentially arranged.
3. The training method for the living body test model augmented based on the training data as claimed in claim 1, wherein the step S2 comprises the steps of:
step S201: performing face detection on the RGB image to generate a reference face frame, wherein g is (x1, y1, W, H), (x1, y1) is an angular point coordinate of the reference face frame, W is the width of the reference face frame, and H is the height of the reference face frame;
step S202: taking the smaller value of the width and the height of the reference face frame as the maximum size S of the generated random face frame;
step S203: randomly acquiring a value nx in a range of [0, W-S), randomly acquiring a value ny in a range of [0, H-S), and generating a set of target face frames c ═ n (nx, ny, S) in the RGB image, wherein (nx, ny) is an angular point coordinate of the target face frame, and S is a width and a height of the target face frame;
step S204: and judging whether the intersection ratio between the target face frame and the reference face frame is smaller than a preset intersection ratio threshold value or not, and determining that the target face frame is a random face frame when the intersection ratio between the target face frame and the reference face frame is smaller than the preset intersection ratio threshold value.
4. The training method for the living body test model augmented based on the training data as claimed in claim 1, wherein the step S3 comprises the steps of:
step S301: intercepting a depth area corresponding to the depth data according to the random face frame to generate 2D depth data;
step S302: acquiring preset key point information;
step S303: and corresponding the key point information to the 2D depth data, and further performing normalization processing to generate the negative sample training set.
5. The training method for living body detection model based on training data augmentation of claim 1, wherein the step S4 comprises the steps of:
step S401: performing key point detection on the RGB image, and determining a plurality of face key points in the reference face frame;
step S402: mapping the key points of the human face in the RGB image to depth data normalized to a preset size to generate a positive sample training set;
step S403: and training the 3D in-vivo detection model according to the negative sample training set and the positive sample training set to generate a target 3D in-vivo detection model.
6. The method for training the living body detection model based on the training data augmentation of claim 2, wherein the step S204 comprises the steps of:
step S2041: acquiring a target face frame;
step S2042: acquiring a preset intersection ratio threshold, judging whether the intersection ratio between the target face frame and the reference face frame is smaller than the preset intersection ratio threshold, triggering a step S2043 when the intersection ratio between the target face frame and the reference face frame is smaller than or equal to the preset intersection ratio threshold, and triggering a step S2041 when the intersection ratio between the target face frame and the reference face frame is larger than the preset intersection ratio threshold;
step S2043: and determining the target face frame as a random face frame.
7. The method for training a living body test model based on training data augmentation of claim 3, wherein the step S301 comprises the steps of:
step S3011: determining depth area data corresponding to the depth data according to the random face frame;
step S3012: judging whether zero-value data exist in the depth region data in the depth direction, when the zero-value data exist and the ratio of the number of the zero-value data to the total data of the depth region data is larger than a preset proportional threshold, discarding the random face frame and returning to the step S3011, otherwise, triggering the step S3013;
step S3013: and intercepting a depth area corresponding to the depth data according to the random face frame to generate 2D depth data.
8. A living body detection model training system based on training data augmentation is characterized by comprising the following modules:
the data reading module is used for reading the depth data and the corresponding RGB image;
the random face frame generating module is used for carrying out face detection on the RGB image to generate a reference face frame and constructing a random face frame according to the reference face frame;
the training set generation module is used for carrying out screenshot on a depth area corresponding to the depth data according to the random face box to generate a negative sample training set;
and the model training module is used for training the 3D in-vivo detection model according to the negative sample training set to generate a target 3D in-vivo detection model.
9. A live body test model training apparatus based on training data augmentation, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the training method for a living body detection model augmented based on training data of any one of claims 1 to 7 via execution of the executable instructions.
10. A computer-readable storage medium storing a program which, when executed, implements the steps of the training method for a living body test model augmented based on training data of any one of claims 1 to 7.
CN202011582603.9A 2020-12-28 2020-12-28 Living body detection model training method, system, equipment and storage medium Pending CN114758369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011582603.9A CN114758369A (en) 2020-12-28 2020-12-28 Living body detection model training method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011582603.9A CN114758369A (en) 2020-12-28 2020-12-28 Living body detection model training method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114758369A true CN114758369A (en) 2022-07-15

Family

ID=82324618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011582603.9A Pending CN114758369A (en) 2020-12-28 2020-12-28 Living body detection model training method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114758369A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107871102A (en) * 2016-09-23 2018-04-03 北京眼神科技有限公司 A kind of method for detecting human face and device
CN109684925A (en) * 2018-11-21 2019-04-26 深圳奥比中光科技有限公司 A kind of human face in-vivo detection method and equipment based on depth image
CN109886341A (en) * 2019-02-25 2019-06-14 厦门美图之家科技有限公司 A kind of trained method for generating Face datection model
CN111597918A (en) * 2020-04-26 2020-08-28 北京金山云网络技术有限公司 Training and detecting method and device of human face living body detection model and electronic equipment
CN112116602A (en) * 2020-08-31 2020-12-22 北京的卢深视科技有限公司 Depth map repairing method and device and readable storage medium
CN114758370A (en) * 2020-12-28 2022-07-15 深圳市光鉴科技有限公司 Training data augmentation method, system, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107871102A (en) * 2016-09-23 2018-04-03 北京眼神科技有限公司 A kind of method for detecting human face and device
CN109684925A (en) * 2018-11-21 2019-04-26 深圳奥比中光科技有限公司 A kind of human face in-vivo detection method and equipment based on depth image
CN109886341A (en) * 2019-02-25 2019-06-14 厦门美图之家科技有限公司 A kind of trained method for generating Face datection model
CN111597918A (en) * 2020-04-26 2020-08-28 北京金山云网络技术有限公司 Training and detecting method and device of human face living body detection model and electronic equipment
CN112116602A (en) * 2020-08-31 2020-12-22 北京的卢深视科技有限公司 Depth map repairing method and device and readable storage medium
CN114758370A (en) * 2020-12-28 2022-07-15 深圳市光鉴科技有限公司 Training data augmentation method, system, device and storage medium

Similar Documents

Publication Publication Date Title
US20220147822A1 (en) Training method and apparatus for target detection model, device and storage medium
US11734954B2 (en) Face recognition method, device and electronic equipment, and computer non-volatile readable storage medium
JP2022133378A (en) Face biological detection method, device, electronic apparatus, and storage medium
CN113361363B (en) Training method, device, equipment and storage medium for face image recognition model
EP4033458A2 (en) Method and apparatus of face anti-spoofing, device, storage medium, and computer program product
CN113221767B (en) Method for training living body face recognition model and recognizing living body face and related device
WO2019169884A1 (en) Image saliency detection method and device based on depth information
CN112149615B (en) Face living body detection method, device, medium and electronic equipment
CN108764176A (en) A kind of action sequence recognition methods, system and equipment and storage medium
WO2022227765A1 (en) Method for generating image inpainting model, and device, medium and program product
CN112183356A (en) Driving behavior detection method, device and readable storage medium
CN114779932A (en) User gesture recognition method, system, device and storage medium
WO2024077971A1 (en) Liveness detection method and apparatus
CN114758370A (en) Training data augmentation method, system, device and storage medium
CN112862840B (en) Image segmentation method, device, equipment and medium
CN112818733B (en) Information processing method, device, storage medium and terminal
CN114758369A (en) Living body detection model training method, system, equipment and storage medium
CN113255400A (en) Training and recognition method, system, equipment and medium of living body face recognition model
CN116704620A (en) Living body detection method, living body detection device, electronic equipment and storage medium
WO2023137923A1 (en) Person re-identification method and apparatus based on posture guidance, and device and storage medium
CN115205939A (en) Face living body detection model training method and device, electronic equipment and storage medium
CN113723306A (en) Push-up detection method, device and computer readable medium
CN112989083A (en) Personnel identity analysis method, device, equipment and storage medium
CN112183347A (en) Depth space gradient-based in-vivo detection method, device, equipment and medium
CN113596436B (en) Video special effects testing 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