Summary of the invention
The object of the present invention is to provide a kind of face identification method, not strong to solve in prior art the face characteristic property distinguished, the problem of cause the accuracy of identification lower, robustness is weak.
To achieve these goals, the invention provides a kind of face identification method, the method comprises:
Obtain the net region weights of training sample;
Detect the human face region in image to be identified;
Human face region is divided into at least two net regions;
Net region weights according to training sample, screen net region, filter out the net region of the high property distinguished;
Extract the characteristics of image of the net region of the high property distinguished;
Utilize sorter to classify to characteristics of image, obtain recognition result.
Preferably, the net region weights that obtain training sample comprise:
Extract positive example sample and negative routine sample as training sample;
Detect the sample human face region of training sample;
Sample human face region is divided into at least two sample grid regions;
Extract the sample image feature in sample grid region;
According to the distance of sample image feature, utilize protruding Optimization Learning method to calculate the weights in sample grid region;
Reservation is greater than the weights in the sample grid region of threshold values, obtains the net region weights of training sample.
Preferably, according to the distance of sample image feature, the weights that utilize protruding Optimization Learning method to calculate sample grid region comprise:
Establishing target function is as follows:
Wherein, k represents k sample grid region, μ
kthe weights that represent k sample grid region; δ
kthe distance that represents the sample image feature of positive example sample in k sample grid region;
the distance that represents the sample image feature of negative routine sample in k net region; || μ || be 1 norm, the weights that make most of sample grid region are 0, produce comparatively sparse expression; λ is punishment parameter, and its numerical value is larger, and the weights in sample grid region are less;
Utilize Optimization Learning method calculating target function, obtain the weights in sample grid region.
Preferably, face identification method also comprises:
Locate the unique point of human face region, the unique point of human face region is snapped to the normal place of setting, the human face region being adjusted;
Human face region is divided into at least two net regions to be comprised: the human face region of adjustment is divided into at least two net regions;
The net region weights that obtain training sample also comprise:
The unique point of this human face region of positioning sample, snaps to the unique point of sample human face region the normal place of setting, the sample human face region being adjusted;
Sample human face region is divided into at least two sample grid regions to be comprised: the sample human face region of adjustment is divided into at least two sample grid regions.
Preferably, face identification method also comprises:
Characteristics of image is carried out to dimension-reduction treatment, obtain the characteristics of image after dimensionality reduction;
Utilize sorter to classify to characteristics of image, obtain recognition result and comprise: the characteristics of image after utilizing sorter to dimensionality reduction is classified, and obtains recognition result.
Preferably, characteristics of image is carried out to dimension-reduction treatment, the characteristics of image obtaining after dimensionality reduction comprises:
Obtain the dimensionality reduction matrix of training sample;
Dimensionality reduction matrix according to training sample, carries out dimension-reduction treatment to characteristics of image, obtains the characteristics of image after dimensionality reduction;
Wherein, the dimensionality reduction matrix that obtains training sample comprises:
Build dimensionality reduction objective function as follows:
Wherein, ψ
ij=W (φ
i-φ
j), φ
i, φ
jfor the sample image feature of training sample, W is dimensionality reduction matrix, and i, j are used for identifying training sample; If training sample i, j are all positive example sample or negative routine sample, y
ijbe 1, otherwise Wei ?1; T is the distance threshold values of sample image feature, affects the data dimension after dimensionality reduction;
Utilize Optimization Learning method to calculate dimensionality reduction objective function, obtain the dimensionality reduction matrix of training sample.
The present invention also provides a kind of face identification device, and this device comprises:
Net region weights acquisition module, for obtaining the net region weights of training sample;
Human face region detection module, for detection of the human face region in image to be identified;
Module is divided in region, for human face region being divided into at least two net regions;
Net region screening module, for according to the net region weights of training sample, screens net region, filters out the net region of the high property distinguished;
Characteristic extracting module, for extracting the characteristics of image of the net region of the high property distinguished;
Tagsort module, for utilizing sorter to classify to characteristics of image, obtains recognition result.
Preferably, weights acquisition module in net region comprises:
Training sample extraction unit, for extracting positive example sample and negative routine sample, as training sample;
Human face region detecting unit, for detection of the sample human face region of training sample;
Region division unit, for being divided into sample human face region at least two sample grid regions;
Feature extraction unit, for extracting the sample image feature in sample grid region;
Net region weight calculation unit, for according to the distance of sample image feature, utilizes protruding Optimization Learning method to calculate the weights in sample grid region;
Net region weights acquiring unit, for retaining the weights in the sample grid region that is greater than threshold values, obtains the net region weights of training sample.
Preferably, net region weight calculation unit is as follows specifically for establishing target function:
Wherein, k represents k sample grid region, μ
kthe weights that represent k sample grid region; δ
kthe distance that represents the sample image feature of positive example sample in k sample grid region;
the distance that represents the sample image feature of negative routine sample in k net region; || μ || be 1 norm, the weights that make most of sample grid region are 0, produce comparatively sparse expression; λ is punishment parameter, and its numerical value is larger, and the weights in sample grid region are less;
Utilize Optimization Learning method calculating target function, obtain the weights in sample grid region.
Preferably, face identification device also comprises:
Human face region adjusting module, for locating the unique point of human face region, snaps to the unique point of human face region the normal place of setting, the human face region being adjusted;
Module is divided in region, specifically for the human face region of adjustment is divided into at least two net regions;
Net region weights acquisition module also comprises:
Human face region adjustment unit, for the unique point of this human face region of positioning sample, snaps to the unique point of sample human face region the normal place of setting, the sample human face region being adjusted;
Region division unit, specifically for being divided at least two sample grid regions by the sample human face region of adjustment.
Preferably, face identification device also comprises Feature Dimension Reduction module, for characteristics of image is carried out to dimension-reduction treatment, obtains the characteristics of image after dimensionality reduction;
Tagsort module, classifies specifically for the characteristics of image after utilizing sorter to dimensionality reduction, obtains recognition result.
Preferably, Feature Dimension Reduction module comprises:
Dimensionality reduction matrix acquiring unit, for obtaining the dimensionality reduction matrix of training sample;
Feature Dimension Reduction unit, for according to the dimensionality reduction matrix of training sample, carries out dimension-reduction treatment to characteristics of image, obtains the characteristics of image after dimensionality reduction;
Wherein, dimensionality reduction matrix acquiring unit, as follows specifically for building dimensionality reduction objective function:
Wherein, ψ
ij=W (φ
i-φ
j), φ
i, φ
jfor the sample image feature of training sample, W is dimensionality reduction matrix, and i, j are used for identifying training sample; If training sample i, j are all positive example sample or negative routine sample, y
ijbe 1, otherwise Wei ?1; T is the distance threshold values of sample image feature, affects the data dimension after dimensionality reduction;
Utilize Optimization Learning method to calculate dimensionality reduction objective function, obtain the dimensionality reduction matrix of training sample.
Face identification method of the present invention and device, by the net region weights of protruding Optimization Learning, filter out the net region for the high property distinguished of identification content, removed the net region of a large amount of low property distinguished, the interference of the characteristics of image of net region that has greatly reduced the low property distinguished to tagsort, has improved accuracy and the robustness of recognition of face; By net region screening and the Feature Dimension Reduction of protruding Optimization Learning, greatly reduced data volume and the dimension of characteristics of image, reduced calculated amount, when guaranteeing the accuracy of recognition of face, promoted the real-time of recognition of face; By training sample, image to be identified are carried out to the adjustment of human face region, the consistance that keeps net region to divide, has reduced net region and has divided the systematic error of bringing, and has strengthened the robustness of recognition of face.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.
Embodiment mono-
As shown in Figure 1, face identification method of the present invention, comprises the following steps:
S110: the net region weights that obtain training sample.
As shown in Figure 2, obtain the net region weights of training sample, comprise the following steps:
S111: extract positive example sample and negative routine sample as training sample.
Positive example sample in training sample and negative routine sample are the different set of making according to the particular content of recognition of face.If to the targeted not other content of identification of recognition of face, can select so male sex's facial image as positive example, women's facial image is as negative routine.If recognition of face relates to the identification of age bracket, suppose and need to identify 3 age brackets---0~15,15~30 and 30~45, so just need to train the model of three age brackets.Concrete, when the model of training 0~15, using the facial image of 0~15 age bracket as positive example, the facial image of other age brackets is as negative example.While training other age brackets, by that analogy.According to choosing of positive example sample and negative routine sample, face identification method of the present invention, can identify the contents such as sex, age.
Positive example sample and negative routine sample can obtain from LFW (Labeled Faces in the Wild) storehouse, also can from other face databases, extract, such as the facial image database of oneself setting up.General, the people's face sample in face database has passed through pre-service, and its size is unified.If the people's face sample in face database does not carry out pre-service, can in follow-up step, to training sample, carry out the pre-service such as convergent-divergent processing.
The quantity of positive example sample and negative routine sample has represented the diversity of training sample.The positive example sample and the negative routine sample that only have sufficient amount, guarantee training sample has been included the various situations of identification content.General, the number needs of positive example sample and negative routine sample is greater than 200.
Concrete, in the present embodiment, from LFW storehouse, extract the negative routine sample of 2000 positive example samples and equal number, as training sample, use.
S112: the sample human face region that detects training sample.
Recognition of face be take human face region as basis, and it is the first step in recognition of face that human face region detects.The method that existing human face region detects has a lot, such as mosaic method, eigenface method, texture maps method, continuous symmetry approach, area of skin color decision method etc.
Concrete, the present embodiment adopts Haar feature and Cascade sorter, detects the sample human face region of training sample.Because be the training sample extracting in Sample Storehouse, so in the detection of the sample human face region of training sample, must detect human face region, needn't consider to fail to detect the situation of human face region.
S114: sample human face region is divided into at least two sample grid regions.
The method that region is divided has a lot, such as the step-length with certain and certain area size are carried out region division, or divide according to regional center point position and the area size that sets etc.The present embodiment adopts certain step-length and certain area size to combine to carry out region division.For example, when the human face region of training sample is of a size of 56x56 pixel, can setting regions size be 8x8 pixel, step-length is 8 pixels, the net region with this by sample human face region is divided into 49 sample grid regions.
S115: the sample image feature of extracting sample grid region.
The characteristics of image of people's face has a variety of characteristic manner, such as HOG (gradient orientation histogram) feature, Haar feature, Gabor feature, LBP (Local Binary Patterns, local binary patterns) feature, LBPH (local binary histogram) feature etc.The present embodiment, the LBPH feature in the sample grid region that extraction step S114 obtains, as the sample image feature in sample grid region.
S116: according to the distance of sample image feature, utilize protruding Optimization Learning method to calculate the weights in sample grid region.
Concrete, to weights μ of each sample grid region allocation
k, set up objective function as follows:
Wherein, k represents k sample grid region, μ
kthe weights that represent k sample grid region; δ
kthe distance that represents the sample image feature of positive example sample in k sample grid region;
the distance that represents the sample image feature of negative routine sample in k net region; || μ || be 1 norm, the weights that make most of sample grid region are 0, produce comparatively sparse expression; λ is punishment parameter, and its numerical value is larger, and the weights in sample grid region are less.
Above-mentioned objective function is convex function, by Optimization Learning method calculating target function, can obtain each net region weights, such as, the method for traditional numerical optimization, gradient method, with optimization methods such as loom gradient methods.In order to reduce quantity and the calculated amount of training sample, improve the real-time of algorithm, in the present embodiment, adopt and calculate above-mentioned objective function with loom gradient method, to obtain the weights in sample grid region.
S117: retain the weights in the sample grid region that is greater than threshold values, obtain the net region weights of training sample.
Set the weights threshold values in sample grid region, remove the lower numerical value of weights, to filter the sample grid region that the property distinguished is low.The weights threshold values in sample grid region can obtain by experiment, and this numerical value is larger, and the sample grid region that retains weights is fewer.
So far, by the protruding Optimization Learning to training sample, the net region weights of training sample have been obtained, for real-time recognition of face.By building in net region the distance of sample image feature and the minimum functional of weights product as the objective function of protruding Optimization Learning, make the differentiation on sample grid region of particular content that the weights in sample grid region can embody recognition of face, make the net region choosing there is the higher property distinguished: approaching as much as possible in (such as being both between positive example sample) sample image feature between similar sample, in (between positive example sample and negative routine sample) sample image feature between foreign peoples's sample, separate as much as possible; Also guaranteed the sparse property in sample grid region simultaneously, the sample grid region quantity of the weights of reservation is reduced greatly.
S120: detect the human face region in image to be identified.
It is the first step of recognition of face that human face region detects.After obtaining image to be identified, first detect the human face region of image to be identified.The method that human face region detects has a lot, such as mosaic method, eigenface method, texture maps method, continuous symmetry approach, area of skin color decision method etc.Concrete, the present embodiment adopts Haar feature and Cascade sorter, treats recognition image and carries out human face region detection, can meet real-time testing requirement more than 15fps, and the real-time robust of realizing human face region detects.
If adopt Haar feature and Cascade sorter, human face region do not detected, this method finishes so, does not need to carry out follow-up recognition of face step.If human face region detected, output detections result---human face region.
Owing to adopting Haar feature and Cascade sorter to carry out human face region detection, there is certain error, in order to reduce error in human face region detection, adopting before Haar feature and Cascade sorter carry out human face region detection, also comprise that the area of skin color based on colour space transformation is judged.If the colour of skin is judged nobody's face in image to be identified, this method finishes.If the colour of skin is determined with people's face, this method continues.
The impact of the Factors on Human face recognition results such as illumination when reducing image acquisition to be identified, noise, contrast, size, before human face region in detecting image to be identified, can also treat recognition image and carry out pre-service, comprise noise reduction process and illumination equilibrium treatment, histogram equalization operation, yardstick convergent-divergent.
S140: the human face region detecting is divided into at least two net regions.
The method that region is divided has a lot, such as the step-length with certain and certain area size are carried out region division, or divides according to regional center point position and the area size that sets.Concrete, in the present embodiment, according to net region size and the step-length set, carry out region division.Such as, when the human face region of image to be identified is of a size of 56x56 pixel, can set net region size for 8x8 pixel, step-length is 8 pixels, the human face region detecting can be divided into 49 net regions.The region of this step is divided consistent with step S113.
S150: the net region weights according to training sample, net region is screened, filter out the net region of the high property distinguished.
The net region weights of the training sample obtaining according to step S110, select to be greater than 0 or the net region of image to be identified corresponding to the net region weights of the training sample of the threshold values set, filter out the net region of the high property distinguished.
S160: the characteristics of image that extracts the net region of the high property distinguished.
The feature of people's face has a variety of characteristic manner, such as HOG (gradient orientation histogram) feature, Haar feature, Gabor feature, LBP (Local Binary Patterns, local binary patterns) feature, LBPH (local binary histogram) feature etc.The present invention adopts LBPH feature, as face characteristic.Concrete, this step, extracts the LBPH feature of the net region filtering out.
Further, after extracting the LBPH feature of net region, net region weights and LBPH feature can be multiplied each other, the LBPH feature of the net region that obtains containing weights, to strengthen the property distinguished of net region characteristics of image.
S170: utilize sorter to classify to the characteristics of image of the net region of the high property distinguished, obtain recognition result.
In recognition of face, often utilize sorter to classify to characteristics of image.Existing sorter has a lot, such as minimum distance classifier, nearest neighbor classifier, Artificial Neural Network, support vector machine and Hidden Markov Model (HMM) etc.
Concrete, the present embodiment is used RBFSVM (Nonlinear Support Vector Machines), and the characteristics of image of the net region of the high property distinguished is classified, and obtains recognition result.Wherein, RBFSVM adopts the mode of grid search to carry out parameter selection, adopt 10 ?fold cross validation mode carry out the training of disaggregated model, using the sample image feature in the sample grid region of the high property distinguished of screening as sample set.
Face identification method of the present invention, can also comprise the collection of image to be identified, and such as adopting monocular cam to obtain image, or binocular camera shooting head obtains image.
Face identification method of the present invention, by building the distance of sample image feature and the objective function of the minimum functional of weights product as protruding Optimization Learning in sample grid region, the differentiation with the particular content of the weights embodiment recognition of face in sample grid region on each sample grid region; By reservation, be greater than the sample grid region weights of threshold values, make the sample grid region screening there is the higher property distinguished.The present invention is directed to different recognition of face contents, extract different training samples, autonomous learning sample grid region weights, can filter out the net region to the high property distinguished of different recognition of face contents.
Face identification method of the present invention, by the sample grid region weights of protruding Optimization Learning, filters out the net region for the high property distinguished of identification content, and the characteristics of image extracting thus has the high property distinguished, has improved the accuracy of recognition of face; Simultaneously, the sample grid region weights that utilize protruding optimization method study to obtain have extremely strong sparse property, while screening the net region of the high property distinguished according to net region weights, removed the net region of a large amount of low property distinguished, the interference of the characteristics of image of net region that has greatly reduced the low property distinguished to tagsort, has strengthened the robustness of recognition of face; Greatly reduce characteristic amount, promoted the real-time of recognition of face.
Further, in order to strengthen the corresponding relation of the net region of the high property distinguished filtering out and the net region weights of training sample, strengthen the robustness of inventor's face recognition method, as shown in Figure 3, the face identification method in the present embodiment, also comprises:
S130: locate the unique point of human face region, the unique point of location is snapped to the normal place of setting, the human face region being adjusted.
Concrete, this step comprises positioning feature point and unique point alignment two parts.
Positioning feature point is mainly the people face position of locating stronger feature, such as positions such as eyes, nose, faces.The method of face characteristic point location has a lot, such as the projection function based on half-tone information or paddy Operator Method, method based on priori rules, active shape model based on geometric configuration and apparent model etc. initiatively, also have in addition based on methods such as statistics PCA (principal component analysis), SVM (support vector machine), AdaBOOST method, template matches.Concrete, the present embodiment adopts CLM (Constraint Local Model, constraint partial model), and the unique point of using 56 unique points to carry out the human face region of image to be identified positions.Adopt CLM model, can realize face characteristic point location fast, accurately.
After location feature point, unique point after positioning is snapped to the normal place of setting.The so-called normal place of setting, is centered by facial image eyes mid point, the eyes of facial image to be rotated to horizontal level, and adjusts the distance (being for example 30 pixels) of two.By unique point, snap to the normal place of setting, human face region can be adjusted to unified position and size.The unique point of human face region is snapped to normal place, can reduce the error that the skew of people's face causes.In the present embodiment, according to affined transformation, unique point after positioning is snapped to the normal place of setting, the human face region being adjusted.Step S141, specifically for being divided at least two net regions by the human face region of adjustment.
As shown in Figure 4, in the face identification method in the present embodiment, step S110: the net region weights that obtain training sample also comprise:
S113: the unique point of this human face region of positioning sample, snaps to the unique point of location the normal place of setting, the sample human face region being adjusted.
Concrete, the present embodiment adopts CLM (Constraint Local Model, constraint partial model), uses 56 unique points to position the unique point of sample human face region; Then according to affined transformation, unique point after positioning is snapped to the normal place of setting, the sample human face region being adjusted.Step S118, specifically for being divided at least two sample grid regions by the sample human face region of adjustment.
By the human face region of the human face region of training sample and image to be identified being adjusted to the normal place of setting, the human face region of training sample and image to be identified is divided and can be consistent as much as possible, make to utilize the net region of the high property distinguished that the net region weights of training sample filter out to there is the more consistent property distinguished, reduce net region and divided the systematic error of bringing, strengthened the robustness of recognition of face.
Embodiment bis-
As shown in Figure 5, the face identification method of embodiment bis-, comprises the following steps:
S210: the net region weights that obtain training sample.
The net region weights that obtain training sample of the present embodiment, consistent with the second embodiment of embodiment mono-, as shown in Figure 4, do not repeat them here.
S220: detect the human face region in image to be identified.
Concrete, the present embodiment adopts Haar feature and Cascade sorter, treats recognition image and carries out human face region detection, can meet real-time testing requirement more than 15fps, and the real-time robust of realizing human face region detects.If adopt Haar feature and Cascade sorter, human face region do not detected, this method finishes so.If human face region detected, output detections result---human face region.
Adopting before Haar feature and Cascade sorter carry out human face region detection, the area of skin color that can also carry out based on colour space transformation is judged.If the colour of skin is judged nobody's face in image to be identified, this method finishes.If the colour of skin is determined with people's face, this method continues.
The impact of the Factors on Human face recognition results such as illumination when reducing image acquisition to be identified, noise, contrast, size, before human face region in detecting image to be identified, can also treat recognition image and carry out pre-service, comprise noise reduction process and illumination equilibrium treatment, histogram equalization operation, yardstick convergent-divergent.
S230: locate the unique point of human face region, the unique point of location is snapped to the normal place of setting, the human face region being adjusted.
Concrete, the present embodiment adopts CLM (Constraint Local Model, constraint partial model), and the unique point of using 56 unique points to carry out the human face region of image to be identified positions; Then according to affined transformation, unique point after positioning is snapped to the normal place of setting, the human face region being adjusted.Certainly, this step also can be used other positioning feature point, the method for alignment.
S240: the human face region of adjustment is divided into at least two net regions.
Concrete, this step, carries out region division according to net region size and the step-length set.Such as, when the human face region of image to be identified is of a size of 56x56 pixel, can set net region size for 8x8 pixel, step-length is 8 pixels, the human face region detecting can be divided into 49 net regions.The method that this step also can be used other regions to divide.
S250: the net region weights according to training sample, net region is screened, filter out the net region of the high property distinguished.
The net region weights of the training sample obtaining according to step S210, select to be greater than 0 or the net region of image to be identified corresponding to the net region weights of the training sample of the threshold values set, obtain the net region of the high property distinguished.
S260: the characteristics of image that extracts the net region of the high property distinguished.
Concrete, this step, extracts the LBPH feature of the net region filtering out, as characteristics of image.This step also can be used the conventional features of recognition of face such as HOG feature, Haar feature, Gabor feature.After extracting the LBPH feature of net region, net region weights and LBPH feature can be multiplied each other, the LBPH feature of the net region that obtains containing weights, to strengthen the property distinguished of net region characteristics of image.
S270: the characteristics of image of the net region of the high property distinguished is carried out to dimension-reduction treatment, obtain the characteristics of image after dimensionality reduction.
In recognition of face, the method of Feature Dimension Reduction has a lot, such as conversion coefficient feature extracting method (such as the coefficient extracting method based on wavelet transformation or Fourier conversion), PCA (principal component analysis), LDA (Fisher linear discriminant analysis) method, ICA (independent component analysis) method etc.
Concrete, as shown in Figure 6, the characteristics of image of the net region of the high property distinguished is carried out to dimension-reduction treatment, obtain the characteristics of image after dimensionality reduction, comprising:
S271: the dimensionality reduction matrix that obtains training sample.
Concrete, build dimensionality reduction objective function as follows:
Wherein, ψ
ij=W (φ
i-φ
j), φ
i, φ
jfor the sample image feature of training sample, W is dimensionality reduction matrix, and i, j are used for identifying training sample; If training sample i, j are all positive example sample or negative routine sample, y
ijbe 1, otherwise Wei ?1; T is the distance threshold values of sample image feature, affects the data dimension after dimensionality reduction.
Above-mentioned dimensionality reduction objective function is convex function, by Optimization Learning method calculating target function, can obtain dimensionality reduction matrix, such as, the method for traditional numerical optimization, gradient method, with optimization methods such as loom gradient methods.In order to reduce quantity and the calculated amount of training sample, improve the real-time of algorithm, in the present embodiment, adopt and calculate above-mentioned dimensionality reduction objective function with loom gradient method, to obtain the dimensionality reduction matrix of training sample.
The feature of the training sample using in this step, can be according to the sample image feature and the sample grid region weights that obtain the sample grid region in the step of net region weights of training sample, filter out the sample grid region of the high property distinguished, and extract LBPH feature, as the sample image feature of training sample; Also can extract separately training sample, after human face region detection, net region division etc. are processed, according to the sample grid region of the high property distinguished of net region weights screening of training sample, then extract LBPH feature.According to the content of recognition of face, the present embodiment can extract training sample targetedly, to obtain identifying the dimensionality reduction matrix that content is different, meets the needs of different identification contents.
S272: the dimensionality reduction matrix according to training sample, the characteristics of image of the net region of the high property distinguished is carried out to dimension-reduction treatment, obtain the characteristics of image after dimensionality reduction.
Concrete, the dimensionality reduction matrix of training sample multiplies each other with the characteristics of image of the net region of the high property distinguished, can realize the dimension-reduction treatment of the feature to extracting, and obtains the characteristics of image after dimensionality reduction.
S280: the characteristics of image after utilizing sorter to dimensionality reduction is classified, and obtains recognition result.
Concrete, this step is used RBFSVM (Nonlinear Support Vector Machines), and the characteristics of image after dimensionality reduction is classified, and obtains recognition result.Wherein, RBFSVM adopts the mode of grid search to carry out parameter selection, adopt 10 ?fold cross validation mode carry out the training of disaggregated model, will the sample image feature in the sample grid region of the high property distinguished be carried out to sample image feature after dimension-reduction treatment as sample set according to dimensionality reduction matrix.Certainly, the method that face characteristic is classified also has a lot, and this step also can adopt other sorters.
Compare with embodiment mono-, the face identification method of the present embodiment, the minimum functional of distance by building sample image feature is as the objective function of protruding Optimization Learning, make the sample image feature after dimensionality reduction there is minimum characteristic distance, the feature that has retained preferably original sample characteristics of image, when guaranteeing the accuracy of recognition of face, robustness, has greatly reduced the dimension of characteristics of image, reduce calculated amount, promoted the real-time of recognition of face.
Embodiment tri-
The present invention also provides a kind of face identification device, as shown in Figure 7, this device comprises: module 40, net region screening module 50, characteristic extracting module 60, tagsort module 80 are divided in net region weights acquisition module 10, human face region detection module 20, region.Wherein:
Net region weights acquisition module 10, for obtaining the net region weights of training sample.
Concrete, as shown in Figure 8, net region weights acquisition module 10, comprising:
Training sample extraction unit 11, for extracting positive example sample and negative routine sample, as training sample.
In the present embodiment, training sample extraction unit 11, from LFW storehouse, extracts the negative routine sample of 2000 positive example samples and equal number, as training sample, uses.
Human face region detecting unit 12, for detection of the sample human face region of training sample.
Concrete, in the present embodiment, human face region detecting unit 12, adopts Haar feature and Cascade sorter, and training sample is carried out to the detection of sample human face region.Certainly, the human face region detecting unit 12 of the present embodiment, also can be used one or several combination of existing human face region detection method.
Region division unit 14, for being divided into sample human face region at least two sample grid regions.
In this enforcement, region division unit 14, adopts and carries out region division with certain step-length and certain area size.For example, when training sample is of a size of 56x56 pixel, can setting regions size be 7x7 pixel, step-length is 7 pixels, and sample human face region is divided into 64 sample grid regions.The method that region division unit 14 also can adopt other regions to divide.
Feature extraction unit 15, for extracting the sample image feature in sample grid region.
The feature of people's face has a variety of characteristic manner, such as HOG, Haar feature, Gabor feature, LBP feature, LBPH feature etc.The feature extraction unit 15 of the present embodiment, extracts LBPH feature, as the sample image feature in sample grid region.
Net region weight calculation unit 16, for according to the distance of sample image feature, utilizes protruding Optimization Learning method to calculate the weights in sample grid region.
Net region weight calculation unit 16 specifically for, to weights μ of each sample grid region allocation
k, set up objective function as follows:
Wherein, k represents k sample grid region, μ
kthe weights that represent k sample grid region; δ
kthe distance that represents the sample image feature of positive example sample in k sample grid region;
the distance that represents the sample image feature of negative routine sample in k net region; || μ || be 1 norm, the weights that make most of sample grid region are 0, produce comparatively sparse expression; λ is punishment parameter, and its numerical value is larger, and the weights in sample grid region are less.
Above-mentioned objective function is convex function, by Optimization Learning method calculating target function, can obtain each sample grid region weights, such as, the method for traditional numerical optimization, gradient method, with optimization methods such as loom gradient methods.In order to reduce quantity and the calculated amount of training sample, improve the real-time of algorithm, in the present embodiment, adopt and calculate above-mentioned objective function with loom gradient method, obtain the weights in sample grid region.
Net region weights acquiring unit 17, for retaining the weights in the sample grid region that is greater than threshold values, obtains the net region weights of training sample.
Net region weights acquisition module 10, by the protruding Optimization Learning of training sample, has obtained the net region weights of training sample, for real-time recognition of face.
Human face region detection module 20, for detection of the human face region in image to be identified.
Concrete, the human face region detection module 20 in the present embodiment, adopts Haar feature and Cascade sorter, and training sample is carried out to human face region detection, can meet real-time testing requirement more than 15fps, and the real-time robust of realizing human face region detects.
Module 40 is divided in region, for the human face region of image to be identified is divided into at least two net regions.
In this enforcement, module 40 is divided in region, adopts and carries out region division with certain step-length and certain area size.For example, when training sample is of a size of 56x56 pixel, can setting regions size be 7x7 pixel, step-length is 7 pixels, and the human face region of training sample is divided into 64 net regions.The method that module 40 also can adopt other regions to divide is divided in region.
Net region screening module 50, for according to the net region weights of training sample, treats the net region of recognition image and screens, and filters out the net region of the high property distinguished.
Net region screening module 50, net region weights for the training sample that obtains according to net region weights acquisition module 10, selection is greater than 0 or the net region corresponding to net region weights of the training sample of the threshold values set, obtains the net region of the high property distinguished.
Characteristic extracting module 60, for extracting the characteristics of image of the net region of the high property distinguished.
Concrete, in the present embodiment, characteristic extracting module 60, extracts the LBPH feature of the net region filtering out.After extracting the LBPH feature of net region, net region weights and LBPH feature can also be multiplied each other, the LBPH feature of the net region that obtains containing weights, further promotes the accuracy of recognition of face.
Tagsort module 80, for utilizing sorter to classify to characteristics of image, obtains recognition result.
Concrete, tagsort module 80 is used RBFSVM (Nonlinear Support Vector Machines) to carry out the classification of feature, obtains recognition result.Wherein, RBFSVM adopts the mode of grid search to carry out parameter selection, adopt 10 ?fold cross validation mode carry out the training of disaggregated model, using the sample image feature in the sample grid region of the high property distinguished of screening as sample set.Certainly, tagsort module 80 also can be used other sorter, such as minimum distance classifier, nearest neighbor classifier, Artificial Neural Network, support vector machine and Hidden Markov Model (HMM) etc.
Face identification device of the present invention, can also comprise pretreatment module, be used for treating recognition image and carry out pre-service, comprise noise reduction process, illumination equilibrium treatment, histogram equalization operation and yardstick convergent-divergent etc., the impact on recognition of face such as the illumination reducing collection, while obtaining image, noise, image size.
Face identification device of the present invention, can also comprise image collection module, for gathering, obtain image to be identified.Image collection module can be monocular-camera or binocular camera.
The face identification device of the present embodiment, by net region weights acquisition module, obtain net region weights, net region screening module filters out the net region of the high property distinguished, the characteristics of image of the image to be identified extracting thus has the high property distinguished, has improved the accuracy of recognition of face; Meanwhile, by the screening of net region, removed the net region of a large amount of low property distinguished, the interference of the characteristics of image of net region that has reduced the low property distinguished to classification, has strengthened the robustness of recognition of face; Greatly reduce image feature data amount, promoted the real-time of recognition of face.
Embodiment tetra-
As shown in Figure 9, compare with embodiment tri-, the face identification device of embodiment tetra-, also comprises Feature Dimension Reduction module 70, for the characteristics of image of the net region of the high property distinguished is carried out to dimension-reduction treatment, obtains the characteristics of image after dimensionality reduction.
Concrete, as shown in figure 11, Feature Dimension Reduction module 70 comprises:
Dimensionality reduction matrix acquiring unit 71, for obtaining the dimensionality reduction matrix of training sample.
Dimensionality reduction matrix acquiring unit 71 specifically for, establishing target function is as follows:
Wherein, ψ
ij=W (φ
i-φ
j), φ
i, φ
jfor the sample image feature of training sample, W is dimensionality reduction matrix, and i, j are used for identifying training sample; If training sample i, j are all positive example sample or negative routine sample, y
ijbe 1, otherwise Wei ?1; T is the distance threshold values of sample image feature, affects the data dimension after dimensionality reduction.
Above-mentioned objective function is convex function, can Optimization Learning method solve above-mentioned objective function, such as, the method for traditional numerical optimization, gradient method, with Optimization Learning methods such as loom gradient methods.In order to reduce quantity and the calculated amount of training sample, improve the real-time of algorithm, the present embodiment dimensionality reduction matrix acquiring unit 71 adopts and calculates above-mentioned objective function with loom gradient method, to obtain the dimensionality reduction matrix of training sample.
The sample image feature of the training sample that dimensionality reduction matrix acquiring unit 71 is used, can be the net region weights of the training sample that obtains of the sample image feature extracted according to feature extraction unit in the weights acquisition module 10 of net region 15 and net region weights acquiring unit 17, obtain the sample image feature in the sample grid region of the high property distinguished after screening; Also can extract separately training sample, after human face region detection, net region division etc. are processed, according to the sample grid region of the high property distinguished of net region weights screening, then put forward power LBPH feature.According to the content of recognition of face, the present embodiment can extract training sample targetedly, to obtain identifying the dimensionality reduction matrix that content is different, meets the needs of different identification contents.
Feature Dimension Reduction unit 72, for according to the dimensionality reduction matrix of training sample, carries out dimension-reduction treatment to the characteristics of image of the net region of the high property distinguished, obtains the characteristics of image after dimensionality reduction.
Feature Dimension Reduction unit 72, multiplies each other with dimensionality reduction matrix and the characteristics of image of the net region of the high property distinguished of training sample, can complete dimension-reduction treatment.Tagsort module 80 specifically for, the characteristics of image after utilizing sorter to dimensionality reduction is classified, and obtains recognition result.
Face identification device in the present embodiment, also has dimension-reduction treatment module between characteristic extracting module, tagsort module.By the method for protruding Optimization Learning, obtain dimensionality reduction matrix, make dimension-reduction treatment retain preferably the feature of primitive character, when guaranteeing the accuracy of recognition of face, greatly reduced characteristic dimension, reduced calculated amount, promoted the real-time of recognition of face.And, in this enforcement, having adopted the learning method of protruding optimization, can learn for different identification contents, guarantee accuracy, the real-time of different identification contents.
Further, as shown in Figure 9, face identification device of the present invention also comprises:
Human face region adjusting module 30, for locating the unique point of the human face region of image to be identified, snaps to unique point the normal place of setting, the human face region being adjusted.
Concrete, human face region adjusting module 30, adopts CLM (Constraint Local Model, constraint partial model), uses 56 unique points, locates the unique point of the human face region of image to be identified; Then use affined transformation, unique point is snapped to the normal place of setting, the human face region being adjusted.Module 40 is divided in region, specifically for the human face region of adjustment is divided into at least two net regions.
As shown in figure 10, net region weights acquisition module 10 also comprises human face region adjustment unit 13, for sample human face region is carried out to positioning feature point, and unique point is snapped to the normal place of setting.
Human face region adjustment unit 13, adopts CLM (Constraint Local Model, constraint partial model) equally, uses 56 unique points to position the unique point of the human face region of training sample; Then use affined transformation, unique point is snapped to the normal place of setting, the human face region of the training sample being adjusted.Region division unit 14, specifically for being divided at least two net regions by the human face region of the training sample of adjustment.
Face identification device of the present invention, increase human face region adjusting module and human face region adjustment unit, by the human face region of the human face region of training sample and image to be identified being adjusted to the normal place of setting, the human face region of training sample and image to be identified is divided and can be consistent as much as possible, make to utilize the net region of the high property distinguished that net region weights filter out to there is the more consistent property distinguished, reduce net region and divided the systematic error of bringing, strengthened the robustness of recognition of face.
Face identification method of the present invention and device, by the net region weights of protruding Optimization Learning, filter out the net region for the high property distinguished of identification content, removed the net region of a large amount of low property distinguished, the interference of the characteristics of image of net region that has greatly reduced the low property distinguished to tagsort, has improved accuracy and the robustness of recognition of face; Net region screening and Feature Dimension Reduction by protruding Optimization Learning, greatly reduced characteristic amount and dimension, reduced calculated amount, when guaranteeing the accuracy of recognition of face, promoted the real-time of recognition of face; By training sample, image to be identified are carried out to the adjustment of human face region, the consistance that keeps net region to divide, has reduced net region and has divided the systematic error of bringing, and has strengthened the robustness of recognition of face.
Face identification method of the present invention and device, accuracy is high, strong robustness, real-time, and hardware configuration requirement is low, with low cost, and easy operating, can be for the application scenarios of homebrew, game products field and various virtual realities.Especially, mutual for augmentor, can make user complete information interaction and the control with robot by face characteristic.
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.