[go: up one dir, main page]

CN109815814B - Face detection method based on convolutional neural network - Google Patents

Face detection method based on convolutional neural network Download PDF

Info

Publication number
CN109815814B
CN109815814B CN201811572322.8A CN201811572322A CN109815814B CN 109815814 B CN109815814 B CN 109815814B CN 201811572322 A CN201811572322 A CN 201811572322A CN 109815814 B CN109815814 B CN 109815814B
Authority
CN
China
Prior art keywords
image
neural network
convolutional neural
loss function
face
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.)
Expired - Fee Related
Application number
CN201811572322.8A
Other languages
Chinese (zh)
Other versions
CN109815814A (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.)
Tianjin University
Original Assignee
Tianjin University
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 Tianjin University filed Critical Tianjin University
Priority to CN201811572322.8A priority Critical patent/CN109815814B/en
Publication of CN109815814A publication Critical patent/CN109815814A/en
Application granted granted Critical
Publication of CN109815814B publication Critical patent/CN109815814B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The invention discloses a face detection method based on a convolutional neural network, which comprises the following steps: step (1), establishing a database; step (2), the images in the database are processed; pre-treating; step (3), training a deeply built learning network; and (4) testing the training result, wherein the detection accuracy of the human faces with shielding, different angles and side faces in the picture and the small and fuzzy human faces in the picture is high, the network structure is simple, the iteration parameters are less, and the training time is short.

Description

一种基于卷积神经网络的人脸检测方法A Face Detection Method Based on Convolutional Neural Network

技术领域technical field

本发明属于计算机视觉、人工智能领域,特别涉及一种基于卷积神经网络的人脸检测方法。The invention belongs to the fields of computer vision and artificial intelligence, and in particular relates to a face detection method based on a convolutional neural network.

背景技术Background technique

人脸检测是指在有人脸的图像中,确定出人脸所在的位置、大小的过程,是计算机视觉领域中重要的组成部分,也是进行人脸识别时预处理的关键步骤,其检测精度很大程度上也决定着人脸识别的精度,对后续的工作有着很大的影响,因此,对人脸检测的研究有着重大的意义和实用价值。Face detection refers to the process of determining the position and size of a face in an image of a human face. It is an important part in the field of computer vision and a key step in preprocessing for face recognition. Its detection accuracy is very high. To a large extent, it also determines the accuracy of face recognition and has a great impact on the follow-up work. Therefore, the research on face detection has great significance and practical value.

人脸检测在实际生活中有着广泛的应用:例如人份认证与安全防护、在关于人脸方面媒体与娱乐、手机、数码相机等电子产品中、以及图像检索层面等等。人脸检测方法大致可分为传统的检测方法(包括基于匹配模板的检测方法、基于距离的检测方法等)以及基于深度学习的检测方法。Face detection has a wide range of applications in real life: such as identity authentication and security protection, in media and entertainment about faces, mobile phones, digital cameras and other electronic products, as well as image retrieval and so on. Face detection methods can be roughly divided into traditional detection methods (including detection methods based on matching templates, detection methods based on distance, etc.) and detection methods based on deep learning.

近年来深度学习得到不断的完善和发展,无论是在分类还是回归任务上都得到了广泛的应用。基于深度学习的人脸检测方法也在不断发展,但对于目前的方法而言,以最常应用的MTCNN方法为例,其识别速度不够快,识别精度不够高,特别是对于图像、视频中有遮挡、或不同角度、侧面以及在画面中较小的人脸不易检测到。而作为人脸识别过程的预处理步骤,人脸检测的精度也在很大程度上影响着后续识别工作的精度,因此解决这些问题至关重要。In recent years, deep learning has been continuously improved and developed, and it has been widely used in both classification and regression tasks. The face detection method based on deep learning is also constantly developing, but for the current method, taking the most commonly used MTCNN method as an example, its recognition speed is not fast enough, and the recognition accuracy is not high enough, especially for images and videos. Faces that are occluded, or different angles, sides, and smaller in the frame are less likely to be detected. As a preprocessing step in the face recognition process, the accuracy of face detection also greatly affects the accuracy of subsequent recognition work, so it is very important to solve these problems.

发明内容Contents of the invention

基于现有技术,本发明提出了一种基于卷积神经网络的人脸检测方法,特别是涉及对画面中由于光照、遮挡的或者是处于侧面状态以及在画面中很小的人脸的检测,通过建立新的数据库,搭建卷积神经网络,并通过调整超参数,不断迭代训练网络,可以得到一个较好的检测效果,从而有效的对人脸进行检测。Based on the prior art, the present invention proposes a face detection method based on a convolutional neural network, especially related to the detection of faces in the picture due to illumination, occlusion or being in a side state and very small in the picture, By establishing a new database, building a convolutional neural network, and continuously iteratively training the network by adjusting hyperparameters, a better detection effect can be obtained, thereby effectively detecting faces.

本发明提出了一种基于卷积神经网络的人脸检测方法,该方法包括以下步骤:The present invention proposes a kind of face detection method based on convolutional neural network, and this method comprises the following steps:

一种基于卷积神经网络的人脸检测方法,该方法包括以下步骤:A kind of face detection method based on convolutional neural network, this method comprises the following steps:

步骤1、建立数据库获得图像数据进行预处理构建卷积神经网络;Step 1. Establish a database to obtain image data for preprocessing to construct a convolutional neural network;

步骤2、通过卷积神经网络中的图像特征分析模块对预处理数据进行四次迭代运算生成图像特征参数;Step 2, performing four iterative operations on the preprocessed data through the image feature analysis module in the convolutional neural network to generate image feature parameters;

步骤3、通过卷积神经网络中的全连接层对图像特征参数运算生成图像一维向量;Step 3, generate a one-dimensional image vector by operating the image feature parameters through the fully connected layer in the convolutional neural network;

步骤4、通过卷积神经网络中的分类层对图像一维向量进行分类和回归获得人脸图像的位置坐标。Step 4. Classify and regress the image one-dimensional vector through the classification layer in the convolutional neural network to obtain the position coordinates of the face image.

所述步骤2图像特征分析模块对预处理数据过程,包括如下步骤:Described step 2 image characteristic analysis module comprises the following steps to preprocessing data process:

步骤2.1所述图像特征分析模块的卷积层对预处理数据的权值与参数进行相卷积的方法提取图像特征;The convolution layer of the image feature analysis module described in step 2.1 extracts image features by convolving the weights and parameters of the preprocessed data;

步骤2.2、所述图像特征分析模块的激活函数层将图像特征运用ReLu函数进行非线性运算获得非线性特征图参数;Step 2.2, the activation function layer of the image feature analysis module uses the ReLu function to perform nonlinear operations on image features to obtain nonlinear feature map parameters;

步骤2.3、所述图像特征分析模块的最大池化层对非线性特征图的参数进行降低处理。Step 2.3, the maximum pooling layer of the image feature analysis module reduces the parameters of the nonlinear feature map.

所述步骤4中分类层对图像一维向量进行分类和回归过程:包括如下步骤。In the step 4, the classification layer performs the classification and regression process on the image one-dimensional vector: the following steps are included.

步骤4.1,通过随机梯度下降法的优化方法对图像一维向量进行迭代权值,达到令损失函数不断的调整,从不断调整训练时的超参数以获得最佳训练结果,其中超参数包含:迭代次数、批次、最大迭代次数、学习率;Step 4.1, iteratively weights the one-dimensional vector of the image through the optimization method of the stochastic gradient descent method, so as to continuously adjust the loss function, and continuously adjust the hyperparameters during training to obtain the best training results. The hyperparameters include: iteration Number of times, batches, maximum number of iterations, learning rate;

步骤4.2,分类过程选取的损失函数为将中心损失函数与softmax损失函数相结合Step 4.2, the loss function selected in the classification process is the combination of the center loss function and the softmax loss function

的方法,具体表达式为:method, the specific expression is:

Figure BDA0001915858600000021
Figure BDA0001915858600000021

其中,LS为softmax损失函数,Lc为中心损失函数,λ为系数,表示二者权重这里取λ=0.1。式中Wx+b为全连接层的输出,经log后表示xi属于类别yi的概率,C表示类别的特征中心;Among them, L S is the softmax loss function, L c is the center loss function, and λ is a coefficient, which means that the weight of the two is here λ=0.1. In the formula, Wx+b is the output of the fully connected layer, after log, it represents the probability that x i belongs to category y i , and C represents the feature center of the category;

步骤4.3,回归过程所采用的损失函数为:欧氏距离损失函数,具体表达式如下:Step 4.3, the loss function used in the regression process is: Euclidean distance loss function, the specific expression is as follows:

Figure BDA0001915858600000031
Figure BDA0001915858600000031

yi∈R4 y i ∈ R 4

其中,

Figure BDA0001915858600000032
是网络预测的输出结果,y为标记的真实标签,即68个人脸关键点的坐标。步骤4.4,将最优权值条件下输出的68个人脸关键点的坐标与数据库中带标签的的人脸关键点坐标及人脸作比对,从而算出此卷积神经网络用于人脸检测的准确率。in,
Figure BDA0001915858600000032
is the output result of the network prediction, and y is the real label of the mark, that is, the coordinates of the 68 key points of the face. Step 4.4, compare the coordinates of the 68 key points of the face output under the condition of the optimal weight with the coordinates of the key points of the face with labels in the database and the face, so as to calculate the use of the convolutional neural network for face detection the accuracy rate.

有益效果Beneficial effect

与现有的技术相比,本发明提供一种基于卷积神经网络的人脸检测方法,对于图片中出现的有遮挡的、不同角度的、侧面的人脸以及图片中较小的、较模糊的人脸的检测准确率较高,并且网络结构简单,迭代参数较少,训练时间较短。Compared with the existing technology, the present invention provides a face detection method based on a convolutional neural network, which can detect occluded, different angles, and side faces in the picture as well as smaller and blurred faces in the picture. The detection accuracy of the face is higher, and the network structure is simple, the iteration parameters are less, and the training time is shorter.

附图说明Description of drawings

图1为一种基于卷积神经网络的人脸检测方法的流程图;Fig. 1 is a kind of flowchart of face detection method based on convolutional neural network;

图2为本发明所提出的一种基于卷积神经网络的人脸识别方法所用卷积神经网络的连接方式,其中包含四个卷积层,四个ReLu激活函数层、四个最大池化层、两个全连接层,其中最后一个全连接层为softmax分类层;Fig. 2 is the connection mode of the used convolutional neural network of a kind of face recognition method based on convolutional neural network proposed by the present invention, which comprises four convolutional layers, four ReLu activation function layers, four maximum pooling layers , two fully connected layers, where the last fully connected layer is a softmax classification layer;

具体实施方式Detailed ways

下面结合附图对本发明作进一步详细描述:Below in conjunction with accompanying drawing, the present invention is described in further detail:

如图1所示,为一种基于卷积神经网络的人脸检测方法的流程图。As shown in Figure 1, it is a flowchart of a face detection method based on a convolutional neural network.

一种基于卷积神经网络的人脸检测方法,该方法包括以下步骤:A kind of face detection method based on convolutional neural network, this method comprises the following steps:

步骤1(110)建立数据库获得图像数据进行预处理构建卷积神经网络;Step 1 (110) establishes a database and obtains image data for preprocessing to construct a convolutional neural network;

本步骤中,建立数据库获得图像数据,即在所建立数据库中包含以下要求的图片:图片中含有至少一个人脸,人脸的位置不做要求,最好是不在正中心、距离较远的人脸;且人脸所处背景复杂多样,包含室内及室外各种场景;用矩形框标记出图像中人脸的所在位置,并且标记出人脸中包括眉毛、眼睛、鼻子、嘴巴、脸部轮廓在内的68个关键点。图像清晰度不做要求。所建立的数据库中共包含6000张包含人脸并做好标记的图像。In this step, establish a database to obtain image data, that is, include pictures with the following requirements in the established database: the picture contains at least one human face, and the position of the human face is not required, preferably people who are not in the center and far away face; and the background of the face is complex and diverse, including various indoor and outdoor scenes; the position of the face in the image is marked with a rectangular frame, and the face includes eyebrows, eyes, nose, mouth, and facial contours 68 key points included. Image clarity is not required. The established database contains a total of 6,000 images containing human faces and labeled.

本步骤中,将数据库中的图像进行预处理过程,对于所建立好的数据库中的图像首先进行空间金字塔池化操作,此操作可由一张图像得到不同像素、不同尺度的多张图像,便于从多尺度的特征中提取出固定大小的特征向量;将上述步骤生成的所有图片进行随机镜像,包括上下、左右镜像操作;将上述步骤处理好的数据库图像中的4/5用作训练数据库,1/5用作测试数据库;In this step, the images in the database are pre-processed, and the images in the established database are firstly subjected to a spatial pyramid pooling operation. This operation can obtain multiple images of different pixels and different scales from one image, which is convenient to obtain from Extract fixed-size feature vectors from multi-scale features; randomly mirror all the pictures generated in the above steps, including up-down, left-right mirroring operations; use 4/5 of the database images processed in the above steps as training databases, 1 /5 is used as a test database;

步骤2、(210)通过卷积神经网络中的图像特征分析模块对预处理数据进行四次迭代运算生成图像特征参数;Step 2, (210) performing four iterative operations on the preprocessed data to generate image feature parameters through the image feature analysis module in the convolutional neural network;

步骤2.1所述图像特征分析模块的卷积层对预处理数据的权值与参数进行相卷积的方法提取图像特征;The convolution layer of the image feature analysis module described in step 2.1 extracts image features by convolving the weights and parameters of the preprocessed data;

2.2、所述图像特征分析模块的激活函数层将图像特征运用ReLu函数进行非线性运算获得非线性特征图参数;2.2, the activation function layer of the image feature analysis module uses the ReLu function to perform nonlinear operations on image features to obtain nonlinear feature map parameters;

步骤2.3、所述图像特征分析模块的最大池化层对非线性特征图的参数进行降低处理。Step 2.3, the maximum pooling layer of the image feature analysis module reduces the parameters of the nonlinear feature map.

本发明是将预处理后的测试数据库图像送入已训练好的神经网络中,测试图片经过训练好的神经网络权值矩阵,提取特征后经过分类器,输出分类与回归的结果,分类的结果以概率形式表示,若判定为人脸的概率大于判定为非人脸的概率,即判定为人脸,并将判定为人脸的部分用矩形框标记;回归的结果是图片中人脸部分68个关键点处用关键点标记出,并返回标记的坐标。The present invention sends the preprocessed test database image into the trained neural network, the test picture passes through the trained neural network weight matrix, extracts features and passes through a classifier to output the results of classification and regression, and the results of classification In the form of probability, if the probability of judging as a human face is greater than the probability of judging as a non-human face, it is judged as a human face, and the part judged as a human face is marked with a rectangular frame; the result of the regression is the 68 key points of the human face in the picture is marked with a keypoint and returns the marked coordinates.

步骤3、(310)通过卷积神经网络中的全连接层对图像特征参数运算生成图像一维向量。Step 3, (310) Generate a one-dimensional vector of the image by operating the image feature parameters through the fully connected layer in the convolutional neural network.

步骤4、(410)通过卷积神经网络中的分类层对图像一维向量进行分类和回归获得人脸图像的位置坐标。所述步骤4中分类层对图像一维向量进行分类和回归过程:包括如下步骤:Step 4, (410) Classify and regress the image one-dimensional vector through the classification layer in the convolutional neural network to obtain the position coordinates of the face image. The classification layer in the step 4 classifies and returns the image one-dimensional vector: including the following steps:

步骤4.1,通过随机梯度下降法的优化方法对图像一维向量进行迭代权值,达到令损失函数不断的调整,从不断调整训练时的超参数以获得最佳训练结果,其中超参数包含:迭代次数、批次、最大迭代次数、学习率;Step 4.1, iteratively weights the one-dimensional vector of the image through the optimization method of the stochastic gradient descent method, so as to continuously adjust the loss function, and continuously adjust the hyperparameters during training to obtain the best training results. The hyperparameters include: iteration Number of times, batches, maximum number of iterations, learning rate;

步骤4.2,分类过程选取的损失函数为将中心损失函数与softmax损失函数相结合的方法,具体表达式为:In step 4.2, the loss function selected in the classification process is the method of combining the center loss function and the softmax loss function, and the specific expression is:

Figure BDA0001915858600000051
Figure BDA0001915858600000051

其中,LS为softmax损失函数,Lc为中心损失函数,λ为系数,表示二者权重这里取λ=0.1。式中Wx+b为全连接层的输出,经log后表示xi属于类别yi的概率,C表示类别的特征中心;Among them, L S is the softmax loss function, L c is the center loss function, and λ is a coefficient, which means that the weight of the two is here λ=0.1. In the formula, Wx+b is the output of the fully connected layer, after log, it represents the probability that x i belongs to category y i , and C represents the feature center of the category;

步骤4.3,回归过程所采用的损失函数为:欧氏距离损失函数,具体表达式如下:Step 4.3, the loss function used in the regression process is: Euclidean distance loss function, the specific expression is as follows:

Figure BDA0001915858600000052
Figure BDA0001915858600000052

yi∈R4 y i ∈ R 4

其中,

Figure BDA0001915858600000053
是网络预测的输出结果,y为标记的真实标签,即68个人脸关键点的坐标。步骤4.4,将最优权值条件下输出的68个人脸关键点的坐标与数据库中带标签的的人脸关键点坐标及人脸作比对,从而算出此卷积神经网络用于人脸检测的准确率。in,
Figure BDA0001915858600000053
is the output result of the network prediction, and y is the real label of the mark, that is, the coordinates of the 68 key points of the face. Step 4.4, compare the coordinates of the 68 key points of the face output under the condition of the optimal weight with the coordinates of the key points of the face with labels in the database and the face, so as to calculate the use of the convolutional neural network for face detection the accuracy rate.

本发明训练任务整体分为两个部分:分类与回归。分类是指将人脸检测问题视作人脸以及非人脸的二分类问题;回归是指经神经网络训练后返回出人脸边框的坐标以及人脸68个关键点的所在位置的坐标的过程,从而完成检测人脸的目的。经过不断迭代更新网络中的权值,以减小损失函数,从而最终得到最优权值;将最优权值条件下输出的识别结果与数据库中带标签的的人脸关键点坐标及人脸作比对,从而算出此卷积神经网络用于人脸检测的准确率。The whole training task of the present invention is divided into two parts: classification and regression. Classification refers to the problem of face detection as a binary classification problem of faces and non-faces; regression refers to the process of returning the coordinates of the frame of the face and the coordinates of the 68 key points of the face after neural network training , so as to complete the purpose of face detection. After iteratively updating the weights in the network to reduce the loss function, the optimal weights are finally obtained; the recognition results output under the conditions of the optimal weights and the coordinates of the key points of the face with labels in the database and the face For comparison, the accuracy of this convolutional neural network for face detection is calculated.

如图2所示,本发明所提出的一种基于卷积神经网络的人脸识别方法所用卷积神经网络包含四个卷积层,四个ReLu激活函数层、四个最大池化层、两个全连接层,其中最后一个全连接层为softmax分类层。其作用分别为:卷积层用于利用将卷积层权值与参数相卷积的方法提取图像的特征;激活函数层是为了增加网络的非线性能力,其中ReLu函数指的是y=max(0,x)这一函数;最大池化层是为了减少输出大小、降低参数量;全连接层是为了将所提取到的特征映射为一维向量;分类层是为了在前述网络提取出的特征中分类出人脸、非人脸两个部分,以及回归出人脸的68个关键点的坐标。整个训练过程为:首先随机初始化卷积层与全连接层中的参数,当将所建立的数据库中的图像送至这个网络后,经过四个卷积、激活、池化层之后,得到人脸的特征,再通过全连接层得到固定大小的特征向量,最后通过分类层得到人脸所在位置的坐标。分类层是为了在前述网络提取出的特征中分类出人脸、非人脸两个部分,以及回归出人脸的68个关键点的坐标。在网络训练的过程中,数据沿网络正向传播,通过损失函数得到的误差沿网络反向传播,使卷积层与全连接层中的参数不断优化,通过不断训练、微调各种参数,最终得到好的训练效果。As shown in Figure 2, the convolutional neural network used in the face recognition method based on the convolutional neural network proposed by the present invention includes four convolutional layers, four ReLu activation function layers, four maximum pooling layers, two fully connected layers, the last fully connected layer is a softmax classification layer. Its functions are respectively: the convolutional layer is used to extract the features of the image by convolving the convolutional layer weights and parameters; the activation function layer is to increase the nonlinear capability of the network, wherein the ReLu function refers to y=max (0, x) this function; the maximum pooling layer is to reduce the output size and reduce the amount of parameters; the fully connected layer is to map the extracted features into a one-dimensional vector; the classification layer is to extract from the aforementioned network In the feature, two parts of the face and non-face are classified, and the coordinates of 68 key points of the face are returned. The whole training process is as follows: First, the parameters in the convolutional layer and the fully connected layer are randomly initialized. After the image in the established database is sent to the network, after four convolutional, activation, and pooling layers, the face is obtained. features, and then through the fully connected layer to obtain a fixed-size feature vector, and finally through the classification layer to obtain the coordinates of the location of the face. The classification layer is to classify the two parts of human face and non-human face in the features extracted by the aforementioned network, and to return the coordinates of 68 key points of the human face. In the process of network training, the data propagates forward along the network, and the error obtained by the loss function propagates backward along the network, so that the parameters in the convolutional layer and the fully connected layer are continuously optimized. Through continuous training and fine-tuning of various parameters, finally Get a good training effect.

本发明的整个训练过程为:首先随机初始化卷积层与全连接层中的参数,当将所建立的数据库中的图像送至这个网络后,经过四个卷积、激活、池化层之后,得到人脸的特征,再通过全连接层得到固定大小的特征向量,最后通过分类层得到人脸所在位置的坐标。在网络训练的过程中,数据沿网络正向传播,通过损失函数得到的误差沿网络反向传播,使卷积层与全连接层中的参数不断优化,通过不断训练、微调各种参数,最终得到好的训练效果。这一步骤是通过对数据库进行训练,从而得到最优的参数。在整个训练过程中,用损失函数表征实际标签与预测结果之间的误差,即通过使损失函数达到最小,不断进行迭代训练,到最后损失函数达到最小时,得到最优参数。其中,要训练的参数包括卷积层的卷积核以及偏置,以及全连接层中的神经元参数。在整个训练过程中,数据前向传播,由损失函数计算得到的误差反向传播,通过梯度下降法,使网络在不断迭代的过程中找到全局最优点,此时便得到了最优参数。在训练结束,即得到最优的网络参数之后,将最优参数代入至整个网络中,此时整个网络具备人脸检测的能力,即可进行人脸检测。之后通过测试可得到此神经网络用于人脸检测的准确率。The whole training process of the present invention is as follows: first, the parameters in the convolutional layer and the fully connected layer are randomly initialized, and after the images in the established database are sent to the network, after four convolutional, activation, and pooling layers, Get the features of the face, and then get the feature vector of fixed size through the fully connected layer, and finally get the coordinates of the location of the face through the classification layer. In the process of network training, the data propagates forward along the network, and the error obtained by the loss function propagates backward along the network, so that the parameters in the convolutional layer and the fully connected layer are continuously optimized. Through continuous training and fine-tuning various parameters, finally Get a good training effect. This step is to obtain the optimal parameters by training the database. During the whole training process, the loss function is used to represent the error between the actual label and the predicted result, that is, by minimizing the loss function, iterative training is carried out continuously, and the optimal parameters are obtained when the loss function reaches the minimum. Among them, the parameters to be trained include the convolution kernel and bias of the convolutional layer, and the neuron parameters in the fully connected layer. During the entire training process, the data is propagated forward, and the error calculated by the loss function is propagated backwards. Through the gradient descent method, the network can find the global optimal point in the process of continuous iteration, and the optimal parameters are obtained at this time. After the training is over, that is, after the optimal network parameters are obtained, the optimal parameters are substituted into the entire network. At this time, the entire network has the ability of face detection, and face detection can be performed. Afterwards, the accuracy of this neural network for face detection can be obtained through testing.

以上说书仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内的所作的任何修改、等同替换和改进等,均为包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention are included in the protection of the present invention. within range.

Claims (2)

1.一种基于卷积神经网络的人脸检测方法,其特征在于,该方法包括以下步骤:1. a face detection method based on convolutional neural network, is characterized in that, the method comprises the following steps: 步骤1、建立数据库获得图像数据进行预处理构建卷积神经网络;Step 1. Establish a database to obtain image data for preprocessing to construct a convolutional neural network; 步骤2、通过卷积神经网络中的图像特征分析模块对预处理数据进行四次迭代运算生成图像特征参数;Step 2, performing four iterative operations on the preprocessed data through the image feature analysis module in the convolutional neural network to generate image feature parameters; 步骤3、通过卷积神经网络中的全连接层对图像特征参数运算生成图像一维向量;Step 3, generate a one-dimensional image vector by operating the image feature parameters through the fully connected layer in the convolutional neural network; 步骤4、通过卷积神经网络中的分类层对图像一维向量进行分类和回归获得人脸图像的位置坐标;其中:所述步骤4中分类层对图像一维向量进行分类和回归过程,包括如下步骤:Step 4, classify and return the image one-dimensional vector by the classification layer in the convolutional neural network to obtain the position coordinates of the face image; wherein: the classification layer in the step 4 classifies and returns the image one-dimensional vector, including Follow the steps below: 步骤4.1、通过随机梯度下降法的优化方法对图像一维向量进行迭代权值,达到令损失函数不断的调整,从不断调整训练时的超参数以获得最佳训练结果,其中超参数包含:迭代次数、批次、最大迭代次数、学习率;Step 4.1, through the optimization method of stochastic gradient descent method, iteratively weights the one-dimensional vector of the image to continuously adjust the loss function, and continuously adjust the hyperparameters during training to obtain the best training results. The hyperparameters include: iteration Number of times, batches, maximum number of iterations, learning rate; 步骤4.2、分类过程选取的损失函数为将中心损失函数与softmax损失函数相结合的方法,具体表达式为:Step 4.2, the loss function selected in the classification process is the method of combining the center loss function and the softmax loss function, and the specific expression is:
Figure FDA0003919103020000011
Figure FDA0003919103020000011
其中,LS为softmax损失函数,Lc为中心损失函数,λ为系数,表示二者权重这里取λ=0.1,式中Wx+b为全连接层的输出,经log后表示xi属于类别yi的概率,C表示类别的特征中心;Among them, L S is the softmax loss function, L c is the center loss function, and λ is the coefficient, indicating that the weight of the two is taken here as λ=0.1, where Wx+b is the output of the fully connected layer, and after log, it means that x i belongs to the category The probability of y i , C represents the feature center of the category; 步骤4.3、回归过程所采用的损失函数为:欧氏距离损失函数,具体表达式如下:Step 4.3, the loss function used in the regression process is: Euclidean distance loss function, the specific expression is as follows:
Figure FDA0003919103020000012
Figure FDA0003919103020000012
yi∈R4 y i ∈ R 4 其中,
Figure FDA0003919103020000013
是网络预测的输出结果,y为标记的真实标签,即68个人脸关键点的坐标;
in,
Figure FDA0003919103020000013
is the output result of the network prediction, y is the real label of the mark, that is, the coordinates of the 68 key points of the face;
步骤4.4、将最优权值条件下输出的68个人脸关键点的坐标与数据库中带标签的的人脸关键点坐标及人脸作比对,从而算出此卷积神经网络用于人脸检测的准确率。Step 4.4, compare the coordinates of the 68 facial key points output under the optimal weight condition with the labeled human face key point coordinates and faces in the database, so as to calculate this convolutional neural network for face detection the accuracy rate.
2.如权利要求1所述的基于卷积神经网络的人脸检测方法,其特征在于,所述步骤2中图像特征分析模块对预处理数据过程,包括如下步骤:2. the face detection method based on convolutional neural network as claimed in claim 1, is characterized in that, in described step 2, image characteristic analysis module comprises the steps to preprocessing data process: 步骤2.1、所述图像特征分析模块的卷积层对预处理数据的权值与参数进行相卷积的方法提取图像特征;Step 2.1, the convolution layer of the image feature analysis module extracts image features by convolving the weights and parameters of the preprocessed data; 步骤2.2、所述图像特征分析模块的激活函数层将图像特征运用ReLu函数进行非线性运算获得非线性特征图参数;Step 2.2, the activation function layer of the image feature analysis module uses the ReLu function to perform nonlinear operations on image features to obtain nonlinear feature map parameters; 步骤2.3、所述图像特征分析模块的最大池化层对非线性特征图的参数进行降低处理。Step 2.3, the maximum pooling layer of the image feature analysis module reduces the parameters of the nonlinear feature map.
CN201811572322.8A 2018-12-21 2018-12-21 Face detection method based on convolutional neural network Expired - Fee Related CN109815814B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811572322.8A CN109815814B (en) 2018-12-21 2018-12-21 Face detection method based on convolutional neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811572322.8A CN109815814B (en) 2018-12-21 2018-12-21 Face detection method based on convolutional neural network

Publications (2)

Publication Number Publication Date
CN109815814A CN109815814A (en) 2019-05-28
CN109815814B true CN109815814B (en) 2023-01-24

Family

ID=66602244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811572322.8A Expired - Fee Related CN109815814B (en) 2018-12-21 2018-12-21 Face detection method based on convolutional neural network

Country Status (1)

Country Link
CN (1) CN109815814B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222764B (en) * 2019-06-10 2021-06-18 中南民族大学 Method, system, device and storage medium for detecting occluded target
CN111177469A (en) * 2019-12-20 2020-05-19 国久大数据有限公司 Face retrieval method and face retrieval device
CN111523452B (en) * 2020-04-22 2023-08-25 北京百度网讯科技有限公司 Method and device for detecting the position of a human body in an image
CN111612785B (en) * 2020-06-03 2024-02-02 浙江大华技术股份有限公司 Face picture quality assessment method, device and storage medium
CN112084551A (en) * 2020-07-03 2020-12-15 邱宇 A method of building facade recognition and generation based on adversarial generative network
CN112052772B (en) * 2020-08-31 2025-01-14 福建捷宇电脑科技有限公司 A face occlusion detection method
CN112733589B (en) * 2020-10-29 2023-01-03 广西科技大学 Infrared image pedestrian detection method based on deep learning
CN113361691A (en) * 2021-06-17 2021-09-07 西安超越申泰信息科技有限公司 Convolutional neural network model-based access control method and access control system
CN114842232A (en) * 2022-04-29 2022-08-02 黑龙江省科学院智能制造研究所 Intelligent face measuring and analyzing method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106599830A (en) * 2016-12-09 2017-04-26 中国科学院自动化研究所 Method and apparatus for positioning face key points
CN106874883A (en) * 2017-02-27 2017-06-20 中国石油大学(华东) A kind of real-time face detection method and system based on deep learning
CN107292267A (en) * 2017-06-21 2017-10-24 北京市威富安防科技有限公司 Photo fraud convolutional neural networks training method and human face in-vivo detection method
CN107358223A (en) * 2017-08-16 2017-11-17 上海荷福人工智能科技(集团)有限公司 A kind of Face datection and face alignment method based on yolo
CN107729819A (en) * 2017-09-22 2018-02-23 华中科技大学 A kind of face mask method based on sparse full convolutional neural networks
CN107871106A (en) * 2016-09-26 2018-04-03 北京眼神科技有限公司 Face detection method and device
CN107871134A (en) * 2016-09-23 2018-04-03 北京眼神科技有限公司 A kind of method for detecting human face and device
CN108073917A (en) * 2018-01-24 2018-05-25 燕山大学 A kind of face identification method based on convolutional neural networks
CN108427921A (en) * 2018-02-28 2018-08-21 辽宁科技大学 A kind of face identification method based on convolutional neural networks

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9141196B2 (en) * 2012-04-16 2015-09-22 Qualcomm Incorporated Robust and efficient learning object tracker
CN108496174B (en) * 2015-10-28 2020-02-11 北京市商汤科技开发有限公司 Method and system for face recognition
US10032067B2 (en) * 2016-05-28 2018-07-24 Samsung Electronics Co., Ltd. System and method for a unified architecture multi-task deep learning machine for object recognition
KR20180057096A (en) * 2016-11-21 2018-05-30 삼성전자주식회사 Device and method to perform recognizing and training face expression
CN107808129B (en) * 2017-10-17 2021-04-16 南京理工大学 A facial multi-feature point localization method based on a single convolutional neural network
CN108304788B (en) * 2018-01-18 2022-06-14 陕西炬云信息科技有限公司 Face recognition method based on deep neural network

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107871134A (en) * 2016-09-23 2018-04-03 北京眼神科技有限公司 A kind of method for detecting human face and device
CN107871106A (en) * 2016-09-26 2018-04-03 北京眼神科技有限公司 Face detection method and device
CN106599830A (en) * 2016-12-09 2017-04-26 中国科学院自动化研究所 Method and apparatus for positioning face key points
CN106874883A (en) * 2017-02-27 2017-06-20 中国石油大学(华东) A kind of real-time face detection method and system based on deep learning
CN107292267A (en) * 2017-06-21 2017-10-24 北京市威富安防科技有限公司 Photo fraud convolutional neural networks training method and human face in-vivo detection method
CN107358223A (en) * 2017-08-16 2017-11-17 上海荷福人工智能科技(集团)有限公司 A kind of Face datection and face alignment method based on yolo
CN107729819A (en) * 2017-09-22 2018-02-23 华中科技大学 A kind of face mask method based on sparse full convolutional neural networks
CN108073917A (en) * 2018-01-24 2018-05-25 燕山大学 A kind of face identification method based on convolutional neural networks
CN108427921A (en) * 2018-02-28 2018-08-21 辽宁科技大学 A kind of face identification method based on convolutional neural networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
特征匹配融合结合改进卷积神经网络的人脸识别;李佳妮,张宝华;《激光与光电子学进展》;20180530;全文 *

Also Published As

Publication number Publication date
CN109815814A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN109815814B (en) Face detection method based on convolutional neural network
Hu et al. Incremental tensor subspace learning and its applications to foreground segmentation and tracking
CN106096561B (en) Infrared pedestrian detection method based on image block deep learning features
US20200285896A1 (en) Method for person re-identification based on deep model with multi-loss fusion training strategy
Christa et al. CNN-based mask detection system using openCV and MobileNetV2
CN111460980B (en) Multi-scale detection method for small-target pedestrian based on multi-semantic feature fusion
CN111079674B (en) Target detection method based on global and local information fusion
CN103605972B (en) Non-restricted environment face verification method based on block depth neural network
CN111709311A (en) A pedestrian re-identification method based on multi-scale convolutional feature fusion
CN107229904A (en) A kind of object detection and recognition method based on deep learning
CN116343330A (en) An abnormal behavior recognition method based on infrared-visible light image fusion
CN108427921A (en) A kind of face identification method based on convolutional neural networks
CN110008861A (en) A kind of recognition methods again of the pedestrian based on global and local feature learning
CN110111365B (en) Training method and device based on deep learning and target tracking method and device
CN112381047B (en) Enhanced recognition method for facial expression image
CN111461061A (en) A Pedestrian Re-identification Method Based on Camera Style Adaptation
Ajay et al. Real time object detection based on rcnn technique
Shi et al. A new multiface target detection algorithm for students in class based on bayesian optimized YOLOv3 model
Engoor et al. Occlusion-aware dynamic human emotion recognition using landmark detection
Asadi-Aghbolaghi et al. Supervised spatio-temporal kernel descriptor for human action recognition from RGB-depth videos
Prasad et al. Human face emotions recognition from thermal images using DenseNet
Chen Vehicle feature recognition via a convolutional neural network with an improved bird swarm algorithm
Ambika et al. Mathematics for 2D face recognition from real time image data set using deep learning techniques
Jain et al. Real-time eyeglass detection using transfer learning for non-standard facial data.
CN106446837A (en) Hand waving detection method based on motion historical images

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230124

CF01 Termination of patent right due to non-payment of annual fee