Summary of the invention
In view of this, the invention provides a kind of method and system of recognition of face, because the sample complexity of difference space method is very high, cause the problem of the difficulty increase of computation complexity and similarity-based learning to overcome in the prior art.
For realizing above-mentioned purpose, the present invention provides following technical scheme:
A kind of method of recognition of face is characterized in that, learns the similarity between the facial image based on SVMs SVM, comprising:
To the original training sample of people's face training data structure similarity-based learning, and said original training sample carried out dimensionality reduction at random, generate the similarity-based learning training set;
Adopt SVMs to train the training set of said similarity-based learning, generate sorter model;
To the original test sample book of people's face test data structure similarity-based learning, and said original test sample book carried out dimensionality reduction at random, generate the similarity-based learning test set;
According to said sorter model said similarity-based learning test set is classified; Obtain the classification results of said similarity-based learning test set; Classification results according to said similarity-based learning test set is added up the similarity probability between each type training sample in sample to be tested and the said original training sample according to preset rules; And, obtain face recognition result with said similarity probability maximal value output.
Wherein, said said original training sample is carried out dimensionality reduction at random, generates the similarity-based learning training set and be specially:
After carrying out at random dimensionality reduction, generate the training sample set behind the dimensionality reduction, keep the classification mark behind the dimensionality reduction constant;
For any two samples that the test sample book behind the said dimensionality reduction is concentrated, it is right to generate two different binary samples, judges whether two sample class are identical; If; Then said new binary is+1 to the classification value of the training sample set of form, and if promptly positive sample is not; Then said new binary is-1 to the classification value of the training sample set of form, i.e. negative sample;
Each sample is found out K nearest foreign peoples's point with the method for k nearest neighbor, said foreign peoples's point is stored in set X
i kIn, generate the similarity-based learning training set.
Wherein, said training set with said similarity-based learning adopts SVMs to train, and generates sorter model and is specially:
Select the regular parameter and the gaussian kernel function of said SVMs, the training set of said similarity-based learning is imported said regular parameter and gaussian kernel function, then obtain sorter model.
Wherein, said said original test sample book is carried out dimensionality reduction at random, generates the similarity-based learning test set and be specially:
After carrying out at random dimensionality reduction, generate the sample collection to be tested behind the dimensionality reduction, keep the classification mark behind the dimensionality reduction constant;
Sample and each sample generation binary sample in the training set behind the said dimensionality reduction for the sample to be tested behind the said dimensionality reduction is concentrated are right, and said binary sample is to being said similarity-based learning test set.
Wherein, said classification results according to said similarity-based learning test set adds up according to preset rules that the similarity probability between each type training sample is specially in sample to be tested and the said original training sample:
Each said classification results sum with said similarity-based learning test set; Measure the merchant with the sample number of the original test sample book of each type respectively, with the said result that obtains of merchant that gets as the similarity probability between each type training sample in sample to be tested and the said original training sample.
The similarity between the facial image is learnt based on SVMs SVM by a kind of system of recognition of face, comprising:
The training pre-processing module is used for the original training sample to people's face training data structure similarity-based learning, and said original training sample is carried out dimensionality reduction at random, generates the similarity-based learning training set;
The training pattern module is used for adopting SVMs to train the training set of said similarity-based learning, generates sorter model;
The test pre-processing module is used for the original test sample book to people's face test data structure similarity-based learning, and said original test sample book is carried out dimensionality reduction at random, generates the similarity-based learning test set;
Test module; Be used for the test set of said similarity-based learning being classified according to said sorter model; Obtain the classification results of said similarity-based learning test set; Classification results according to said similarity-based learning test set is added up the similarity probability between each type training sample in sample to be tested and the said original training sample according to preset rules, and with said similarity probability maximal value output, obtains face recognition result.
Can know via above-mentioned technical scheme, compared with prior art, the invention discloses a kind of method of recognition of face; Through test sample book and training sample are carried out dimensionality reduction at random, and generate similarity-based learning training set and test set, select the regular parameter and the gaussian kernel function of SVMs; The training set of similarity-based learning is input in regular parameter and the gaussian kernel function, obtains sorter model, the test set with similarity-based learning is input in the sorter model again; Obtain classification results, through said classification results is sued for peace, with the merchant of the sample size of a certain type of sample be the size of the similarity probability of said a certain class; Obtain maximal value; And, obtain the size of similarity probability with said maximal value output, obtain face recognition result the most accurately.Through dimensionality reduction to sample, the sample complexity is reduced, make that to learn the algorithm of the similarity between the facial image based on SVM quick; In addition, through the algorithm that carries out for each type, make the recognition of face rate that corresponding raising arranged.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The invention discloses a kind of method of recognition of face, through test sample book and training sample are carried out dimensionality reduction at random, and generate similarity-based learning training set and test set; Select the regular parameter and the gaussian kernel function of SVMs, the training set of similarity-based learning is input in regular parameter and the gaussian kernel function, obtain sorter model; Test set with similarity-based learning is input in the sorter model again; Obtain classification results, through said classification results is sued for peace, with the merchant of the sample size of a certain type of sample be the size of the similarity probability of said a certain class; Obtain maximal value; And, obtain the size of similarity probability with said maximal value output, obtain face recognition result the most accurately.Through dimensionality reduction to sample, the sample complexity is reduced, make that to learn the algorithm of the similarity between the facial image based on SVM quick; In addition, through the algorithm that carries out for each type, make the recognition of face rate that corresponding raising arranged.
The test that the present invention carries out in the ORL face database, the ORL face database is created by Cambridge University AT&T laboratory, comprises 40 people, everyone 10 secondary pictures, totally 400 face-images.Aspects such as the illumination of shot picture, countenance are not quite similar.This face database has been taken into account aspects such as ethnic group, sex and facial expression, is a kind of commonly used, database of carrying out recognition of face.5 of every type of picked at random are as training set from 40 types of samples, in every type other 5 as test set, each 200 sample in training set, the test set.
See also accompanying drawing 1, be the method flow diagram of the disclosed a kind of recognition of face of the embodiment of the invention.The method of the disclosed a kind of recognition of face of the embodiment of the invention, the practical implementation step is:
Step 101: to the original training sample of people's face training data structure similarity-based learning, and said original training sample carried out dimensionality reduction at random, generate the similarity-based learning training set.
This step is mainly handled people's face training data, the training sample of structure similarity-based learning.If existing people's face training dataset does
X wherein
i∈ R
DBe someone's face data, y
i=1,2 ..., c} representes x
iClassification.In the present embodiment, 1=200, D=10304, c=40.
The sample of at first people's face training data being concentrated carries out dimensionality reduction at random, and sample is all dropped to the d dimension, and (d<D) keeps the classification mark behind the dimensionality reduction constant simultaneously.Then the training sample set behind the dimensionality reduction is the training sample behind the dimensionality reduction for
; In the present embodiment experiment, d=100.
At random behind the dimensionality reduction; Generate the training set of new binary to form; For any two samples
and
; It is identical with the classification of
as if
with
to
to produce two different binary samples; The classification value of then remembering new sample is+1, promptly positive sample; Otherwise note-1, i.e. negative sample.In order to reduce the right number of sample; Improve the efficient of algorithm; Each sample
is found out its K nearest foreign peoples's point with the method for k nearest neighbor, be stored in these these foreign peoples's points in the set
.Then the training set of similarity-based learning can be expressed as
Z wherein
q∈ R
2d, m is the right number of sample, and if y
i=y
j, then
If y
i≠ y
j, then
In this experiment, K=9, m=5200.
Step 102: adopt SVMs to train the training set of said similarity-based learning, generate sorter model.
This step mainly is the training set to the similarity-based learning of last step generation, adopts SVMs to train.Select the regular parameter of SVMs and parameter σ>0 of gaussian kernel function
; The set of input training sample, then the sorter model of gained is:
Wherein: α
iWith b is to train tight model coefficient of giving birth to by SVMs,
The expression sign function.
Step 103: to the original test sample book of people's face test data structure similarity-based learning, and said original test sample book carried out dimensionality reduction at random, generate the similarity-based learning test set.
This step is mainly handled people's face test data, the test sample book of structure similarity-based learning.
If any sample x ∈ R to be tested
D, people's face test data sample is carried out dimensionality reduction at random, method is with identical to the processing of training set, and the dimension of people's face test data is dropped to the d dimension, and the sample to be tested behind the dimensionality reduction does
At random behind the dimensionality reduction; Produce the test set of new binary sample to form; With each sample
in the training set behind test sample book
and the dimensionality reduction treated behind the dimensionality reduction all generate the binary sample to
then the test set of similarity-based learning be expressed as
q=1; N, n are the right number of sample.
In the present embodiment experiment, sample x ∈ R to be tested
10304, people's face test data sample is carried out dimensionality reduction at random, with the dimension dimensionality reduction to 100 of people's face test data, the sample to be tested behind the dimensionality reduction does
Behind the dimensionality reduction, produce the test set of new binary sample to form at random, this test set can be expressed as
Q=1 ..., 200.
Step 104: said similarity-based learning test set is classified according to said sorter model; Obtain the classification results of said similarity-based learning test set; Classification results according to said similarity-based learning test set is added up the similarity probability between each type training sample in sample to be tested and the said original training sample according to preset rules; And, obtain face recognition result with said similarity probability maximal value output.
This step is right according to the sample that the processing in the
step 103 obtains with sample to be tested x
Be input in the sorter model of
step 102 generation, replace the z in the former sorter model, can obtain n classification results, can be expressed as f (z successively
i), i=1 ..., n.According to classification results, can count the similarity probability size of each type in test sample book x and the former training sample, and x classified according to following rule:
Wherein: l
pThe expression classification is the sample size of p, and
In this experiment, it is right that sample x to be tested obtains sample according to the processing in the
step 103
Be input in the sorter model of
step 102 generation, replace the z in the former sorter model, can obtain 200 classification results, can be expressed as f (z successively
i), i=1 ..., 200.According to following rule x is classified:
According to classification results, add up the similarity probability of each type in original test sample book and the original training sample, and similarity probability maximal value is exported according to rule, obtain face recognition result the most accurately.
The method of a kind of recognition of face disclosed by the invention through test sample book and training sample are carried out dimensionality reduction at random, and generates the training set and the test set of similarity-based learning; Select the regular parameter and the gaussian kernel function of SVMs, the training set of similarity-based learning is input in regular parameter and the gaussian kernel function, obtain sorter model; Test set with similarity-based learning is input in the sorter model again; Obtain classification results, through said classification results is sued for peace, with the merchant of the sample size of a certain type of sample be the size of the similarity probability of said a certain class; Obtain maximal value; And, obtain the size of similarity probability with said maximal value output, obtain face recognition result the most accurately.Through dimensionality reduction to sample, the sample complexity is reduced, make that to learn the algorithm of the similarity between the facial image based on SVM quick; In addition, through the algorithm that carries out for each type, make the recognition of face rate that corresponding raising arranged.
Describe method in detail among the disclosed embodiment of the invention described above, can adopt the system of various ways to realize, therefore the invention also discloses a kind of system, provide concrete embodiment below and be elaborated for method of the present invention.
See also accompanying drawing 2, be the system construction drawing of the disclosed a kind of recognition of face of the embodiment of the invention.The invention discloses a kind of system of recognition of face, this system specifically comprises:
Training pre-processing module 201 is used for the original training sample to people's face training data structure similarity-based learning, and said original training sample is carried out dimensionality reduction at random, generates the similarity-based learning training set.Training pattern module 202 is used for adopting SVMs to train the training set of said similarity-based learning, generates sorter model.Test pre-processing module 203 is used for the original test sample book to people's face test data structure similarity-based learning, and said original test sample book is carried out dimensionality reduction at random, generates the similarity-based learning test set.Test module 204; Be used for the test set of said similarity-based learning being classified according to said sorter model; Obtain the classification results of said similarity-based learning test set; Classification results according to said similarity-based learning test set is added up the similarity probability between each type training sample in sample to be tested and the said original training sample according to preset rules, and with said similarity probability maximal value output, obtains face recognition result.
Training pre-processing module 201 is mainly handled people's face training data, the training sample of structure similarity-based learning.If existing people's face training dataset does
X wherein
i∈ R
DBe someone's face data, y
i=1,2 ..., c} representes x
iClassification.
The sample of at first people's face training data being concentrated carries out dimensionality reduction at random, and sample is all dropped to the d dimension, and (d<D) keeps the classification mark behind the dimensionality reduction constant simultaneously.The dimensionality reduction of training sample set is
is the dimensionality reduction of training samples.
After the dimensionality reduction, generate the training set of new binary now at random to form.For any two samples
and
; It is identical with the classification of
as if
with
to
to produce two different binary samples; The classification value of then remembering new sample is+1, promptly positive sample; Otherwise note-1, i.e. negative sample.In order to reduce the right number of sample; Improve the efficient of algorithm; Each sample
is found out its K nearest foreign peoples's point with the method for k nearest neighbor, be stored in these these foreign peoples's points in the set
.Then the training set of similarity-based learning can be expressed as
Z wherein
q∈ R
2d, m is the right number of sample, and if y
i=y
j, then
If y
i≠ y
j, then
Training pattern module 202 mainly is that the training set employing SVMs of the similarity-based learning of training pre-processing module generation is trained.Select the regular parameter of SVMs and parameter σ>0 of gaussian kernel function
; The set of input training sample, then the sorter model of gained is:
Wherein: α
iWith b is to train the model coefficient that produces by SVMs,
The expression sign function.
Test pre-processing module 203 is mainly handled people's face test data, the test sample book of structure similarity-based learning.If any sample x ∈ R to be tested
D, people's face test data sample is carried out dimensionality reduction at random, method is identical to the processing of training set in the pre-processing module with training, and the dimension of people's face test data is dropped to the d dimension, and the sample to be tested behind the dimensionality reduction does
After the dimensionality reduction, produce the test set of new binary sample at random to form.With each sample
in the training set behind test sample book
and the dimensionality reduction treated behind the dimensionality reduction all generate the binary sample to
then the test set of similarity-based learning be expressed as
q=1; N, n are the right number of sample.
Test module 204 is right according to the sample that the processing in the
test pre-processing module 203 obtains with sample to be tested x
Be input in the sorter model of training module generation, replace the z in the former sorter model, can obtain n classification results, can be expressed as f (z successively
i), i=1 ..., n.According to classification results, can count the similarity probability size of each type in test sample book x and the former training sample, and x classified according to following rule:
Wherein: l
pThe expression classification is the sample size of p, and
On training sample, adopt 5 times of cross validations to select parameter, wherein the span of regular factor is { 2
-4, 2
-3..., 2
9, Gauss's radial kernel function parameters span is { 2
-9, 2
-8..., 2
4.Come to train again a model with the parameter of select then, obtain discrimination at the test set estimated performance.Selecting of training sample and test sample book is at random, and we repeat 10 tests.See also table 1, be the error rate contrast table of the present invention and difference space method, provided the error rate and the average result of 10 experiments.Comparative approach has two kinds of forms of difference space: difference sample and difference absolute value sample, and method of the present invention.The method of difference space has also been used the k nearest neighbor method, otherwise can't carry out emulation.
The error rate contrast of table 1. the present invention and difference space method
See also accompanying drawing 3, be the prediction synoptic diagram of the disclosed a kind of recognition of face of the embodiment of the invention.
We can find out that recognition of face effect of the present invention obviously is superior to difference sample and difference absolute value sample through experimental result, and have shown stronger stability, have certain advantage.
In sum: the invention discloses a kind of method of recognition of face, through test sample book and training sample are carried out dimensionality reduction at random, and generate the training set and the test set of similarity-based learning; Select the regular parameter and the gaussian kernel function of SVMs, the training set of similarity-based learning is input in regular parameter and the gaussian kernel function, obtain sorter model; Test set with similarity-based learning is input in the sorter model again; Obtain classification results, through said classification results is sued for peace, with the merchant of the sample size of a certain type of sample be the size of the similarity probability of said a certain class; Obtain maximal value; And, obtain the size of similarity probability with said maximal value output, obtain face recognition result the most accurately.Through dimensionality reduction to sample, the sample complexity is reduced, make that to learn the algorithm of the similarity between the facial image based on SVM quick; In addition, through the algorithm that carries out for each type, make the recognition of face rate that corresponding raising arranged.
For the disclosed system of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part is partly explained referring to method and is got final product.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.