CN110163049A - A kind of face character prediction technique, device and storage medium - Google Patents

A kind of face character prediction technique, device and storage medium Download PDF

Info

Publication number
CN110163049A
CN110163049A CN201810787870.6A CN201810787870A CN110163049A CN 110163049 A CN110163049 A CN 110163049A CN 201810787870 A CN201810787870 A CN 201810787870A CN 110163049 A CN110163049 A CN 110163049A
Authority
CN
China
Prior art keywords
face
predicted
picture
processing
character
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.)
Granted
Application number
CN201810787870.6A
Other languages
Chinese (zh)
Other versions
CN110163049B (en
Inventor
贺珂珂
葛彦昊
邰颖
汪铖杰
李季檩
吴永坚
黄飞跃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd, Tencent Cloud Computing Beijing Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810787870.6A priority Critical patent/CN110163049B/en
Publication of CN110163049A publication Critical patent/CN110163049A/en
Application granted granted Critical
Publication of CN110163049B publication Critical patent/CN110163049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a kind of face character prediction technique, device and storage mediums.Method includes: to obtain face picture to be predicted in the embodiment of the present invention;Default processing is carried out to face picture to be predicted, obtains face processing figure to be predicted;Face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtains the face character predicted value of face picture to be predicted;According to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.Face character is predicted by face picture to be predicted and corresponding face processing figure in the embodiment of the present invention, face processing figure can carry out complementation with face picture, the interference that background predicts face character is reduced, the accuracy and robustness of face character prediction are improved.

Description

A kind of face character prediction technique, device and storage medium
Technical field
The present invention relates to technical field of image processing, in particular to a kind of face character prediction technique, device and storage are situated between Matter.
Background technique
Currently, according to facial image predict face character more and more attention has been paid to.Face character includes expression, and movement is single Member, gender, the age, ethnic group, mouth size, the bridge of the nose height, if wear glasses, if wear dark glasses, eyes size, eyes open or Person closeds, and mouth opening perhaps closeds hair length or hair style classification, face value, front or side etc..Face character predicts skill Art is now widely used in human-computer interaction, the fields such as user modeling.
Existing face character prediction is based primarily upon traditional machine learning frame, extracts the feature of engineer first, Then to Feature Dimension Reduction, to obtain compact feature, finally using classification or forecast of regression model face character.
The prediction of existing face character is using original image as inputting, and original picture contains a large amount of ambient noise, such as quotient Field scene/office scenarios have very big difference, and different backgrounds is easy to interfere the classification of attribute, lead to face character Predict not accurate enough, robustness is poor.
Summary of the invention
The embodiment of the invention provides a kind of face character prediction technique, device and storage mediums, reduce background to people The interference of face attribute forecast improves the accuracy and robustness of face character prediction.
In a first aspect, this application provides a kind of face character prediction techniques, this method comprises:
Obtain face picture to be predicted;
Default processing is carried out to the face picture to be predicted, obtains face processing figure to be predicted;
Face character calculating is carried out according to the face picture to be predicted and the face processing figure to be predicted, is obtained described The face character predicted value of face picture to be predicted;
According to the face character predicted value of the face picture to be predicted, the face category of the face picture to be predicted is predicted Property.
Second aspect, the application provide a kind of face character prediction meanss, which includes:
Acquiring unit, for obtaining face picture to be predicted;
Picture processing unit obtains face processing to be predicted for carrying out default processing to the face picture to be predicted Figure;
Computing unit, for carrying out face character according to the face picture to be predicted and the face processing figure to be predicted It calculates, obtains the face character predicted value of the face picture to be predicted;
Predicting unit predicts the people to be predicted for the face character predicted value according to the face picture to be predicted The face character of face picture.
Further, the splicing subelement is specifically used for:
The first face characteristic and the second face characteristic data are spliced, spelled with obtaining the face Connect data.
Further, the splicing subelement is specifically used for:
The first face characteristic and the second face characteristic data are normalized, so that described First face characteristic and the second face characteristic data are in the same order of magnitude;
The the first face characteristic and the second face characteristic data that are in the same order of magnitude are spliced, obtained described Face splices data.
Further, described device further includes training unit, and the training unit is specifically used for:
The face picture to be predicted and the face processing figure to be predicted are separately input to preset multi-pass described Before road neural network model, multiple sample face pictures are acquired, and obtain the corresponding face character of every sample face picture True value;
Obtain the corresponding sample face processing figure of every sample face picture;
The sample face picture, sample face processing figure and the corresponding face character of every sample face picture is true Value is added in training sample data set;
Using the preset multi-channel nerve network of training sample data set training, the multi-channel nerve net is obtained Network model.
Further, the face processing figure to be predicted includes face abstract graph to be predicted, the picture processing unit tool Body is used for:
Abstract processing is carried out to the face picture to be predicted, obtains face abstract graph to be predicted.
Further, the acquiring unit includes:
Subelement is obtained, for obtaining original image;
Detection sub-unit is rectified for carrying out Face datection to the original image with carrying out face to the original image Positive processing, obtains the face picture to be predicted.
Further, the detection sub-unit is specifically used for:
Face datection is carried out to the original image, determines human face region;
The face key point of preset quantity is determined in the human face region;
Face correction is carried out to the original image according to the face key point, obtains face correction figure;
Figure is corrected to the face according to preset size and carries out size adjusting, obtains the face picture to be predicted.
The third aspect, the present invention also provides a kind of storage medium, the storage medium is stored with a plurality of instruction, described instruction It is loaded suitable for processor, step when executing in first aspect in any face character prediction technique.
The embodiment of the present invention is by obtaining face picture to be predicted;Default processing is carried out to face picture to be predicted, is obtained Face processing figure to be predicted;Carry out face character calculating according to face picture to be predicted and face processing figure to be predicted, obtain to Predict the face character predicted value of face picture;According to the face character predicted value of face picture to be predicted, people to be predicted is predicted The face character of face picture.Face is predicted by face picture to be predicted and corresponding face processing figure in the embodiment of the present invention Attribute, face processing figure can reduce single face picture and carry out face character with having carried out message complementary sense in face picture The interference that background predicts face character when prediction improves the accuracy and robustness of face character prediction.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, institute in being described below to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is one embodiment schematic diagram of the face identification system provided in the embodiment of the present invention;
Fig. 2 is one embodiment flow diagram of the face character prediction technique provided in the embodiment of the present invention;
Fig. 3 is one embodiment configuration diagram of the multi-channel nerve network provided in the embodiment of the present invention;
Fig. 4 is another embodiment flow diagram of the face character prediction technique provided in the embodiment of the present invention;
Fig. 5 is one embodiment schematic diagram of the face character prediction meanss provided in the embodiment of the present invention;
Fig. 6 is the structural schematic diagram of the server provided in the embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
In the following description, specific embodiments of the present invention will refer to the step as performed by one or multi-section computer And symbol illustrates, unless otherwise indicated.Therefore, these steps and operation will have to mention for several times is executed by computer, this paper institute The computer execution of finger includes by representing with the computer processing unit of the electronic signal of the data in a structuring pattern Operation.This operation is converted at the data or the position being maintained in the memory system of the computer, reconfigurable Or in addition change the running of the computer in mode known to the tester of this field.The maintained data structure of the data For the provider location of the memory, there is the specific feature as defined in the data format.But the principle of the invention is with above-mentioned text Word illustrates that be not represented as a kind of limitation, this field tester will appreciate that plurality of step and behaviour as described below Also it may be implemented in hardware.
Term as used herein " module " can regard the software object to execute in the arithmetic system as.It is as described herein Different components, module, engine and service can be regarded as the objective for implementation in the arithmetic system.And device as described herein and side Method is preferably implemented in the form of software, can also be implemented on hardware certainly, within that scope of the present invention.
The embodiment of the present invention provides a kind of face character prediction technique, device and storage medium.
Referring to Fig. 1, Fig. 1 is a kind of face identification system schematic diagram provided in an embodiment of the present invention, as shown in Figure 1, should Face identification system includes terminal and server, by network connection between the terminal and the server, can carry out data friendship Mutually.The terminal can be used as image capture device, can be acquired to image, and acquired image is converted to computer Readable form, the terminal are also used as identification equipment, carry out recognition of face to its acquired image, obtain the image Effective information.The server can also be used as identification equipment, carry out recognition of face to terminal acquired image.The server is also It can targetedly be serviced based on recognition result offer, for example, authentication can be carried out by recognition of face or complete to pay Deng.
The face identification system can have face capture and identify with following function, face modeling and search function, true man Function and picture quality detection function, do not repeat herein.In the embodiment of the present invention, which has identification people The function of the face character of face image, specifically, the face identification system may include face character prediction meanss, the face category Property prediction meanss specifically can integrate in the server, and the server in the server, that is, Fig. 1, the server is mainly used for obtaining Face picture to be predicted;Default processing is carried out to face picture to be predicted, obtains face processing figure to be predicted;According to people to be predicted Face picture and face processing figure to be predicted carry out face character calculating, obtain the face character predicted value of face picture to be predicted; According to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.
In embodiments of the present invention, face character may include expression, motor unit, gender, the age, ethnic group, and mouth is big It is small, bridge of the nose height, if wear glasses, if wear dark glasses, eyes size, eyes, which are opened, perhaps to be closed mouth opening or closeds, Hair length or hair style classification, face value, front or side etc..
In the embodiment of the present invention, which can be a server, be also possible to consist of several servers Server cluster or a cloud computing service center.
It should be noted that the schematic diagram of a scenario of face identification system shown in FIG. 1 is only an example, the present invention is real The face identification system and scene of applying example description are the technical solutions in order to more clearly illustrate the embodiment of the present invention, not The restriction for technical solution provided in an embodiment of the present invention is constituted, those of ordinary skill in the art are it is found that with recognition of face The differentiation of system and the appearance of new business scene, technical solution provided in an embodiment of the present invention is for similar technical problem, together Sample is applicable in.
It is described in detail combined with specific embodiments below.
In the present embodiment, it will be described from the angle of face character prediction meanss, face attribute forecast device tool Body can integrate in terminal or server.
The present invention provides a kind of face character prediction technique, this method comprises: obtaining face picture to be predicted;To be predicted Face picture carries out default processing, obtains face processing figure to be predicted;According to face picture to be predicted and face processing to be predicted Figure carries out face character calculating, obtains the face character predicted value of face picture to be predicted;According to the people of face picture to be predicted Face attribute forecast value, predicts the face character of face picture to be predicted.
Referring to Fig. 2, one embodiment of face character prediction technique includes: in the embodiment of the present invention
101, face picture to be predicted is obtained.
The face picture to be predicted refers mainly to the picture that original image reaches preset requirement after treatment.The present invention is implemented Original image is obtained in example, and there are many modes, such as specifically can obtain original image by shooting a large number of users face, or Person can also obtain the original image by searching for face picture on the internet, or obtain from face picture database Original image etc..Wherein, multiple people of same user can also be shot when shooting user's face to obtain the original image The approach such as face picture obtain original image.
It should be noted that obtaining original above by modes such as shooting user's face, internet hunt and face databases After beginning picture, the original image of acquisition may face part image corner (such as lower right corner) or side the case where, obtain simultaneously The original image size taken is different, it is therefore necessary to be uniformly processed to the original sheet of acquisition, obtain face picture to be predicted. Further, that is, also need to handle original image before obtaining face picture to be predicted so that original image meet it is pre- If it is required that the prediction of more conducively face character, at this point, the step of obtaining face picture to be predicted may further include: obtaining Take original image;Face datection is carried out to original image, to carry out face correction process to original image, obtains face to be predicted Picture.
Further, Face datection is carried out to original image, to carry out face correction process to original image, obtained to pre- The step of surveying face picture may include: to carry out Face datection to original image, determine human face region;It is determined in human face region The face key point of preset quantity;Face correction is carried out to original image according to face key point, obtains face correction figure;According to Preset size corrects figure to face and carries out size adjusting, obtains the face picture to be predicted.It is understood that the original graph It is the original image comprising face in piece, only the original image comprising face could handle to obtain face picture to be predicted, no Picture comprising face can be abandoned directly, without subsequent processing.
In the embodiment of the present invention, AdaBoost classifier (adaptively enhancing classifier) or deep learning can use Face datection algorithm carries out Face datection to original image and determines human face region and the determining preset quantity in human face region Face key point.Wherein, the algorithm of face key point is determined using AdaBoost detection of classifier face and utilize deep learning The method that algorithm detection face determines face key point is conventional techniques, and details are not described herein again.
In determining original image after face key point, can face key point to original image carry out face correction, obtain It corrects and schemes to face, for example, if in face key point including the key point of both sides eyebrow in face key point, according to face key Face key point in point on the eyebrow of both sides can be linked to be straight line, if the straight line opposed patterns up-and-down boundary be it is inclined, adjust Whole original image makes the straight line parallel with pattern up-and-down boundary, finally according to preset size (such as 50*50) to sample This face correction figure carries out size adjusting to get face picture to be predicted is arrived.It should be noted that the size of original image is general In the case of need be greater than the preset size, be convenient for size adjusting, certainly, in certain embodiments, original image The preset size can be less than, after the enhanced processing for needing first to carry out original image presupposition multiple in such cases, then into Row size adjusting.
102, default processing is carried out to face picture to be predicted, obtains face processing figure to be predicted.
Specifically, carrying out default processing to face picture to be predicted, obtaining face processing figure to be predicted may include: to utilize Preset processing figure generates model and handles face picture to be predicted, obtains face processing figure to be predicted.The default processing It can also be abstract processing, gray proces, preset color range adjustment, preset brightness adjustment or the processing of preset channel etc. are right It answers, face processing figure to be predicted can be face abstract graph to be predicted, face grayscale image to be predicted, face color range tune to be predicted Whole figure, face brightness adjustment figure to be predicted or face channel to be predicted processing figure etc., can specifically be set according to actual needs It is fixed.
It should be noted that face processing figure to be predicted may include a plurality of types of to be predicted in the embodiment of the present invention It is one or more in face processing figure, it can be specifically configured according to the demand of practical application, for example, face processing to be predicted Figure is one in face abstract graph to be predicted or face grayscale image to be predicted.In other embodiments of the present invention, face to be predicted Handling figure can also include other kinds of face processing figure to be predicted, such as only carry out some colors to face picture to be predicted Contrast is whole, brightness adjustment, the face processing to be predicted obtained after channel processing (removing a Color Channel in such as RGB channel) Figure.
In one embodiment, face processing figure to be predicted includes face abstract graph to be predicted, at this point, to face figure to be predicted Piece carries out default processing, obtains face processing figure to be predicted, may include: to carry out abstract processing to face picture to be predicted, obtains To face abstract graph to be predicted.It is then above-mentioned that face picture to be predicted is handled using preset processing figure generation model, it obtains Generating model to the processing figure in face processing figure step to be predicted can be abstract graph generation model, it can utilize preset Abstract graph generates model and carries out abstract processing to face picture to be predicted, obtains face abstract graph to be predicted, abstract graph generates mould The training method of type can generate the training method of model with reference to following processing figures, and details are not described herein again.
When face processing figure to be predicted includes multiple, scheme to generate model to face picture to be predicted using preset processing It also may include that multiple corresponding processing figures generate model in the step of being handled, obtaining face processing figure to be predicted, specifically Can be configured according to the demand of practical application, for example, face processing figure to be predicted include face abstract graph to be predicted and to Predict face grayscale image, it then may include that abstract graph generates model and grayscale image and generates model that processing figure, which generates model, using pre- If abstract graph generate model, grayscale image generate model face picture to be predicted is handled respectively, obtain face to be predicted Abstract graph and face grayscale image to be predicted.Certainly, it for face processing figure to be predicted, does not limit at every kind of face to be predicted yet The all corresponding processing figure of reason figure generates model, some face processing figures to be predicted can be handled by program, such as logical Algorithm realization is crossed to carry out the channel R in RGB channel in face picture to be predicted (i.e. red channel, green channel and blue channel) Removal, obtain only comprising the channel G, channel B image information face processing figure to be predicted, by face picture to be predicted obtain to The mode for predicting face processing figure, is not specifically limited herein.
Further, model is generated using preset processing figure to handle face picture to be predicted, obtain to be predicted Processing figure generates model and can be trained in the following way in the step of face processing figure: obtaining multiple sample face numbers According to including the data of multiple sample face pictures and corresponding multiple sample face processing figures in multiple sample human face data Value;Using the preset processing figure neural network of multiple sample human face data training, obtains processing figure and generate model.
Wherein, since digital image data can be indicated with matrix, matrix theory and matrix algorithm can be used Digital picture is analyzed and is handled, the matrix for obtaining image indicates.Most typical example is gray level image, gray level image Pixel data is exactly a matrix, and the width of the height (unit is pixel) of the row correspondence image of matrix, matrix column correspondence image is (single Position is pixel), the value of the pixel of the element correspondence image of matrix, matrix element is exactly the gray value of pixel.The embodiment of the present invention In, the sample face figure, sample face processing figure can be that the matrix of sample face abstract graph indicates, be indicated using matrix Digital picture, meets the ranks characteristic of image, while being also convenient for the addressing operation of program, so that computer picture programming is very square Just.The matrix that the data value and predicted value of following sample face processing figures may each be image indicates.
In the embodiment of the present invention, using the preset processing figure neural network of multiple sample human face data training, obtain everywhere Reason figure generates model
(1) by each sample face picture input processing figure neural network, the prediction of each sample face processing figure is obtained Value.
The processing figure neural network constructs in advance, processing figure neural network can be convolutional neural networks (CNN, Convolutional Neural Network), it may include encoder and decoder in processing figure neural network, to each sample This face picture, sample face picture are introduced into encoder, obtain high-level characteristic.Specifically, i.e. decoder is successive Convolution operation, constantly carry out the mapping in high-level characteristic space for picture will to be inputted, obtain high-level characteristic.It is decoding later Device, the high-level characteristic that decoder is used to finally obtain encoder restores, for generating sample face processing figure.It is specific and It says, is continuously deconvolution operation in decoder, so that the length and width dimensions of the high-level characteristic constantly become larger, finally exports It can be the matrix of sample face processing figure herein certainly to the equirotal sample face processing figure of sample face picture It indicates, i.e. the predicted value of sample face processing figure.
(2) predicted value of each sample face processing figure is restrained with data value, obtains processing figure and generates model.
For example, can specifically be carried out using predicted value and data value of the default loss function to each sample face processing figure Convergence obtains processing figure and generates model.Wherein, which can carry out flexible setting according to practical application request, for example, Loss function can be cross entropy loss function.Between predicted value and data value by reducing each sample face processing figure Error constantly train, and the parameter to adjust processing figure neural network can obtain processing figure and generate mould to appropriate value Type.Specifically, being calculated with data value according to default loss function the predicted value of each sample face processing figure, obtain The penalty values of multiple sample face processing figures;The parameter of processing figure neural network is adjusted, until parameter adjusted makes When obtaining the penalty values of multiple sample face processing figures less than or equal to preset threshold, stop adjustment, obtain processing figure and generate model, Specifically processing figure generates model, and the training method as abstract graph generates model or grayscale image generation model can direct reference process Figure generates the training method of model, herein no longer citing description one by one.
103, face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtains people to be predicted The face character predicted value of face picture.
Specifically, carrying out face character calculating according to face picture to be predicted and face processing figure to be predicted, obtain to pre- Survey face picture face character predicted value may include:
(1) respectively to face picture to be predicted and face processing figure feature extraction to be predicted, to obtain multiple face characteristics Data.
Wherein, special to obtain multiple faces respectively to face picture to be predicted and face processing figure feature extraction to be predicted Sign data may further include: face characteristic extraction is carried out to face picture to be predicted, to obtain the first face characteristic, The first face characteristic includes the face character predicted value of face picture to be predicted;People is carried out to face processing figure to be predicted Face feature extraction, to obtain the second face characteristic data, which includes the people of face processing figure to be predicted Face attribute forecast value.At this point, including the first face characteristic and the second face characteristic data in multiple face characteristic data. Face characteristic extraction is carried out to face picture to be predicted, the step of to obtain the first face characteristic, and to people to be predicted Face processing figure carry out face characteristic extraction, with obtain the second face characteristic data the step of, can pass through preset multichannel Multiple neural sub-network model realizations in network model, detailed process are referred to following multi-channel nerve network model description Related content.
(2) multiple face characteristic data are spliced, to obtain face splicing data.
When in multiple face characteristic data including the first face characteristic and the second face characteristic data, to multiple Face characteristic data are spliced, and may further include the step of face splicing data with obtaining: to the first face characteristic Spliced according to the second face characteristic data, to obtain face splicing data.
Further, the first face characteristic and the second face characteristic data are spliced, to obtain face splicing Data may include: that the first face characteristic and the second face characteristic data are normalized, so that the first Face characteristic and the second face characteristic data are in the same order of magnitude;To the first face characteristic for being in the same order of magnitude Spliced with the second face characteristic data, obtains face splicing data.For example, it is assumed that the first face characteristic includes 2048 A vector, the second face characteristic data include 1024 vectors, then to the first face characteristic and the second face characteristic data It is normalized, the first face characteristic and the second face characteristic data is adjusted to 2048 vectors.To being in The the first face characteristic and the second face characteristic data of the same order of magnitude spliced after to get to sample splice data 4096 vectors.
(3) linear transformation is carried out to face splicing data, obtains the face character predicted value of sample face picture.
The prediction of subsequent specific face character for convenience can splice data to face and carry out a linear transformation, should Linear transformation operation can be carried out using linear function, such as Y=a*X+b.Wherein, Y is output, and X is input, and a, b are ginsengs Number.For example input X is the vector of 10 dimensions, a is a matrix of preset 4*10, and b is a constant.Such as 0.2.First do Matrix Multiplication Method, obtained result arrive output Y plus this constant b.Such as assume to obtain after carrying out linear transformation to face splicing data To 20 vectors, which is 20 face attribute forecast values of face prediction.
Further, face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtain to The step of predicting the face character predicted value of face picture can be realized according to preset multi-channel nerve network model.Specifically , i.e., face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtains face picture to be predicted Face character predicted value, may include: face picture to be predicted and face processing figure to be predicted are separately input to it is preset Multi-channel nerve network model obtains the face character predicted value of face picture to be predicted.
Wherein, preset multi-channel nerve network model is the neural network model for including multiple input channels, preset Multi-channel nerve network model can be set according to the demand of practical application, for example, the preset multi-channel nerve network Model may include multiple neural sub-network models, each corresponding input channel of nerve sub-network model, multiple nerve Sub-network model structure is identical but parameter setting is not identical.The quantity and face picture to be predicted of multiple nerve sub-network model And the total quantity of face processing figure to be predicted is identical, corresponding one neural sub-network model of face picture to be predicted, people to be predicted Face handles corresponding one neural sub-network model of each figure in figure, such as at face picture to be predicted 1 and face to be predicted Fig. 2 are managed, then the quantity for the neural sub-network model for including in multi-channel nerve network model is 3, i.e., 3 neural sub-network moulds Type.
Specifically, the multi-channel nerve network model can be obtained by the preset multi-channel nerve network of training, such as Fig. 3 Shown, the structure of the multi-channel nerve network may include: input layer, convolutional layer, pond layer, specification layer, full articulamentum and damage Lose layer.It is specific as follows:
Input layer: it is responsible for receiving picture input, such as training sample (such as sample face picture and sample face processing figure) Or the picture (input of face picture input and face processing figure to be predicted such as to be predicted) for needing face character to identify.
The multi-channel nerve network internal includes multiple neural sub-network models, in each neural sub-network model, Comprising convolutional layer and pond layer, the two operations are alternately carried out (i.e. convolutional layer and pond layer is arranged alternately).Wherein, Duo Gezi The structure of network is the same, but the parameter of the two networks is independent.Facilitate face figure to be predicted in this way Piece and face processing figure to be predicted can fully be learnt respectively.
Convolutional layer: it is mainly used for carrying out feature extraction to the image (such as training sample or the image for needing to identify) of input (initial data is mapped to hidden layer feature space), wherein convolution kernel size can be depending on practical application, for example, One layer of convolution lamination core is dimensioned to (5,5), first layer convolution lamination core is dimensioned to (3,3), optionally, in order to drop The complexity of low calculating improves computational efficiency, and the convolution kernel size of all convolutional layers can also all be set in neural sub-network model It is set to (3,3);Detector of the convolutional layer as feature obtains neural sub-network model from low-level feature to high-rise spy Sign.Optionally, in order to improve the ability to express of model, can also be added by the way that nonlinear activation function is added it is non-linear because Element is respectively connected with nonlinear activation function in embodiments of the present invention behind convolutional layer, specifically can be according to the need of practical application It asks and is configured, for example, nonlinear activation function can be f (x)=max (0, x).
Pond layer: pond layer is merged to adjacent area, so that the deformation that neural sub-network model tolerable is certain, is promoted Model robustness.The operation of the pond layer and convolutional layer is essentially identical, and only the convolution kernel of pond layer is only to take corresponding position Maximum value (max pooling) or average value (average pooling) etc..
Specification layer: to the output feature in multiple neural sub-network models, being spliced by specification layer again respectively, wherein Specification layer feature can be normalized so that the output feature in multiple nerve sub-network models has same quantity Grade, convenient for the fusion of feature.
Full articulamentum: and then the feature of fusion is inputted into full the articulamentum, " distributed nature that full articulamentum can will be acquired Indicate " it is mapped to sample labeling space, the effect of " classifier ", full articulamentum are primarily served in entire convolutional neural networks All nodes for being exported with upper one layer (such as the last one pond layer in neural sub-network model) of each node be connected, Wherein, a node of full articulamentum is a neuron being known as in full articulamentum, and the quantity of neuron can in full articulamentum With depending on the demand of practical application, for example, the neuronal quantity of full articulamentum can be disposed as 2048.Since this is more Channel neural network model includes multiple neural sub-network models, and each nerve sub-network model can export multiple vectors, And the quantity of vector is consistent with the quantity of neural sub-network model neuron, full articulamentum splices this multiple vector, A fused vector is obtained, for example, multi-channel nerve network model includes first nerves sub-network model and nervus opticus Sub-network model, if first nerves sub-network model and nervus opticus sub-network model can export 2048 vectors respectively;Then Full articulamentum splices first nerves sub-network model output vector and nervus opticus sub-network model output vector, obtains 4096 vectors.
Optionally, in full articulamentum, after obtaining fused vector, one can be carried out to fused vector linearly Transformation, to facilitate the prediction of subsequent specific face character.Linear transformation operation can be carried out using linear function, such as such as The linear function Y=a*X+b of upper description.
Loss layer: loss layer obtains multi-channel nerve network model, specifically for the training to multi-channel nerve network , for calculating the difference for comparing face character predicted value and face character true value, and by back-propagation algorithm to multi-pass Parameter in road neural network carries out constantly amendment optimization, obtains multi-channel nerve network model, wherein loss function can be with Using cross entropy loss function.
The multi-channel nerve network can also include output layer, for being connected to complete when predicting face character The result of layer is exported.
Face picture to be predicted and face processing figure to be predicted are being separately input to preset multi-channel nerve network mould Before type, training is also needed to obtain the multi-channel nerve network model in the embodiment of the present invention, at this point, side in the embodiment of the present invention Method can also include: to acquire multiple sample face pictures, and obtain the corresponding face character true value of every sample face picture; Obtain the corresponding sample face processing figure of every sample face picture;By sample face picture, sample face processing figure and every The corresponding face character true value of sample face picture is added in training sample data set;Utilize training sample data set The preset multi-channel nerve network of training, obtains multi-channel nerve network model.
In the embodiment of the present invention, certain original sample face picture can be acquired, and every picture is carried out corresponding The mark of face character, the attribute of mark cover the face and hair of face, specifically include: whether hair length, hair are rolled up It is bent, if to have fringe, eyebrows bushed together, eyes size, if to be double-edged eyelid, if russian, if having double chin, if micro- Laugh at, if be branded as, if wear masks, if wear dark glasses, if wear glasses, if makeup and whether youth etc..Likewise, adopting Collection original sample face picture specifically can obtain original sample face picture by shooting a large number of users face, or can also To obtain the original sample face picture by searching for face picture on the internet, or obtained from face picture database Take original sample face picture etc..Wherein, it can also be clapped when shooting user's face to obtain multiple sample face pictures The approach such as multiple face pictures of same user are taken the photograph to acquire original sample face picture.It should be noted that above by bat It takes the photograph after the modes such as user's face, internet hunt and face database obtain original sample face picture, dimension of picture specification Possible disunity, be referred to it is above-mentioned treat the mode that predicted pictures are handled original sample face picture handled, Multiple sample face pictures are obtained, details are not described herein again.
In the embodiment of the present invention, the corresponding face character true value of sample face picture, that is, preset sample face figure The correct face character value of piece, such as include a women face in some this face picture, in test, can manually determine should Gender attribute is female in sample face picture, it is assumed that represents male with 0, use 1 represents female, then gender attribute in the sample face picture True value be 1.
In other of the invention embodiments, obtaining the corresponding sample face processing figure of every sample face picture can be with It is that face character prediction meanss itself are completed.It can specifically, obtaining the corresponding sample face processing figure of every sample face picture To include: to obtain sample face picture, model is generated using preset processing figure, sample face picture is handled, obtain sample This face processing figure.Wherein, which generates processing figure described in the training detailed process step 102 as above of model and generates Model, details are not described herein again.
It should be noted that the corresponding sample face processing figure of every sample face picture is obtained in the embodiment of the present invention, Wherein sample face processing figure may include a plurality of types of sample face processing figures, specifically can be according to the demand of practical application It is configured, for example, sample face abstract graph and sample face grayscale image etc..Can also include in other embodiments of the present invention Other kinds of sample face processing figure, such as some color range adjustment, brightness adjustment, channel only are carried out to sample face picture The sample face processing figure obtained after processing (removing a Color Channel in such as RGB channel), scheme as sample face color range adjusts, Sample face brightness adjustment figure or sample face channel processing figure etc..
In one embodiment, sample face processing figure includes sample face abstract graph, then above-mentioned processing figure neural network can To be abstract graph neural network, which, which generates model, can be abstract graph generation model, it can is abstracted using preset Figure generates model and handles sample face picture, obtains sample face abstract graph, and abstract graph generates the training method of model The training method of model can be generated with reference to above-mentioned processing figure, details are not described herein again.When sample face processing figure includes multiple, Also may include that multiple corresponding processing figures generate model in the embodiment of the present invention, specifically can according to the demand of practical application into Row setting, for example, sample face processing figure, including sample face abstract graph and sample face grayscale image, then it may include being abstracted Figure generates model, grayscale image generates model, generates model using preset abstract graph, grayscale image generates model respectively to sample people Face picture is handled, and sample face abstract graph and sample face grayscale image are obtained.Certainly, for sample face processing figure, It does not limit all corresponding processing figure of every kind of sample face processing figure and generates model, some sample face processing figures can pass through Program is handled, such as is realized by programming to RGB channel (i.e. red channel, green channel and indigo plant in sample face picture Chrominance channel) in the channel R be removed, obtain sample face processing figure only comprising the channel G or channel B image information, pass through sample This face picture obtains the mode of sample face processing figure, is not specifically limited herein.
Specifically, by sample face picture, sample face processing figure and the corresponding face character of every sample face picture When true value is added in training sample data set, each sample face picture, its corresponding sample face processing figure and should The corresponding face character true value of sample face picture constitutes a training sample, i.e., includes sample face in each training sample Picture, sample face processing figure and the corresponding face character true value of sample face picture.Training sample data set i.e. include Multiple such training samples.
Further, using the preset multi-channel nerve network of training sample data set training, multi-channel nerve is obtained Network model can specifically include:
(1) it is trained using multiple neural sub-network models of the training sample data set to multi-channel nerve network, To obtain the face character predicted value of each sample face picture;
Wherein, it is instructed using multiple neural sub-network models of the training sample data set to multi-channel nerve network Practice, can specifically include with obtaining the face character predicted value of each sample face picture: respectively with training sample data set Middle sample face picture is target sample face picture, by target sample face picture and corresponding target sample face processing figure Multiple neural sub-network models of multi-channel nerve network are separately input to, to obtain multiple sample face characteristic data;To more A sample face characteristic data are spliced, to obtain sample splicing data;Linear transformation is carried out to sample splicing data, is obtained The face character predicted value of sample face picture.Wherein, by the full articulamentum in multi-channel nerve network to multiple sample people Face characteristic is spliced, to obtain sample splicing data.
When sample face processing figure only includes a sample face processing figure, the is only included in multiple nerve sub-networks One neural sub-network model and nervus opticus sub-network model, a neural sub-network model is for handling sample face figure, and one A nerve sub-network model is for handling sample face processing figure, at this point, by target sample face picture and corresponding target sample This face processing figure is separately input to multiple neural sub-network models of multi-channel nerve network, special to obtain multiple sample faces Levy data, comprising: target sample face picture is input to first nerves sub-network model, to obtain first sample face characteristic Data, the first sample face characteristic data include the face character predicted value of target sample face picture;By target sample people Face processing figure is input to nervus opticus sub-network model, and to obtain the second sample face characteristic data, the second sample face is special Sign data include the face character predicted value of target sample face processing figure.
Wherein, first sample face characteristic number is obtained by first nerves sub-network model and nervus opticus sub-network model According to and the processes of the second sample face characteristic data be specifically referred to following face pictures to be predicted and obtain the first face characteristic The process of data and the second face characteristic data, details are not described herein again.
In addition, facilitating face category due to containing face location information abundant and texture information in face abstract graph Property fining identification, it is preferred, therefore, that in sample face processing figure include sample face abstract graph, when sample face processing It, can preferred sample face abstract graph when figure only includes a sample face processing figure.
Further, multiple sample face characteristic data are spliced, to obtain sample splicing data the step of can be with It include: that first sample face characteristic data and the second sample face characteristic data are normalized, so that the first sample This face characteristic and the second sample face characteristic data are in the same order of magnitude;To the first sample for being in the same order of magnitude Face characteristic data and the second sample face characteristic data are spliced, and sample splicing data are obtained.For example, it is assumed that first sample Face characteristic data include 2048 vectors, and the second sample human face data includes 1024 vectors, then special to first sample face Sign data and the second sample face characteristic data are normalized, by first sample face characteristic data and the second sample people Face characteristic is adjusted to 2048 vectors.To the first face characteristic and the second face characteristic for being in the same order of magnitude Data spliced after to get to sample splicing data 4096 vectors.
It should be noted that be foregoing description being the feelings for only including two neural sub-network models in multi-channel nerve network Condition, it is to be understood that in other embodiments of the present invention, neural sub-network model can also include more neural sub-networks Model, such as further include third nerve sub-network model, at this point, may include at first sample face in sample face processing figure Reason figure and the second sample face processing figure, will be defeated by target sample face picture and corresponding target sample face processing figure difference Enter multiple neural sub-network models to multi-channel nerve network, to obtain multiple sample face characteristic data, comprising: by target Sample face picture is input to first nerves sub-network model, to obtain first sample face characteristic data, first sample face Characteristic includes the predicted value of multiple face characters of face picture;First sample face processing figure is input to nervus opticus Sub-network model, to obtain the second sample face characteristic data, which includes the first face processing The predicted value of multiple face characters of figure;Second sample face processing figure is input to third nerve sub-network model, to obtain Third sample face characteristic data, the third sample face characteristic data include multiple face characters of the second face processing figure Predicted value;
It include: to the first sample to obtain the step of sample splices data at this point, splicing to multiple face characteristic data This face characteristic, the second sample face characteristic data and third face characteristic are spliced, to obtain sample splicing Data.The specific implementation above-mentioned acquisition multiple sample face characteristic data and multiple sample face characteristic data are spliced Journey can refer to the case where two neural sub-network models are only included in aforementioned multi-channel nerve network, and details are not described herein again.
The prediction of subsequent specific face character for convenience can splice data to sample and carry out a linear transformation, obtain To the face character predicted value of each sample face picture, it specifically can be and utilize linear function described in as above full articulamentum Carry out linear transformation, it is assumed that 20 vectors are obtained after linear transformation, which is 20 face characters of face prediction Predicted value.
(2) face character predicted value and face character true value are restrained, obtains multi-channel nerve network model.
For example, can be restrained using loss layer to face character predicted value and face character true value, specifically, i.e. It is restrained using predicted value of the default loss function to each sample face processing figure with data value, obtains multi-channel nerve net Network model.Wherein, which can carry out flexible setting according to practical application request, for example, loss function can be friendship Pitch entropy loss function.By reducing between the corresponding face character predicted value of each sample face picture and face character true value Error, carry out constantly train, the parameter to adjust multi-channel nerve network can obtain multi-channel nerve net to appropriate value Network model.Specifically, i.e. according to default loss function to the corresponding face character true value of each sample face picture and face Attribute true value is calculated, and the penalty values of multiple sample face picture face predictions are obtained;To the ginseng of multi-channel nerve network Number is adjusted, and is preset until parameter adjusted is less than or equal to the penalty values of multiple sample face picture face predictions When threshold value, stops adjustment, obtain multi-channel nerve network model.
Based on the structure of above-mentioned multi-channel nerve network model, when face processing figure to be predicted only includes a people to be predicted It is to only include first nerves sub-network model and nervus opticus sub-network model in multiple nerve sub-networks when face processing figure, one A nerve sub-network model is for handling face picture to be predicted, and a neural sub-network model is for handling at face to be predicted Reason figure, at this point, face picture to be predicted and face processing figure to be predicted are separately input to preset multi-channel nerve network mould Type, obtains the face character predicted value of face picture to be predicted, can specifically include: face picture to be predicted is input to first Neural sub-network model, to obtain the first face characteristic, which includes face picture to be predicted Face character predicted value;Face processing figure to be predicted is input to nervus opticus sub-network model, it is special to obtain the second face Data are levied, which includes the face character predicted value of face processing figure to be predicted.
Wherein, face picture to be predicted is input to first nerves sub-network model, to obtain the first face characteristic According to may include: the face characteristic extracted in face picture to be predicted;Utilize the different faces in first nerves sub-network model The corresponding submodel of attribute carries out forward calculation to the face characteristic of face picture to be predicted, obtains the first face characteristic. It, can be with to obtain the second face characteristic data likewise, face processing figure to be predicted is input to nervus opticus sub-network model It include: the face characteristic extracted in face processing figure to be predicted;Utilize the different faces attribute in nervus opticus sub-network model Corresponding submodel carries out forward calculation to the face characteristic of face processing figure to be predicted, obtains the second face characteristic data.
In each nerve sub-network model, the corresponding different attribute submodel of different attribute, the corresponding category of different attribute The attribute that sub-model needs to identify is different, then the face characteristic for needing to extract is also different, for example, identification hair style attribute, only needs Extract the profile of face and the position coordinates of hair.Face character prediction meanss pass through in each neural sub-network model Different attribute corresponding attribute submodel respective attributes can be extracted to face picture to be predicted and face processing figure to be predicted Corresponding face characteristic, and forward calculation is carried out to face characteristic, obtain the predicted value of multiple attributes of face picture to be predicted. In each neural sub-network model in the corresponding attribute submodel of different attribute, initial parameter can be set, for more Any of a attribute submodel attribute submodel, the face characteristic which can use parameter and extract carry out Forward calculation exports the predicted value that the attribute submodel being calculated corresponds to attribute, face picture all properties to be predicted Predicted value is the face character predicted value of corresponding face picture to be predicted, and similarly face processing figure all properties to be predicted is pre- Measured value is the face character predicted value of corresponding face processing figure to be predicted.
In a kind of possible implementation, the process of the forward calculation can be with are as follows: in each nerve sub-network model, to people The process of face feature calculation can have multilayer calculating, and upper one layer calculates the feature of input, and obtained output is as next The input of layer, and so on, the output of the last layer is obtained, and each attribute submodel is determined based on the output of the last layer The predicted value of corresponding attribute.The process that above-mentioned multilayer calculates can first calculate input and weight in the specific implementation, in every layer Product, then calculate product and bias and value, by this and value as output.Certainly, which calculates only with the calculation For be illustrated, may further include other calculating in calculating process, the present invention does not repeat this.
In addition, facilitating face category due to containing face location information abundant and texture information in face abstract graph Property fining identification, it is preferred, therefore, that in face processing figure to be predicted include face abstract graph to be predicted, as people to be predicted When face processing figure only includes a face processing figure to be predicted, it is preferred that face processing figure to be predicted can be face to be predicted Abstract graph.
It should be noted that be foregoing description being the feelings for only including two neural sub-network models in multi-channel nerve network Condition, it is to be understood that in other embodiments of the present invention, neural sub-network model can also include more neural sub-networks Model, such as further include third nerve sub-network model, at this point, may include the first people to be predicted in face processing figure to be predicted Face processing figure and the second face processing figure to be predicted, face picture to be predicted and face processing figure to be predicted are separately input to pre- If multi-channel nerve network model, obtain the face character predicted value of face picture to be predicted, may include: by people to be predicted Face picture is input to first nerves sub-network model, to obtain the first face characteristic, the first face characteristic include to Predict the predicted value of multiple face characters of face picture;It will be at face to be predicted by the first face processing figure to be predicted and second Reason figure is separately input to nervus opticus sub-network model and third nerve sub-network model, to obtain the second face characteristic data.
Specifically, face processing figure to be predicted is separately input to the second mind by the first face processing figure to be predicted and second Through sub-network model and third nerve sub-network model, may further include with obtaining the second face characteristic data: by first Face processing figure to be predicted is input to nervus opticus sub-network model, and to obtain third face characteristic, the third face is special Sign data include the predicted value of multiple face characters of the first face processing figure to be predicted;Second face processing figure to be predicted is defeated Enter to third nerve sub-network model, to obtain the 4th face characteristic data, the 4th face characteristic data include second to pre- The predicted value of multiple face characters of face processing figure is surveyed, which includes third party's face characteristic With the 4th face characteristic data.
At this point, splicing to the first face characteristic and the second face characteristic data, to obtain face splicing data The step of include: that the first face characteristic, third face characteristic and the 4th face characteristic data are spliced, to obtain Face is taken to splice data.The above-mentioned specific implementation process spliced to face characteristic data, can be with reference to aforementioned multichannel mind The case where two neural sub-network models are only included in network, details are not described herein again.
104, according to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.
Since the type of face character is different, the attribute value for being used to indicate face character in the embodiment of the present invention can also have There is different representations, the attribute value of face character can be numeric form, be also possible to vector form, can be with other numbers According to representation, such as array etc..For example, the corresponding face character of the face picture to be predicted can be whether to wear glasses, property Not, whether the face characters such as wear masks.In practical applications, each face character can be indicated using numeric form, for example, There are two types of genders, can represent male with 0, use 1 represents female.Whether wear glasses can have 2 kinds: be with it is no, respectively can with 0 representative No (not wearing glasses), being represented with 1 is (wearing glasses).Whether wear masks can have 2 kinds: be with it is no, it is same to use 0 representative respectively No (not wearing masks), being represented with 1 is (wearing masks).Such as the attribute of two facial images in two face pictures to be predicted can To be female respectively, wear glasses, do not wear masks and male, do not wear glasses, do not wear masks, then the face of the two facial images to be predicted Attribute true value can be 1,1,0 and 0,0,0.In the embodiment of the present invention, the attribute value of certain face characters can be used Numeric form indicates, such as age attribute, can be indicated using vector form the attribute value of other face characters, such as property Other attribute and expression attribute.
In the embodiment of the present invention, in the face character predicted value for determining face picture to be predicted, people to be predicted can be predicted The face character of face picture, for example, face character predicted value include 1,1 and 0, it is assumed that the face character respectively indicated be gender, Whether wear glasses and whether wear masks, represents male with 0, use 1 represents female;No (not wearing glasses) is represented with 0, being represented with 1 is (hyperphoria with fixed eyeballs Mirror);No (not wearing masks) can be represented with 0, being represented with 1 is (wearing masks), then can be according to face character predicted value, predicting should Face picture face character to be predicted is female, wears glasses, does not wear masks.
It should be noted that only being lifted in the example above with three face characters and corresponding face character predicted value Example, it is to be understood that in practical applications, can have more or fewer face characters and face character predicted value, herein It is not construed as limiting.
The embodiment of the present invention is by obtaining face picture to be predicted;Default processing is carried out to face picture to be predicted, is obtained Face processing figure to be predicted;Carry out face character calculating according to face picture to be predicted and face processing figure to be predicted, obtain to Predict the face character predicted value of face picture;According to the face character predicted value of face picture to be predicted, people to be predicted is predicted The face character of face picture.Face is predicted by face picture to be predicted and corresponding face processing figure in the embodiment of the present invention Attribute, face processing figure can carry out complementation with face picture, reduce the interference that background predicts face character, improve The accuracy and robustness of face character prediction.
Face character prediction technique in the embodiment of the present invention is described below with reference to a concrete application scene.
Referring to Fig. 4, Fig. 4 is another flow diagram of face character prediction technique provided in an embodiment of the present invention, it should Method flow may include:
201, server obtains face picture A to be predicted;
Wherein, face picture A to be predicted is the face picture of original image X after treatment, is specifically obtained by original image X It may include: that Face datection is carried out to original image X to face picture A, determine human face region;It is determined in human face region default The face key point of quantity (for example including key points such as facial contour, eyes, eyebrow, lip and nose profiles);For example, if It include the key point of both sides eyebrow in face key point in face key point, according to the face in face key point on the eyebrow of both sides Key point can be linked to be straight line, if the straight line opposed patterns up-and-down boundary be it is inclined, adjust original image and make the straight line It is parallel with pattern up-and-down boundary, obtain face correction figure Y;Figure Y is corrected to face according to 50*50 and carries out size adjusting, is somebody's turn to do Face picture A to be predicted.
202, server carries out abstract processing to face picture A to be predicted, obtains face abstract graph B to be predicted;
Due to containing face location information abundant and texture information in face abstract graph, facilitate the essence of face character Refinement identifies that face processing figure selection face abstract graph is illustrated in the present embodiment.
In the present embodiment, it can use preset abstract graph generation model and abstract processing carried out to face picture A to be predicted, Obtain face abstract graph B to be predicted.It may include encoder and decoder that abstract graph, which generates in model, to face picture to be predicted A, face picture A to be predicted are introduced into encoder, obtain high-level characteristic.Specifically, i.e. decoder is continuously convolution Operation obtains high-level characteristic for face picture A to be predicted constantly to be carried out to the mapping in high-level characteristic space.It is solution later Code device, the high-level characteristic that decoder is used to finally obtain encoder restores, for generating face abstract graph B to be predicted. Specifically, being continuously deconvolution operation in decoder, so that the length and width dimensions of the high-level characteristic constantly become larger, finally Output obtains the face abstract graph B to be predicted with face picture A size to be predicted.
203, face picture A to be predicted and face abstract graph B to be predicted are separately input to multi-channel nerve net by server Network model obtains the face character predicted value of face picture A to be predicted;
In the present embodiment, face picture A to be predicted and face abstract graph B to be predicted are separately input to train in advance more The face character predicted value of face picture A to be predicted is obtained in the neural network model of channel.For example, face picture A to be predicted It include the predicted value of three attributes, specially 1,1 and 0 in face character predicted value.
204, server predicts the people of face picture A to be predicted according to the face character predicted value of face picture A to be predicted Face attribute.
For example, the face character predicted value of face picture A to be predicted includes 1,1 and 0, it is assumed that the face character respectively indicated For gender, whether wear glasses and whether wear masks, represents male with 0, use 1 represents female;No (not wearing glasses) is represented with 0, is represented with 1 It is (wearing glasses);No (not wearing masks) can be represented with 0, being represented with 1 is (wearing masks), then can be according to face picture to be predicted The face character predicted value of A predicts that the face picture A face character to be predicted is female, wears glasses, do not wear masks.
Yi Suhe multichannel is inputted by face picture A to be predicted and face abstract graph B to be predicted in the embodiment of the present invention Neural network model predicts that face character, face picture A to be predicted and face abstract graph to be predicted have carried out complementation, made to get profit When carrying out face character prediction to face picture A to be predicted with multi-channel nerve network model, face character prediction is improved Accuracy and robustness.
For convenient for better implementation face character prediction technique provided in an embodiment of the present invention, the embodiment of the present invention is also provided A kind of device based on the prediction of above-mentioned face character.Wherein the meaning of noun is identical with above-mentioned face character prediction technique, tool Body realizes that details can be with reference to the explanation in embodiment of the method.
Referring to Fig. 5, Fig. 5 is the structural schematic diagram of face character prediction meanss provided in an embodiment of the present invention, wherein should Face character prediction meanss may include acquiring unit 501, picture processing unit 502, computing unit 503 and predicting unit 504, It is specific as follows:
Acquiring unit 501, for obtaining face picture to be predicted;
Picture processing unit 502 obtains face processing to be predicted for carrying out default processing to face picture to be predicted Figure;
Computing unit 503, for carrying out face character calculating according to face picture to be predicted and face processing figure to be predicted, Obtain the face character predicted value of face picture to be predicted;
Predicting unit 504 predicts face picture to be predicted for the face character predicted value according to face picture to be predicted Face character.
Further, which includes extracting subelement and splicing subelement, specific as follows:
Subelement is extracted, is used for respectively to face picture to be predicted and face processing figure feature extraction to be predicted, to obtain Multiple face characteristic data;
Splice subelement, for splicing to multiple face characteristic data, to obtain face splicing data;
Subelement is converted, for carrying out linear transformation to face splicing data, obtains the face character of sample face picture Predicted value.
Further, which is specifically used for:
Face characteristic extraction is carried out to face picture to be predicted, to obtain the first face characteristic, first face is special Sign data include the face character predicted value of face picture to be predicted;
Face characteristic extraction is carried out to face processing figure to be predicted, to obtain the second face characteristic data, second face Characteristic includes the face character predicted value of face processing figure to be predicted.
Further, which is specifically used for:
First face characteristic and the second face characteristic data are spliced, to obtain face splicing data.
Further, which is specifically used for:
First face characteristic and the second face characteristic data are normalized, so that the first face characteristic Data and the second face characteristic data are in the same order of magnitude;
The the first face characteristic and the second face characteristic data that are in the same order of magnitude are spliced, face is obtained Splice data.
Further, which is specifically used for:
Face picture to be predicted and face processing figure to be predicted are separately input to preset multi-channel nerve network model, Obtain the face character predicted value of face picture to be predicted.
Further, which further includes training unit, which is specifically used for:
Face picture to be predicted and face processing figure to be predicted are being separately input to preset multi-channel nerve network mould Before type, multiple sample face pictures are acquired, and obtain the corresponding face character true value of every sample face picture;
Obtain the corresponding sample face processing figure of every sample face picture;
Sample face picture, sample face processing figure and the corresponding face character true value of every sample face picture are added It is added in training sample data set;
Using the preset multi-channel nerve network of training sample data set training, multi-channel nerve network model is obtained.
Further, which includes face abstract graph to be predicted, and the picture processing unit 502 is specific For:
Abstract processing is carried out to face picture to be predicted, obtains face abstract graph to be predicted.
Further, which includes:
Subelement is obtained, for obtaining original image;
Detection sub-unit, to carry out face correction process to original image, is obtained for carrying out Face datection to original image To face picture to be predicted.
Further, which is specifically used for:
Face datection is carried out to original image, determines human face region;
The face key point of preset quantity is determined in human face region;
Face correction is carried out to original image according to face key point, obtains face correction figure;
Figure is corrected to face according to preset size and carries out size adjusting, obtains face picture to be predicted.
The embodiment of the present invention obtains face picture to be predicted by acquiring unit 501;Picture processing unit 502 is to be predicted Face picture carries out default processing, obtains face processing figure to be predicted;Computing unit 503 is according to face picture to be predicted and to pre- It surveys face processing figure and carries out face character calculating, obtain the face character predicted value of face picture to be predicted;Predicting unit 504 According to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.In the embodiment of the present invention Predict face character by face picture to be predicted and corresponding face processing figure, face processing figure can with face picture into It has gone complementation, has reduced the interference that background predicts face character, improved the accuracy and robustness of face character prediction.
The embodiment of the present invention also provides a kind of server, as shown in fig. 6, it illustrates take involved in the embodiment of the present invention The structural schematic diagram of business device, specifically:
The server may include one or processor 601, one or more meters of more than one processing core The components such as memory 602, power supply 603 and the input unit 604 of calculation machine readable storage medium storing program for executing.Those skilled in the art can manage Solution, server architecture shown in Fig. 6 do not constitute the restriction to server, may include than illustrating more or fewer portions Part perhaps combines certain components or different component layouts.Wherein:
Processor 601 is the control centre of the server, utilizes each of various interfaces and the entire server of connection Part by running or execute the software program and/or module that are stored in memory 602, and calls and is stored in memory Data in 602, the various functions and processing data of execute server, to carry out integral monitoring to server.Optionally, locate Managing device 601 may include one or more processing cores;Preferably, processor 601 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation storage medium of application processor, user interface and application program etc., modem processor Main processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 601.
Memory 602 can be used for storing software program and module, and processor 601 is stored in memory 602 by operation Software program and module, thereby executing various function application and data processing.Memory 602 can mainly include storage journey Sequence area and storage data area, wherein application program needed for storing program area can store operation storage medium, at least one function (such as sound-playing function, image player function etc.) etc.;Storage data area can be stored to be created according to using for server Data etc..In addition, memory 602 may include high-speed random access memory, it can also include nonvolatile memory, such as At least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memory 602 can be with Including Memory Controller, to provide access of the processor 601 to memory 602.
Server further includes the power supply 603 powered to all parts, it is preferred that power supply 603 can be deposited by power management Storage media and processor 601 are logically contiguous, to realize management charging, electric discharge and power consumption by power management storage medium The functions such as management.Power supply 603 can also include one or more direct current or AC power source, recharge storage medium, electricity The random components such as source fault detection circuit, power adapter or inverter, power supply status indicator.
The server may also include input unit 604, which can be used for receiving the number or character letter of input Breath, and generation keyboard related with user setting and function control, mouse, operating stick, optics or trackball signal are defeated Enter.
Although being not shown, server can also be including display unit etc., and details are not described herein.Specifically in the present embodiment, Processor 601 in server can according to following instruction, by the process of one or more application program is corresponding can It executes file to be loaded into memory 602, and runs the application program of storage in the memory 602 by processor 601, thus Realize various functions, as follows:
Obtain face picture to be predicted;Default processing is carried out to face picture to be predicted, obtains face processing figure to be predicted; Face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtains the face of face picture to be predicted Attribute forecast value;According to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the detailed description above with respect to face character prediction technique, details are not described herein again.
It will appreciated by the skilled person that all or part of the steps in the various methods of above-described embodiment can be with It is completed by instructing, or relevant hardware is controlled by instruction to complete, which can store computer-readable deposits in one In storage media, and is loaded and executed by processor.
For this purpose, the embodiment of the present invention provides a kind of storage medium, wherein being stored with a plurality of instruction, which can be processed Device is loaded, to execute the step in any face character prediction technique provided by the embodiment of the present invention.For example, this refers to Order can execute following steps:
Obtain face picture to be predicted;Default processing is carried out to face picture to be predicted, obtains face processing figure to be predicted; Face character calculating is carried out according to face picture to be predicted and face processing figure to be predicted, obtains the face of face picture to be predicted Attribute forecast value;According to the face character predicted value of face picture to be predicted, the face character of face picture to be predicted is predicted.
The specific implementation of above each operation can be found in the embodiment of front, and details are not described herein.
Wherein, which may include: read-only memory (ROM, Read Only Memory), random access memory Body (RAM, Random Access Memory), disk or CD etc..
By the instruction stored in the storage medium, any face category provided by the embodiment of the present invention can be executed Step in property prediction technique, it is thereby achieved that any face character prediction technique institute provided by the embodiment of the present invention The beneficial effect being able to achieve is detailed in the embodiment of front, and details are not described herein.
A kind of face character prediction technique, device and storage medium is provided for the embodiments of the invention above to have carried out in detail Thin to introduce, used herein a specific example illustrates the principle and implementation of the invention, and above embodiments are said It is bright to be merely used to help understand method and its core concept of the invention;Meanwhile for those skilled in the art, according to this hair Bright thought, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not manage Solution is limitation of the present invention.

Claims (15)

1. a kind of face character prediction technique, which is characterized in that the described method includes:
Obtain face picture to be predicted;
Default processing is carried out to the face picture to be predicted, obtains face processing figure to be predicted;
Face character calculating is carried out according to the face picture to be predicted and the face processing figure to be predicted, is obtained described to pre- Survey the face character predicted value of face picture;
According to the face character predicted value of the face picture to be predicted, the face character of the face picture to be predicted is predicted.
2. face character prediction technique according to claim 1, which is characterized in that described according to the face figure to be predicted Piece and the face processing figure to be predicted carry out face character calculating, obtain the face character prediction of the face picture to be predicted Value, comprising:
Respectively to the face picture to be predicted and the face processing figure feature extraction to be predicted, to obtain multiple face characteristics Data;
The multiple face characteristic data are spliced, to obtain face splicing data;
Linear transformation is carried out to face splicing data, obtains the face character predicted value of sample face picture.
3. face character prediction technique according to claim 2, which is characterized in that described respectively to the face to be predicted Picture and the face processing figure feature extraction to be predicted, to obtain multiple face characteristic data, comprising:
Face characteristic extraction is carried out to the face picture to be predicted, to obtain the first face characteristic, first face Characteristic includes the face character predicted value of the face picture to be predicted;
Face characteristic extraction is carried out to the face processing figure to be predicted, to obtain the second face characteristic data, second people Face characteristic includes the face character predicted value of the face processing figure to be predicted.
4. face character prediction technique according to claim 3, which is characterized in that described to the multiple face characteristic number According to being spliced, to obtain face splicing data, comprising:
The first face characteristic and the second face characteristic data are spliced, to obtain the face splicing number According to.
5. face character prediction technique according to claim 4, which is characterized in that described to the first face characteristic Spliced according to the second face characteristic data, to obtain the face splicing data, comprising:
The first face characteristic and the second face characteristic data are normalized, so that described first Face characteristic data and the second face characteristic data are in the same order of magnitude;
The the first face characteristic and the second face characteristic data that are in the same order of magnitude are spliced, the face is obtained Splice data.
6. face character prediction technique according to claim 1, which is characterized in that described according to the face figure to be predicted Piece and the face processing figure to be predicted carry out face character calculating, obtain the face character prediction of the face picture to be predicted Value, comprising:
The face picture to be predicted and the face processing figure to be predicted are separately input to preset multi-channel nerve network Model obtains the face character predicted value of the face picture to be predicted.
7. face character prediction technique according to claim 6, which is characterized in that described by the face figure to be predicted Piece and the face processing figure to be predicted are separately input to before preset multi-channel nerve network model, and the method is also wrapped It includes:
Multiple sample face pictures are acquired, and obtain the corresponding face character true value of every sample face picture;
Obtain the corresponding sample face processing figure of every sample face picture;
The sample face picture, sample face processing figure and the corresponding face character true value of every sample face picture are added It is added in training sample data set;
Using the preset multi-channel nerve network of training sample data set training, the multi-channel nerve network mould is obtained Type.
8. face character prediction technique according to claim 1, which is characterized in that the face processing figure to be predicted includes Face abstract graph to be predicted, it is described that default processing is carried out to the face picture to be predicted, face processing figure to be predicted is obtained, is wrapped It includes:
Abstract processing is carried out to the face picture to be predicted, obtains face abstract graph to be predicted.
9. face character prediction technique according to claim 1, which is characterized in that it is described to obtain face picture to be predicted, Include:
Obtain original image;
Face datection is carried out to the original image, to carry out face correction process to the original image, is obtained described to pre- Survey face picture.
10. face character prediction technique according to claim 8, which is characterized in that described to be carried out to the original image Face datection obtains the face picture to be predicted to carry out face correction process to the original image, comprising:
Face datection is carried out to the original image, determines human face region;
The face key point of preset quantity is determined in the human face region;
Face correction is carried out to the original image according to the face key point, obtains face correction figure;
Figure is corrected to the face according to preset size and carries out size adjusting, obtains the face picture to be predicted.
11. a kind of face character prediction meanss, which is characterized in that described device includes:
Acquiring unit, for obtaining face picture to be predicted;
Picture processing unit obtains face processing figure to be predicted for carrying out default processing to the face picture to be predicted;
Computing unit, by being carried out based on face character according to the face picture to be predicted and the face processing figure to be predicted It calculates, obtains the face character predicted value of the face picture to be predicted;
Predicting unit predicts the face figure to be predicted for the face character predicted value according to the face picture to be predicted The face character of piece.
12. face character prediction meanss according to claim 11, which is characterized in that the computing unit includes:
Subelement is extracted, for respectively to the face picture to be predicted and the face processing figure feature extraction to be predicted, with Obtain multiple face characteristic data;
Splice subelement, for splicing to the multiple face characteristic data, to obtain face splicing data;
Subelement is converted, for carrying out linear transformation to face splicing data, obtains the face character of sample face picture Predicted value.
13. face character prediction meanss according to claim 12, which is characterized in that the extraction subelement is specifically used In:
Face characteristic extraction is carried out to the face picture to be predicted, to obtain the first face characteristic, first face Characteristic includes the face character predicted value of the face picture to be predicted;
Face characteristic extraction is carried out to the face processing figure to be predicted, to obtain the second face characteristic data, second people Face characteristic includes the face character predicted value of the face processing figure to be predicted.
14. face character prediction meanss according to claim 11, which is characterized in that the computing unit is specifically used for:
The face picture to be predicted and the face processing figure to be predicted are separately input to preset multi-channel nerve network Model obtains the face character predicted value of the face picture to be predicted.
15. a kind of storage medium, which is characterized in that the storage medium is stored with a plurality of instruction, and described instruction is suitable for processor It is loaded, the step in 1 to 10 described in any item face character prediction techniques is required with perform claim.
CN201810787870.6A 2018-07-18 2018-07-18 Face attribute prediction method, device and storage medium Active CN110163049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810787870.6A CN110163049B (en) 2018-07-18 2018-07-18 Face attribute prediction method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810787870.6A CN110163049B (en) 2018-07-18 2018-07-18 Face attribute prediction method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110163049A true CN110163049A (en) 2019-08-23
CN110163049B CN110163049B (en) 2023-08-29

Family

ID=67645069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810787870.6A Active CN110163049B (en) 2018-07-18 2018-07-18 Face attribute prediction method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110163049B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112183299A (en) * 2020-09-23 2021-01-05 成都佳华物链云科技有限公司 Pedestrian attribute prediction method and device, electronic equipment and storage medium
CN113171214A (en) * 2021-05-27 2021-07-27 山东大学 Multi-path feedback myoelectricity control prosthetic hand based on self-adaptive enhanced classifier and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484658A (en) * 2014-12-30 2015-04-01 中科创达软件股份有限公司 Face gender recognition method and device based on multi-channel convolution neural network
WO2016110005A1 (en) * 2015-01-07 2016-07-14 深圳市唯特视科技有限公司 Gray level and depth information based multi-layer fusion multi-modal face recognition device and method
CN106529447A (en) * 2016-11-03 2017-03-22 河北工业大学 Small-sample face recognition method
CN106897675A (en) * 2017-01-24 2017-06-27 上海交通大学 The human face in-vivo detection method that binocular vision depth characteristic is combined with appearance features
US20180012107A1 (en) * 2015-12-11 2018-01-11 Tencent Technology (Shenzhen) Company Limited Image classification method, electronic device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484658A (en) * 2014-12-30 2015-04-01 中科创达软件股份有限公司 Face gender recognition method and device based on multi-channel convolution neural network
WO2016110005A1 (en) * 2015-01-07 2016-07-14 深圳市唯特视科技有限公司 Gray level and depth information based multi-layer fusion multi-modal face recognition device and method
US20180012107A1 (en) * 2015-12-11 2018-01-11 Tencent Technology (Shenzhen) Company Limited Image classification method, electronic device, and storage medium
CN106529447A (en) * 2016-11-03 2017-03-22 河北工业大学 Small-sample face recognition method
CN106897675A (en) * 2017-01-24 2017-06-27 上海交通大学 The human face in-vivo detection method that binocular vision depth characteristic is combined with appearance features

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112183299A (en) * 2020-09-23 2021-01-05 成都佳华物链云科技有限公司 Pedestrian attribute prediction method and device, electronic equipment and storage medium
CN112183299B (en) * 2020-09-23 2024-02-09 成都佳华物链云科技有限公司 Pedestrian attribute prediction method and device, electronic equipment and storage medium
CN113171214A (en) * 2021-05-27 2021-07-27 山东大学 Multi-path feedback myoelectricity control prosthetic hand based on self-adaptive enhanced classifier and method
CN113171214B (en) * 2021-05-27 2023-10-24 山东大学 Multi-path feedback myoelectric control prosthetic hand based on self-adaptive enhancement classifier and method

Also Published As

Publication number Publication date
CN110163049B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN110263681B (en) Facial expression recognition method and device, storage medium and electronic device
US11967151B2 (en) Video classification method and apparatus, model training method and apparatus, device, and storage medium
Gray et al. Predicting facial beauty without landmarks
Žeger et al. Grayscale image colorization methods: Overview and evaluation
CN111401174B (en) Volleyball group behavior identification method based on multi-mode information fusion
CN108898579A (en) A kind of image definition recognition methods, device and storage medium
CN108830237B (en) Facial expression recognition method
WO2022143645A1 (en) Three-dimensional face reconstruction method and apparatus, device, and storage medium
CN109447001B (en) Dynamic emotion recognition method
CN108280426B (en) Dark light source expression identification method and device based on transfer learning
CN109800817B (en) Image classification method based on fusion semantic neural network
CN110991380A (en) Human body attribute identification method and device, electronic equipment and storage medium
CN108463823A (en) A kind of method for reconstructing, device and the terminal of user's Hair model
CN111080746A (en) Image processing method, image processing device, electronic equipment and storage medium
CN109919006A (en) Expression detection method, device, electronic equipment and storage medium
CN111079833A (en) Image recognition method, image recognition device and computer-readable storage medium
CN107341762A (en) Take pictures processing method, device and terminal device
WO2024109374A1 (en) Training method and apparatus for face swapping model, and device, storage medium and program product
CN111127309A (en) Portrait style transfer model training method, portrait style transfer method and device
CN113486944A (en) Face fusion method, device, equipment and storage medium
CN114973349A (en) Face image processing method and training method of face image processing model
CN114677730A (en) Living body detection method, living body detection device, electronic apparatus, and storage medium
CN110163049A (en) A kind of face character prediction technique, device and storage medium
CN112069916A (en) Face beauty prediction method, device and system and readable storage medium
Guo et al. Facial parts swapping with generative adversarial networks

Legal Events

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