A kind of video sequence face identification method based on AAM model
Technical field
The present invention relates to a kind of face identification method, particularly to a kind of video sequence recognition of face based on AAM model
Method.
Background technology
The information age maked rapid progress in this information expansion, computer technology, the mankind start to wish that computer becomes a kind of
Can with natural language between the machine that exchanged, and thirst for developing man machine interface and artificial intelligence's skill of novel concept
Art, thus enable people to eliminate the reliance on the interactive devices such as keyboard, mouse and the display device of traditional computer.However, it is real
Now so naturally man-machine interaction requires that computer can quickly and accurately obtain identity, state, intention and the phase of user
The characteristic information closing.Because the bulk information content that face is contained is an important information transmission window, computer passes through
Obtain identity and the relevant information of object using the uniqueness of face face, pass through the expression shape change that face enriches simultaneously
The state of conveyed object and intention, make one to build up an intelligentized bridge and computer between, and these must have been studied
The image processing techniquess related to face of effect.
At present in existing face identification method, face feature extraction method is mainly based upon geometric properties, based on template
Coupling, based on subspace with based on methods such as neutral nets.In the extracting method based on subspace, principal component analysiss PCA and
The methods such as Fisher linear discriminant are the more commonly used methods, and they obtain higher discrimination in still image.But
In video sequence, current face identification method must could obtain preferable recognition effect in the case of user's cooperation, if
In the case of user is ill-matched in identification process, recognition effect is likely to occur and is greatly reduced.In addition in the video sequence, by
Changeable etc. in face posture leads to the discrimination of these methods to have different degrees of decline.
Movable appearance model (Active Appearance Model, AAM) is be widely used in area of pattern recognition one
Plant Feature Points Extraction.Human face characteristic positioning method based on AAM, during setting up faceform, not only considers that local is special
Reference ceases, and considers global shape and texture information, by uniting to face shape feature and textural characteristics
Meter analysis, sets up face mixed model, i.e. final corresponding AAM model.
Content of the invention
It is an object of the invention to overcoming shortcoming and the deficiency of prior art, provide a kind of video sequence based on AAM model
Row face identification method.The method also accurately can identify face in the case that face posture is changeable, has very strong
Robustness.
The purpose of the present invention is achieved through the following technical solutions:A kind of video sequence recognition of face side based on AAM model
Method, including training stage and cognitive phase;
(1)The described training stage includes:
(1-1)PCA projects:
First training picture is normalized, average face is calculated according to the training picture after normalization, by all normalizings
Training picture after change and average face do difference operation, obtain the first difference;
Then according to first difference build covariance matrix, by the feature of K eigenvalue of maximum before covariance matrix to
Amount composition PCA projection matrix WPCA, as feature quantity space;
Finally the first difference is projected to lower dimensional space by PCA projection matrix WPCA, obtain the characteristic vector after dimensionality reduction;
(1-2)LDA projects:
Calculate first the mean vector m of characteristic vector after the PCA dimensionality reduction that obtains of projection for all training picture samples with
And i-th class train the mean vector mi of characteristic vector after the PCA dimensionality reduction that obtains of projection for the picture sample;
Then according to mean vector m, mi and calculating training sample within class scatter matrix SWWith inter _ class relationship matrix SB,
Calculating matrix SW -1SBCharacteristic vector, by choose SW -1SBFirst L maximum characteristic vector constitute LDA projection matrix WLDA;
Finally by LDA projection matrix WLDAProject to projecting the characteristic vector after dimensionality reduction by PCA, obtain every
Optimal classification feature Γ of training pictureij;
(2)Described cognitive phase includes:
(2-1)Adaboost detects:The subregion that test video frame comprises face is identified by Adaboost algorithm;
(2-2)AAM follows the tracks of and posture correction:Training obtains AAM model first;Then pass through the AAM model that training obtains
Face subregion is tracked;The net shape parameter obtaining when finally using AAM model training is entered to the subregion of face
Row posture corrects, and obtains the face subregion after posture correction;
(2-3)PCA projects:
First the face subregion picture after posture obtained above correction is normalized, then with the training stage
The average face obtaining during PCA projection does difference operation, obtains the second difference;
Then above-mentioned second matrix of differences is projected to the PCA projection matrix W that the training stage obtainsPCA, after obtaining dimensionality reduction
Characteristic vector η;
(2-4)LDA projects:By step(2-3)In eigenvector projection after the dimensionality reduction that obtains obtain to the training stage
LDA projection matrix WLDA, obtain the optimal classification feature of facial image to be identified;
(2-5)Nearest neighbor classifier decision-making:
Calculate European between each training picture optimal classification feature and other training picture optimal classification features first
Distance, therefrom selects Euclidean distance value F of maximum;Set threshold value b, the size of this threshold value b is maximum Euclidean distance
The half of value F;
Then calculation procedure(2-4)The optimal classification feature of the facial image to be identified obtaining is each with what the training stage obtained
Minimum euclid distance γ of the optimal classification feature of individual training picture1;
Finally by minimum euclid distance γ1Being compared with threshold value b, if being more than threshold value b, judging this people to be identified
Face image is non-training storehouse picture;If being less than threshold value b, by minimum euclid distance γ1Place characteristic of division place class
Face picture is judged to recognition result.
Preferably, described step(1-1)In calculated average face f be:
Wherein xijFor the training picture after normalization, C is the classification sum of the training picture after normalization, and N is every apoplexy due to endogenous wind
The training picture sample sum comprising, M is training picture sample sum, wherein M=N*C;
Training picture after normalization and average face do difference operation, the first difference d obtainingijFor:
dij=xij- f, i=1,2 ..., C, j=1,2 ... N;
According to the first matrix of differences dijBuild covariance matrix U be:
Wherein the first difference is passed through PCA projection matrix WPCAProject to lower dimensional space, obtain characteristic vector η after dimensionality reductionij
For:
ηij=WPCA Tdij, i=1,2 ..., C, j=1,2 ... N.
Further, described step(1-2)In all training picture samples through PCA projection after characteristic vector averages
Vectorial m is:
I-th class trains the mean vector mi of characteristic vector after PCA projection for the picture sample to be:
Described step trains the within class scatter matrix S of picture sampleWWith inter _ class relationship matrix SBIt is respectively:
Wherein ni is the number of the i-th class training sample;Optimal classification feature Γ of every training pictureijFor:
Γij=WLDA TWPCA Tdij, i=1,2 ..., C, j=1,2 ... N.
Preferably, described step(2-2)Middle AAM follows the tracks of as follows with the training step of the AAM model of posture correction:
(2-2-1)Choosing training object is to include positive face, left and right sides face, face of facing upward, S of face of bowing reliability sample;
(2-2-2)Described point is carried out to reliable sample, 68 feature visibility points of face are demarcated;
(2-2-3)Using Procrustes, the face after described point is alignd, obtain removing translation, yardstick and rotation
Alignment face;
(2-2-4)Using principal component analytical method to step(2-2-3)The alignment face obtaining carries out shape modeling, obtains
Form parameter p(I.e. coefficient of torsion)And shape;
(2-2-5)Remove average shape face from shape, then delaunay triangle division is carried out to it, then use
The affine method of burst makes texture project in average shape, is finally processed with PCA, obtains parametric texture and texture mould
Type;
(2-2-6)According to shape obtained above and texture model, right respectively using reversely combined aam matching algorithm
Existing shape and texture model are trained, and obtain hessian matrix.
Further, described step(2-2-1)Quantity S of middle reliable sample is 100~1000.
Further, described step(2-2)The process that middle face subregion is tracked is as follows:
(2-2-7)Form parameter p according to hessian matrix and shape obtains shape by following burst mapping function
Shape parameter increase △ p:
Wherein H is hessian matrix, and W is the affine equation of burst, and T is alignment face, and I is actual picture, and x is actual figure
Pixel in picture, p is the form parameter of shape in corresponding training process;
(2-2-8)Form parameter p, wherein p=p+ Δ p are updated according to form parameter increment Delta p;It is then back to step(2-2-
7), continue to calculate Δ p by above-mentioned burst mapping function, until calculated form parameter increment Delta p is less than a or iteration
Number of times reaches maximum iteration time, then stop calculating;
(2-2-9)Form parameter p obtaining after updating combines shape, and application principal component analytical method is followed the tracks of
Target facial image.
Further, described threshold value a is 500 to 2000.
Further, described step(2-2)In posture trimming process as follows:When accurately tracing into target facial image
Afterwards, posture correction is carried out to the subregion of face according to net shape parameter p obtaining in tracking iterative process, after being reversed
Shape I (W (x;P)) it is the reconstruction face consistent with positive face.
Preferably, described step(2-3)In obtain characteristic vector η after dimensionality reduction and be:
η=WPCA Tu;
Optimal classification feature Γ of facial image to be identified is:
Γ=WLDA TWPCA Tu;
Wherein u is step(2-3)In the second difference of obtaining;Wherein u=x-f;X is step(2-3)In the posture school that obtains
The picture after face subregion normalization after just, f is step(1-1)In the average face that obtains.
Preferably, described step(2-5)In optimal classification feature Γ and training stage of facial image to be identified obtain
Optimal classification feature Γ of each training pictureijMinimum euclid distance γ1For:
Wherein C is the classification sum of the training picture after normalization, and N is the training picture sample sum that every apoplexy due to endogenous wind comprises.
The present invention has such advantages as with respect to prior art and effect:
After the present inventor's face recognition method is tracked using AAM model in identification process, carries out attitude updating, obtain
To a reconstruction face consistent with positive face as the face subregion after attitude updating, this process will test facial image distortion
It is corrected to the facial image just to photographic head, then adopt PCA projection and LDA projection preferably to extract facial image to be identified
Optimal classification feature is so that the inventive method also can accurately identify face in the case of human face posture is diverse.Tool
There is strong robustness.
Brief description
Fig. 1 is the flow chart of the inventive method.
Fig. 2 is 68 feature locations of face in the inventive method.
Specific embodiment
With reference to embodiment and accompanying drawing, the present invention is described in further detail, but embodiments of the present invention do not limit
In this.
Embodiment
As shown in figure 1, present embodiment discloses a kind of video sequence face identification method based on AAM model, including instruction
Practice step and identification step;
(1)Training step includes:
(1-1)PCA projects:
First pretreatment is carried out to training picture, including being converted into gray scale, every training picture pulls into column vector by row, enters
Row normalization, according to the training picture x after normalizationijCalculate average face f, by the training picture x after all normalizationijWith flat
All face f do difference operation, obtain the first difference dij;
Wherein average face f is:
xijFor j-th training picture of the i-th class after normalization, C is the classification sum of the training picture after normalization, and N is
The training picture sample sum that every apoplexy due to endogenous wind comprises, M is training picture sample sum, wherein M=N*C;
First difference dijFor:
dij=xij- f, i=1,2 ..., C, j=1,2 ... N;
Then according to the first difference dijBuild covariance matrix U, accounting for before gross energy more than 95% by covariance matrix
The characteristic vector composition PCA projection matrix W of K eigenvalue of maximumPCA, as feature quantity space;The covariance matrix of wherein structure
U is:
Finally the first difference is passed through PCA projection matrix WPCAProject to lower dimensional space, obtain characteristic vector η after dimensionality reductionij
For:
ηij=WPCA Tdij, i=1,2 ..., C, j=1,2 ... N;
(1-2)LDA projects:
Calculate first the mean vector m of characteristic vector after the PCA dimensionality reduction that obtains of projection for all training picture samples with
And i-th class train the mean vector mi of characteristic vector after the PCA dimensionality reduction that obtains of projection for the picture sample;
Then according to mean vector m, mi and calculating training sample within class scatter matrix SWWith inter _ class relationship matrix SB,
Calculating matrix SW -1SBCharacteristic vector, by choose SW -1SBFirst L maximum characteristic vector structure accounting for gross energy more than 95%
Become LDA projection matrix WLDA;Wherein training sample within class scatter matrix SWWith inter _ class relationship matrix SBIt is respectively:
Wherein ni is the number of the i-th class training sample;
Finally by LDA projection matrix WLDAProject to projecting the characteristic vector after dimensionality reduction by PCA, obtain every
Optimal classification feature Γ of training pictureij;Wherein optimal classification feature ΓijFor:
Γij=WLDA TWPCA Tdij, i=1,2 ..., C, j=1,2 ... N;
(2)Described identification step includes:
(2-1)Adaboost detects:The subregion that test video frame comprises face is identified by Adaboost algorithm;
(2-2)AAM follows the tracks of and posture correction:Training obtains AAM model first;Then pass through the AAM model that training obtains
Face subregion is tracked;The net shape parameter obtaining when finally using AAM model training is entered to the subregion of face
Row posture corrects, and obtains the face subregion after posture correction;
Wherein AAM follows the tracks of as follows with the training step of the AAM model of posture correction:
(2-2-1)Choosing training object is to include positive face, left and right sides face, face of facing upward, S of face of bowing reliability sample,
In embodiment, quantity S of reliable sample is 100~1000.
(2-2-2)Described point is carried out to reliable sample, 68 feature visibility points of face are demarcated;In Fig. 2
Shown.
(2-2-3)Using Procrustes(Pu Shi analyzes)Face after described point is alignd, obtains removing translation, chi
Degree and the alignment face of rotation;
(2-2-4)Using principal component analytical method to step(2-2-3)The alignment face obtaining carries out shape modeling, obtains
Form parameter p(I.e. coefficient of torsion)And shape;
(2-2-5)Remove average shape face from shape, then delaunay triangle division is carried out to it, then use
The affine method of burst makes texture project in average shape, is finally processed with PCA, obtains parametric texture and texture mould
Type;
(2-2-6)According to shape obtained above and texture model, right respectively using reversely combined aam matching algorithm
Existing shape and texture model are trained, and obtain hessian matrix.
The process that face subregion is tracked is as follows:
(2-2-7)Form parameter p according to hessian matrix and shape obtains shape by following burst mapping function
Shape parameter increase Δ p:
Wherein, H is hessian matrix, and W is the affine equation of burst, and T is alignment face, and I is actual picture, and x is actual figure
Pixel in picture, p is the form parameter of shape in corresponding training process;
(2-2-8)Form parameter p, wherein p=p+ Δ p are updated according to form parameter increment Delta p;It is then back to step(2-2-
7), continue to calculate Δ p by above-mentioned burst mapping function, until calculated form parameter increment Delta p is less than a or iteration
Number of times reaches maximum iteration time, then stop calculating;
(2-2-9)Form parameter p obtaining after updating combines shape, and application principal component analytical method is followed the tracks of
Target facial image.
Posture trimming process is as follows:After accurately tracing into target facial image, according to obtain in tracking iterative process
Net shape parameter p carries out posture correction to the subregion of face, the shape I (W (x after being reversed;P)) it is and positive face one
The reconstruction face causing, that is, obtain the face subregion after posture correction;
(2-3)PCA projects:
First the face subregion picture after posture obtained above correction is pulled into by row and is normalized after column vector,
The average face obtaining when then projecting with the PCA of training stage does difference operation, obtains the second difference;
Then above-mentioned second matrix of differences is projected to the PCA projection matrix W that the training stage obtainsPCA, after obtaining dimensionality reduction
Characteristic vector η is:
η=WPCA Tu;
(2-4)LDA projects:By step(2-3)In eigenvector projection after the dimensionality reduction that obtains obtain to the training stage
LDA projection matrix WLDA, optimal classification feature Γ obtaining facial image to be identified is:
Γ=WLDA TWPCA Tu;
Wherein u is step(2-3)In the second difference of obtaining, u=x-f;X is step(2-3)In obtain posture correction after
Face subregion normalization after picture, f be step(1-1)In the average face that obtains.
(2-5)Nearest neighbor classifier decision-making:
Calculate each training picture optimal classification feature in training picture library first and train picture optimal classification feature with other
Between Euclidean distance, therefrom select maximum Euclidean distance value F;Set threshold value b, the size of this threshold value b is maximum
Euclidean distance value F half.
Then calculation procedure(2-4)The optimal classification feature of the facial image to be identified obtaining is each with what the training stage obtained
Minimum euclid distance γ of the optimal classification feature of individual training picture1:
Finally by minimum euclid distance γ1Being compared with threshold value b, if being more than threshold value b, judging this people to be identified
Face image is non-training storehouse picture;If being less than threshold value b, by minimum euclid distance γ1Place characteristic of division place class
Face picture is judged to recognition result.
Above-described embodiment is the present invention preferably embodiment, but embodiments of the present invention are not subject to above-described embodiment
Limit, other any spirit without departing from the present invention and the change made under principle, modification, replacement, combine, simplify,
All should be equivalent substitute mode, be included within protection scope of the present invention.