The content of the invention
The invention provides a kind of face identification method and monitoring device, for improving the precision and efficiency of recognition of face.
First aspect present invention provides a kind of face identification method, including:
Monitoring device obtains face image data;
The monitoring device carries out local linear discriminant analysis LLDA to the face image data, extracts face characteristic number
According to;
The monitoring device carries out Classification and Identification according to default k nearest neighbor sample to the face characteristic data.
With reference to the first aspect of the present invention, in the first implementation of the first aspect of the present invention, the local line
Property discriminant analysis LLDA include the local linear discriminant analysis VLLDA based on vector or the local linear discriminant analysis based on matrix
MLLDA。
With reference to the first implementation of the first aspect of the present invention, in second of realization side of the first aspect of the present invention
In formula, the face image data is expressed as vector by the local linear discriminant analysis VLLDA based on vector, described to be based on
The face image data is expressed as matrix by the local linear discriminant analysis MLLDA of matrix.
Second with reference to the first of the first aspect of the present invention or first aspect implementation or first aspect is real
Existing mode, in the third implementation of the first aspect of the present invention, the monitoring device is entered to the face image data
Row local linear discriminant analysis LLDA, extraction face characteristic data specifically include:
The monitoring device is according to the default k nearest neighbor sample, default first formula and default second formula difference
Scatter matrix S in the class of the face image data is calculatedwThe scatter matrix S between classb, the k nearest neighbor sample includes multiple
The set of the training sample of class;
Default first formula is:
Default second formula is:
Wherein, c ' be k nearest neighbor sample classification number, m ' be k nearest neighbor sample average, l 'iFor the i-th class K in classification c '
The number of neighbour's sample, i.e.,m′iFor the average of the k nearest neighbor sample of the i-th class in classification c ', x 'ijFor classification c '
In the i-th class j-th of k nearest neighbor sample;
The monitoring device is according to scatter matrix S in the classw, scatter matrix S between the classbAnd Fei Sheer criterion meters
Calculation obtains the characteristic vector of face image data;
The monitoring device carries out feature extraction to the characteristic vector of the face image data, obtains the face characteristic
Data.
With reference to the third implementation of the first aspect of the present invention, in the 4th kind of realization side of the first aspect of the present invention
In formula, the monitoring device calculates respectively according to the default k nearest neighbor sample, default first formula and default second formula
Obtain scatter matrix S in the class of the face image datawThe scatter matrix S between classbAlso include before:
The monitoring device carries out dimension-reduction treatment according to principal component analysis PCA to training sample;
The monitoring device determines the default k nearest neighbor by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
Sample.
Second with reference to the first of the first aspect of the present invention or first aspect implementation or first aspect is real
Existing mode, in the 5th kind of implementation of the first aspect of the present invention, the monitoring device is according to default k nearest neighbor sample pair
The face characteristic data carry out Classification and Identification and specifically included:
The monitoring device is matched the face characteristic data with the default k nearest neighbor sample;
The monitoring device is obtained and the face characteristic data pair using the training sample matched by k nearest neighbor algorithm
The test sample answered;
The monitoring device calculates the Euclidean distance between the test sample and the default k nearest neighbor sample;
When the Euclidean distance is less than preset threshold value, determine to include the face characteristic number in facial feature database
According to;When the Euclidean distance is more than preset threshold value, determine not including the face characteristic data in facial feature database.
With reference to the 5th kind of implementation of the first aspect of the present invention, in the 6th kind of realization side of the first aspect of the present invention
Do not include the face characteristic data in formula, in the determination facial feature database includes afterwards:
The monitoring device display warning picture, and the prompt tone that gives a warning.
Second aspect of the present invention provides a kind of monitoring device, including:
Acquiring unit, for obtaining face image data;
Analytic unit, for carrying out local linear discriminant analysis LLDA to the face image data, extract face characteristic
Data;
Recognition unit, for carrying out Classification and Identification to the face characteristic data according to default k nearest neighbor sample.
With reference to the second aspect of the present invention, in the first implementation of the second aspect of the present invention, the analysis is single
Member specifically includes:
First computing module, for according to the default k nearest neighbor sample, default first formula and default second formula
Scatter matrix S in the class of the face image data is calculated respectivelywThe scatter matrix S between classb, the k nearest neighbor sample includes
The set of the training sample of multiple classes;
Default first formula is:
Default second formula is:
Wherein, c ' be k nearest neighbor sample classification number, m ' be k nearest neighbor sample average, l 'iFor the i-th class K in classification c '
The number of neighbour's sample, i.e.,m′iFor the average of the k nearest neighbor sample of the i-th class in classification c ', x 'ijFor classification c '
In the i-th class j-th of k nearest neighbor sample;
Second computing module, for according to scatter matrix S in the classw, scatter matrix S between the classbAnd Fei Sheer is accurate
The characteristic vector of face image data is then calculated;
Extraction module, for carrying out feature extraction to the characteristic vector of the face image data, it is special to obtain the face
Levy data.
With reference to the first implementation of the second aspect of the present invention, in second of realization side of the second aspect of the present invention
In formula, the monitoring device also includes:
Processing unit, for carrying out dimension-reduction treatment to training sample according to principal component analysis PCA;
Determining unit, for determining the default k nearest neighbor from the training sample after dimension-reduction treatment by k nearest neighbor algorithm
Sample.
Second with reference to the first of the second aspect of the present invention or second aspect implementation or second aspect is real
Existing mode, in the third implementation of the second aspect of the present invention, the recognition unit specifically includes:
Matching module, for the face characteristic data to be matched with the default k nearest neighbor sample;
3rd computing module, for being obtained and the face characteristic by k nearest neighbor algorithm using the training sample matched
Test sample corresponding to data;
4th computing module, for calculating the Euclidean distance between the test sample and the default k nearest neighbor sample;
First determining module, for after the Euclidean distance is less than preset threshold value, determining to wrap in facial feature database
Containing the face characteristic data;
Second determining module, for after the Euclidean distance is more than preset threshold value, determining in facial feature database not
Include the face characteristic data.
With reference to the third implementation of the second aspect of the present invention, in the 4th kind of realization side of the second aspect of the present invention
In formula, the recognition unit also includes:
Output module, for after it is determined that not including the face characteristic data in the facial feature database, showing
Alert picture, and the prompt tone that gives a warning.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:Monitoring device obtains facial image
Data;The monitoring device carries out local linear discriminant analysis LLDA to the face image data, extracts face characteristic data;
The monitoring device carries out Classification and Identification according to default k nearest neighbor sample to the face characteristic data.The present invention is based on to big
The processing of data, using distributed structure/architecture, rely on distributed treatment, distributed data base and cloud storage, the void of cloud computing
Planization technology.Therefore, when data category distribution is more complicated, by carrying out local linear differentiation point to the face image data
LLDA is analysed, so as to need to only train the sub-fraction of whole training set before testing, and according to default k nearest neighbor sample to the people
Face characteristic carries out Classification and Identification, improves the precision and efficiency of recognition of face.By the above method, monitoring device is to place
The personnel in region carry out man face image acquiring, are stored in database and are used as training sample.After the completion of collection, it is possible to dealing
Personnel carry out man face image acquiring and are used as test sample.Described training sample be for establishing model, using they
Feature can be exactly to be determined by the feature of training sample with structural classification device, some parameters of grader.Described test
Sample may be considered new unknown sample, and test sample is classified by the grader having had built up.So
After carry out recognition of face, the personnel not in database are irised out in display picture with rectangle frame, and send caution sound prompting
Security personnel couple can be checked with personnel, to take precautions against the personal safety as well as the property safety for specifying place.Because this method is not required to train institute
Have a sample, but a portion sample, be exactly in this way to a large amount of more suitable for the processing to big data, popular saying
The processing of sample.And traditional LDA is not appropriate for the processing of large sample.
Embodiment
To enable goal of the invention, feature, the advantage of the present invention more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that disclosed below
Embodiment be only part of the embodiment of the present invention, and not all embodiment.Based on the embodiment in the present invention, this area
The every other embodiment that those of ordinary skill is obtained under the premise of creative work is not made, belongs to protection of the present invention
Scope.
A kind of face identification method in the embodiment of the present invention is specifically described below, referring to Fig. 1, the present invention is implemented
A kind of one embodiment of face identification method includes in example:
101st, monitoring device obtains face image data;
Monitoring device obtains face image data;It should be noted that monitoring device passes through USB (Universal
Serial Bus, logical to get lines crossed) the existing face image data of any of interface or network node acquisition;Or pass through connection
Photographing module obtains face image data, and specific acquisition modes are not construed as limiting herein.
102nd, above-mentioned monitoring device carries out local linear discriminant analysis LLDA to above-mentioned face image data, and extraction face is special
Levy data;
Above-mentioned monitoring device carries out local linear discriminant analysis LLDA (Local Linear to above-mentioned face image data
Discriminant Analysis, local linear discriminant analysis) extraction face characteristic data;It should be noted that above-mentioned part
Linear discriminant analysis LLDA includes local linear discriminant analysis VLLDA (the Vector Local Linear based on vector
Discriminant Analysis, the local linear discriminant analysis based on vector) or local linear discriminant analysis based on matrix
MLLDA (Matrix Local Linear Discriminant Analysis, the local linear discriminant analysis based on matrix).
Wherein, above-mentioned face image data is expressed as vector by the above-mentioned local linear discriminant analysis VLLDA based on vector, above-mentioned to be based on
Above-mentioned face image data is expressed as matrix by the local linear discriminant analysis MLLDA of matrix.
103rd, above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data.
Above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data;Need
Bright, above-mentioned default k nearest neighbor sample is K arest neighbors of the test sample determined in training sample, and K number does not limit
It is fixed;It is compared with the facial feature database of preservation after classifying to above-mentioned face characteristic data, knows so as to complete face
Other process.
In the embodiment of the present invention, monitoring device obtains face image data;Above-mentioned monitoring device is to above-mentioned facial image number
According to local linear discriminant analysis LLDA is carried out, face characteristic data are extracted;Above-mentioned monitoring device is according to default k nearest neighbor sample pair
Above-mentioned face characteristic data carry out Classification and Identification.The present invention, using distributed structure/architecture, is relied on based on the processing to big data
Distributed treatment, distributed data base and the cloud storage of cloud computing, virtualization technology.Therefore, when data category distribution is more complicated
When, by carrying out local linear discriminant analysis LLDA to above-mentioned face image data, so as to which only whole instruction need to be trained before testing
Practice the sub-fraction of collection, and Classification and Identification is carried out to above-mentioned face characteristic data according to default k nearest neighbor sample, improve face
The precision and efficiency of identification.
By the above method, monitoring device carries out man face image acquiring to the personnel of region, is stored in database
As training sample.After the completion of collection, it is possible to carry out man face image acquiring to dealing personnel and be used as test sample.Described
Training sample is for establishing model, can be exactly to lead to structural classification device, some parameters of grader using their feature
The feature of training sample is crossed to determine.Described test sample may be considered new unknown sample, by having built
The grader that has stood is classified to test sample.Then recognition of face is carried out, the personnel not in database are being shown
Irised out in picture with rectangle frame, and send caution sound and remind security personnel couple to be checked with personnel, to take precautions against specified place
Personal safety as well as the property safety.Because this method is not required to train all samples, but a portion sample, it is more suitable in this way
In the processing to big data, popular saying is exactly the processing to great amount of samples.And traditional LDA is not appropriate for the processing of large sample.
Based on the face identification method in above-described embodiment, below for the specific of above-mentioned local linear discriminant analysis LLDA
Process is illustrated, referring to Fig. 2, a kind of another embodiment of face identification method includes in the embodiment of the present invention:
201st, monitoring device obtains face image data;
Monitoring device obtains face image data;It should be noted that monitoring device passes through USB (Universal
Serial Bus, logical to get lines crossed) the existing face image data of any of interface or network node acquisition;Or pass through connection
Photographing module obtains face image data, and specific acquisition modes are not construed as limiting herein.
202nd, above-mentioned monitoring device is according to default k nearest neighbor sample, default first formula and default second formula difference
Scatter matrix S in the class of above-mentioned face image data is calculatedwThe scatter matrix S between classb;
It should be noted that above-mentioned k nearest neighbor sample includes the set of the training sample of multiple classes;Above-mentioned default first formula
For:
Above-mentioned default second formula is:
Wherein, c ' be k nearest neighbor sample classification number, m ' be k nearest neighbor sample average, l 'iFor the i-th class K in classification c '
The number of neighbour's sample, i.e.,m′iFor the average of the k nearest neighbor sample of the i-th class in classification c ', x 'ijFor classification c '
In the i-th class j-th of k nearest neighbor sample.
203rd, above-mentioned monitoring device is according to scatter matrix S in above-mentioned classw, scatter matrix S between above-mentioned classbAnd Fei Sheer is accurate
The characteristic vector of face image data is then calculated;
It should be noted that above-mentioned specific algorithm refer to it is as follows:For example, in VLLDA algorithms, facial image number is inputted
According to vector representation.For a given sample, from whole training sample xi∈RnThe sample is determined in (i=1,2 ..., L)
K arest neighbors.This K arest neighbors is expressed as x 'i∈Rn(i=1,2 ..., K).They come from the individual classifications of c ', are expressed as c 'i(i
=1,2 ..., c '), these classifications are a parts for whole classifications.If classification c 'iThere is l 'iIndividual fixed neighbour, i.e.,m′iRepresent in classification c 'iIn fixed neighbour average, x 'ijIt is the sample in classification c 'iIn j-th
Fixed neighbour.Scatter matrix is as follows between scatter matrix and class in definition class:
Wherein, m ' is the average of all fixed neighbours.Then, the local Fei Sheer criterions based on vector can represent
For:
It is understood that if each classification in the individual classifications of c ' only includes an arest neighbors of given sample, that
Scatter matrix is exactly a null matrix in the class of these arest neighbors.So in above-mentioned VLLDA algorithms, it is only necessary to utilize class
Between scatter matrix, and criterion reforms into:
On the other hand, if whole K arest neighbors of given sample are all from same classification, then they
Scatter matrix is exactly a null matrix between class.So, it is only necessary to utilize scatter matrix in classAnd criterion becomes:
So for a given sample, make JVLF(Wv) maximize, and a projection matrix is obtained, the matrix
Row are characteristic vectors, correspond to characteristic equationTop characteristic value, or matrixOrTop feature
Value.
Different from VLLDA, the input data in MLLDA is represented as matrix.Assuming that there are the L instructions from c classification
Practice sampleIn order to extract the feature of sample, we determine its K from training set first
Arest neighbors.These neighbours are expressed as A 'i(i=1,2 ..., K), and come from the individual classification C ' of C 'i(i=1,2 ..., C '), this c ' is individual
Classification is a part for whole classifications.Then, we define in the class of the K fixed neighbours of a sample scatter matrix and
Scatter matrix is as follows between class:
Wherein, L 'iIt is in classification C 'iThe number of fixed neighbour in classification, i.e.,M′iRepresent in class
Other C 'iIn fixed neighbour average, A 'ijIt is in classification C 'iIn j-th of fixed neighbour, M ' is represented to random sample sheet
K fixed neighbours average.So the local Fei Sheer criterions based on matrix can be expressed as:
Similarly, if each classification in the individual classifications of C ' only has a fixed neighbour, then this K fixed
Scatter matrix is a null matrix in the class of neighbour.So MLLDA only needs to utilize scatter matrix between class, and differentiate standard
It is then:
On the other hand, if whole K arest neighbors of given sample are all from same classification, then they
Scatter matrix is exactly a null matrix between class.So we only need to utilize scatter matrix in class, and criterion becomes
Into:
It is understood that for a given sample, make JMLF(Wm) maximize, and a projection matrix is obtained,
The matrix column is characteristic vector, correspond to characteristic equationTop characteristic value, or matrixOrTop characteristic value.
204th, above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face
Characteristic;
Above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face characteristic
Data.
205th, above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data.
Above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data;Above-mentioned prison
Control equipment and Classification and Identification is carried out to above-mentioned face characteristic data according to default k nearest neighbor sample;It is it should be noted that above-mentioned default
K nearest neighbor sample be the K arest neighbors of test sample determined in training sample, K number is not construed as limiting;It is special to above-mentioned face
Sign data are compared after being classified with the facial feature database of preservation, so as to complete face recognition process;Above-mentioned classification
Nearest neighbor classifier is may be selected in method or other graders are classified to above-mentioned face characteristic data, is not restricted specifically.
In the embodiment of the present invention, above-mentioned monitoring device is according to default k nearest neighbor sample, default first formula and default the
Scatter matrix between scatter matrix and class is calculated in the class of above-mentioned face image data in two formula respectively, and accurate using Fei Sheer
The characteristic vector of face image data is then calculated, so as to extract face characteristic data by Partial data structure, improves
The precision and efficiency of recognition of face.
Based on the face identification method in above-described embodiment, in the embodiment of the present invention, the recognition of face for large database concept,
Data Dimensionality Reduction first can be carried out to it, to carry out characteristic extraction, referring to Fig. 3, a kind of face is known in the embodiment of the present invention
Another embodiment of other method includes:
301st, monitoring device obtains face image data;
Monitoring device obtains face image data;It should be noted that monitoring device passes through in USB interface or network node
Any one obtains existing face image data;Or face image data is obtained by the photographing module of connection, it is specific to obtain
Mode is not construed as limiting herein.
302nd, above-mentioned monitoring device carries out dimension-reduction treatment according to principal component analysis PCA to training sample;
Above-mentioned monitoring device is according to principal component analysis PCA (Principal Component Analysis, principal component point
Analysis) dimension-reduction treatment is carried out to training sample;PCA conversion is carried out to training sample first, obtains the projection square after PCA projections
Battle array.
303rd, above-mentioned monitoring device determines above-mentioned default K by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
Neighbour's sample;
Above-mentioned monitoring device determines above-mentioned default k nearest neighbor by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
Sample;K nearest neighbor algorithm refers to prior art, wherein it is determined that above-mentioned default k nearest neighbor sample is true i.e. from above-mentioned training sample
Determine K nearest samples of test sample.
304th, above-mentioned monitoring device is according to default k nearest neighbor sample, default first formula and default second formula difference
Scatter matrix S in the class of above-mentioned face image data is calculatedwThe scatter matrix S between classb;
It should be noted that above-mentioned k nearest neighbor sample includes the set of the training sample of multiple classes;Above-mentioned default first formula
For:
Above-mentioned default second formula is:
Wherein, c ' be k nearest neighbor sample classification number, m ' be k nearest neighbor sample average, l 'iFor the i-th class K in classification c '
The number of neighbour's sample, i.e.,m′iFor the average of the k nearest neighbor sample of the i-th class in classification c ', x 'ijFor classification c '
In the i-th class j-th of k nearest neighbor sample.
305th, above-mentioned monitoring device is according to scatter matrix S in above-mentioned classw, scatter matrix S between above-mentioned classbAnd Fei Sheer is accurate
The characteristic vector of face image data is then calculated;
Specific algorithm refers to step 203, and here is omitted.
306th, above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face
Characteristic;
Above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face characteristic
Data.
307th, above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data.
Above-mentioned monitoring device carries out Classification and Identification according to default k nearest neighbor sample to above-mentioned face characteristic data;Above-mentioned prison
Control equipment and Classification and Identification is carried out to above-mentioned face characteristic data according to default k nearest neighbor sample;It is it should be noted that above-mentioned default
K nearest neighbor sample be the K arest neighbors of test sample determined in training sample, K number is not construed as limiting;It is special to above-mentioned face
Sign data are compared after being classified with the facial feature database of preservation, so as to complete face recognition process;Above-mentioned classification
Nearest neighbor classifier is may be selected in method or other graders are classified to above-mentioned face characteristic data, is not restricted specifically.
In the embodiment of the present invention, above-mentioned monitoring device carries out dimension-reduction treatment according to principal component analysis PCA to training sample, and
Above-mentioned default k nearest neighbor sample is determined from the training sample after dimension-reduction treatment by k nearest neighbor algorithm;So as to more accurately from
Face is identified in huge database.
Based on the face identification method in above-described embodiment, in the embodiment of the present invention, above-mentioned face characteristic data will be entered
Row Classification and Identification is described specifically, referring to Fig. 4, in the embodiment of the present invention a kind of face identification method another embodiment bag
Include:
401st, monitoring device obtains face image data;
Monitoring device obtains face image data;It should be noted that monitoring device passes through in USB interface or network node
Any one obtains existing face image data;Or face image data is obtained by the photographing module of connection, it is specific to obtain
Mode is not construed as limiting herein.
402nd, above-mentioned monitoring device carries out dimension-reduction treatment according to principal component analysis PCA to training sample;
Above-mentioned monitoring device carries out dimension-reduction treatment according to principal component analysis PCA to training sample;I.e. first to training sample
PCA conversion is carried out, obtains the projection matrix after PCA projections.
403rd, above-mentioned monitoring device determines above-mentioned default K by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
Neighbour's sample;
Above-mentioned monitoring device determines above-mentioned default k nearest neighbor by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
Sample;K nearest neighbor algorithm refers to prior art, wherein it is determined that above-mentioned default k nearest neighbor sample is true i.e. from above-mentioned training sample
Determine K nearest samples of test sample.
404th, above-mentioned monitoring device is according to default k nearest neighbor sample, default first formula and default second formula difference
Scatter matrix S in the class of above-mentioned face image data is calculatedwThe scatter matrix S between classb;
It should be noted that above-mentioned k nearest neighbor sample includes the set of the training sample of multiple classes;Above-mentioned default first formula
For:
Above-mentioned default second formula is:
Wherein, c ' be k nearest neighbor sample classification number, m ' be k nearest neighbor sample average, l 'iFor the i-th class K in classification c '
The number of neighbour's sample, i.e.,m′iFor the average of the k nearest neighbor sample of the i-th class in classification c ', x 'ijFor classification c '
In the i-th class j-th of k nearest neighbor sample.
405th, above-mentioned monitoring device is according to scatter matrix S in above-mentioned classw, scatter matrix S between above-mentioned classbAnd Fei Sheer is accurate
The characteristic vector of face image data is then calculated;
Specific algorithm refers to step 203, and here is omitted.
406th, above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face
Characteristic;
Above-mentioned monitoring device carries out feature extraction to the characteristic vector of above-mentioned face image data, obtains above-mentioned face characteristic
Data.
407th, above-mentioned monitoring device is matched above-mentioned face characteristic data with above-mentioned default k nearest neighbor sample;
Above-mentioned monitoring device is matched above-mentioned face characteristic data with above-mentioned default k nearest neighbor sample.
408th, above-mentioned monitoring device is obtained and above-mentioned face characteristic number using the training sample matched by k nearest neighbor algorithm
According to corresponding test sample;
Above-mentioned monitoring device is obtained and above-mentioned face characteristic data pair using the training sample matched by k nearest neighbor algorithm
The test sample answered.
409th, above-mentioned monitoring device calculates the Euclidean distance between above-mentioned test sample and above-mentioned default k nearest neighbor sample;
Above-mentioned monitoring device calculates the Euclidean distance between above-mentioned test sample and above-mentioned default k nearest neighbor sample.
410th, when above-mentioned Euclidean distance is less than preset threshold value, determine to include above-mentioned face characteristic in facial feature database
Data;When above-mentioned Euclidean distance is more than preset threshold value, determine not including above-mentioned face characteristic data in facial feature database.
When above-mentioned Euclidean distance is less than preset threshold value, determine to include above-mentioned face characteristic number in facial feature database
According to;When above-mentioned Euclidean distance is more than preset threshold value, determine not including above-mentioned face characteristic data in facial feature database.Need
It is noted that when it is determined that not including above-mentioned face characteristic data in above-mentioned facial feature database, the monitoring device is shown
Alert picture, and the prompt tone that gives a warning;The facial image got can specifically be irised out with rectangle frame in display picture,
And send caution sound and remind security personnel to check a suspect, to ensure the personal safety as well as the property safety for specifying place.
In the embodiment of the present invention, above-mentioned monitoring device is calculated between above-mentioned test sample and above-mentioned default k nearest neighbor sample
Euclidean distance, when above-mentioned Euclidean distance is less than preset threshold value, determine to include above-mentioned face characteristic in facial feature database
Data;When above-mentioned Euclidean distance is more than preset threshold value, determine not including above-mentioned face characteristic data in facial feature database,
And warning picture is shown, give a warning prompt tone, so as to complete face recognition process.
A kind of face identification method in the embodiment of the present invention is described above, below from the angle of device to this hair
A kind of monitoring device in bright embodiment is described in detail, referring to Fig. 5, in the embodiment of the present invention a kind of monitoring device one
Individual embodiment includes:
Acquiring unit 501, for obtaining face image data;
Analytic unit 502, for carrying out local linear discriminant analysis LLDA to above-mentioned face image data, extraction face is special
Levy data;
Recognition unit 503, for carrying out Classification and Identification to above-mentioned face characteristic data according to default k nearest neighbor sample.
It should be noted that the mode of above-mentioned acquisition face image data can be by any in USB interface or network node
It is individual to obtain existing face image data;Or face image data, specific acquisition modes are obtained by the photographing module of connection
It is not construed as limiting herein.
Above-mentioned local linear discriminant analysis LLDA is included based on vectorial local linear discriminant analysis VLLDA or based on matrix
Local linear discriminant analysis MLLDA.Wherein, the above-mentioned local linear discriminant analysis VLLDA based on vector is by above-mentioned face figure
As data are expressed as vector, above-mentioned face image data is expressed as by the above-mentioned local linear discriminant analysis MLLDA based on matrix
Matrix.
Above-mentioned default k nearest neighbor sample is K arest neighbors of the test sample determined in training sample, and K number is not made
Limit;It is compared after classifying to above-mentioned face characteristic data with the facial feature database of preservation, so as to complete face
Identification process, the processing mode of above-mentioned face image data can pass through extra large dupp Hadoop processing.
In the embodiment of the present invention, above-mentioned acquiring unit 501 obtains face image data;Above-mentioned analytic unit 502 is to above-mentioned
Face image data carries out local linear discriminant analysis LLDA, extracts face characteristic data;Above-mentioned recognition unit 503 is according to default
K nearest neighbor sample to above-mentioned face characteristic data carry out Classification and Identification.Therefore, when data category distribution is more complicated, by right
Above-mentioned face image data carries out local linear discriminant analysis LLDA, the one of whole training set small so as to need to only train before testing
Part, and Classification and Identification is carried out to above-mentioned face characteristic data according to default k nearest neighbor sample, improve the precision of recognition of face
And efficiency.
Based on the monitoring device in above-described embodiment, optionally, as shown in fig. 6, above-mentioned analysis list in the embodiment of the present invention
Member 502 specifically includes:
First computing module 601, for according to above-mentioned default k nearest neighbor sample, default first formula and default second
Scatter matrix Sb between scatter matrix Sw and class is calculated in the class of above-mentioned face image data in formula respectively;
Second computing module 602, for according to scatter matrix Sb and taking house between scatter matrix Sw, above-mentioned class in above-mentioned class
The characteristic vector of face image data is calculated in your criterion;
Extraction module 603, for carrying out feature extraction to the characteristic vector of above-mentioned face image data, obtain above-mentioned face
Characteristic.
Detailed process refers to as follows:For example, in VLLDA algorithms, face image data vector representation is inputted.For
One given sample, from whole training sample xi∈RnK arest neighbors of the sample is determined in (i=1,2 ..., L).This K
Arest neighbors is expressed as x 'i∈Rn(i=1,2 ..., K).They come from the individual classifications of c ', are expressed as c 'i(i=1,2 ..., c '), these
Classification is a part for whole classifications.If classification c 'iThere is l 'iIndividual fixed neighbour, i.e.,m′iRepresent in classification
c′iIn fixed neighbour average, x 'ijIt is the sample in classification c 'iIn j-th of fixed neighbour.Define in class
Scatter matrix is as follows between scatter matrix and class:
Wherein, m ' is the average of all fixed neighbours.Then, the local Fei Sheer criterions based on vector can represent
For:
It is understood that if each classification in the individual classifications of c ' only includes an arest neighbors of given sample, that
Scatter matrix is exactly a null matrix in the class of these arest neighbors.So in above-mentioned VLLDA algorithms, it is only necessary to utilize class
Between scatter matrixAnd criterion reforms into:
On the other hand, if whole K arest neighbors of given sample are all from same classification, then they
Scatter matrix is exactly a null matrix between class.So, it is only necessary to utilize scatter matrix in classAnd criterion becomes:
So for a given sample, make JVLF(Wv) maximize, and a projection matrix is obtained, the matrix
Row are characteristic vectors, correspond to characteristic equationTop characteristic value, or matrixOrTop feature
Value.
Different from VLLDA, the input data in MLLDA is represented as matrix.Assuming that there are the L instructions from c classification
Practice sample.In order to extract the feature of sample, we determine its K from training set first
Arest neighbors.These neighbours are expressed as A 'i(i=1,2 ..., K), and come from the individual classification C ' of C 'i(i=1,2 ..., C '), this c ' is individual
Classification is a part for whole classifications.Then, we define in the class of the K fixed neighbours of a sample scatter matrix and
Scatter matrix is as follows between class:
Wherein, L 'iIt is in classification C 'iThe number of fixed neighbour in classification, i.e.,M′iRepresent in class
Other C 'iIn fixed neighbour average, A 'ijIt is in classification C 'iIn j-th of fixed neighbour, M ' is represented to random sample sheet
K fixed neighbours average.So the local Fei Sheer criterions based on matrix can be expressed as:
Similarly, if each classification in the individual classifications of C ' only has a fixed neighbour, then this K fixed
Scatter matrix is a null matrix in the class of neighbour.So MLLDA only needs to utilize scatter matrix between classAnd differentiate standard
It is then:
On the other hand, if whole K arest neighbors of given sample are all from same classification, then they
Scatter matrix is exactly a null matrix between class.So we only need to utilize scatter matrix in classAnd criterion becomes
Into:
It is understood that for a given sample, make JMLF(Wm) maximize, and a projection matrix is obtained,
The matrix column is characteristic vector, correspond to characteristic equationTop characteristic value, or matrixOrTop characteristic value;Feature extraction is carried out after obtaining features described above vector, so as to obtain above-mentioned face characteristic data.
In the embodiment of the present invention, the first computing module 601 is according to default k nearest neighbor sample, default first formula and pre-
If scatter matrix between scatter matrix and class is calculated in the class of above-mentioned face image data in the second formula respectively, and by above-mentioned
The characteristic vector of face image data is calculated using Fei Sheer criterions for second computing module 602, so as to pass through local data
Structure extraction face characteristic data, improve the precision and efficiency of recognition of face.
Based on the monitoring device in above-described embodiment, optionally, as shown in fig. 7, above-mentioned monitoring is set in the embodiment of the present invention
It is standby also to include:
Processing unit 701, for carrying out dimension-reduction treatment to training sample according to principal component analysis PCA;
Determining unit 702, for determining above-mentioned default K from the training sample after dimension-reduction treatment by k nearest neighbor algorithm
Neighbour's sample.
It should be noted that above-mentioned carry out dimension-reduction treatment i.e. to training sample according to principal component analysis PCA to training sample
PCA conversion is carried out, obtains the projection matrix after PCA projections;Above-mentioned k nearest neighbor algorithm refers to prior art, wherein it is determined that above-mentioned
Default k nearest neighbor sample is the K nearest samples that test sample is determined from above-mentioned training sample.
In the embodiment of the present invention, above-mentioned processing unit 701 is carried out at dimensionality reduction according to principal component analysis PCA to training sample
Reason, above-mentioned determining unit 702 determine above-mentioned default k nearest neighbor sample by k nearest neighbor algorithm from the training sample after dimension-reduction treatment
This;So as to which more accurately face be identified from huge database.
Based on the monitoring device in above-described embodiment, optionally, as shown in figure 8, above-mentioned identification list in the embodiment of the present invention
Member 503 specifically includes:
Matching module 801, for above-mentioned face characteristic data to be matched with above-mentioned default k nearest neighbor sample;
3rd computing module 802, it is special with above-mentioned face for being obtained using the training sample matched by k nearest neighbor algorithm
Levy test sample corresponding to data;
4th computing module 803, for calculate the Euclidean between above-mentioned test sample and above-mentioned default k nearest neighbor sample away from
From;
First determining module 804, for after above-mentioned Euclidean distance is less than preset threshold value, determining in facial feature database
Include above-mentioned face characteristic data;
Second determining module 805, for after above-mentioned Euclidean distance is more than preset threshold value, determining in facial feature database
Not comprising above-mentioned face characteristic data.
In the embodiment of the present invention, above-mentioned 4th computing module 803 calculates above-mentioned test sample and above-mentioned default k nearest neighbor sample
Euclidean distance between this, when above-mentioned Euclidean distance is less than preset threshold value, above-mentioned first determining module 804 determines face characteristic
Above-mentioned face characteristic data are included in database;When above-mentioned Euclidean distance is more than preset threshold value, above-mentioned second determining module 805
Determine not including above-mentioned face characteristic data in facial feature database, so as to complete face recognition process.
Based on the monitoring device in above-described embodiment, optionally, as shown in figure 9, above-mentioned identification list in the embodiment of the present invention
Member 503 also includes:
Output module 901, for after it is determined that not including above-mentioned face characteristic data in above-mentioned facial feature database, showing
Warn and accuse picture, and the prompt tone that gives a warning.
It should be noted that the specific implementation of the above-mentioned display of output module 901 warning picture can be in display picture
The facial image got is irised out with rectangle frame in face, and sends caution sound and reminds security personnel to examine a suspect
Look into, to ensure the personal safety as well as the property safety for specifying place.
In the embodiment of the present invention, after it is determined that not including above-mentioned face characteristic data in above-mentioned facial feature database, lead to
The above-mentioned display of output module 901 warning picture, and the prompt tone that gives a warning are crossed, to make the precautionary measures in time, ensures and specifies
The personal safety as well as the property safety in place.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments
The present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each implementation
Technical scheme described in example is modified, or carries out equivalent substitution to which part technical characteristic;And these modification or
Replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.