A kind of extensive face identification methodTechnical field
The present invention relates to technical field of face recognition more particularly to a kind of extensive face identification methods.
Background technique
The features such as human face recognizing identity authentication technology is convenient and efficient with its, contactless, is widely used in security protection, doorThe fields such as taboo, attendance.And convolutional neural networks are being characterized in being there is large capacity by aspect, are suitable for large-scale peopleFace identification.But it needs to consider in face recognition process by factors such as human face's expression, posture, age, position and overcoversVariation in caused class, and from the identity such as ambient light photographs, background it is different caused by change between class, the branch that both change is allBe it is highly complex and nonlinear, generally analyzed using Softmax loss function, but Softmax loss function is onlyMeeting can't make to belong to of a sort feature aggregation, such feature is for recognition of face so that character separation between classIt is not efficient enough.
Summary of the invention
It is an object of the invention to propose a kind of extensive face identification method, the precision of recognition of face is improved, thus realNow large-scale recognition of face.
To achieve this purpose, the present invention adopts the following technical scheme:
A kind of extensive face identification method, comprising the following steps:
Step 1: training data simultaneously cleans trained data;
Step 2: setting network;
Step 3: input setting calibrates faces using 5 key points and normalizes to the color image of 112*112 specificationOn;
Step 4: output setting;
Step 5: optimizing Softmax loss function, new Softmax loss function is obtained, according to newSoftmax loss function improves the precision of recognition of face, and Softmax loss function is defined as follows:
M indicates that sample size, n indicate sample classification quantity in formula, and s indicates scale coefficient,m+θyIndicate angle step sideFormula, wherein m=0.5.
Preferably, in step 5, Softmax loss function is optimized including first suboptimization and double optimization, instituteState just suboptimization the following steps are included:
0 is set by bias, and a margin is added on the angle of projection, obtains the formula of first suboptimization, as follows:
M indicates that sample size, n indicate sample classification quantity in formula, and s indicates scale coefficient,m+θyIndicate angle step sideFormula, wherein m=0.5.
Preferably, the double optimization includes increasing fixed value in angle.
Preferably, in step 1, training data includes being trained using VGG network.
Preferably, in step 4, output setting include using optimum structure (Convolution- > BN- > Dropout- >FullyConnected- > BN) realize the method that the last one convolutional layer is connected to feature vector.
The utility model has the advantages that
By optimizing traditional softmax loss function, θ is indicated the angle after w and x normalization so that class and class itBetween only straight line so that boundary becomes larger, convenient for classification.Cleaning is optimized to training data simultaneously, selects optimal netNetwork structure, so that accuracy of identification greatly improves, with the raising of accuracy of identification, recognition efficiency for extensive face and accurateDegree also increases accordingly.
Detailed description of the invention
Fig. 1 is the flow chart of the extensive recognition of face precision of raising of the invention.
Specific embodiment
To further illustrate the technical scheme of the present invention below with reference to the accompanying drawings and specific embodiments.
A kind of extensive face identification method of the present embodiment, as shown in Figure 1, comprising the following steps:
Step 1: training data simultaneously cleans trained data;Training set uses 8000 people of VGG network training,Comprising 3000000 images, test set includes that 500 people 160000 open image, and picture quality crosses over posture, age, illumination, kindRace, occupation etc..Training data is cleaned.
Step 2: setting network;Using MxNet framework, use VGG2 as training data, softmax is as loss letterNumber demonstrates a variety of different network settings.It criticizes and is dimensioned to 512, learning rate is since 0.1, in 100k, 140k and 160kWhen reduce 10 times respectively, momentum unit value 0.9, weight decaying is set as 5e-4.
Step 3: input setting calibrates faces using 5 key points and normalizes to the color image of 112*112 specificationOn;Using 5 key point calibration faces and 112*112 color image is normalized to, in order to guarantee the resolution ratio of characteristic pattern, this realityIt applies example and conv7*7stride2 is replaced with into conv3*3stride1.The output of last convolution is 7*7.
Step 4: output setting;Including by optimum structure (Convolution- > BN- > Dropout- >FullyConnected- > BN), realize that the last one convolutional layer is connected to feature vector.
Step 5: optimizing Softmax loss function, new Softmax loss function is obtained, according to newSoftmax loss function improves the precision of recognition of face, and common Softmax loss function is defined as follows:
Traditional Softmax can not be optimized between the class of characteristic point with inter- object distance, calculate us for convenienceBias is set as 0, the angle after at this moment just indicating and normalize.In such Softmax, the boundary between class and class is onlyIt is a line.The point for falling near border in this way can allow the generalization ability of entire model poor.In order to allow this boundary to become largerIt is some, make the point between inhomogeneity remote as far as possible.A margin is added on the angle of projection can achieve this purpose.ThereforeFunction after first suboptimization is as follows:
After first suboptimization, Softmax function can stop restraining in the initial stage, therefore do double optimization, in angleUpper increase fixed value, the function after double optimization are as follows:
After optimization, angular distance is more direct in the influence to angle than COS distance.
The technical principle of the invention is described above in combination with a specific embodiment.These descriptions are intended merely to explain of the inventionPrinciple, and shall not be construed in any way as a limitation of the scope of protection of the invention.Based on the explanation herein, the technology of this fieldPersonnel can associate with other specific embodiments of the invention without creative labor, these modes are fallen withinWithin protection scope of the present invention.