CN106326857A - Gender identification method and gender identification device based on face image - Google Patents
Gender identification method and gender identification device based on face image Download PDFInfo
- Publication number
- CN106326857A CN106326857A CN201610698494.4A CN201610698494A CN106326857A CN 106326857 A CN106326857 A CN 106326857A CN 201610698494 A CN201610698494 A CN 201610698494A CN 106326857 A CN106326857 A CN 106326857A
- Authority
- CN
- China
- Prior art keywords
- face image
- target
- image
- gender
- facial image
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/172—Classification, e.g. identification
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
- G06F18/24155—Bayesian classification
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/161—Detection; Localisation; Normalisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/247—Aligning, centring, orientation detection or correction of the image by affine transforms, e.g. correction due to perspective effects; Quadrilaterals, e.g. trapezoids
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Human Computer Interaction (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Probability & Statistics with Applications (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本发明公开一种基于人脸图像的性别识别方法及装置,该方法包括:通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果,通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果,将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。
The invention discloses a gender recognition method and device based on a human face image. The method includes: performing gender classification and discrimination on a target human face image through a preset prior model in a deep convolutional neural network to obtain the target human face image For the corresponding gender discrimination result, by comparing the cosine similarity between the features of the target face image and the features of the image sample, the cosine comparison result corresponding to the target face image is obtained, and the gender discrimination result is compared with the cosine Perform Bayesian classifier operations on the results to obtain the gender of the object in the face image. In this way, in complex imaging situations, the key parts of the face image are re-spliced, and the deep convolutional neural network is used to distinguish and The combination of image feature comparison can use the features of key parts of the face, depth texture, edge and color features for auxiliary recognition, increasing the accuracy of gender recognition.
Description
技术领域technical field
本发明属于图像识别技术领域,尤其涉及一种基于人脸图像的性别识别方法及装置。The invention belongs to the technical field of image recognition, and in particular relates to a gender recognition method and device based on a human face image.
背景技术Background technique
人脸识别,是基于人的脸部特征信息进行身份识别的一种生物识别技术。用摄像机或摄像头采集含有人脸的图像或视频流,并自动在图像中检测和跟踪人脸,通常也叫做人像识别、面部识别。人脸识别产品已广泛应用于金融、司法、军队、公安、边检、政府、航天、电力、工厂、教育、医疗及众多企事业单位等领域。例如,人脸识别门禁考勤系统和人脸识别防盗门,关于信息安全的计算机登录、电子政务和电子商务。随着技术的进一步成熟和社会认同度的提高,人脸识别技术将应用在更多的领域。其中,基于图像的性别识别能够有效地辅助人脸识别,性别识别的准确性可以直接影响最终的人脸识别的精确性。Face recognition is a biometric technology for identification based on human facial feature information. Use a video camera or camera to collect images or video streams containing human faces, and automatically detect and track human faces in the images, usually also called portrait recognition and facial recognition. Face recognition products have been widely used in finance, justice, military, public security, border inspection, government, aerospace, electric power, factories, education, medical care and many enterprises and institutions. For example, face recognition access control time attendance system and face recognition anti-theft door, computer login, e-government and e-commerce regarding information security. With the further maturity of technology and the improvement of social recognition, face recognition technology will be applied in more fields. Among them, image-based gender recognition can effectively assist face recognition, and the accuracy of gender recognition can directly affect the accuracy of final face recognition.
现有技术中,人脸图像性别识别的流程为:先进行人脸检测,然后人脸图像的特征提取,最后根据提取的特征通过分类器识别人脸图像的性别。由于成像设备的关系,图像不一定会清晰的反应人的完整面部,大部分的图像会出现模糊、强光、黑暗等不清晰的情况,或者图像中人物出现低头、侧脸等不能完全显示整个人脸的姿态,在这种复杂的成像条件下,现有技术单纯的提取人脸图像的特征是无法准确判别人物的性别的,进而会增加识别结果的错误率。In the prior art, the process of identifying the gender of a face image is as follows: first face detection, then feature extraction of the face image, and finally identify the gender of the face image through a classifier according to the extracted features. Due to the relationship between the imaging equipment, the image may not clearly reflect the complete face of the person. Most of the images will appear blurry, strong light, dark, etc. Face posture, under such complex imaging conditions, existing technologies cannot accurately determine the gender of a person by simply extracting the features of the face image, which in turn will increase the error rate of the recognition result.
发明内容Contents of the invention
本发明实施例提供一种基于人脸图像的性别识别方法及装置,旨在解决由于外部成像因素的变化而导致的无法准确的提取人脸图像的特征,这样会增加识别的错误率的问题。The embodiment of the present invention provides a gender recognition method and device based on a face image, aiming to solve the problem that the features of the face image cannot be accurately extracted due to changes in external imaging factors, which will increase the error rate of recognition.
本发明实施例提供的一种基于人脸图像的性别识别方法,包括:通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到所述目标人脸图像对应的性别判别结果,其中所述目标人脸图像是由人脸图像中各关键部位区域组成的图像;通过比对所述目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到所述目标人脸图像对应的余弦比对结果;将所述性别判别结果和所述余弦比对结果进行贝叶斯分类器运算,得到所述人脸图像中对象的性别。A gender recognition method based on a face image provided by an embodiment of the present invention includes: performing gender classification and discrimination on a target face image through a preset prior model in a deep convolutional neural network to obtain the target face image Corresponding gender discrimination results, wherein the target face image is an image composed of key parts in the face image; by comparing the cosine similarity between the features of the target face image and the features of the image samples, Obtaining a cosine comparison result corresponding to the target face image; performing a Bayesian classifier operation on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image.
本发明实施例提供的一种基于人脸图像的性别识别装置,包括:性别判别模块用于通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到所述目标人脸图像对应的性别判别结果,其中所述目标人脸图像是由人脸图像中各关键部位区域组成的图像;比对处理模块用于通过比对所述目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到所述目标人脸图像对应的余弦比对结果;识别模块用于将所述性别判别结果和所述余弦比对结果进行贝叶斯分类器运算,得到所述人脸图像中对象的性别。A gender recognition device based on a human face image provided by an embodiment of the present invention includes: a gender discrimination module for performing gender classification and discrimination on a target human face image through a preset prior model in a deep convolutional neural network to obtain the The gender discrimination result corresponding to the target human face image, wherein the target human face image is an image composed of each key part area in the human face image; the comparison processing module is used to compare the features of the target human face image with the The cosine similarity between the features of the image samples is used to obtain the corresponding cosine comparison result of the target face image; the identification module is used to perform Bayesian classifier operations on the gender discrimination result and the cosine comparison result, Obtain the gender of the object in the face image.
本发明实施例提供的基于人脸图像的性别识别方法及装置,通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到所述目标人脸图像对应的性别判别结果,其中所述目标人脸图像是由人脸图像中各关键部位区域组成的图像,通过比对所述目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到所述目标人脸图像对应的余弦比对结果,将所述性别判别结果和所述余弦比对结果进行贝叶斯分类器运算,得到所述人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。The gender recognition method and device based on human face images provided by the embodiments of the present invention use the preset deep convolutional neural network prior model to classify and judge the gender of the target human face image, and obtain the corresponding gender of the target human face image. Gender discrimination results, wherein the target face image is an image composed of key parts in the face image, by comparing the cosine similarity between the features of the target face image and the features of the image sample, the obtained The cosine comparison result corresponding to the target face image, the Bayesian classifier operation is performed on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image, so in complex imaging situations Next, by re-splicing each key part of the face image, and combining the deep convolutional neural network discrimination and image feature comparison, the features, depth texture, edge and color features of each key part of the face can be used Assisted identification increases the accuracy of gender identification.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the 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 are some embodiments of the present invention.
图1是本发明第一实施例提供的基于人脸图像的性别识别方法的实现流程示意图;Fig. 1 is the realization flow diagram of the gender recognition method based on face image that the first embodiment of the present invention provides;
图2是本发明第二实施例提供的基于人脸图像的性别识别方法的实现流程示意图;Fig. 2 is a schematic diagram of the implementation flow of the gender recognition method based on the face image provided by the second embodiment of the present invention;
图3是本发明实施例中人脸检测的示意图;Fig. 3 is the schematic diagram of face detection in the embodiment of the present invention;
图4是本发明实施例中人脸图像的示意图;Fig. 4 is the schematic diagram of face image in the embodiment of the present invention;
图5是本发明实施例中由各关键部位区域重构得到的目标人脸图像的示意图;FIG. 5 is a schematic diagram of a target face image obtained by reconstruction of each key part area in an embodiment of the present invention;
图6是本发明第三实施例提供的基于人脸图像的性别识别装置的结构示意图;6 is a schematic structural diagram of a gender recognition device based on a face image provided by a third embodiment of the present invention;
图7是本发明第四实施例提供的基于人脸图像的性别识别装置的结构示意图。Fig. 7 is a schematic structural diagram of a gender recognition device based on a face image according to a fourth embodiment of the present invention.
图8是本发明第五实施例提供的基于人脸图像的性别识别方法的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device for a gender recognition method based on a face image according to a fifth embodiment of the present invention.
具体实施方式detailed description
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而非全部实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described The embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the protection scope of the present invention.
请参阅图1,图1为本发明第一实施例提供的基于人脸图像的性别识别方法的实现流程示意图,可应用于人脸考勤设备、人脸防盗系统、计算机等识别人脸图像的终端中。图1所示的基于人脸图像的性别识别方法,主要包括以下步骤:Please refer to Fig. 1, Fig. 1 is a schematic diagram of the implementation flow of the gender recognition method based on face images provided by the first embodiment of the present invention, which can be applied to face recognition equipment, face anti-theft systems, computers and other terminals for recognizing face images middle. The gender recognition method based on face images shown in Figure 1 mainly includes the following steps:
S101、通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果。S101. Perform gender classification and discrimination on the target face image through the preset prior model in the deep convolutional neural network, and obtain a gender discrimination result corresponding to the target face image.
该目标人脸图像是由人脸图像中各关键部位区域组成的图像。该各关键部位区域可以是人脸各个器官部位的区域以及面部轮廓区域,此处对目标人脸图像中各关键部位区域不做限定。需要说明的是,人脸图像和目标人图像的关系为:该目标人脸图像是由该人脸图像中该各关键部位区域组成的图像。该人脸图像用于表示整体人脸的图像。The target face image is an image composed of key parts in the face image. The key part areas may be the areas of various organ parts of the human face and the facial contour area, and the key part areas in the target human face image are not limited here. It should be noted that the relationship between the face image and the target person image is: the target face image is an image composed of the key parts in the face image. The face image is used to represent an image of the whole face.
深度卷积神经网络为卷积神经网络(CNN,Convolutional Neural Networks,),是一种带有卷积结构的深度神经网络,至少包括两个非线性可训练的卷积层、两个非线性的固定卷积层和全连接层,一共至少5个隐含层,主要应用于语���分析以及图像识别领域。The deep convolutional neural network is a convolutional neural network (CNN, Convolutional Neural Networks,), which is a deep neural network with a convolutional structure, including at least two nonlinear trainable convolutional layers, two nonlinear Fixed convolutional layer and fully connected layer, a total of at least 5 hidden layers, mainly used in speech analysis and image recognition.
通过深度卷积神经网络训练图像样本就可以得到先验模型,其中训练图像样本以得到先验模型的过程是按照预置的类别对图像样本进行分类的过程,其中先验模型可用于对图像进行分类判别的模型。A priori model can be obtained by training image samples through a deep convolutional neural network. The process of training image samples to obtain a priori model is the process of classifying image samples according to preset categories, and the prior model can be used to classify images. Classification models.
S102、通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果。S102. Obtain a cosine comparison result corresponding to the target face image by comparing the cosine similarity between the features of the target face image and the features of the image sample.
在图像识别领域中,图像的特征是图像识别领域的专有名词,图像的特征的提取是计算机视觉和图像处理中的一个概念。In the field of image recognition, the feature of an image is a proper term in the field of image recognition, and the extraction of image features is a concept in computer vision and image processing.
图像样本的特征可以存储在终端内置的存储模块中,也可以存储在云端服务器上。余弦相似度是用向量空间中两个向量夹角的余弦值作为衡量两个个体间差异的大小的度量。The features of the image samples can be stored in the built-in storage module of the terminal, or can be stored on the cloud server. Cosine similarity uses the cosine value of the angle between two vectors in a vector space as a measure of the difference between two individuals.
S103、将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别。S103. Perform a Bayesian classifier operation on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image.
需要说明的是,该人脸图像中对象为该人脸图像中所描绘的人。贝叶斯分类器是通过贝叶斯公式计算出对象属于哪个类别概率的算法,贝叶斯分类器运算的原理是通过某对象的先验概率,利用贝叶斯公式计算出该对象的后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类别作为该对象所属的类别。It should be noted that the object in the face image is the person depicted in the face image. The Bayesian classifier is an algorithm that calculates the probability of which category an object belongs to through the Bayesian formula. The principle of Bayesian classifier operation is to use the Bayesian formula to calculate the posterior probability of the object through the prior probability of an object. Probability, that is, the probability that the object belongs to a certain class, and the class with the largest posterior probability is selected as the class to which the object belongs.
本发明实施例中是将该性别判别结果和该余弦比对结果作为人脸图像中对象的先验概率,通过贝叶斯公式计算出该对象所属���的男性类别和女性类别的后验概率,并选取具有最大后验概率的性别类别作为该对象的性别类别。In the embodiment of the present invention, the gender discrimination result and the cosine comparison result are used as the prior probability of the object in the face image, and the posterior probability of the male category and the female category to which the object belongs is calculated by Bayesian formula, And select the gender category with the largest posterior probability as the gender category of the object.
本发明实施例中,通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果,其中该目标人脸图像是由人脸图像中各关键部位区域组成的图像,然后通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果,最后将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。In the embodiment of the present invention, the gender classification and discrimination are performed on the target face image through the preset deep convolutional neural network prior model, and the gender discrimination result corresponding to the target face image is obtained, wherein the target face image is composed of The image composed of each key part area in the face image, and then by comparing the cosine similarity between the features of the target face image and the features of the image sample, the cosine comparison result corresponding to the target face image is obtained, and finally The gender discrimination result and the cosine comparison result are subjected to a Bayesian classifier operation to obtain the gender of the object in the face image. In this way, in complex imaging situations, the key parts in the face image are re-spliced, and Combining deep convolutional neural network discrimination and image feature comparison, it can use the features of key parts of the face, depth texture, edge and color features for auxiliary recognition, increasing the accuracy of gender recognition.
请参阅图2,图2为本发明第二实施例提供的基于人脸图像的性别识别方法的实现流程示意图,可应用于人脸考勤设备、人脸防盗系统、计算机等识别人脸图像的终端中,主要包括以下步骤:Please refer to Fig. 2, Fig. 2 is a schematic diagram of the implementation flow of the gender recognition method based on face images provided by the second embodiment of the present invention, which can be applied to face recognition equipment, face anti-theft systems, computers and other terminals for recognizing face images , mainly includes the following steps:
S201、根据人脸图像的各关键点在该人脸图像中的位置,提取该人脸图像中关键部位区域。S201. According to the position of each key point of the face image in the face image, extract the key part area in the face image.
S202、根据该人脸图像中关键部位区域重构人脸的图像,得到该目标人脸图像。S202. Reconstruct the face image according to the key parts in the face image to obtain the target face image.
该目标人脸图像是由人脸图像中各关键部位区域组成的图像。The target face image is an image composed of key parts in the face image.
可选地,在步骤S201之前还包括:通过人脸检测以及人脸关键点定位确定待识别图像中的人脸图像;将该待识别图像中的人脸图像设定为检测区域。Optionally, before step S201, the method further includes: determining a face image in the image to be recognized through face detection and face key point location; setting the face image in the image to be recognized as a detection area.
通过小波(HAAR)分��器或者DLIB(C++library)算法对输入的图像进行人脸检测,然后对检测后的图像通过监督式下降算法(SDM,Supervised Descent Method)进行人脸关键点定位,其中通过SDM算法定位的人脸关键点包括:眉毛、眼睛、鼻子、嘴巴和面部轮廓。当然人脸检测和人脸关键点定位也可以通过其他算法来实现。Use the wavelet (HAAR) classifier or DLIB (C++ library) algorithm to detect the face of the input image, and then use the supervised descent algorithm (SDM, Supervised Descent Method) to locate the key points of the face on the detected image. Among them, the key points of the face located by the SDM algorithm include: eyebrows, eyes, nose, mouth and facial contours. Of course, face detection and face key point positioning can also be realized by other algorithms.
HAAR分类器,包含自适应增强(Adaboost)算法,在图像识别领域中,分类器是指对人脸和非人脸进行分类的算法。DLIB是一种C++的算法库,可应用于人脸检测和人脸关键点定位。The HAAR classifier includes an adaptive enhancement (Adaboost) algorithm. In the field of image recognition, a classifier refers to an algorithm for classifying human faces and non-human faces. DLIB is a C++ algorithm library that can be applied to face detection and face key point location.
图3为人脸检测的示意图,如图3所示,深黑色方形框为人脸检测框,圆形表示人脸,三角形表示动物,多边形表示树木,经过人脸检测可以在图像中提取人脸图像,并将人脸图像设置于人脸检测框内。Figure 3 is a schematic diagram of face detection. As shown in Figure 3, the dark black square frame is the face detection frame, the circle represents the face, the triangle represents the animal, and the polygon represents the tree. After the face detection, the face image can be extracted from the image. And set the face image in the face detection frame.
可选地,根据预置倍数扩大该检测区域,以使该人脸图像中包括头发区域的图像。根据预置倍数扩大该检测区域是将头发区域扩充到人脸图像中,扩大检测区域的方式可以是将整个检测区域进行扩大,也可以是将检测区域的上部、下部、左右两部分均扩大预置倍数,还可以只扩大该检测区域的上部和下部。该预置倍数与头发长度以及脑顶头发高度有关,本实施中优选的预置倍数的数值为0.15,即将该检测区域的上部和下部各扩大0.15倍。图4为人脸图像的示意图,其中图4(a)和图4(b)中长方形框以内为检测区域,图4(a)中的检测区域内包括扩大检测区域之前的人脸图像,图4(b)中的检测区域内包括扩大检测区域之后的人脸图像。Optionally, the detection area is enlarged according to a preset multiple, so that the face image includes an image of a hair area. Expanding the detection area according to the preset multiple is to expand the hair area into the face image. The way to expand the detection area can be to expand the entire detection area, or to expand the upper part, lower part, and left and right parts of the detection area. It is also possible to expand only the upper and lower parts of the detection area by setting the multiple. The preset multiple is related to the length of the hair and the height of the hair on the top of the head. In this implementation, the preferred value of the preset multiple is 0.15, that is, the upper part and the lower part of the detection area are each enlarged by 0.15 times. Fig. 4 is a schematic diagram of a human face image, wherein the detection area is within the rectangular frame in Fig. 4 (a) and Fig. 4 (b), and the detection area in Fig. 4 (a) includes the face image before expanding the detection area, Fig. 4 The detection area in (b) includes the face image after expanding the detection area.
由于头发的颜色、长短以及发型是识别性别很重要的依据,所以人脸图像中包括头发区域可以更准确识别性别。Since the color, length, and hairstyle of hair are very important basis for identifying gender, including the hair region in the face image can identify gender more accurately.
可选地,对该检测区域中眼睛区域进行矫正,以使该人脸图像中该眼睛区域内的双眼处于同一水平线上。矫正眼睛的方式不做限定,可以通过几何变换来矫正眼睛,也可以改变两个眼睛之间夹角来矫正眼睛,最终的目的是将该眼睛区域内的双眼处于同一水平线上。Optionally, the eye area in the detection area is corrected so that the eyes in the eye area in the face image are on the same horizontal line. The way to correct the eyes is not limited, the eyes can be corrected by geometric transformation, and the angle between the two eyes can also be changed to correct the eyes. The ultimate goal is to put the eyes in the eye area on the same horizontal line.
人脸关键点包括:眼睛、鼻子、嘴巴、眉毛、头发以及面部轮廓,通过各关键点在该人脸图像中的位置,提取该人脸图像中关键部位区域。其中该人脸图像中关键部位区域包括:头发区域、眉毛区域、眼睛区域、鼻子区域、嘴巴区域。通过重构各关键部位区域得到的目标人脸图像可以更加精确的描绘不同性别的人脸的发型、皮肤以及面部轮廓等人脸的局部区域。The key points of the face include: eyes, nose, mouth, eyebrows, hair and facial contour, and the key parts of the face image are extracted through the position of each key point in the face image. Wherein, the key part areas in the face image include: a hair area, an eyebrow area, an eye area, a nose area, and a mouth area. The target face image obtained by reconstructing each key part area can more accurately describe the local area of the face such as hairstyle, skin, and facial contour of faces of different genders.
如图5所示,图5为由各关键部位区域重构得到的目标人脸图像的示意图。为了便于说明及显示,图5所示的示意图中关键部位区域仅包括眼睛区域、眉毛区域、鼻子区域和嘴巴区域,其他关键部位区域并没有显示在图5中,图5所示的示意图仅仅是一个举例,并不能对本发明中关键部位区域构成限定。As shown in FIG. 5 , FIG. 5 is a schematic diagram of a target face image reconstructed from each key part area. For the convenience of explanation and display, the key parts in the schematic diagram shown in Figure 5 only include the eye area, eyebrow area, nose area and mouth area, and other key parts are not shown in Figure 5, and the schematic diagram shown in Figure 5 is only An example does not constitute a limitation to key parts and regions in the present invention.
S203、通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果。S203. Perform gender classification and discrimination on the target face image through the preset deep convolutional neural network prior model, and obtain a gender discrimination result corresponding to the target face image.
深度卷积神经网络是一种带有卷积结构的深度神经网络,至少包括两个非线性可训练的卷积层、两个非线性的固定卷积层和全连接层,一共至少5个隐含层,主要应用于语音分析以及图像识别领域。此处对卷积神经网络、���验模型的解释说明请参照本发明第一实施例中相关描述,此处不做赘述。A deep convolutional neural network is a deep neural network with a convolutional structure, including at least two non-linear trainable convolutional layers, two non-linear fixed convolutional layers and a fully connected layer, with a total of at least 5 hidden It is mainly used in the fields of speech analysis and image recognition. For the explanation of the convolutional neural network and the prior model here, please refer to the relevant description in the first embodiment of the present invention, and details are not repeated here.
可选地,通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果,具体为:Optionally, through the prior model in the preset deep convolutional neural network, gender classification and discrimination are performed on the target face image, and the gender discrimination result corresponding to the target face image is obtained, specifically:
通过该深度卷积神经网络中先验模型,对该目标人脸图像进行分类判别,得到该目标人脸图像对应的最大概率值以及该最大概率值对应的第一目标性别类别;Classifying and discriminating the target face image through the prior model in the deep convolutional neural network, obtaining a maximum probability value corresponding to the target face image and a first target gender category corresponding to the maximum probability value;
将该最大概率值和该第一目标性别类别作为所述性别判别结果。The maximum probability value and the first target gender category are used as the gender discrimination result.
该性别类别包括女性类别和男性类别。在深度卷积神经网络中对多个关键部位图像样本进行训练,训练后得到先验模型。通过深度卷积神经网络训练图像样本就可以得到先验模型,其中训练图像样本以得到先验模型的过程是按照预置的性别类别对图像样本进行分类的过程,其中先验模型可用于对图像进行分类判别的模型。该第一目标性别类别为男性类别或女性类别。The gender category includes a female category and a male category. Multiple image samples of key parts are trained in a deep convolutional neural network, and a prior model is obtained after training. A priori model can be obtained by training image samples through a deep convolutional neural network. The process of training image samples to obtain a priori model is the process of classifying image samples according to preset gender categories. The prior model can be used to classify images A model for classifying discriminants. The first target gender category is a male category or a female category.
S204、通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果。S204. Obtain a cosine comparison result corresponding to the target face image by comparing the cosine similarity between the features of the target face image and the features of the image sample.
该图像样本为由整体人脸图像样本中各关键部位区域组成的图像样本,其中该整体人脸图像样本中关键部位区域包括:头发区域、眉毛区域、眼睛区域、鼻子区域、嘴巴区域。该整体人脸图像样本中关键部位区域与该人脸图像中关键部位区域中包括的区域是对应的,即,若该整体人脸图像样本中包括眉毛区域,则该人脸图像中包括眉毛区域,若该整体人脸图像样本中包括眼镜区域,则该人脸图像中包括眼镜区域。重构后得到的图像样本的构成与图5所示的图像相似。从整体人脸图像样本中提取关键部位区域的方式与从人脸图像提取关键部位区域的提取方式相同,此处不做赘述。同样的,重构得到图像样本的重构方式与重构得到目标人脸图像的重构方式相同,此处不做赘述。The image sample is an image sample composed of various key parts in the overall face image sample, wherein the key parts in the overall face image sample include: hair area, eyebrow area, eye area, nose area, and mouth area. The key part area in the overall human face image sample corresponds to the area included in the key part area in the human face image, that is, if the overall human face image sample includes the eyebrow area, then the human face image includes the eyebrow area , if the overall face image sample includes the glasses area, then the face image includes the glasses area. The composition of the image samples obtained after reconstruction is similar to the image shown in Figure 5. The method of extracting the key part region from the whole face image sample is the same as the method of extracting the key part region from the face image, and will not be repeated here. Similarly, the reconstruction method of the reconstructed image sample is the same as the reconstruction method of the reconstructed target face image, which will not be repeated here.
该余弦相似度是用向量空间中两个向量夹角的余弦值作为衡量两个个体间差异的大小的度量。The cosine similarity uses the cosine value of the angle between two vectors in the vector space as a measure to measure the size of the difference between two individuals.
可选地,通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果,具体为:Optionally, by comparing the cosine similarity between the features of the target face image and the features of the image sample, the cosine comparison result corresponding to the target face image is obtained, specifically:
通过将该目标人脸图像的特征与图像样本的特征之间进行余弦相似度比对,得到该目标人脸图像对应的多个余弦相似度值;By performing a cosine similarity comparison between the feature of the target face image and the feature of the image sample, a plurality of cosine similarity values corresponding to the target face image are obtained;
按照该余弦相似度值由高到低的顺序,选取预置数目的目标人脸图像样本;According to the order of the cosine similarity value from high to low, select a preset number of target face image samples;
对该目标人脸图像样本的性别类别进行数量统计,并将数量最多的性别类别作为第二目标性别类别;Perform quantitative statistics on the gender categories of the target face image sample, and use the gender category with the largest number as the second target gender category;
在该目标人脸图像样本中选取性别类别为该第二目标性别类别的相似人脸图像样本,并提取该相似人脸图像样本与该目标人脸图像之间的余弦相似度值作为目标余弦相似度值;Select a similar face image sample whose gender category is the second target gender category in the target face image sample, and extract the cosine similarity value between the similar face image sample and the target face image as the target cosine similarity degree value;
计算该目标余弦相似度值的平均值;Calculate the average of the target cosine similarity values;
将该第二目标性别类别和所述平均值作为该余弦比对结果。The second target gender category and the average value are used as the cosine comparison result.
余弦相似度值的数值越大,表示相似度越高。首先根据算出的余弦相似度值,将图像样本,按照相似度由高到底的顺序进行排列,然后由相似度高开始,选取出预置数目的目标人脸图像样本。预置数目任意选取,当然选取的数目多,则最后判别的准确性就会提高。本实施例优选的预置数目为20个。The larger the value of the cosine similarity value, the higher the similarity. First, according to the calculated cosine similarity value, the image samples are arranged in order of similarity from high to low, and then a preset number of target face image samples are selected starting from the high similarity. The preset number can be selected arbitrarily. Of course, if the number selected is large, the accuracy of final discrimination will be improved. The preferred number of presets in this embodiment is 20.
对该目标人脸图像样本的性别类别进行数量统计,并将样本数量最多的性别类别作为目标性别类别,如果该目标人脸图像样本中男性类别的样本的数量多,则目标性别类别为男性;如果该目标人脸图像样本中女性类别的样本的数量多,则目标性别类别为女性。若目标性别类别为男性,则选取目标人脸图像样本中男性的图像样本作为相似人脸图像样本,若目标性别类别为女性,则选取目标人脸图像样本中女性的图像样本作为相似人脸图像样本。The gender category of this target human face image sample is carried out quantitative statistics, and the gender category with the largest number of samples is used as the target gender category, if the number of samples of the male category in the target human face image sample is large, then the target gender category is male; If the number of samples of the female category in the target face image sample is large, the target gender category is female. If the target gender category is male, then select the image samples of men in the target face image samples as similar face image samples; if the target gender category is female, then select the image samples of women in the target face image samples as similar face images sample.
下面以一个具体例子来说明,如何根据目标人脸图像的特征与图像样本的特征之间余弦相似度比对来识别对象的性别,具体说明如下:The following is a specific example to illustrate how to identify the gender of the object according to the cosine similarity comparison between the features of the target face image and the features of the image sample. The specific instructions are as follows:
为了便于说明,设5个图像样本的特征分别为:样本1、样本2、样本3、样本4、样本5,该目标人脸图像为图像1,预置数目为3;设,样本1的性别类别为男性,样本2的性别类别为女性,样本3的性别类别为男性,样本4的性别类别为女性,样本5的性别类别为男性。For the convenience of explanation, let the characteristics of five image samples be: sample 1, sample 2, sample 3, sample 4, and sample 5, the target face image is image 1, and the preset number is 3; suppose, the gender of sample 1 The category is male, the gender category of sample 2 is female, the gender category of sample 3 is male, the gender category of sample 4 is female, and the gender category of sample 5 is male.
将图像1的特征分别与样本1-5的特征进行余弦相似度比对;Compare the cosine similarity between the features of image 1 and the features of samples 1-5;
算出图像1与样本1之间的余弦相似度值为数值1,算出图像1与样本2之间的余弦相似度值为数值2,算出图像1与样本3之间的余弦相似度值为数值3,算出图像1与样本4之间的余弦相似度值为数值4,算出图像1与样本5之间的余弦相似度值为数值5,其中数值5>数值3>数值4>数值1>数值2;Calculate the cosine similarity value between image 1 and sample 1 as 1, calculate the cosine similarity value between image 1 and sample 2 as 2, and calculate the cosine similarity value between image 1 and sample 3 as 3 , Calculate the cosine similarity value between image 1 and sample 4 as a value 4, calculate the cosine similarity value between image 1 and sample 5 as a value 5, where value 5>value 3>value 4>value 1>value 2 ;
按照上述算出的余弦相似度值由高到低的顺序,选取预置数目的目标人脸图像样本为样本5、样本3和样本4;According to the order of the cosine similarity value calculated above from high to low, select a preset number of target face image samples as sample 5, sample 3 and sample 4;
对该目标人脸图像样本的性别类别进行数量统计,男性类别的样本个数为2个,女性类别的样本个数为1个,则男性类别为第二目标性别类别;The gender category of this target face image sample is carried out quantity statistics, the sample number of male category is 2, the sample number of female category is 1, then male category is the second target gender category;
确定男性类别的目标人脸图像样本为样本5和样本3,并算出数值5和数值3的平均值1;Determine the target face image samples of the male category as samples 5 and 3, and calculate the average value 1 of the values 5 and 3;
将平均值1和第二目标性别类别作为该余弦比对结果。The mean value 1 and the second target gender category are used as the cosine comparison result.
S205、将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别。S205 , performing a Bayesian classifier operation on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image.
贝叶斯分类器是通过贝叶斯公式计算出对象属于哪个类别概率的算法,贝叶斯分类器运算的原理是通过某对象的先验概率,利用贝叶斯公式计算出该对象的后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类别作为该对象所属的类别。The Bayesian classifier is an algorithm that calculates the probability of which category an object belongs to through the Bayesian formula. The principle of Bayesian classifier operation is to use the Bayesian formula to calculate the posterior probability of the object through the prior probability of an object. Probability, that is, the probability that the object belongs to a certain class, and the class with the largest posterior probability is selected as the class to which the object belongs.
本发明实施例中是将该性别判别结果和该余弦比对结果作为人脸图像中对象的先验概率,通过贝叶斯公式计算出该对象的属于男性类别和女性类别的后验概率,并选取具有最大后验概率的性别类别作为该对象的性别类别。In the embodiment of the present invention, the gender discrimination result and the cosine comparison result are used as the prior probability of the object in the face image, and the posterior probability of the object belonging to the male category and the female category is calculated by the Bayesian formula, and The gender category with the largest posterior probability is selected as the gender category of the object.
本发明实施例中,根据人脸图像的各关键点在该人脸图像中的位置,提取该人脸图像中关键部位区域,根据该人脸图像中关键部位区域重构人脸的图像,得到该目标人脸图像,通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果,通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果,最后将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。In the embodiment of the present invention, according to the position of each key point of the face image in the face image, the key part area in the face image is extracted, and the image of the face is reconstructed according to the key part area in the face image to obtain The target face image, through the preset deep convolutional neural network prior model, performs gender classification and discrimination on the target face image, and obtains the gender discrimination result corresponding to the target face image. By comparing the target face image The cosine similarity between the features of the target face image and the features of the image sample is obtained, and the cosine comparison result corresponding to the target face image is obtained. Finally, the Bayesian classifier operation is performed on the gender discrimination result and the cosine comparison result to obtain the person The gender of the object in the face image, so that in complex imaging situations, by re-stitching the key parts of the face image, and combining the deep convolutional neural network discrimination with the feature comparison of the image, it is possible to use the face The features, depth texture, edge and color features of the key parts are assisted in the recognition, which increases the accuracy of gender recognition.
请参阅图6,图6是本发明第三实施例提供的基于人脸图像的性别识别装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。图6示例的基于人脸图像的性别识别装置可以是前述图1所示实施例提供的基于人脸图像的性别识别方法的执行主体,可以是终端或终端中的一个控制模块。图6示例的基于人脸图像的性别识别装置,主要包括:性别判别模块601、比对处理模块602和识别模块603。以上各功能模块详细说明如下:Please refer to FIG. 6 . FIG. 6 is a schematic structural diagram of a gender recognition device based on a face image according to a third embodiment of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown. The face image-based gender recognition device illustrated in FIG. 6 may be the subject of execution of the face image-based gender recognition method provided in the embodiment shown in FIG. 1 , and may be a terminal or a control module in the terminal. The gender recognition device based on the face image shown in FIG. 6 mainly includes: a gender discrimination module 601 , a comparison processing module 602 and a recognition module 603 . The above functional modules are described in detail as follows:
性别判别模块601,用于通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果;The gender discrimination module 601 is used to perform gender classification and discrimination on the target face image through the prior model in the preset deep convolutional neural network, and obtain the gender discrimination result corresponding to the target human face image;
比对处理模块602,用于通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果;Comparison processing module 602, for obtaining the cosine comparison result corresponding to the target human face image by comparing the cosine similarity between the features of the target human face image and the features of the image sample;
识别模块603,用于将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别。The identification module 603 is configured to perform a Bayesian classifier operation on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image.
该目标人脸图像是由人脸图像中各��键部位区域组成的图像。该各关键部位区域可以是人脸各个器官部位的区域以及面部轮廓区域,此处对目标人脸图像中各关键部位区域不做限定。需要说明的是,人脸图像和目标人图像的关系为:该目标人脸图像是由该人脸图像中该各关键部位区域组成的图像。该人脸图像用于表示整体人脸的图像。The target face image is an image composed of key parts in the face image. The key part areas may be the areas of various organ parts of the human face and the facial contour area, and the key part areas in the target human face image are not limited here. It should be noted that the relationship between the face image and the target person image is: the target face image is an image composed of the key parts in the face image. The face image is used to represent an image of the whole face.
深度卷积神经网络是一种带有卷积结构的深度神经网络,至少包括两个非线性可训练的卷积层、两个非线性的固定卷积层和全连接层,一共至少5个隐含层,主要应用于语音分析以及图像识别领域。A deep convolutional neural network is a deep neural network with a convolutional structure, including at least two non-linear trainable convolutional layers, two non-linear fixed convolutional layers and a fully connected layer, with a total of at least 5 hidden It is mainly used in the fields of speech analysis and image recognition.
通过深度卷积神经网络训练图像样本就可以得到先验模型,其中训练图像样本以得到先验模型的过程是按照预置的类别对图像样本进行分类的过程,其中先验模型可用于对图像进行分类判别的模型。A priori model can be obtained by training image samples through a deep convolutional neural network. The process of training image samples to obtain a priori model is the process of classifying image samples according to preset categories, and the prior model can be used to classify images. Classification models.
在图像识别领域中,图像的特征是图像识别领域的专有名词,图像的特征的提取是计算机视觉和图像处理中的一个概念。In the field of image recognition, the feature of an image is a proper term in the field of image recognition, and the extraction of image features is a concept in computer vision and image processing.
图像样本的特征可以存储在终端内置的存储模块中,也可以存储在云端服务器上。余弦相似度是用向量空间中两个向量夹角的余弦值作为衡量两个个体间差异的大小的度量。需要说明的是,该人脸图像中对象为该人脸图像中所描绘的人。The features of the image samples can be stored in the built-in storage module of the terminal, or can be stored on the cloud server. Cosine similarity uses the cosine value of the angle between two vectors in a vector space as a measure of the difference between two individuals. It should be noted that the object in the face image is the person depicted in the face image.
贝叶斯分类器是通过贝叶斯公式计算出对象属于哪个类别概率的算法,贝叶斯分类器运算的原理是通过某对象的先验概率,利用贝叶斯公式计算出该对象的后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类别作为该对象所属的类别。本发明实施例中是将该性别判别结果和该余弦比对结果作为人脸图像中对象的先验概率,通过贝叶斯公式计算出该对象所属于的男性类别和女性类别的后验概率,并选取具有最大后验概率的性别类别作为该对象的性别类别。The Bayesian classifier is an algorithm that calculates the probability of which category an object belongs to through the Bayesian formula. The principle of Bayesian classifier operation is to use the Bayesian formula to calculate the posterior probability of the object through the prior probability of an object. Probability, that is, the probability that the object belongs to a certain class, and the class with the largest posterior probability is selected as the class to which the object belongs. In the embodiment of the present invention, the gender discrimination result and the cosine comparison result are used as the prior probability of the object in the face image, and the posterior probability of the male category and the female category to which the object belongs is calculated by Bayesian formula, And select the gender category with the largest posterior probability as the gender category of the object.
需要说明的是,以上图6示例的基于人脸图像的性别识别装置的实施方式中,各功能模块的划分仅是举例说明,实际应用中可以根据需要,例如相应硬件的配置要求或者软件的实现的便利考虑,而将上述功能分配由不同的功能模块完成。而且,实际应用中,本实施例中的相应的功能模块可以是由相应的硬件实现,也可以由相应的硬件执行相应的软件完成。本说明书提供的各个实施例都可应用上述描述原则,以下不再赘述。It should be noted that, in the implementation of the gender recognition device based on the face image shown in FIG. 6 above, the division of each functional module is only an example. In actual applications, it can be based on the needs, such as the configuration requirements of the corresponding hardware or the realization of the software. Considering the convenience, the above-mentioned functions are allocated by different functional modules. Moreover, in practical applications, the corresponding functional modules in this embodiment may be implemented by corresponding hardware, or may be completed by corresponding hardware executing corresponding software. Each of the embodiments provided in this specification can apply the above-mentioned description principle, which will not be described in detail below.
本发明实施例中,性别判别模块602通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果,其中���述目标人脸图像是由人脸图像中各关键部位区域组成的图像,比对处理模块603通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果,识别模块604将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。In the embodiment of the present invention, the gender discrimination module 602 performs gender classification and discrimination on the target face image through the preset deep convolutional neural network prior model, and obtains the gender discrimination result corresponding to the target face image, wherein the target The face image is an image composed of key parts in the face image, and the comparison processing module 603 obtains the target face image by comparing the cosine similarity between the features of the target face image and the features of the image sample For the corresponding cosine comparison result, the recognition module 604 performs Bayesian classifier operation on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image. The key parts of the face image are re-stitched, and the deep convolutional neural network discrimination is combined with the feature comparison of the image, which can use the features, depth texture, edge and color features of each key part of the face for auxiliary recognition, increasing the accuracy of gender recognition.
请参阅图7,本发明第四实施例提供的基于人脸图像的性别识别装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。图7示例的基于人脸图像的性别识别装置可以是前述图2所示实施例提供的基于人脸图像的性别识别方法的执行主体,可以是终端或终端中的一个控制模块。图7示例的基于人脸图像的性别识别装置,主要包括:提取模块701、重构模块702、性别判别模块703、比对处理模块704、识别模块705,其中性别判别模块703包括:判别模块7031和设定模块7032;比对处理模块704包括:比对模块7041、选取模块7042、统计模块7043和设置模块7044。以上各功能模块详细说明如下:Please refer to FIG. 7 , which is a schematic structural diagram of a gender recognition device based on a face image provided by a fourth embodiment of the present invention. For convenience of description, only the parts related to the embodiment of the present invention are shown. The face image-based gender recognition device illustrated in FIG. 7 may be the subject of execution of the face image-based gender recognition method provided in the embodiment shown in FIG. 2 , and may be a terminal or a control module in the terminal. The gender recognition device based on the face image shown in Figure 7 mainly includes: an extraction module 701, a reconstruction module 702, a gender discrimination module 703, a comparison processing module 704, and a recognition module 705, wherein the gender discrimination module 703 includes: a discrimination module 7031 and setting module 7032; comparison processing module 704 includes: comparison module 7041, selection module 7042, statistics module 7043 and setting module 7044. The above functional modules are described in detail as follows:
提取模块701,用于根据人脸图像的各关键点在该人脸图像中的位置,提取该人脸图像中关键部位区域。The extraction module 701 is configured to extract the key part area in the face image according to the position of each key point of the face image in the face image.
重构模块702,用于根据该人脸图像中关键部位区域重构人脸的图像,得到该目标人脸图像。The reconstruction module 702 is configured to reconstruct the image of the face according to the key parts in the face image to obtain the target face image.
该目标人脸图像是由人脸图像中各关键部位区域组成的图像。The target face image is an image composed of key parts in the face image.
可选地,该装置还包括:确定模块用于通过人脸检测以及人脸关键点定位确定待识别图像中的人脸图像;该确定模块还用于将该待识别图像中的人脸图像设定为检测区域。Optionally, the device further includes: a determination module for determining the face image in the image to be recognized through face detection and face key point positioning; the determination module is also used for setting the face image in the image to be recognized as the detection area.
通过HAAR分类器或者DLIB算法对输入的图像进行人脸检测,然后对检测后的图像通过SDM算法进行人脸关键点定位,其中通过SDM算法定位的人脸关键点包括:眉毛、眼睛、鼻子、嘴巴和面部轮廓。当然人脸检测和人脸关键点定位也可以通过其他算法来实现。Use the HAAR classifier or DLIB algorithm to detect the face of the input image, and then use the SDM algorithm to locate the key points of the face on the detected image. The key points of the face located by the SDM algorithm include: eyebrows, eyes, nose, Mouth and facial contours. Of course, face detection and face key point positioning can also be realized by other algorithms.
HAAR分类器,包含Adaboost算法,在图像识别领域中,分类器是指对人脸和非人脸进行分类的算法。DLIB是一种C++的算法库,可应用于人脸检测和人脸关键点定位。The HAAR classifier includes the Adaboost algorithm. In the field of image recognition, a classifier refers to an algorithm for classifying human faces and non-human faces. DLIB is a C++ algorithm library that can be applied to face detection and face key point location.
图3为人脸检测的示意图,如图3所示,深黑色方形框为人脸检测框,圆形表示人脸,三角形表示动物,多边形表示树木,经过人脸检测可以在图像中提取人脸图像,并将人脸图像设置于人脸检测框内。Figure 3 is a schematic diagram of face detection. As shown in Figure 3, the dark black square frame is the face detection frame, the circle represents the face, the triangle represents the animal, and the polygon represents the tree. After the face detection, the face image can be extracted from the image. And set the face image in the face detection frame.
可选地,该装置还包括扩大模块用于根据预置倍数扩大该检测区域,以使该人脸图像中包括头发区域的图像。扩大模块根据预置倍数扩大该检测区域是将头发区域扩充到人脸图像中,扩大检测区域的方式可以是将整个检测区域进行扩大,也可以是将检测区域的上部、下部、左右两部分均扩大预置倍数,还可以只扩大该检测区域的上部和下部。该预置倍数与头发长度以及脑顶头发高度有关,本实施中优选的预置倍数的数值为0.15,即将该检测区域的上部和下部各扩大0.15倍。图4为人脸图像的示意图,其中图4(a)和图4(b)中长方形框以内为检测区域,图4(a)中的检测区域内包括扩大检测区域之前的人脸图像,图4(b)中的检测区域内包括扩大检测区域之后的人脸图像。Optionally, the device further includes an expansion module for expanding the detection area according to a preset multiple, so that the face image includes an image of a hair area. The expansion module expands the detection area according to the preset multiple to expand the hair area into the face image. The way to expand the detection area can be to expand the entire detection area, or to expand the upper, lower, and left and right parts of the detection area. Enlarging the preset multiple can also expand only the upper and lower parts of the detection area. The preset multiple is related to the length of the hair and the height of the hair on the top of the head. In this implementation, the preferred value of the preset multiple is 0.15, that is, the upper part and the lower part of the detection area are each enlarged by 0.15 times. Fig. 4 is a schematic diagram of a human face image, wherein the detection area is within the rectangular frame in Fig. 4 (a) and Fig. 4 (b), and the detection area in Fig. 4 (a) includes the face image before expanding the detection area, Fig. 4 The detection area in (b) includes the face image after expanding the detection area.
由于头发的颜色、长短以及发型是识别性别很重要的依据,所以人脸图像中包括头发区域可以更���确识别性别。Since the color, length, and hairstyle of hair are very important basis for identifying gender, including the hair region in the face image can identify gender more accurately.
可选地,该装置还包括矫正模块用于对该检测区域中眼睛区域进行矫正,以使该人脸图像中该眼睛区域内的双眼处于同一水平线上。矫正眼睛的方式不做限定,可以通过几何变换来矫正眼睛,也可以改变两个眼睛之间夹角来矫正眼睛,最终的目的是将该眼睛区域内的双眼处于同一水平线上。Optionally, the device further includes a correction module for correcting the eye area in the detection area, so that the eyes in the eye area in the face image are on the same horizontal line. The way to correct the eyes is not limited, the eyes can be corrected by geometric transformation, and the angle between the two eyes can also be changed to correct the eyes. The ultimate goal is to put the eyes in the eye area on the same horizontal line.
人脸关键点包括:眼睛、鼻子、嘴巴、眉毛、头发以及面部轮廓,提取模块701通过各关键点在该人脸图像中的位置,提取该人脸图像中关键部位区域。其中该人脸图像中关键部位区域包括:头发区域、眉毛区域、眼睛区域、鼻子区域、嘴巴区域。通过重构模块702重构各关键部位区域得到的目标人脸图像可以更加精确的描绘不同性别的人脸的发型、皮肤以及面部轮廓等人脸的局部区域。The key points of the human face include: eyes, nose, mouth, eyebrows, hair and facial contour. The extraction module 701 extracts the key parts of the human face image based on the positions of each key point in the human face image. Wherein, the key part areas in the face image include: a hair area, an eyebrow area, an eye area, a nose area, and a mouth area. The target face image obtained by reconstructing each key part area through the reconstruction module 702 can more accurately describe the local area of the face such as hairstyle, skin, and facial contour of faces of different genders.
如图5所示,图5为由各关键部位区域重构得到的目标人脸图像的示意图。为了便于说明及显示,图5所示的示意图中关键部位区域仅包括眼睛区域、眉毛区域、鼻子区域和嘴巴区域,其他关键部位区域并没有显示在图5中,图5所示的示意图仅仅是一个举例,并不能对本发明中关键部位区域构成限定。As shown in FIG. 5 , FIG. 5 is a schematic diagram of a target face image reconstructed from each key part area. For the convenience of explanation and display, the key parts in the schematic diagram shown in Figure 5 only include the eye area, eyebrow area, nose area and mouth area, and other key parts are not shown in Figure 5, and the schematic diagram shown in Figure 5 is only An example does not constitute a limitation to key parts and regions in the present invention.
性别判别模块703,用于通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到该目标人脸图像对应的性别判别结果。The gender discrimination module 703 is configured to perform gender classification and discrimination on the target face image through the preset prior model in the deep convolutional neural network, and obtain a gender discrimination result corresponding to the target face image.
可选地,性别判别模块703包括:判别模块7031和设定模块7032;Optionally, the gender discrimination module 703 includes: a discrimination module 7031 and a setting module 7032;
判别模块7031,用于通过该深度卷积神经网络中先验模型,对该目标人脸图像进行分类判别,得到该目标人脸图像对应的最大概率值以及该最大概率值对应的第一目标性别类别;The discrimination module 7031 is used to classify and discriminate the target face image through the prior model in the deep convolutional neural network, and obtain the maximum probability value corresponding to the target human face image and the first target gender corresponding to the maximum probability value category;
设定模块7032,用于将该最大概率值和该第一目标性别类别作为所述性别判别结果。A setting module 7032, configured to use the maximum probability value and the first target gender category as the gender discrimination result.
该第一目标性别类别为男性类别或女性类别。深度卷积神经网络是一种带有卷积结构的深度神经网络,至少包括两个非线性可训练的卷积层、两个非线性的固定卷积层和全连接层,一共至少5个隐含层,主要应用于语音分析以及图像识别领域。此处对卷积神经网络、先验模型的解释说明请参照本发明第一实施例中相关描述,此处不做赘述。The first target gender category is a male category or a female category. A deep convolutional neural network is a deep neural network with a convolutional structure, including at least two non-linear trainable convolutional layers, two non-linear fixed convolutional layers and a fully connected layer, with a total of at least 5 hidden It is mainly used in the fields of speech analysis and image recognition. For the explanation of the convolutional neural network and the prior model here, please refer to the relevant description in the first embodiment of the present invention, and details are not repeated here.
比对处理模块704,用于通过比对该目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到该目标人脸图像对应的余弦比对结果。The comparison processing module 704 is configured to obtain a cosine comparison result corresponding to the target human face image by comparing the cosine similarity between the features of the target human face image and the features of the image sample.
该图像样本为由整体人脸图像样本中各关键部位区域组成的图像样本,其中该整体人脸图像样本中关键部位区域包括:头发区域、眉毛区域、眼睛区域、鼻子区域、嘴巴区域。该整体人脸图像样本中关键部位区域与该人脸图像中关键部位区域中包括的区域是对应的,即,若该整体人脸图像样本中包括眉毛区域,则该人脸图像中包括眉毛区域,若该整体人脸图像样本中包括眼镜区域,则该人脸图像中包括眼镜区域。重构后得到的图像样本的构成与图5所示的图像相似。从整体人脸图像样本中提取关键部位区域的方式与从人脸图像提取关键部位区域的提取方式相同,此处不做赘述。同样的,重构得到图像样本的重构方式与重构得到目标人脸图像的重构方式相同,此处不做赘述。The image sample is an image sample composed of various key parts in the overall face image sample, wherein the key parts in the overall face image sample include: hair area, eyebrow area, eye area, nose area, and mouth area. The key part area in the overall human face image sample corresponds to the area included in the key part area in the human face image, that is, if the overall human face image sample includes the eyebrow area, then the human face image includes the eyebrow area , if the overall face image sample includes the glasses area, then the face image includes the glasses area. The composition of the image samples obtained after reconstruction is similar to the image shown in Figure 5. The method of extracting the key part region from the whole face image sample is the same as the method of extracting the key part region from the face image, and will not be repeated here. Similarly, the reconstruction method of the reconstructed image sample is the same as the reconstruction method of the reconstructed target face image, which will not be repeated here.
该余弦相似度是用向量空间中两个向量夹角的余弦值作为衡量两个个体间差异的大小的度量。The cosine similarity uses the cosine value of the angle between two vectors in the vector space as a measure to measure the size of the difference between two individuals.
可选地,比对处理模块704包括:比对模块7041、选取模块7042、统计模块7043、计算模块7044和设置模块7045。Optionally, the comparison processing module 704 includes: a comparison module 7041 , a selection module 7042 , a statistics module 7043 , a calculation module 7044 and a setting module 7045 .
比对模块7041,用于通过将该目标人脸图像的特征与图像样本的特征之间进行余弦相似度比对,得到该目标人脸图像对应的多个余弦相似度值;The comparison module 7041 is used to obtain a plurality of cosine similarity values corresponding to the target face image by performing a cosine similarity comparison between the features of the target face image and the features of the image sample;
选取模块7042,用于按照该余弦相似度值由高到低的顺序,选取预置数目的目标人脸图像样本;The selection module 7042 is used to select a preset number of target face image samples according to the order of the cosine similarity value from high to low;
统计模块7043,用于对该目标人脸图像样本的性别类别进行数量统计,并将数量最多的性别类别作为第二目标性别类别;Statistical module 7043, used for counting the gender category of the target face image sample, and using the gender category with the largest number as the second target gender category;
选取模块7042,还用于在该目标人脸图像样本中选取性别类别为该第二目标性别类别的相似人脸图像样本,并提取该相似人脸图像样本与该目标人脸图像之间的余弦相似度值作为目标余弦相似度值;The selecting module 7042 is also used to select a similar human face image sample whose gender category is the second target gender category in the target human face image sample, and extract the cosine between the similar human face image sample and the target human face image The similarity value is used as the target cosine similarity value;
计算模块7044,用于计算该目标余弦相似度值的平均值;Calculation module 7044, for calculating the average value of the target cosine similarity value;
设置模块7045,用于将该第二目标性别类别和所述平均值作为该余弦比对结果。A setting module 7045, configured to use the second target gender category and the average value as the cosine comparison result.
余弦相似度值的数值越大,表示相似度越高。预置数目任意选取,当然选取的数目多,则最后判别的准确性就会提高。本实施例优选的预置数目为20个。The larger the value of the cosine similarity value, the higher the similarity. The preset number can be selected arbitrarily. Of course, if the number selected is large, the accuracy of final discrimination will be improved. The preferred number of presets in this embodiment is 20.
统计模块7043对该目标人脸图像样本的性别类别进行数量统计,并将样本数量最多的性别类别作为目标性别类别,如果该目标人脸图像样本中男性类别的样本的数量多,则目标性别类别为男性;如果该目标人脸图像样本中女性类别的样本的数量多,则目标性别类别为女性。若目标性别类别为男性,则选取模块7042选取目标人脸图像样本中男性的图像样本作为相似人脸图像样本,若目标性别类别为女性,则选取模块7042选取目标人脸图像样本中女性的图像样本作为相似人脸图像样本。Statistical module 7043 performs quantitative statistics on the gender category of the target face image sample, and uses the gender category with the largest number of samples as the target gender category. If the number of samples of the male category in the target human face image sample is large, the target gender category is a male; if the number of samples of the female category in the target face image sample is large, the target gender category is female. If the target gender category is male, then the selection module 7042 selects the image samples of men in the target face image samples as similar face image samples, and if the target gender category is female, then the selection module 7042 selects the images of women in the target face image samples samples as similar face image samples.
识别模块705,用于将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别。The recognition module 705 is configured to perform Bayesian classifier operations on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image.
贝叶斯分类器是通过贝叶斯公式计算出对象属于哪个类别概率的算法,贝叶斯分类器运算的原理是通过某对象的先验概率,利用贝叶斯公式计算出该对象的后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类别作为该对象所属的类别。The Bayesian classifier is an algorithm that calculates the probability of which category an object belongs to through the Bayesian formula. The principle of Bayesian classifier operation is to use the Bayesian formula to calculate the posterior probability of the object through the prior probability of an object. Probability, that is, the probability that the object belongs to a certain class, and the class with the largest posterior probability is selected as the class to which the object belongs.
本发明实施例中是将该性别判别结果和该余弦比对结果作为人脸图像中对象的先验概率,识别模块705通过贝叶斯公式计算出该对象的属于男性类别和女性类别的后验概率,并选取具有最大后验概率的性别类别作为该对象的性别类别。In the embodiment of the present invention, the gender discrimination result and the cosine comparison result are used as the prior probability of the object in the face image, and the identification module 705 calculates the posterior probability of the object belonging to the male category and the female category through the Bayesian formula probability, and select the gender category with the largest posterior probability as the gender category of the object.
本发明实施例中,提取模块701根据所述人脸图像的各关键点在所述人脸图像中的位置,提取所述人脸图像中关键部位区域,其中所述人脸图像中关键部位区域包括:头发区域、眉毛区域、眼睛区域、鼻子区域、嘴巴区域,重构模块702根据所述人脸图像中关键部位区域重构人脸的图像,得到所述目标人脸图像,,性别判别模块703通过预置的深度卷积神经网络中先验模型,对目标人脸图像进行性别分类判别,得到所述目标人脸图像对应的性别判别结果,其中所述目标人脸图像是由人脸图像中各关键部位区域组成的图像,然后比对处理模块704通过比对所述目标人脸图像的特征与图像样本的特征之间的余弦相似度,得到所述目标人脸图像对应的余弦比对结果,最后识别模块705将该性别判别结果和该余弦比对结果进行贝叶斯分类器运算,得到该人脸图像中对象的性别,这样在复杂的成像情况下,通过对人脸图像中各关键部位重新进行拼接,并将深度卷积神经网络判别和图像的特征比对相结合,能够利用人脸各关键部位区域的特征、深度纹理、边缘与颜色特征进行辅助识别,增加了性别识别的准确性。In the embodiment of the present invention, the extraction module 701 extracts the key part area in the face image according to the position of each key point of the face image in the face image, wherein the key part area in the face image Including: hair area, eyebrow area, eye area, nose area, mouth area, the reconstruction module 702 reconstructs the image of the human face according to the key part area in the human face image, and obtains the target human face image, and the gender discrimination module 703 Perform gender classification and discrimination on the target face image through the preset prior model in the deep convolutional neural network, and obtain the gender discrimination result corresponding to the target face image, wherein the target face image is composed of the face image The image composed of each key part area in the image, and then the comparison processing module 704 obtains the cosine comparison corresponding to the target face image by comparing the cosine similarity between the features of the target face image and the features of the image sample As a result, the final recognition module 705 performs Bayesian classifier operations on the gender discrimination result and the cosine comparison result to obtain the gender of the object in the face image. The key parts are re-stitched, and the deep convolutional neural network discrimination is combined with the feature comparison of the image, which can use the features, depth texture, edge and color features of each key part of the face for auxiliary recognition, increasing the gender recognition. accuracy.
图8是本发明第五实施例提供的基于人脸图像的性别识别方法的电子设备的硬件结构示意图,如图8所示,该电子设备包括:Fig. 8 is a schematic diagram of the hardware structure of the electronic device of the gender recognition method based on the face image provided by the fifth embodiment of the present invention. As shown in Fig. 8, the electronic device includes:
一个或多个处理器810以及存储器820,图8中以一个处理器810为例。One or more processors 810 and memory 820, one processor 810 is taken as an example in FIG. 8 .
该电子设备还可以包括:输入装置830和输出装置840。The electronic device may further include: an input device 830 and an output device 840 .
处理器810、存储器820、输入装置830和输出装置840可以通过总线或者其他方式连接,图8中以通过总线850连接为例。The processor 810, the memory 820, the input device 830, and the output device 840 may be connected through a bus or in other ways. In FIG. 8, connection through a bus 850 is taken as an example.
存储器820作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的数据存储方法对应的程序指令/模块(例如,附图6所示的性别判别模块601、比对处理模块602和识别模块603)。处理器810通过运行存储在存储器820中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的基于人脸图像的性别识别方法。The memory 820, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and modules, such as program instructions corresponding to the data storage method in the embodiment of the present application /modules (for example, gender discrimination module 601, comparison processing module 602 and recognition module 603 shown in FIG. 6). The processor 810 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 820, that is, realizes the face image-based gender recognition method of the above-mentioned method embodiment.
存储器820可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据基于人脸图像的性别识别装置的使用所创建的数据等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器820可选包括相对于处理器810远程设置的存储器,这些远程存储器可以通过网络连接至基于人脸图像的性别识别装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; data etc. In addition, the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the storage 820 may optionally include storages that are remotely located relative to the processor 810, and these remote storages may be connected to the gender recognition device based on facial images through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置830可接收输入的数字或字符信息,以及产生与基于人脸图像的性别识别装置的用户设置以及功能控制有关的键信号输入。输出装置840可包括显示屏等显示设备。The input device 830 can receive input numbers or character information, and generate key signal input related to user settings and function control of the gender recognition device based on facial images. The output device 840 may include a display device such as a display screen.
所述一个或者多个模块存储在所述存储器820中,当被所述一个或者多个处理器810执行时,执行上述任意方法实施例中的基于人脸图像的性别识别方法。The one or more modules are stored in the memory 820, and when executed by the one or more processors 810, perform the gender recognition method based on a face image in any method embodiment above.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above-mentioned products can execute the method provided by the embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, refer to the method provided in the embodiment of this application.
本发明实施例的电子设备以多种形式存在,包括但不限于:The electronic equipment of the embodiment of the present invention exists in various forms, including but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机、多媒体手机、功能性手机,以及低端手机等。(1) Mobile communication equipment: This type of equipment is characterized by mobile communication functions, and its main goal is to provide voice and data communication. Such terminals include: smart phones, multimedia phones, feature phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:掌上电脑(PDA Personal DigitalAssistant)、移动互联网设备(MID,Mobile Internet Device)和超级移动个人计算机(UMPC,Ultra-mobile Personal Computer)设备等。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has the characteristics of mobile Internet access. Such terminals include: PDA Personal Digital Assistant, Mobile Internet Device (MID, Mobile Internet Device) and Ultra-mobile Personal Computer (UMPC, Ultra-mobile Personal Computer) equipment, etc.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器,掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment equipment: This type of equipment can display and play multimedia content. Such devices include: audio and video players, handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The composition of a server includes a processor, hard disk, memory, system bus, etc. The server is similar to a general-purpose computer architecture, but due to the need to provide high-reliability services, it is important in terms of processing power and stability. , Reliability, security, scalability, manageability and other aspects have high requirements.
(5)其他具有数据交互功能的电子装置。(5) Other electronic devices with data interaction function.
在本申请所提供的多个实施例中,应该理解到,所揭露的系统、终端和方法,可以通过其它的方式实现。例如,以上所描述的终端实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信链接可以是通过一些接口,模块的间接耦合或通信链接,可以是电性,机械或其它的形式。In the multiple embodiments provided in this application, it should be understood that the disclosed system, terminal and method may be implemented in other ways. For example, the terminal embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication link shown or discussed may be through some interfaces, and the indirect coupling or communication link between modules may be in electrical, mechanical or other forms.
所述作为分离部件���明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated modules are realized in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes.
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本发明所必须的。It should be noted that, for the sake of simplicity of description, all the aforementioned method embodiments are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. Because of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
以上为对本发明所提供的基于人脸图像的性别识别方法及装置的描述,对于本领域的技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。The above is the description of the face image-based gender recognition method and device provided by the present invention. For those skilled in the art, according to the idea of the embodiment of the present invention, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610698494.4A CN106326857A (en) | 2016-08-19 | 2016-08-19 | Gender identification method and gender identification device based on face image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610698494.4A CN106326857A (en) | 2016-08-19 | 2016-08-19 | Gender identification method and gender identification device based on face image |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106326857A true CN106326857A (en) | 2017-01-11 |
Family
ID=57741455
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610698494.4A Pending CN106326857A (en) | 2016-08-19 | 2016-08-19 | Gender identification method and gender identification device based on face image |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106326857A (en) |
Cited By (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107578029A (en) * | 2017-09-21 | 2018-01-12 | 北京邮电大学 | Method, device, electronic equipment and storage medium for computer-aided picture authentication |
| CN107886474A (en) * | 2017-11-22 | 2018-04-06 | 北京达佳互联信息技术有限公司 | Image processing method, device and server |
| CN107958245A (en) * | 2018-01-12 | 2018-04-24 | 上海���鹏信息科技有限公司 | A kind of gender classification method and device based on face characteristic |
| CN108122001A (en) * | 2017-12-13 | 2018-06-05 | 北京小米移动软件有限公司 | Image-recognizing method and device |
| CN108154169A (en) * | 2017-12-11 | 2018-06-12 | 北京小米移动软件有限公司 | Image processing method and device |
| CN108664948A (en) * | 2018-05-21 | 2018-10-16 | 北京京东尚科信息技术有限公司 | Method and apparatus for generating information |
| CN109271957A (en) * | 2018-09-30 | 2019-01-25 | 厦门市巨龙信息科技有限公司 | Face gender identification method and device |
| CN109493490A (en) * | 2018-11-27 | 2019-03-19 | 电卫士智能电器(北京)有限公司 | Electricity consumption user right judgment method and device |
| CN109584417A (en) * | 2018-11-27 | 2019-04-05 | 电卫士智能电器(北京)有限公司 | Door-access control method and device |
| CN110210293A (en) * | 2018-10-30 | 2019-09-06 | 上海市服装研究所有限公司 | A kind of gender identification method based on three-dimensional data and face-image |
| CN110751215A (en) * | 2019-10-21 | 2020-02-04 | 腾讯科技(深圳)有限公司 | Image identification method, device, equipment, system and medium |
| CN110826525A (en) * | 2019-11-18 | 2020-02-21 | 天津高创安邦技术有限公司 | Face recognition method and system |
| CN110880011A (en) * | 2018-09-05 | 2020-03-13 | 宏达国际电子股份有限公司 | Image segmentation method, device and non-transitory computer readable medium thereof |
| CN111353943A (en) * | 2018-12-20 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | A face image restoration method, device and readable storage medium |
| CN111951267A (en) * | 2020-09-08 | 2020-11-17 | 南方科技大学 | Gender judgment method, device, server and storage medium based on neural network |
| CN112882042A (en) * | 2021-01-14 | 2021-06-01 | 天津市水产研究所 | Marine ranching seabed telemetering and identifying method based on acoustic data |
| CN116778541A (en) * | 2022-03-10 | 2023-09-19 | 帮瀛网络科技(北京)股份有限公司 | A gender recognition method and system based on facial contour features |
-
2016
- 2016-08-19 CN CN201610698494.4A patent/CN106326857A/en active Pending
Cited By (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107578029A (en) * | 2017-09-21 | 2018-01-12 | 北京邮电大学 | Method, device, electronic equipment and storage medium for computer-aided picture authentication |
| CN107578029B (en) * | 2017-09-21 | 2020-03-27 | 北京邮电大学 | Computer-aided picture authentication method and device, electronic equipment and storage medium |
| CN107886474A (en) * | 2017-11-22 | 2018-04-06 | 北京达佳互联信息技术有限公司 | Image processing method, device and server |
| CN108154169A (en) * | 2017-12-11 | 2018-06-12 | 北京小米移动软件有限公司 | Image processing method and device |
| CN108122001A (en) * | 2017-12-13 | 2018-06-05 | 北京小米移动软件有限公司 | Image-recognizing method and device |
| CN108122001B (en) * | 2017-12-13 | 2022-03-11 | 北京小米移动软件有限公司 | Image recognition method and device |
| CN107958245A (en) * | 2018-01-12 | 2018-04-24 | 上海正鹏信息科技有限公司 | A kind of gender classification method and device based on face characteristic |
| CN108664948A (en) * | 2018-05-21 | 2018-10-16 | 北京京东尚科信息技术有限公司 | Method and apparatus for generating information |
| CN110880011A (en) * | 2018-09-05 | 2020-03-13 | 宏达国际电子股份有限公司 | Image segmentation method, device and non-transitory computer readable medium thereof |
| CN109271957B (en) * | 2018-09-30 | 2020-10-20 | 厦门市巨龙信息科技有限公司 | Face gender identification method and device |
| CN109271957A (en) * | 2018-09-30 | 2019-01-25 | 厦门市巨龙信息科技有限公司 | Face gender identification method and device |
| CN110210293A (en) * | 2018-10-30 | 2019-09-06 | 上海市服装研究所有限公司 | A kind of gender identification method based on three-dimensional data and face-image |
| CN109584417A (en) * | 2018-11-27 | 2019-04-05 | 电卫士智能电器(北京)有限公司 | Door-access control method and device |
| CN109493490A (en) * | 2018-11-27 | 2019-03-19 | 电卫士智能电器(北京)有限公司 | Electricity consumption user right judgment method and device |
| CN111353943A (en) * | 2018-12-20 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | A face image restoration method, device and readable storage medium |
| CN111353943B (en) * | 2018-12-20 | 2023-12-26 | 杭州海康威视数字技术股份有限公司 | A face image recovery method, device and readable storage medium |
| CN110751215A (en) * | 2019-10-21 | 2020-02-04 | 腾讯科技(深圳)有限公司 | Image identification method, device, equipment, system and medium |
| CN110826525B (en) * | 2019-11-18 | 2023-05-26 | 天津高创安邦技术有限公司 | Face recognition method and system |
| CN110826525A (en) * | 2019-11-18 | 2020-02-21 | 天津高创安邦技术有限公司 | Face recognition method and system |
| CN111951267A (en) * | 2020-09-08 | 2020-11-17 | 南方科技大学 | Gender judgment method, device, server and storage medium based on neural network |
| CN112882042B (en) * | 2021-01-14 | 2022-06-21 | 天津市水产研究所 | Marine ranching seabed telemetering and identifying method based on acoustic data |
| CN112882042A (en) * | 2021-01-14 | 2021-06-01 | 天津市水产研究所 | Marine ranching seabed telemetering and identifying method based on acoustic data |
| CN116778541A (en) * | 2022-03-10 | 2023-09-19 | 帮瀛网络科技(北京)股份有限公司 | A gender recognition method and system based on facial contour features |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106326857A (en) | Gender identification method and gender identification device based on face image | |
| CN106469298A (en) | Age recognition methodss based on facial image and device | |
| CN106295591A (en) | Gender identification method based on facial image and device | |
| CN112395979B (en) | Image-based health state identification method, device, equipment and storage medium | |
| KR102174595B1 (en) | System and method for identifying faces in unconstrained media | |
| CN107633207B (en) | AU characteristic recognition methods, device and storage medium | |
| CN111291817B (en) | Image recognition methods, devices, electronic equipment and computer-readable media | |
| Zhang et al. | Random Gabor based templates for facial expression recognition in images with facial occlusion | |
| CN104573652B (en) | Determine the method, apparatus and terminal of the identity of face in facial image | |
| CN113221771B (en) | Living body face recognition method, device, apparatus, storage medium and program product | |
| CN105160318B (en) | Lie detecting method based on facial expression and system | |
| US20210012777A1 (en) | Context acquiring method and device based on voice interaction | |
| CN111310705A (en) | Image recognition method and device, computer equipment and storage medium | |
| CN106407911A (en) | Image-based eyeglass recognition method and device | |
| CN112818909A (en) | Image updating method and device, electronic equipment and computer readable medium | |
| CN111898413A (en) | Face recognition method, device, electronic device and medium | |
| CN113553961B (en) | Training method and device of face recognition model, electronic equipment and storage medium | |
| WO2019095571A1 (en) | Human-figure emotion analysis method, apparatus, and storage medium | |
| CN113706550A (en) | Image scene recognition and model training method and device and computer equipment | |
| CN107911643B (en) | Method and device for showing scene special effect in video communication | |
| CN113255557A (en) | Video crowd emotion analysis method and system based on deep learning | |
| Zeng et al. | Occlusion‐invariant face recognition using simultaneous segmentation | |
| CN116386099A (en) | Face multi-attribute recognition method and its model acquisition method and device | |
| Abate et al. | Smartphone enabled person authentication based on ear biometrics and arm gesture | |
| Wang et al. | A study of convolutional sparse feature learning for human age estimate |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170111 |
|
| WD01 | Invention patent application deemed withdrawn after publication |