Movatterモバイル変換


[0]ホーム

URL:


CN110502959A - Gender judgment method, gender judgment device, storage medium and electronic equipment - Google Patents

Gender judgment method, gender judgment device, storage medium and electronic equipment
Download PDF

Info

Publication number
CN110502959A
CN110502959ACN201810476279.9ACN201810476279ACN110502959ACN 110502959 ACN110502959 ACN 110502959ACN 201810476279 ACN201810476279 ACN 201810476279ACN 110502959 ACN110502959 ACN 110502959A
Authority
CN
China
Prior art keywords
preset model
training
face images
gender
feature set
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810476279.9A
Other languages
Chinese (zh)
Inventor
张弓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810476279.9ApriorityCriticalpatent/CN110502959A/en
Publication of CN110502959ApublicationCriticalpatent/CN110502959A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The embodiment of the application discloses a method, a device, a storage medium and electronic equipment for judging the gender, wherein the method comprises the steps of obtaining a plurality of training face images from a face database; acquiring a high-level feature set of a plurality of training face images by using a first neural network of a preset model, and acquiring a bottom-level feature set of the plurality of training face images by using a second neural network of the preset model; fusing the high-level feature set and the bottom-level feature set to obtain a fused feature set; inputting the fusion characteristic set serving as training data into a prediction module of a preset model for training to obtain a trained preset model; and judging the current face image by using the trained preset model to obtain the gender characteristics corresponding to the current face image. The accuracy of judging the image gender by the trained preset model can be improved.

Description

Translated fromChinese
性别判断方法、装置、存储介质及电子设备Gender determination method, device, storage medium and electronic device

技术领域technical field

本申请涉及电子设备技术领域,具体涉及一种性别判断方法、装置、存储介质及电子设备。The present application relates to the technical field of electronic devices, and in particular, to a gender determination method, device, storage medium and electronic device.

背景技术Background technique

目前,随着终端技术的高速发展,如智能手机越来越深入人们的生活之中,智能手机的拍照功能越来越强大,智能手机已成为用户拍照的首选。At present, with the rapid development of terminal technology, for example, smart phones have become more and more embedded in people's lives, and the camera functions of smart phones have become more and more powerful, and smart phones have become the first choice for users to take pictures.

现有的智能手机的人脸性别识别方法中,是使用大量的人脸图像对模型进行训练,然后将事先训练好的模型植入智能手机系统中,在拍照时使用训练好的性别识别系统对照片中的人物性别进行判断。然而现有的性别判断系统通常会出现判断不准确的情况。In the existing face gender recognition method of smart phone, a large number of face images are used to train the model, and then the pre-trained model is implanted into the smart phone system, and the trained gender recognition system is used when taking pictures. The gender of the person in the photo is judged. However, the existing gender judgment systems usually have inaccurate judgments.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种性别判断方法、装置、存储介质及电子设备,能够提高对图像的性别判断的准确度。The embodiments of the present application provide a gender determination method, device, storage medium and electronic device, which can improve the accuracy of gender determination of an image.

第一方面,本申请实施例了提供了的性别判断方法,包括:In the first aspect, the embodiments of the present application provide a gender judgment method, including:

从人脸数据库中获取多张训练人脸图像;Obtain multiple training face images from the face database;

利用预设模型的第一神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取所述多张训练人脸图像的底层特征集合;Use the first neural network of the preset model to obtain the high-level feature sets of the multiple training face images, and use the second neural network of the preset model to obtain the low-level feature sets of the multiple training face images;

将所述高层特征集合和所述底层特征集合进行融合,得到融合特征集合;Fusing the high-level feature set and the bottom-level feature set to obtain a fusion feature set;

将所述融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;Inputting the fusion feature set as training data into a prediction module of a preset model for training, to obtain a trained preset model;

利用所述训练后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征。The current face image is judged by using the trained preset model, and the gender feature corresponding to the current face image is obtained.

第二方面,本申请实施例提供了的一种性别判断装置,所述装置包括:In a second aspect, an embodiment of the present application provides a gender determination device, the device comprising:

训练人脸图像获取模块,用于从人脸数据库中获取多张训练人脸图像;The training face image acquisition module is used to obtain multiple training face images from the face database;

第一获取模块,用于利用预设模型的第一神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取所述多张训练人脸图像的底层特征集合;The first obtaining module is used to obtain the high-level feature sets of the multiple training face images by using the first neural network of the preset model, and obtain the bottom layer of the multiple training face images using the second neural network of the preset model. feature set;

第二获取模块,用于将所述高层特征集合和所述底层特征集合进行融合,得到融合特征集合;A second acquisition module, configured to fuse the high-level feature set and the bottom-level feature set to obtain a fused feature set;

训练模块,用于将所述融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;A training module, for inputting the fusion feature set as training data into a prediction module of a preset model for training to obtain a trained preset model;

判断模块,用于利用所述训练后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征。The judgment module is used for judging the current face image by using the trained preset model to obtain the gender feature corresponding to the current face image.

第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的性别判断方法。In a third aspect, the storage medium provided by the embodiment of the present application stores a computer program thereon, and when the computer program runs on a computer, the computer is made to execute the gender determination method provided by any embodiment of the present application.

第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行如本申请任一实施例提供的性别判断方法。In a fourth aspect, an electronic device provided by an embodiment of the present application includes a processor and a memory, the memory has a computer program, and the processor is configured to execute the gender as provided by any embodiment of the present application by invoking the computer program. Judgment method.

本申请实施例提供的性别判断方法,首先从人脸数据库中获取多张训练人脸图像;然后利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;接着将高层特征集合和底层特征集合进行融合,得到融合特征集合;再将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;最后利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。将第一神经网络和第二神经网络获取的高层特征集合和底层特征集合融合,然后将融合后的特征集合后输入预设模型的预测模块进行训练,可以提高训练后的预设模型判断图像性别的准确度。In the gender determination method provided by the embodiment of the present application, firstly, a plurality of training face images are obtained from a face database; then a high-level feature set of the plurality of training face images is obtained by using the first neural network of the preset model, and the preset model is used to obtain the high-level feature set of the multiple training face images. The second neural network obtains the underlying feature set of multiple training face images; then fuses the high-level feature set and the underlying feature set to obtain a fused feature set; then input the fused feature set as training data into the prediction module of the preset model Perform training to obtain a preset model after training; finally, use the preset model after training to judge the current face image, and obtain the gender feature corresponding to the current face image. The high-level feature set and the bottom-level feature set obtained by the first neural network and the second neural network are fused, and then the fused feature set is input into the prediction module of the preset model for training, which can improve the judgment of the image gender by the preset model after training. accuracy.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.

图1为本申请实施例提供的性别判断方法的应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of the gender determination method provided by the embodiment of the present application.

图2为本申请实施例提供的性别判断方法的流程示意图。FIG. 2 is a schematic flowchart of a gender determination method provided by an embodiment of the present application.

图3为本申请实施例提供的性别判断方法的另一流程示意图。FIG. 3 is another schematic flowchart of the gender determination method provided by the embodiment of the present application.

图4为本申请实施例提供的性别判断方法的另一应用场景示意图。FIG. 4 is a schematic diagram of another application scenario of the gender determination method provided by the embodiment of the present application.

图5为本申请实施例提供的性别判断方法的又一应用场景示意图。FIG. 5 is a schematic diagram of another application scenario of the gender determination method provided by the embodiment of the present application.

图6为本申请实施例提供的性别判断装置的结构示意图。FIG. 6 is a schematic structural diagram of a gender determination apparatus provided by an embodiment of the present application.

图7为本申请实施例提供的性别判断装置的另一结构示意图。FIG. 7 is another schematic structural diagram of a gender determination apparatus provided by an embodiment of the present application.

图8为本申请实施例提供的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

图9为本申请实施例提供的电子设备的另一结构示意图。FIG. 9 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, wherein the same component symbols represent the same components, and the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application and should not be construed as limiting other specific embodiments of the present application not detailed herein.

在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols performed by one or more computers, unless otherwise stated. Accordingly, the steps and operations will be referred to several times as being performed by a computer, which reference herein includes operations by a computer processing unit of electronic signals representing data in a structured format. This operation transforms the data or maintains it in a location in the computer's memory system, which can be reconfigured or otherwise change the operation of the computer in a manner well known to testers in the art. The data structures maintained by the data are physical locations of the memory that have specific characteristics defined by the data format. However, the principle of the present application is described by the above text, which is not meant to be a limitation, and testers in the art will understand that various steps and operations described below can also be implemented in hardware.

本文所使用的术语“模块”可看做为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。As used herein, the term "module" can be thought of as a software object that executes on the computing system. The various components, modules, engines, and services described herein may be considered objects of implementation on the computing system. The apparatus and method described herein can be implemented in software, and certainly can also be implemented in hardware, which are all within the protection scope of the present application.

本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first," "second," and "third," etc. in this application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include unlisted steps or modules, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

本申请实施例提供一种性别判断方法,该性别判断方法的执行主体可以是本申请实施例提供的性别判断装置,或者集成了该性别判断装置的电子设备,其中该性别判断装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等设备。The embodiment of the present application provides a gender determination method, and the execution body of the gender determination method may be the gender determination device provided in the embodiment of the present application, or an electronic device integrated with the gender determination device, wherein the gender determination device may adopt hardware or implemented in software. The electronic device may be a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer and other devices.

请参阅图1,图1为本申请实施例提供的性别判断方法的应用场景示意图,如图1所示,先从人脸数据库中选取训练人脸图像,然后利用预设模型E的第一神经网络A获取高层特征集合a1、预设模型E的第二神经网络B获取底层特征集合b1,然后将高层特征集合a1和底层特征集合b1进行融合得到融合特征集合c1,将融合特征集合c1输入预设模型E的预测模块D中作为训练数据,预测模块D根据融合特征集合c1进行训练,优化预设模型E中的各个参数,得到训练后的预设模型E1,然后获取具体场景的图像,如实时拍摄获取的照片,利用训练后的预设模型E1对具体场景的图像中的人物进行性别判断,得到一个预测结果,预测结果为男性或女性。Please refer to FIG. 1. FIG. 1 is a schematic diagram of an application scenario of the gender determination method provided by the embodiment of the present application. As shown in FIG. 1, a training face image is first selected from a face database, and then the first neural The network A obtains the high-level feature set a1, and the second neural network B of the preset model E obtains the bottom-level feature set b1, and then fuses the high-level feature set a1 and the bottom-level feature set b1 to obtain the fusion feature set c1, and the fusion feature set c1 Assume that the prediction module D of the model E is used as training data, the prediction module D is trained according to the fusion feature set c1, optimizes each parameter in the preset model E, obtains the preset model E1 after training, and then obtains the image of the specific scene, such as The obtained photos are taken in real time, and the trained preset model E1 is used to judge the gender of the characters in the images of the specific scene, and a prediction result is obtained, and the prediction result is male or female.

请参照图2,图2为本申请实施例提供的性别判断方法的流程示意图。本申请实施例提供的性别判断方法的具体流程可以如下:Please refer to FIG. 2 , which is a schematic flowchart of a gender determination method provided by an embodiment of the present application. The specific process of the gender judgment method provided by the embodiment of the present application may be as follows:

201,从人脸数据库中获取多张训练人脸图像。201. Acquire multiple training face images from a face database.

人脸数据库包括多张人脸图像,多张人脸图像包括正面人脸图像、侧面人脸图像、多角度的人脸图像。多角度的人脸图像包括多个俯视角度的人脸图像、多个仰视角度的人脸图像、多个侧面角度的人脸图像等。The face database includes a plurality of face images, and the plurality of face images includes a front face image, a side face image, and a multi-angle face image. The multi-angle face images include face images from a plurality of top-down angles, face images from a plurality of upward angles, and face images from a plurality of side angles.

多张人脸图像中可以一张人脸图像对应一个用户,也可以多张人脸图像对应同一个用户。其中,对应同一用户的多张人脸图像可以为多角度人脸图像。Among the multiple face images, one face image may correspond to one user, or multiple face images may correspond to the same user. The multiple face images corresponding to the same user may be multi-angle face images.

人脸数据库中的多张人脸图像可以包括清晰度高的人脸图像,也可以包括清晰度低的人脸图像,还可以包括具有不同程度噪点的人脸图像,还包括多姿态的人脸图像。其中,多姿态的人脸图像包括笑脸人脸图像、严肃的人脸图像等各种表情的人脸图像。The multiple face images in the face database can include high-definition face images, low-definition face images, face images with different degrees of noise, and multi-pose faces. image. The multi-pose face images include face images of various expressions, such as smiling face images and serious face images.

人脸数据库可以由用户自己建立,如网上收集大量人脸图像、收集自己及周边亲友的人脸图像、拍摄获取街道上的大量人脸图像等。The face database can be established by users themselves, such as collecting a large number of face images on the Internet, collecting face images of themselves and their relatives and friends, and capturing a large number of face images on the street.

人脸数据库还可以利用现有的人脸数据库,如CelebA数据库等。The face database can also utilize existing face databases, such as CelebA database.

需要说明的是,人脸数据库中的人脸图像对应有其性别特征。It should be noted that the face images in the face database correspond to their gender characteristics.

可以从人脸数据库中随机挑选多张训练人脸图像,也可以根据用户信息挑选对应的多张训练人脸图像。例如,可以根据用户拍摄获取的图像进行挑选,具体的,用户拍摄的图像东方人脸较多,则从人脸数据库中挑选的多张训练人脸图像中东方人脸的人脸图像比例较大。用户拍摄的图像儿童人脸较多,则从人脸数据库中挑选的多张训练人脸图像中儿童人脸的比例较大。用户拍摄的图像女性人脸较多,则从人脸数据库中挑选的多张训练人脸图像中女性人脸的比例较大。Multiple training face images can be randomly selected from the face database, or multiple corresponding training face images can be selected according to user information. For example, the selection can be made according to the images captured by the user. Specifically, if the images captured by the user are more oriental faces, the proportion of face images with oriental faces in the multiple training face images selected from the face database is larger. . If there are many children's faces in the images taken by the user, the proportion of children's faces in the multiple training face images selected from the face database is relatively large. If there are many female faces in the images taken by the user, the proportion of female faces in the multiple training face images selected from the face database is relatively large.

202,利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合。202. Use the first neural network of the preset model to obtain high-level feature sets of multiple training face images, and use the second neural network of the preset model to obtain low-level feature sets of multiple training face images.

图像具有三大底层特征,即颜色、纹理和形状特征,当然底层特征也包括颜色、亮度、方向、纹理和边缘特征。底层特征集合包括多张训练人脸图像的各种底层特征的集合。The image has three underlying features, namely color, texture and shape features. Of course, the underlying features also include color, brightness, orientation, texture and edge features. The underlying feature set includes a set of various underlying features of multiple training face images.

高层特征是基于底层特征的基础上去提取出更高级更加能反应出图像的语义信息的特征。也可以理解为高层特征是在底层特征的基础上经过特定算法(如卷积神经网络)进行构建的,一般指的是图像中物体的轮廓等更复杂的特征。相较于简单的提取图像原始信息的底层特征,高层特征信息更具有表现力,充分考虑到了场景的上下文信息。高层特征集合包括多张训练人脸图像的各种高层特征的集合。The high-level features are based on the underlying features to extract higher-level features that can reflect the semantic information of the image. It can also be understood that high-level features are constructed on the basis of low-level features through specific algorithms (such as convolutional neural networks), which generally refer to more complex features such as the contours of objects in images. Compared with simply extracting the underlying features of the original image information, the high-level feature information is more expressive and fully considers the contextual information of the scene. The high-level feature set includes a set of various high-level features of multiple training face images.

具体的可以利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合。Specifically, the first neural network of the preset model may be used to obtain high-level feature sets of multiple training face images, and the second neural network of the preset model may be used to obtain low-level feature sets of multiple training face images.

203,将高层特征集合和底层特征集合进行融合,得到融合特征集合。203 , fuse the high-level feature set and the bottom-level feature set to obtain a fused feature set.

特征融合可以理解为将来源不同的特征整合到一起,去冗余;得到的整合后的融合信息将利于我们之后的分析处理。具体的,特征融合可以通过算法实现,例如基于贝叶斯决策理论的算法、基于稀疏表示理论的算法、基于深度学习理论算法等。Feature fusion can be understood as integrating features from different sources to remove redundancy; the integrated fusion information obtained will be beneficial to our subsequent analysis and processing. Specifically, feature fusion can be implemented by algorithms, such as algorithms based on Bayesian decision theory, algorithms based on sparse representation theory, algorithms based on deep learning theory, and the like.

得到高层特征集合和底层特征集合,将两者进行融合得到融合特征集合。具体的,同一输入信息对应的高层特征和底层特征进行融合得到融合特征,其中同一输入信息可以为同一张人脸图像,也可以为同一张人脸图像中的某个特征如肤色。输入多个输入信息后,得到多个高层特征和多个底层特征,根据多个高层特征和底层特征得到多个融合特征,多个融合特征形成融合特征集合。A high-level feature set and a low-level feature set are obtained, and the two are fused to obtain a fusion feature set. Specifically, high-level features and low-level features corresponding to the same input information are fused to obtain fusion features, wherein the same input information may be the same face image, or may be a certain feature in the same face image, such as skin color. After inputting multiple input information, multiple high-level features and multiple low-level features are obtained, and multiple fusion features are obtained according to the multiple high-level features and underlying features, and the multiple fusion features form a fusion feature set.

204,将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型。204. Input the fusion feature set as training data into a prediction module of a preset model for training, to obtain a trained preset model.

得到融合特征集合后,将其作为训练数据输入预设模型的预测模块中进行训练,预设模型的预测模块根据训练数据进行训练学习,优化预设模型内的各个计算参数,得到训练后的预设模型。After the fusion feature set is obtained, it is input into the prediction module of the preset model as training data for training. Set up the model.

具体的,可以先获取一张训练人脸图像,然后获取该训练人脸图像的底层特征集合和高层特征集合,然后将两者融合并输入预设模型的预测模块进行训练学习,得到预测结果。若预测结果正确,则保留预设模型训练后的计算参数;若预测结果不正确,则修改预设模型的计算参数继续进行训练,直至预测结果正确。然后换其他张训练人脸图像重复上述步骤,直至所有训练人脸图像都进行了一次预测,然后再将所有训练人脸图像重新预测一遍或多遍,直至预测结果不再改变,得到最终优化的计算参数,具有最终优化的计算参数的预设模型为训练后的预设模型。Specifically, a training face image can be obtained first, then a low-level feature set and a high-level feature set of the training face image can be obtained, and then the two can be fused and input into the prediction module of the preset model for training and learning to obtain the prediction result. If the prediction result is correct, the calculation parameters after the training of the preset model are retained; if the prediction result is incorrect, the calculation parameters of the preset model are modified and the training is continued until the prediction result is correct. Then repeat the above steps for other training face images until all training face images have been predicted once, and then re-predict all training face images one or more times until the prediction results no longer change, and the final optimized Calculation parameters, the preset model with the final optimized calculation parameters is the preset model after training.

还可以将多张训练人脸图像输入预设模型,预设模型对每张训练人脸图像进行性别预测,得到一个预测结果。例如,预测为男性的概率为70%,为女性的概率为30%,则认为该预测结果为男性,概率为70%。根据预先设置的正确结果对其进行评分,若正确结果为男性,则预测结果正确,若正确结果为女性,则预测结果错误。根据预测结果的正确概率进行调整预测模型的计算参数,当调整后的预测模型预测结果的正确率无法再提高,且针对各张训练人脸图像的预测概率也无法整体提高,则认为此时的预测模型的计算参数为最优计算参数,具有该最优计算参数的预设模型为训练后的预先模型。It is also possible to input multiple training face images into a preset model, and the preset model performs gender prediction on each training face image to obtain a prediction result. For example, if the probability of being male is 70% and the probability of being female is 30%, the prediction is considered to be male with probability 70%. It is scored according to the preset correct result. If the correct result is male, the predicted result is correct, and if the correct result is female, the predicted result is wrong. The calculation parameters of the prediction model are adjusted according to the correct probability of the prediction results. When the correct rate of the prediction results of the adjusted prediction model can no longer be improved, and the prediction probability of each training face image cannot be improved as a whole, it is considered that the current The calculation parameter of the prediction model is the optimal calculation parameter, and the preset model with the optimal calculation parameter is the pre-trained model.

需要说明的是,在训练过程中,可以改变预测模块的计算参数,还也可以改变第一神经网络和第二神经网络的计算参数,优化整个预设模型中所有的计算参数。It should be noted that, in the training process, the calculation parameters of the prediction module can be changed, and the calculation parameters of the first neural network and the second neural network can also be changed to optimize all the calculation parameters in the entire preset model.

205,利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。205. Use the trained preset model to judge the current face image to obtain a gender feature corresponding to the current face image.

得到训练后的预设模型后,可以在实际场景中使用该训练后的预设模型对当然人脸图像进行判断,得到当前人脸图像对应的性别特征。例如,使用电子设备拍摄获取一个人脸图像,该人脸图像为当前人脸图像,训练后的预设模型对该当前人脸图像进行性别预测,得到一预测结果,根据该预测结果判断当前人脸图像的性别特征。性别特征包括男性和女性。After the trained preset model is obtained, the trained preset model can be used in the actual scene to judge the natural face image, and the gender feature corresponding to the current face image can be obtained. For example, using an electronic device to capture a face image, the face image is the current face image, the trained preset model performs gender prediction on the current face image, obtains a prediction result, and judges the current person according to the prediction result. Gender characteristics of face images. Gender traits include both male and female.

需要说明的是,步骤201至204是对预设模型的训练过程。训练过程可以在服务器中进行,训练完成后,将训练后的预设模型移植到移动终端中,移动终端利用训练后的预设模型对当前人脸图像进行判断。也可以训练过程也在移动终端中进行,训练完成后,移动终端直接利用训练后的预设模型对当前人脸图像进行判断。还可以训练过程可以在服务器中进行,移动终端需要对当前人脸图像进行判断时,将当前人脸图像发送至服务器,服务器进行判断,然后将判断结果发送回移动终端。It should be noted that steps 201 to 204 are the training process of the preset model. The training process can be performed in the server. After the training is completed, the trained preset model is transplanted into the mobile terminal, and the mobile terminal uses the trained preset model to judge the current face image. The training process may also be performed in the mobile terminal. After the training is completed, the mobile terminal directly uses the trained preset model to judge the current face image. The training process can also be performed in the server. When the mobile terminal needs to judge the current face image, it sends the current face image to the server, and the server judges and then sends the judgment result back to the mobile terminal.

在一些实施例中,得到当前人脸图像的性别特征后,可以根据该性别特征对当前人脸图像进行优化。如判断该当前人脸图像为男性,则对当前人脸图像进行低程度的美颜。如判断该当前人脸图像为女性,则对当前人脸图像进行高程度的美颜。还可以根据性别特征设置不同的优化策略,如女性则可以进行美白、磨皮、去黑眼圈、加装饰等。In some embodiments, after the gender feature of the current face image is obtained, the current face image can be optimized according to the gender feature. If it is determined that the current face image is male, a low-level beautification is performed on the current face image. If it is determined that the current face image is female, a high degree of beauty is performed on the current face image. Different optimization strategies can also be set according to gender characteristics. For example, women can perform whitening, microdermabrasion, dark circle removal, and decoration.

请参照图3,图3为本申请实施例提供的性别判断方法的另一流程示意图。本申请实施例提供的性别判断方法的具体流程可以如下:Please refer to FIG. 3 , which is another schematic flowchart of the gender determination method provided by the embodiment of the present application. The specific process of the gender judgment method provided by the embodiment of the present application may be as follows:

301,从人脸数据库中获取多张人脸图像。301. Acquire multiple face images from a face database.

人脸数据库包括多张人脸图像,多张人脸图像包括正面人脸图像、侧面人脸图像、多角度的人脸图像。多角度的人脸图像包括多个俯视角度的人脸图像、多个仰视角度的人脸图像、多个侧面角度的人脸图像等。The face database includes a plurality of face images, and the plurality of face images includes a front face image, a side face image, and a multi-angle face image. The multi-angle face images include face images from a plurality of top-down angles, face images from a plurality of upward angles, and face images from a plurality of side angles.

多张人脸图像中可以一张人脸图像对应一个用户,也可以多张人脸图像对应同一个用户。其中,对应同一用户的多张人脸图像可以为多角度人脸图像。Among the multiple face images, one face image may correspond to one user, or multiple face images may correspond to the same user. The multiple face images corresponding to the same user may be multi-angle face images.

人脸数据库中的多张人脸图像可以包括清晰度高的人脸图像,也可以包括清晰度低的人脸图像,还可以包括具有不同程度噪点的人脸图像,还包括多姿态的人脸图像。其中,多姿态的人脸图像包括笑脸人脸图像、严肃的人脸图像等各种表情的人脸图像。The multiple face images in the face database can include high-definition face images, low-definition face images, face images with different degrees of noise, and multi-pose faces. image. The multi-pose face images include face images of various expressions, such as smiling face images and serious face images.

人脸数据库可以由用户自己建立,如网上收集大量人脸图像、收集自己及周边亲友的人脸图像、拍摄获取街道上的大量人脸图像等。The face database can be established by users themselves, such as collecting a large number of face images on the Internet, collecting face images of themselves and their relatives and friends, and capturing a large number of face images on the street.

人脸数据库还可以利用现有的人脸数据库,如CelebA数据库等。The face database can also utilize existing face databases, such as CelebA database.

需要说明的是,人脸数据库中的人脸图像对应有其性别特征。It should be noted that the face images in the face database correspond to their gender characteristics.

可以从人脸数据库中随机挑选多张人脸图像,也可以根据用户信息挑选对应的多张人脸图像。例如,可以根据用户拍摄获取的图像进行挑选,具体的,用户拍摄的图像东方人脸较多,则从人脸数据库中挑选的多张人脸图像中东方人脸的人脸图像比例较大。用户拍摄的图像儿童人脸较多,则从人脸数据库中挑选的多张人脸图像中儿童人脸的比例较大。用户拍摄的图像女性人脸较多,则从人脸数据库中挑选的多张人脸图像中女性人脸的比例较大。Multiple face images can be randomly selected from the face database, or multiple corresponding face images can be selected according to user information. For example, the selection may be made according to the images captured by the user. Specifically, if the images captured by the user are more oriental faces, the proportion of face images of oriental faces in the multiple face images selected from the face database is larger. If there are many children's faces in the images taken by the user, the proportion of children's faces in the plurality of face images selected from the face database is relatively large. If there are many female faces in the images taken by the user, the proportion of female faces in the plurality of face images selected from the face database is relatively large.

302,对多张人脸图像随机添加噪声得到多张训练人脸图像。302, randomly adding noise to the plurality of face images to obtain a plurality of training face images.

得到多张人脸图像后,因为人脸数据库中的人脸图像可能经过挑选或处理,都是效果比较好的人脸图像,如噪点少、角度好、清晰度高等。但是我们实际使用过程中,无法得到效果那么好的图像,有噪声的、多姿态、多角度人脸图像无法准确判断。因此,在得到多张人脸图像后,对多张人脸图像进行随机添加噪声得到多张训练人脸图像。After obtaining multiple face images, because the face images in the face database may be selected or processed, they are all face images with relatively good effects, such as less noise, good angle, and high definition. However, in our actual use process, we cannot get such good images, and noisy, multi-pose, multi-angle face images cannot be accurately judged. Therefore, after obtaining multiple face images, randomly add noise to the multiple face images to obtain multiple training face images.

其中,随机添加噪声可以包括增加白噪声、增加噪点、部分模糊、降低清晰度中的一项或多项。随机添加噪声甚至还可以包括图像替换,例如,将同一用户的两张人脸图像进行部分替换,如嘴巴替换等。还可以包括图像融合,例如,从同一用户的多张人脸图像中,每张人脸图像挑选部分图像,然后将各张图像的部分非图像进行融合得到该用户的一张人脸图像。经过随机添加噪声后的训练人脸图像更加复杂,而且很多更接近实际使用场景。Wherein, adding noise randomly may include one or more of adding white noise, adding noise, partially blurring, and reducing sharpness. Randomly adding noise can even include image replacement, for example, partial replacement of two face images of the same user, such as mouth replacement. Image fusion may also be included. For example, from multiple face images of the same user, select a partial image from each face image, and then fuse some non-images of each image to obtain a face image of the user. The training face images after randomly adding noise are more complex, and many are closer to the actual usage scenarios.

303,利用预设模型的深层卷积神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的浅层神经网络获取多张训练人脸图像的底层特征集合。303. Use the deep convolutional neural network of the preset model to obtain high-level feature sets of the multiple training face images, and use the shallow neural network of the preset model to obtain the underlying feature sets of the multiple training face images.

底层特征包括颜色、亮度、方向、纹理和边缘特征。底层特征集合包括多张训练人脸图像的各种底层特征的集合。Low-level features include color, brightness, orientation, texture, and edge features. The underlying feature set includes a set of various underlying features of multiple training face images.

高层特征是基于底层特征的基础上去提取出更高级更加能反应出图像的语义信息的特征。相较于简单的提取图像原始信息的底层特征,高层信息更具有表现力,充分考虑到了场景的上下文信息。高层特征集合包括多张训练人脸图像的各种高层特征的集合。The high-level features are based on the underlying features to extract higher-level features that can reflect the semantic information of the image. Compared with simply extracting the underlying features of the original image information, the high-level information is more expressive and fully considers the contextual information of the scene. The high-level feature set includes a set of various high-level features of multiple training face images.

其中,卷积神经网络是一种前馈神经网络,它的人工神经元可以响应一部分覆盖范围内的周围单元,对于大型图像处理有出色表现。卷积神经网络包括卷积层(convolutional layer)和池化层(pooling layer)。具体的,深层卷积神经网络包括的卷积层和池化层的层数,多于浅层卷积神经网络包括的卷积层和池化层的层数。利用深层卷积神经网络可以获取图像的高层特征集合,利用浅层卷积神经网络可以获取图像的底层特征集合。Among them, the convolutional neural network is a feed-forward neural network, and its artificial neurons can respond to the surrounding units within a certain coverage area, and it has excellent performance for large-scale image processing. Convolutional neural networks include convolutional layers and pooling layers. Specifically, the number of convolutional layers and pooling layers included in the deep convolutional neural network is more than the number of convolutional layers and pooling layers included in the shallow convolutional neural network. The high-level feature set of the image can be obtained by using a deep convolutional neural network, and the low-level feature set of the image can be obtained by using a shallow convolutional neural network.

304,将高层特征集合和底层特征集合进行融合,得到融合特征集合。304 , fuse the high-level feature set and the bottom-level feature set to obtain a fused feature set.

得到高层特征集合和底层特征集合,将两者进行融合得到融合特征集合。A high-level feature set and a low-level feature set are obtained, and the two are fused to obtain a fusion feature set.

305,将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型。305. Input the fusion feature set as training data into a prediction module of a preset model for training, to obtain a trained preset model.

得到融合特征集合后,将其作为训练数据输入预设模型的预测模块中进行训练,预设模型根据训练数据进行训练学习,优化预设模型内的各个计算参数,得到训练后的预设模型。After the fusion feature set is obtained, it is input into the prediction module of the preset model as training data for training, the preset model is trained and learned according to the training data, and each calculation parameter in the preset model is optimized to obtain the trained preset model.

具体的,可以先获取一张训练人脸图像,然后获取该训练人脸图像的底层特征集合和高层特征集合,然后将两者融合并输入预设模型进行训练学习,得到预测结果。若预测结果正确,则保留预设模型训练后的计算参数;若预测结果不正确,则修改预设模型的计算参数继续进行训练,直至预测结果正确。然后换其他张训练人脸图像重复上述步骤,直至所有训练人脸图像都进行了一次预测,然后再将所有训练人脸图像重新预测一遍或多遍,直至预测结果不再改变,得到最终优化的计算参数,具有最终优化的计算参数的预设模型为训练后的预设模型。Specifically, a training face image can be obtained first, and then a low-level feature set and a high-level feature set of the training face image can be obtained, and then the two are fused and input into a preset model for training and learning to obtain a prediction result. If the prediction result is correct, the calculation parameters after the training of the preset model are retained; if the prediction result is incorrect, the calculation parameters of the preset model are modified and the training is continued until the prediction result is correct. Then repeat the above steps for other training face images until all training face images have been predicted once, and then re-predict all training face images one or more times until the prediction results no longer change, and the final optimized Calculation parameters, the preset model with the final optimized calculation parameters is the preset model after training.

还可以将多张训练人脸图像输入预设模型,预设模型对每张训练人脸图像进行性别预测,得到一个预测结果。例如,预测为男性的概率为70%,为女性的概率为30%,则认为该预测结果为男性,概率为70%。根据预先设置的正确结果对其进行评分,若正确结果为男性,则预测结果正确,若正确结果为女性,则预测结果错误。根据预测结果的正确概率进行调整预测模型的计算参数,当调整后的预测模型预测结果的正确率无法再提高,且针对各张训练人脸图像的预测概率也无法整体提高,则认为此时的预测模型的计算参数为最优计算参数,具有该最优计算参数的预设模型为训练后的预先模型。It is also possible to input multiple training face images into a preset model, and the preset model performs gender prediction on each training face image to obtain a prediction result. For example, if the probability of being male is 70% and the probability of being female is 30%, the prediction is considered to be male with probability 70%. It is scored according to the preset correct result. If the correct result is male, the predicted result is correct, and if the correct result is female, the predicted result is wrong. The calculation parameters of the prediction model are adjusted according to the correct probability of the prediction results. When the correct rate of the prediction results of the adjusted prediction model can no longer be improved, and the prediction probability of each training face image cannot be improved as a whole, it is considered that the current The calculation parameter of the prediction model is the optimal calculation parameter, and the preset model with the optimal calculation parameter is the pre-trained model.

在一些实施例中,预设模型的预测模块为逻辑回归分类器(Logistic RegressionClassifier)。In some embodiments, the prediction module of the preset model is a Logistic Regression Classifier.

需要说明的是,在训练过程中,可以改变逻辑回归分类器的计算参数,还也可以改变深层卷积神经网络和浅层卷积神经网络的计算参数,优化整个预设模型中所有的计算参数。It should be noted that during the training process, the calculation parameters of the logistic regression classifier can be changed, and the calculation parameters of the deep convolutional neural network and the shallow convolutional neural network can also be changed to optimize all the calculation parameters in the entire preset model. .

306,获取拍摄图像。306. Acquire a captured image.

拍摄图像可以为电子设备实际场景中拍摄获取的图像,例如,拍摄图像为用户平时拍摄的生活照片、出去游玩时拍的照片等。该拍摄图像可以是之前拍摄的,其存储在移动终端内或存储在服务器内。该拍摄图像也可以是当前拍摄的。当前拍摄的拍摄图像可以是用户手动点击拍摄按钮后获取的,也可以是电子设备开启摄像功能后,通过摄像模块如摄像头自动获取存储在缓存中的图像。摄像模块开启后会自动获取实景图像存入缓存,当按下拍摄按钮,则可以从缓存中获取图像作为照片或按下拍摄按钮后再去获取图像作为照片。The captured image may be an image captured in an actual scene of the electronic device, for example, the captured image is a daily life photo taken by the user, a photo taken when going out to play, and the like. The captured image may be previously captured and stored in the mobile terminal or in the server. The captured image may also be currently captured. The captured image currently captured may be obtained after the user manually clicks the capture button, or the electronic device may automatically obtain the image stored in the cache through a camera module such as a camera after the camera function is enabled. After the camera module is turned on, it will automatically obtain the live image and store it in the cache. When the shooting button is pressed, the image can be obtained from the cache as a photo, or the image can be obtained as a photo after pressing the shooting button.

307,预设模型包括多层网络,多层网络对输入数据依次进行计算得到预测结果,其中,多层网络的每层网络包括独立的计算参数。307. The preset model includes a multi-layer network, and the multi-layer network sequentially calculates the input data to obtain a prediction result, wherein each layer of the multi-layer network includes independent calculation parameters.

预设模型包括多层网络,多层网络之间的数据为延续的。例如,多层网络为3层网络,则输入数据输入第一层网络,第一层网络对输入数据进行计算得到第一中间值,第一中间值作为第二层网络的输入数据,第二层网络对第一中间值计算得到第二中间值,第二中间值作为第三层网络的输入数据,第三网络对第二中间值计算得到预测结果。多层网络每层网络的计算方程式可以不一样,每层网络的计算方程式中的计算参数也是独立的,仅适用于本层网络。The preset model includes multi-layer networks, and the data between the multi-layer networks is continuous. For example, if the multi-layer network is a 3-layer network, the input data is input to the first layer network, the first layer network calculates the input data to obtain the first intermediate value, the first intermediate value is used as the input data of the second layer network, and the second layer network The network calculates the first intermediate value to obtain the second intermediate value, the second intermediate value is used as the input data of the third-layer network, and the third network calculates the second intermediate value to obtain the prediction result. The calculation equations of each layer of the multi-layer network can be different, and the calculation parameters in the calculation equation of each layer of the network are also independent and only applicable to the network of this layer.

308,根据拍摄图像,对训练后的预设模型的多层网络中的一层或多层网络的计算参数进行调整,得到调整后的预设模型。308. Adjust the calculation parameters of one or more layers of the multi-layer network of the trained preset model according to the captured image, to obtain an adjusted preset model.

根据拍摄图像得到新的训练图像,针对具体场景,采用训练好的预设模型根据新的训练图像进行微调。其中,进行微调的部分可以是第一神经网络、第二神经网络和预测模块中的一项或两项或三项。具体的,可以微调其中一项或多项的部分,如第一神经网络包括多层网络,可以微调其中几层网络。训练好的预设模型可以是面对所有用户训练得到的,调整后的预设模型可以是针对单个用户或少数几个用户进行调整,使其更贴合单个用户或少数几个用户的使用。A new training image is obtained according to the captured image, and for a specific scene, a trained preset model is used to fine-tune the new training image. The fine-tuning part may be one or two or three of the first neural network, the second neural network and the prediction module. Specifically, one or more of the parts can be fine-tuned. For example, the first neural network includes a multi-layer network, and several layers of the network can be fine-tuned. The trained preset model can be trained for all users, and the adjusted preset model can be adjusted for a single user or a few users, so that it is more suitable for the use of a single user or a few users.

在一些实施例中,微调方法可以是固定预设模型前面几层网络的计算参数,利用新的数据集训练最后几层网络的计算参数,微调之后的预设模型即可用于具体场景下的性别判断。In some embodiments, the fine-tuning method may be to fix the calculation parameters of the first few layers of the network in the preset model, use a new data set to train the calculation parameters of the last few layers of the network, and the preset model after fine-tuning can be used for gender in specific scenarios. judge.

在一些实施例中,微调方法也可以是固定预设模型后面几层网络的计算参数,利用新的数据集训练前面几层网络的计算参数,微调之后的预设模型即可用于具体场景下的性别判断。In some embodiments, the fine-tuning method may also be to fix the calculation parameters of the following layers of the preset model, use a new data set to train the calculation parameters of the previous layers of the network, and the fine-tuned preset model can be used in specific scenarios. gender judgment.

在一些实施例中,微调方法也可以是固定预设模型前面几层和后面几层网络的计算参数,利用新的数据集训练中间几层网络的计算参数,微调之后的预设模型即可用于具体场景下的性别判断。In some embodiments, the fine-tuning method may also be to fix the calculation parameters of the first few layers and the next few layers of the preset model, and use the new data set to train the calculation parameters of the middle layers of the network, and the fine-tuned preset model can be used for Gender judgment in specific scenarios.

其中,可以采用步骤303-305类似的方法进行微调。在此不再详述。Wherein, fine-tuning can be performed by a method similar to steps 303-305. It will not be described in detail here.

309,利用调整后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。309. Use the adjusted preset model to judge the current face image to obtain a gender feature corresponding to the current face image.

得到调整后的预设模型后,可以在实际场景中使用该调整后的预设模型对当然人脸图像进行判断,得到当前人脸图像对应的性别特征。例如,使用电子设备拍摄获取一个人脸图像,该人脸图像为当前人脸图像,调整后的预设模型对该当前人脸图像进行性别预测,得到一预测结果,根据该预测结果判断当前人脸图像的性别特征。性别特征包括男性和女性。After the adjusted preset model is obtained, the adjusted preset model can be used in the actual scene to judge the natural face image, and the gender characteristic corresponding to the current face image can be obtained. For example, using an electronic device to capture a face image, the face image is the current face image, the adjusted preset model performs gender prediction on the current face image, and a prediction result is obtained, and the current face image is determined according to the prediction result. Gender characteristics of face images. Gender traits include both male and female.

如图4所示,得到当前人脸图像的性别特征后,可以根据该性别特征对当前人脸图像进行优化。如判断该当前人脸图像为男性,则对当前人脸图像进行低程度的美颜。如判断该当前人脸图像为女性,则对当前人脸图像进行高程度的美颜。还可以根据性别特征设置不同的优化策略,如女性则可以进行美白、磨皮、去黑眼圈、加装饰等。As shown in FIG. 4 , after the gender feature of the current face image is obtained, the current face image can be optimized according to the gender feature. If it is determined that the current face image is male, a low-level beautification is performed on the current face image. If it is determined that the current face image is female, a high degree of beauty is performed on the current face image. Different optimization strategies can also be set according to gender characteristics. For example, women can perform whitening, microdermabrasion, dark circle removal, and decoration.

需要说明的是,步骤301至305是对预设模型的训练过程。如图5所示,该训练过程可以在服务器中进行,训练完成后,将训练后的预设模型移植到移动终端中,移动终端利用训练后的预设模型对当前人脸图像进行判断。也可以训练过程也在移动终端中进行,训练完成后,移动终端直接利用训练后的预设模型对当前人脸图像进行判断。还可以训练过程可以在服务器中进行,移动终端需要对当前人脸图像进行判断时,将当前人脸图像发送至服务器,服务器进行判断,然后将判断结果发送回移动终端。It should be noted that steps 301 to 305 are the training process of the preset model. As shown in FIG. 5 , the training process can be performed in the server. After the training is completed, the trained preset model is transplanted into the mobile terminal, and the mobile terminal uses the trained preset model to judge the current face image. The training process may also be performed in the mobile terminal. After the training is completed, the mobile terminal directly uses the trained preset model to judge the current face image. The training process can also be performed in the server. When the mobile terminal needs to judge the current face image, it sends the current face image to the server, and the server judges and then sends the judgment result back to the mobile terminal.

需要说明的是,步骤306至308是对预设模型的调整过程。调整过程可以在服务器中进行,调整完成后,将调整后的预设模型移植到移动终端中,移动终端利用调整后的预设模型对当前人脸图像进行判断。也可以调整过程在移动终端中进行,调整完成后,移动终端直接利用调整练后的预设模型对当前人脸图像进行判断。还可以调整过程可以在服务器中进行,移动终端需要对当前人脸图像进行判断时,将当前人脸图像发送至服务器,服务器进行判断,然后将判断结果发送回移动终端。It should be noted that steps 306 to 308 are the adjustment process of the preset model. The adjustment process can be performed in the server. After the adjustment is completed, the adjusted preset model is transplanted into the mobile terminal, and the mobile terminal uses the adjusted preset model to judge the current face image. The adjustment process may also be performed in the mobile terminal, and after the adjustment is completed, the mobile terminal directly uses the preset model after adjustment and training to judge the current face image. The adjustment process can also be performed in the server. When the mobile terminal needs to judge the current face image, it sends the current face image to the server, and the server judges and then sends the judgment result back to the mobile terminal.

在一些实施例中,训练过程可以在服务器中进行,训练完成后,将训练后的预设模型移植到移动终端中,移动终端根据拍摄图像对训练后的预设模型进行调整,调整完成后,移动终端直接利用调整练后的预设模型对当前人脸图像进行判断。In some embodiments, the training process may be performed in the server. After the training is completed, the trained preset model is transplanted into the mobile terminal, and the mobile terminal adjusts the trained preset model according to the captured image. After the adjustment is completed, The mobile terminal directly uses the adjusted preset model to judge the current face image.

由上可知,本申请实施例的性别判断方法,首先从人脸数据库中获取多张训练人脸图像;然后利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;接着将高层特征集合和底层特征集合进行融合,得到融合特征集合;再将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;最后利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。将第一神经网络和第二神经网络获取的高层特征集合和底层特征集合融合,然后将融合后的特征集合后输入预设模型进行训练,可以提高训练后的预设模型判断图像性别的准确度。As can be seen from the above, the gender determination method of the embodiment of the present application first obtains multiple training face images from the face database; then uses the first neural network of the preset model to obtain the high-level feature sets of multiple training face images, and uses The second neural network of the preset model obtains the underlying feature set of multiple training face images; then fuses the high-level feature set and the underlying feature set to obtain a fused feature set; and then inputs the fused feature set as training data into the preset model. Perform training in the prediction module to obtain a preset model after training; finally, use the preset model after training to judge the current face image, and obtain the gender feature corresponding to the current face image. The high-level feature set and the bottom-level feature set obtained by the first neural network and the second neural network are fused, and then the fused feature set is input into the preset model for training, which can improve the accuracy of the trained preset model for judging the gender of the image .

请参阅图6,图6为本申请实施例提供的性别判断装置的结构示意图。其中该性别判断装置400包括训练人脸图像获取模块401、第一获取模块402、第二获取模块403、训练模块404和判断模块405。其中:Please refer to FIG. 6 , FIG. 6 is a schematic structural diagram of a gender determination apparatus provided by an embodiment of the present application. The gender determination device 400 includes a training face image acquisition module 401 , a first acquisition module 402 , a second acquisition module 403 , a training module 404 and a judgment module 405 . in:

训练人脸图像获取模块401,用于从人脸数据库中获取多张训练人脸图像;A training face image acquisition module 401 is used to acquire multiple training face images from a face database;

第一获取模块402,用于利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;The first obtaining module 402 is configured to obtain high-level feature sets of multiple training face images by using the first neural network of the preset model, and obtain the underlying feature sets of multiple training face images by using the second neural network of the preset model;

第二获取模块403,用于将高层特征集合和底层特征集合进行融合,得到融合特征集合;The second acquisition module 403 is used to fuse the high-level feature set and the bottom-level feature set to obtain a fused feature set;

训练模块404,用于将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;The training module 404 is used for inputting the fusion feature set as training data into the prediction module of the preset model for training to obtain the preset model after training;

判断模块405,用于利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。The judgment module 405 is configured to use the trained preset model to judge the current face image to obtain the gender feature corresponding to the current face image.

请参阅图7,图7为本申请实施例提供的性别判断装置的另一结构示意图。其中训练人脸图像获取模块401包括人脸图像获取子模块4011和训练人脸获取子模块4012。Please refer to FIG. 7 . FIG. 7 is another schematic structural diagram of a gender determination apparatus provided by an embodiment of the present application. The training face image acquisition module 401 includes a face image acquisition submodule 4011 and a training face acquisition submodule 4012 .

人脸图像获取子模块4011,用于从人脸数据库中获取多张人脸图像;A face image acquisition sub-module 4011, used for acquiring multiple face images from the face database;

训练人脸获取子模块4012,用于对多张人脸图像随机添加噪声得到多张训练人脸图像。The training face acquisition sub-module 4012 is used to randomly add noise to multiple face images to obtain multiple training face images.

在一些实施例中,装置还包括拍摄图像获取模块和调整模块。In some embodiments, the apparatus further includes a captured image acquisition module and an adjustment module.

拍摄图像获取模块,用于获取拍摄图像;a captured image acquisition module for acquiring captured images;

调整模块,用于将训练后的预设模型根据拍摄图像进行调整,得到调整后的预设模型;The adjustment module is used to adjust the trained preset model according to the captured image to obtain the adjusted preset model;

判断模块,还用于利用调整后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。The judgment module is further configured to use the adjusted preset model to judge the current face image to obtain the gender feature corresponding to the current face image.

在一些实施例中,预设模型包括多层网络,多层网络对输入数据依次进行计算得到预测结果,其中,多层网络的每层网络包括独立的计算参数。该调整模块还用于根据拍摄图像,对训练后的预设模型的多层网络中的一层或多层网络的计算参数进行调整,得到调整后的预设模型。In some embodiments, the preset model includes a multi-layer network, and the multi-layer network sequentially calculates the input data to obtain a prediction result, wherein each layer of the multi-layer network includes independent calculation parameters. The adjustment module is further configured to adjust the calculation parameters of one or more layers of the multi-layer network of the trained preset model according to the captured image, so as to obtain the adjusted preset model.

在一些实施例中,该第一获取模块还用于利用预设模型的深层卷积神经网络多张训练人脸图像的获取高层特征集合,利用预设模型的浅层神经网络获取多张训练人脸图像的底层特征集合。In some embodiments, the first obtaining module is further configured to obtain high-level feature sets of multiple training face images using a deep convolutional neural network of a preset model, and obtain multiple training face images using a shallow neural network of the preset model. The underlying feature set of the face image.

在一些实施例中,该训练模块,还用于将融合特征集合作为训练数据输入预设模型的逻辑回归分类器中进行训练,得到训练后的预设模型。In some embodiments, the training module is further configured to input the fusion feature set as training data into a logistic regression classifier of a preset model for training to obtain a trained preset model.

由上可知,本申请实施例的性别判断装置,首先训练人脸图像获取模块401从人脸数据库中获取多张训练人脸图像;然后第一获取模块402利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;接着第二获取模块403将高层特征集合和底层特征集合进行融合,得到融合特征集合;再训练模块404将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;最后判断模块405利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。将第一神经网络和第二神经网络获取的高层特征集合和底层特征集合融合,然后将融合后的特征集合后输入预设模型的预测模块进行训练,可以提高训练后的预设模型判断图像性别的准确度。As can be seen from the above, in the gender determination device of the embodiment of the present application, the training face image acquisition module 401 first acquires a plurality of training face images from the face database; then the first acquisition module 402 uses the first neural network of the preset model to acquire. The high-level feature sets of multiple training face images, and the second neural network of the preset model is used to obtain the underlying feature sets of multiple training face images; then the second acquisition module 403 fuses the high-level feature set and the underlying feature set to obtain The fusion feature set; the retraining module 404 inputs the fusion feature set as training data into the prediction module of the preset model for training, and obtains the preset model after training; finally, the judgment module 405 uses the preset model after training to perform training on the current face image Judgment is performed to obtain the gender feature corresponding to the current face image. The high-level feature set and the bottom-level feature set obtained by the first neural network and the second neural network are fused, and then the fused feature set is input into the prediction module of the preset model for training, which can improve the judgment of the gender of the image by the preset model after training. accuracy.

本申请实施例还提供一种电子设备。请参阅图8,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。The embodiments of the present application also provide an electronic device. Referring to FIG. 8 , the electronic device 500 includes a processor 501 and a memory 502 . The processor 501 is electrically connected to the memory 502 .

处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据,从而实现对电子设备物料信息的自动变更。The processor 500 is the control center of the electronic device 500, uses various interfaces and lines to connect various parts of the entire electronic device, executes the electronic device by running or loading the computer program stored in the memory 502 and calling the data stored in the memory 502. Various functions of the device 500 are processed and data is processed, thereby realizing automatic changes to the material information of the electronic device.

存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。The memory 502 can be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502 . The memory 502 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, a computer program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of electronic equipment, etc. Additionally, memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 502 may also include a memory controller to provide processor 501 access to memory 502 .

在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:In this embodiment of the present application, the processor 501 in the electronic device 500 loads the instructions corresponding to the processes of one or more computer programs into the memory 502 according to the following steps, and is executed by the processor 501 and stored in the memory 502 The computer program in , so as to realize various functions, as follows:

从人脸数据库中获取多张训练人脸图像;Obtain multiple training face images from the face database;

利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;Use the first neural network of the preset model to obtain high-level feature sets of multiple training face images, and use the second neural network of the preset model to obtain the underlying feature sets of multiple training face images;

将高层特征集合和底层特征集合进行融合,得到融合特征集合;The high-level feature set and the bottom-level feature set are fused to obtain a fused feature set;

将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;Input the fusion feature set as training data into the prediction module of the preset model for training, and obtain the preset model after training;

利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。The current face image is judged by using the trained preset model, and the gender feature corresponding to the current face image is obtained.

在一些实施例中,从人脸数据库中获取多张训练人脸图像时,处理器501可以具体执行以下步骤:In some embodiments, when acquiring multiple training face images from the face database, the processor 501 may specifically perform the following steps:

从人脸数据库中获取多张人脸图像;Obtain multiple face images from the face database;

对多张人脸图像随机添加噪声得到多张训练人脸图像;Randomly add noise to multiple face images to obtain multiple training face images;

在一些实施例中,利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征时,处理器501可以具体执行以下步骤:In some embodiments, the processor 501 may specifically perform the following steps when the current face image is judged by using the trained preset model to obtain the gender feature corresponding to the current face image:

获取拍摄图像;Get the captured image;

将训练后的预设模型根据拍摄图像进行调整,得到调整后的预设模型;Adjust the trained preset model according to the captured image to obtain the adjusted preset model;

利用调整后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。The current face image is judged by using the adjusted preset model, and the gender feature corresponding to the current face image is obtained.

在一些实施例中,将训练后的预设模型根据拍摄图像进行调整,得到调整后的预设模型时,处理器501可以具体执行以下步骤:In some embodiments, the trained preset model is adjusted according to the captured image, and when the adjusted preset model is obtained, the processor 501 may specifically perform the following steps:

预设模型包括多层网络,多层网络对输入数据依次进行计算得到预测结果,其中,多层网络的每层网络包括独立的计算参数;The preset model includes a multi-layer network, and the multi-layer network sequentially calculates the input data to obtain a prediction result, wherein each layer of the multi-layer network includes independent calculation parameters;

根据拍摄图像,对训练后的预设模型的多层网络中的一层或多层网络的计算参数进行调整,得到调整后的预设模型。According to the captured image, the calculation parameters of one or more layers of the multi-layer network of the trained preset model are adjusted to obtain the adjusted preset model.

在一些实施例中,利用第一神经网络获取多张训练人脸图像的高层特征集合,利用第二神经网络获取多张训练人脸图像的底层特征集合时,处理器501可以具体执行以下步骤:In some embodiments, when using the first neural network to obtain high-level feature sets of multiple training face images, and using the second neural network to obtain low-level feature sets of multiple training face images, the processor 501 may specifically perform the following steps:

利用预设模型的深层卷积神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的浅层神经网络获取多张训练人脸图像的底层特征集合。The deep convolutional neural network of the preset model is used to obtain high-level feature sets of multiple training face images, and the shallow neural network of the preset model is used to obtain the low-level feature sets of multiple training face images.

在一些实施例中,将融合特征集合作为训练数据输入预设模型中进行训练,得到训练后的预设模型时,处理器501可以具体执行以下步骤:In some embodiments, the fusion feature set is input into a preset model as training data for training, and when the trained preset model is obtained, the processor 501 may specifically perform the following steps:

将融合特征集合作为训练数据输入预设模型的逻辑回归分类器中进行训练,得到训练后的预设模型。The fusion feature set is input into the logistic regression classifier of the preset model as training data for training, and the trained preset model is obtained.

由上可知,本申请实施例的电子设备,首先从人脸数据库中获取多张训练人脸图像;然后利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;接着将高层特征集合和底层特征集合进行融合,得到融合特征集合;再将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;最后利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。将第一神经网络和第二神经网络获取的高层特征集合和底层特征集合融合,然后将融合后的特征集合后输入预设模型的预测模块进行训练,可以提高训练后的预设模型判断图像性别的准确度。As can be seen from the above, the electronic device of the embodiment of the present application first obtains multiple training face images from the face database; then uses the first neural network of the preset model to obtain high-level feature sets of multiple training face images, and uses the preset Set the second neural network of the model to obtain the underlying feature set of multiple training face images; then fuse the high-level feature set and the underlying feature set to obtain a fused feature set; then use the fused feature set as training data to input the prediction of the preset model The training is performed in the module to obtain a preset model after training; finally, the preset model after training is used to judge the current face image, and the gender feature corresponding to the current face image is obtained. The high-level feature set and the bottom-level feature set obtained by the first neural network and the second neural network are fused, and then the fused feature set is input into the prediction module of the preset model for training, which can improve the judgment of the image gender by the preset model after training. accuracy.

请一并参阅图9,在一些实施例中,电子设备500还可以包括:显示器503、射频电路504、音频电路505以及电源506。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。Please also refer to FIG. 9 , in some embodiments, the electronic device 500 may further include: a display 503 , a radio frequency circuit 504 , an audio circuit 505 and a power supply 506 . Among them, the display 503 , the radio frequency circuit 504 , the audio circuit 505 and the power supply 506 are respectively electrically connected to the processor 501 .

显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在一些实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 may be used to display information input by or provided to the user and various graphical user interfaces, which may be composed of graphics, text, icons, video, and any combination thereof. The display 503 may include a display panel, and in some embodiments, the display panel may be configured in the form of a Liquid Crystal Display (LCD), or an Organic Light-Emitting Diode (OLED).

射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 can be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 may be used to provide an audio interface between the user and the electronic device through speakers and microphones.

电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。Power supply 506 may be used to power various components of electronic device 500 . In some embodiments, the power supply 506 may be logically connected to the processor 501 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.

尽管图9中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 9 , the electronic device 500 may further include a camera, a Bluetooth module, and the like, which will not be repeated here.

本申请实施例还提供一种存储介质,存储介质存储有计算机程序,当计算机程序在计算机上运行时,使得计算机执行上述任一实施例中的性别判断方法,比如:从人脸数据库中获取多张训练人脸图像;利用预设模型的第一神经网络获取多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取多张训练人脸图像的底层特征集合;将高层特征集合和底层特征集合进行融合,得到融合特征集合;将融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;利用训练后的预设模型对当前人脸图像进行判断,得到当前人脸图像对应的性别特征。The embodiments of the present application also provide a storage medium, where a computer program is stored in the storage medium, and when the computer program is run on the computer, the computer is made to execute the gender determination method in any of the above-mentioned embodiments, for example: obtaining multiple data from a face database training face images; use the first neural network of the preset model to obtain high-level feature sets of multiple training face images, and use the second neural network of the preset model to obtain the underlying feature sets of multiple training face images; The feature set and the underlying feature set are fused to obtain a fused feature set; input the fused feature set as training data into the prediction module of the preset model for training, and obtain a trained preset model; The face image is judged to obtain the gender feature corresponding to the current face image.

在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM)、或者随机存取记忆体(Random Access Memory,RAM)等。In this embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), or the like.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

需要说明的是,对本申请实施例的性别判断方法而言,本领域普通测试人员可以理解实现本申请实施例的性别判断方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如性别判断方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the gender determination method of the embodiment of the present application, ordinary testers in the art can understand that all or part of the process of realizing the gender determination method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. , the computer program can be stored in a computer-readable storage medium, such as in a memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process can include, for example, an embodiment of a gender determination method process. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.

对本申请实施例的性别判断装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,存储介质譬如为只读存储器,磁盘或光盘等。For the gender judging device of the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk.

以上对本申请实施例所提供的一种性别判断方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A gender determination method, device, storage medium, and electronic device provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described with specific examples. The descriptions of the above embodiments are only It is used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, this specification The content should not be construed as a limitation on this application.

Claims (10)

Translated fromChinese
1.一种性别判断方法,其特征在于,包括:1. a gender judgment method, is characterized in that, comprises:从人脸数据库中获取多张训练人脸图像;Obtain multiple training face images from the face database;利用预设模型的第一神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取所述多张训练人脸图像的底层特征集合;Use the first neural network of the preset model to obtain the high-level feature sets of the multiple training face images, and use the second neural network of the preset model to obtain the low-level feature sets of the multiple training face images;将所述高层特征集合和所述底层特征集合进行融合,得到融合特征集合;Fusing the high-level feature set and the bottom-level feature set to obtain a fusion feature set;将所述融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;Inputting the fusion feature set as training data into a prediction module of a preset model for training, to obtain a trained preset model;利用所述训练后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征。The current face image is judged by using the trained preset model, and the gender feature corresponding to the current face image is obtained.2.根据权利要求1所述性别判断方法,其特征在于,所述从人脸数据库中获取多张训练人脸图像的步骤,包括:2. according to the described gender judgment method of claim 1, it is characterized in that, the described step that obtains a plurality of training face images from face database, comprises:从人脸数据库中获取多张人脸图像;Obtain multiple face images from the face database;对所述多张人脸图像随机添加噪声得到多张训练人脸图像。A plurality of training face images are obtained by randomly adding noise to the plurality of face images.3.根据权利要求1所述性别判断方法,其特征在于,所述利用所述训练后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征的步骤,包括:3. The gender judging method according to claim 1, wherein the step of using the preset model after the training to judge the current face image to obtain the gender feature corresponding to the current face image, comprising: :获取拍摄图像;Get the captured image;将训练后的预设模型根据所述拍摄图像进行调整,得到调整后的预设模型;Adjusting the trained preset model according to the captured image to obtain an adjusted preset model;利用所述调整后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征。The current face image is judged by using the adjusted preset model, and the gender feature corresponding to the current face image is obtained.4.根据权利要求3所述性别判断方法,其特征在于,所述将训练后的预设模型根据所述拍摄图像进行调整,得到调整后的预设模型的步骤,包括:4. The gender judging method according to claim 3, wherein the step of adjusting the trained preset model according to the captured image to obtain the adjusted preset model comprises:所述预设模型包括多层网络,所述多层网络对输入数据依次进行计算得到预测结果,其中,所述多层网络的每层网络包括独立的计算参数;The preset model includes a multi-layer network, and the multi-layer network sequentially calculates the input data to obtain a prediction result, wherein each layer of the multi-layer network includes independent calculation parameters;根据所述拍摄图像,对训练后的预设模型的多层网络中的一层或多层网络的计算参数进行调整,得到调整后的预设模型。According to the captured image, the calculation parameters of one or more layers of the multi-layer network of the trained preset model are adjusted to obtain the adjusted preset model.5.根据权利要求1所述性别判断方法,其特征在于,所述利用预设模型的第一神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取所述多张训练人脸图像的底层特征集合的步骤,包括:5. The gender judging method according to claim 1, wherein the first neural network of the preset model is used to obtain the high-level feature set of the multiple training face images, and the second neural network of the preset model is used. The steps of acquiring the underlying feature sets of the multiple training face images include:利用预设模型的深层卷积神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的浅层神经网络获取所述多张训练人脸图像的底层特征集合。Use the deep convolutional neural network of the preset model to obtain the high-level feature sets of the multiple training face images, and use the shallow neural network of the preset model to obtain the underlying feature sets of the multiple training face images.6.根据权利要求1所述性别判断方法,其特征在于,所述将所述融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型的步骤,包括:6. The gender judging method according to claim 1, wherein the described fusion feature set is input as training data in the prediction module of the preset model for training, and the step of obtaining the preset model after training comprises:将所述融合特征集合作为训练数据输入预设模型的逻辑回归分类器中进行训练,得到训练后的预设模型。The fusion feature set is input into a logistic regression classifier of a preset model as training data for training, and a trained preset model is obtained.7.一种性别判断装置,其特征在于,所述装置包括:7. A gender judging device, wherein the device comprises:训练人脸图像获取模块,用于从人脸数据库中获取多张训练人脸图像;The training face image acquisition module is used to obtain multiple training face images from the face database;第一获取模块,用于利用预设模型的第一神经网络获取所述多张训练人脸图像的高层特征集合,利用预设模型的第二神经网络获取所述多张训练人脸图像的底层特征集合;The first obtaining module is used to obtain the high-level feature sets of the multiple training face images by using the first neural network of the preset model, and obtain the bottom layer of the multiple training face images using the second neural network of the preset model. feature set;第二获取模块,用于将所述高层特征集合和所述底层特征集合进行融合,得到融合特征集合;A second acquisition module, configured to fuse the high-level feature set and the bottom-level feature set to obtain a fused feature set;训练模块,用于将所述融合特征集合作为训练数据输入预设模型的预测模块中进行训练,得到训练后的预设模型;A training module, for inputting the fusion feature set as training data into a prediction module of a preset model for training to obtain a trained preset model;判断模块,用于利用所述训练后的预设模型对当前人脸图像进行判断,得到所述当前人脸图像对应的性别特征。The judgment module is used for judging the current face image by using the trained preset model to obtain the gender feature corresponding to the current face image.8.根据权利要求7所述的性别判断装置,其特征在于,所述训练人脸图像获取模块包括:8. The gender judging device according to claim 7, wherein the training face image acquisition module comprises:人脸图像获取子模块,用于从人脸数据库中获取多张人脸图像;The face image acquisition sub-module is used to acquire multiple face images from the face database;训练人脸获取子模块,用于对所述多张人脸图像随机添加噪声得到多张训练人脸图像。The training face acquisition sub-module is used to randomly add noise to the multiple face images to obtain multiple training face images.9.一种存储介质,其上存储有计算机程序,其特征在于,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至6任一项所述的性别判断方法。9 . A storage medium having a computer program stored thereon, wherein when the computer program runs on a computer, the computer is made to execute the gender determination method according to any one of claims 1 to 6 . 10 .10.一种电子设备,包括处理器和存储器,所述存储器储存有计算机程序,其特征在于,所述处理器通过调用所述计算机程序,用于执行如权利要求1至6任一项所述的性别判断方法。10. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, wherein the processor is used to execute the computer program according to any one of claims 1 to 6 by invoking the computer program method of gender determination.
CN201810476279.9A2018-05-172018-05-17Gender judgment method, gender judgment device, storage medium and electronic equipmentPendingCN110502959A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201810476279.9ACN110502959A (en)2018-05-172018-05-17Gender judgment method, gender judgment device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201810476279.9ACN110502959A (en)2018-05-172018-05-17Gender judgment method, gender judgment device, storage medium and electronic equipment

Publications (1)

Publication NumberPublication Date
CN110502959Atrue CN110502959A (en)2019-11-26

Family

ID=68583954

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201810476279.9APendingCN110502959A (en)2018-05-172018-05-17Gender judgment method, gender judgment device, storage medium and electronic equipment

Country Status (1)

CountryLink
CN (1)CN110502959A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111161713A (en)*2019-12-202020-05-15北京皮尔布莱尼软件有限公司Voice gender identification method and device and computing equipment
CN112669203A (en)*2020-12-302021-04-16咪咕文化科技有限公司Character conversion method in image, electronic device and storage medium
CN113255396A (en)*2020-02-072021-08-13北京达佳互联信息技术有限公司Training method and device of image processing model, and image processing method and device
CN113298156A (en)*2021-05-282021-08-24有米科技股份有限公司Neural network training method and device for image gender classification

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105095833A (en)*2014-05-082015-11-25中国科学院声学研究所Network constructing method for human face identification, identification method and system
CN106503661A (en)*2016-10-252017-03-15陕西师范大学Face gender identification method based on fireworks depth belief network
CN107301389A (en)*2017-06-162017-10-27广东欧珀移动通信有限公司 Method, device and terminal for identifying user gender based on facial features
CN107766891A (en)*2017-10-312018-03-06广东欧珀移动通信有限公司User's gender identification method, device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105095833A (en)*2014-05-082015-11-25中国科学院声学研究所Network constructing method for human face identification, identification method and system
CN106503661A (en)*2016-10-252017-03-15陕西师范大学Face gender identification method based on fireworks depth belief network
CN107301389A (en)*2017-06-162017-10-27广东欧珀移动通信有限公司 Method, device and terminal for identifying user gender based on facial features
CN107766891A (en)*2017-10-312018-03-06广东欧珀移动通信有限公司User's gender identification method, device, storage medium and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111161713A (en)*2019-12-202020-05-15北京皮尔布莱尼软件有限公司Voice gender identification method and device and computing equipment
CN113255396A (en)*2020-02-072021-08-13北京达佳互联信息技术有限公司Training method and device of image processing model, and image processing method and device
CN112669203A (en)*2020-12-302021-04-16咪咕文化科技有限公司Character conversion method in image, electronic device and storage medium
CN112669203B (en)*2020-12-302024-04-12咪咕文化科技有限公司Character transferring method in image, electronic device and storage medium
CN113298156A (en)*2021-05-282021-08-24有米科技股份有限公司Neural network training method and device for image gender classification
CN113298156B (en)*2021-05-282024-09-06有米科技股份有限公司Neural network training method and device for classifying image sexes

Similar Documents

PublicationPublication DateTitle
US11727577B2 (en)Video background subtraction using depth
CN113129312B (en)Image processing method, device and equipment
CN112232425B (en)Image processing method, device, storage medium and electronic equipment
CN107995428B (en)Image processing method, image processing device, storage medium and mobile terminal
US12008811B2 (en)Machine learning-based selection of a representative video frame within a messaging application
CN112262563B (en)Image processing method and electronic device
CN113298845A (en)Image processing method, device and equipment
CN111783647A (en) Training method of face fusion model, face fusion method, device and equipment
CN111797249A (en)Content pushing method, device and equipment
CN107784114A (en) Recommended method, device, terminal and storage medium for emoticon images
CN108924420A (en)Image shooting method, image shooting device, image shooting medium, electronic equipment and model training method
KR102045575B1 (en)Smart mirror display device
CN110502959A (en)Gender judgment method, gender judgment device, storage medium and electronic equipment
CN107193571A (en) Interface push method, mobile terminal and storage medium
US12354355B2 (en)Machine learning-based selection of a representative video frame within a messaging application
CN110430356A (en)One kind repairing drawing method and electronic equipment
CN111565281A (en) Photographing method, device, electronic device and storage medium
CN108334821B (en)Image processing method and electronic equipment
EP4490915A1 (en)Video stream refinement for dynamic scenes
CN114581951A (en)Gesture recognition method, system, device and medium
US20210312257A1 (en)Distributed neuromorphic infrastructure
CN115696019A (en)Image processing method, image processing device, computer equipment and storage medium
CN115170441B (en)Image processing method and electronic equipment
US20250292464A1 (en)Systems and methods for using ai to facilitate image editing
CN110278370A (en) Method, device, and electronic device for automatically generating shooting control mechanism

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20191126


[8]ページ先頭

©2009-2025 Movatter.jp