# Patent

## Title
Statistical facial feature extraction method

## Abstract

A statistical facial feature extraction method is disclosed. In a training phase, N training face images are respectively labeled n feature points located in n different blocks to form N feature vectors. Next, a principal component analysis (PCA) technique is used to obtain a statistical face shape model after aligning each shape vector with a reference shape vector. In an executing phase, initial positions for desired facial features are firstly guessed according to the coordinates of the mean shape for aligned training face images obtained in the training phase, and k candidates are respectively labeled in n search ranges corresponding to above-mentioned initial positions to obtain kn different combinations of test shape vectors. Finally, coordinates of the test shape vector having the best similarity with the mean shape for aligned training face image and the statistical face shape model are assigned as facial features of the test face image.

## Background
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to a statistical facial feature extraction method, which uses principle component analysis (PCA) to extract facial features from images.
2. Description of Related Art
With the development of information technology continuously, more and more corresponding applications are introduced into our daily lives for improvement. Especially, the use of effective human-computer interactions makes our lives more convenient and efficient. With recent dramatic decrease in video and image acquisition cost, computer vision systems can be extensively deployed in desktop and embedded systems. For example, an ATM machine can identify users by the images captured from the camera equipped on it, or the video-based access control systems can give the access permission by recognizing captured face images.
Among all the interfaces between humans and computers, a human face is commonly regarded as one of the most efficient media since it carries enormous information (i.e., many facial features like eyes, nose, nostrils, eyebrow, mouth, lip, . . . , etc.), and is most visually discriminative among individuals. Therefore, facial images of individuals can be recognized easier than other kinds of images.
Two typical techniques for facial feature extraction are used: one parameterized model method for describing the facial features based on the energy-minimized values, and the other eigen-image method for detecting facial features.
The former method uses deformable templates to extract desired facial features to change the properties such as size and shape, to match the model to the image and thus obtain more precise description to the facial features. The execution phase uses peak, valley, and edge images as representatives to highlight the salient feature in an image data, and an energy minimization function to alter deformable templates in the image data. The deformable templates are parameterized models for describing the facial features, such as eyes or mouth. Parameter settings can alter the position, orientation, size and other properties of the templates. In addition, an automatic feature detection and age classification system for human face images have developed in the prior art. They represent the shape of eyes or face contour by parametric curves (for example, combination of parabola curves or ovals). Next, an energy function is defined for each facial feature based on its intensity property. For example, a valley can describe the possible location of an iris.
However, the cited method is based on finding the best deformable model capable of minimizing an energy function having the property of the particular facial feature of interest, so deformable model used by the minimization process usually needs a proper initial guess value to help for computing required convergence.
In the other eigen-image method for detecting facial features, a face recognition system is applied to localize desired head and eyes from images in the basis of principal component analysis (PCA) algorithm. For the detection of eyes, typical eigen-eye images are constructed from the basis of eye feature images. To speed up the computational cost, the correlation between an input image and the eigen-template image is computed by Fast Fourier Transform (FFT) algorithm. However, the cited method uses a separate template for comparison, which can only find an individual difference. For example, using a left eye feature image can extract only the corresponding left eye location from a facial image, but cannot detect complete features of a whole face image and is not easy to be matched to statistical models.
Therefore, it is desirable to provide an improved facial feature extraction method to mitigate and/or obviate the aforementioned problems.
SUMMARY OF THE INVENTION
An object of the present invention is to provide a statistical facial feature extraction method, which is based on principal component analysis (PCA) technique to further accurately describe the appearance and geometric variations of facial features.
Another object of the present invention is to provide a statistical facial feature extraction method, which can combine the statistical information on geometric feature distribution and photometric feature appearance obtained in a facial feature training phase, thereby extracting complete facial features from face images.
A further object of the present invention is to provide a statistical facial feature extraction method, which does not need a proper initial guess value because only candidate feature positions (shapes) are required to be found in candidate search ranges of each facial feature, as based on face images completely detected by a face detection method, thereby reducing system load.
To achieve the object, the statistical facial feature extraction method of the present invention comprises a first procedure and a second procedure. The first procedure creates a statistical face shape model based on a plurality of training face images. This is achieved by selecting N training face images and respectively labeling feature points located in n different blocks for the training face images to define corresponding shape vectors of the training face images; aligning each shape vector with a reference shape vector after the shapes for all the face images in the training data set are labeled; and using a principal component analysis (PCA) process to compute a plurality of principal components based on the aligned shape vectors and thus forming the statistical face shape model, wherein the shape vectors are represented by a statistical face shape with conjunction to a plurality of projection coefficients.
The second procedure extracts a plurality of facial features from a test face image. This is achieved by selecting a test face image; guessing n initial positions of n test feature points, wherein the initial positions are located in the test face image and each initial position is represented by a mean value of the n feature points of the aligned shape vectors; defining n search ranges in the test face image, based on the initial positions, wherein the search ranges correspond to different blocks, respectively; labeling a plurality of candidate feature points for each search range; doing combination of the candidate feature points in different search ranges to form a plurality of test shape vectors; and matching each shape vector to the mean value and principle components in order to compute a similarity, wherein one, having the best similarity, of the test shape vectors, corresponds to candidate feature points to be assigned as facial features of the test face image.
Other objects, advantages, and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a flowchart of an embodiment of the present invention;
FIG. 2 is a schematic diagram of training face images according to the embodiment of the present invention;
FIG. 3 is a schematic diagram of labeled feature points of FIG. 2 according to the embodiment of the present invention;
FIG. 4 is a flowchart illustrating a process of aligning a shape vector with a reference shape vector according to the embodiment of the present invention;
FIG. 5 is a flowchart illustrating a process of calculating a statistical facial shape model according to the embodiment of the present invention;
FIG. 6 is a schematic diagram of a test face image according to the embodiment of the present invention;
FIG. 7 is a schematic diagram of search ranges defined by initial positions of test feature points according to the embodiment of the present invention;
FIG. 8 is a flowchart illustrating a process labeling candidate feature points according to the embodiment of the present invention;
FIG. 9 is a flowchart of decision steps according to the embodiment of the present invention; and
FIG. 10 is a flowchart of decision steps according to another embodiment of the present invention.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
Two embodiments are given in the following for purpose of better understanding.
The statistical facial feature extraction method of the present invention essentially includes two phases: a training phase for creating a statistical face shape model based on a plurality of training face images; and a executing phase for extracting a plurality of facial features from a test face image. In this embodiment, each face image can be defined by six feature points located in different ranges, including four points at the internal and external corners of eyes and two points at the corners of mouth. Of course, other features such as nostrils, eyebrow and/or the like can be defined. These features may vary with different face poses, lighting conditions or facial expressions. Therefore, a template matching algorithm is used to find candidates of facial features. Required templates for facial features are constructed from a lot of training examples in the training phase. In addition, a principal component analysis (PCA) technique is applied to gain further precise description on appearance and geometry variations of facial features.
The Training Phase:
With reference to the flowchart of FIG. 1, the primary purpose in the training phase is to create a statistical face shape model and local facial feature templates based on a plurality of training face images. Accordingly, N such as 100 or 1000 of training face images 1 shown in FIG. 2 are selected as training samples (step S101), preferably selecting frontal face images and using N as big as possible for creating more accurate model and templates. However, the number of training samples to be required depends on practical need. Next, the six feature points for each training face image 1 are manually labeled (step S102) or automatically labeled by any known image extraction technique. As shown in FIG. 3, these feature points labeled on the training face image include coordinates (x1,y1), (x2,y2), (x3,y3) and (x4,y4) of the internal and external corners of eyes, and coordinates (x5,y5) and (x6,y6) of the corners of mouth. Accordingly, a shape vector xj=(xj1, yj1, . . . , xjn, yjn) is defined, where in this embodiment, n=6, and xj1 equals to x1 shown in FIG. 3, yj1 equal to y1, and so on.
To reduce difference between training face images 1 due to face pose and expression variations, a 2D scaled rigid transform algorithm is applied to align each shape vector xj with a reference shape vector xi=(xi1,yi1, . . . , xin,yin) by means of scaling, 2D rotation and shift. The vector xi can be one of the cited N shape vector xj or a self-defined vector corresponding to the cited feature point coordinates.
With reference to FIG. 4, there is shown a flowchart of aligning a shape vector xj with a reference shape vector xi in this embodiment. After the reference shape vector xi and the shape vector xj are selected (step S401), a squared Euclidean distance E between the vectors xi and xj is computed (step S402) based on the following equation:

E=(xi−M(N)(α,θ)[xj]−t)T(xi−M(N)(α,θ)[xj]−t)  (step S402),

where M(N)(α,θ)[xj]−t is a geometric transformation defining with a plurality of transfer parameters to align the shape vector xj. The transfer parameters include a rotating angle θ, a scaling factor α, and a shifting vector represented by t=(tx,ty). In addition, as





  
    
      M
      ⁡
      
        (
        
          α
          ,
          θ
        
        )
      
    
    =
    
      (
      
        
          
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
            
          
          
            
              
                -
                α
              
              ⁢
              
                
              
              ⁢
              sin
              ⁢
              
                
              
              ⁢
              θ
            
          
        
        
          
            
              α
              ⁢
              
                
              
              ⁢
              sin
              ⁢
              
                
              
              ⁢
              θ
            
          
          
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
            
          
        
      
      )
    
  
  ,




M(N)(α,θ) is a 2n×2n diagonal blocked matrix, where each diagonal block is a 2×2 matrix M(α,θ), and





  
    
      
        M
        ⁡
        
          (
          
            α
            ,
            θ
          
          )
        
      
      ⁡
      
        [
        
          
            
              
                x
                jk
              
            
          
          
            
              
                y
                jk
              
            
          
        
        ]
      
    
    =
    
      (
      
        
          
            
              
                α
                ⁢
                
                  
                
                ⁢
                cos
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                
                  x
                  jk
                
              
              -
              
                α
                ⁢
                
                  
                
                ⁢
                sin
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                
                  y
                  jk
                
              
            
          
        
        
          
            
              
                α
                ⁢
                
                  
                
                ⁢
                sin
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                
                  x
                  jk
                
              
              +
              
                α
                ⁢
                
                  
                
                ⁢
                cos
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                
                  y
                  jk
                
              
            
          
        
      
      )
    
  
  ,




where 1≦k≦n. Next, E is minimized as the equation:

E=(xi−M(N)(αj,θj)[xj]−tj)T(xi−M(N)(αj,θj)[xj]−tj),

such that the parameters of angle θj, factor αj, and vector represented by tj=(txj,tyj) are found and used to align the shape vector (step S403).

After the N shape vectors xj in this embodiment are all aligned with the reference shape vectors xi (step S404), a least square algorithm is used to minimize the sum of squared Euclidean distance between the vectors xj and xi (step S405). The least square algorithm for the above minimization leads to solving the following linear system:




  
    
      
        (
        
          
            
              Z
            
            
              0
            
            
              
                X
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              
                Y
                ⁢
                
                  
                
                ⁢
                2
              
            
          
          
            
              0
            
            
              Z
            
            
              
                
                  -
                  Y
                
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              
                X
                ⁢
                
                  
                
                ⁢
                2
              
            
          
          
            
              
                X
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              
                
                  -
                  Y
                
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              n
            
            
              0
            
          
          
            
              
                Y
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              
                X
                ⁢
                
                  
                
                ⁢
                2
              
            
            
              0
            
            
              n
            
          
        
        )
      
      ⁢
      
        (
        
          
            
              a
            
          
          
            
              b
            
          
          
            
              
                t
                xj
              
            
          
          
            
              
                t
                yj
              
            
          
        
        )
      
    
    =
    
      (
      
        
          
            
              C
              ⁢
              
                
              
              ⁢
              1
            
          
        
        
          
            
              C
              ⁢
              
                
              
              ⁢
              2
            
          
        
        
          
            
              X
              ⁢
              
                
              
              ⁢
              1
            
          
        
        
          
            
              Y
              ⁢
              
                
              
              ⁢
              1
            
          
        
      
      )
    
  
  ,




where n is the number of landmark points of each shape and,





   
  
    
      
        
          
            
              X
              ⁢
              
                
              
              ⁢
              1
            
            =
            
              
                ∑
                
                  k
                  =
                  1
                
                n
              
              ⁢
              
                x
                ik
              
            
          
          ,
          
            
              Y
              ⁢
              
                
              
              ⁢
              1
            
            =
            
              
                ∑
                
                  k
                  =
                  1
                
                n
              
              ⁢
              
                y
                ik
              
            
          
          ,
          
            
              X
              ⁢
              
                
              
              ⁢
              2
            
            =
            
              
                ∑
                
                  k
                  =
                  1
                
                n
              
              ⁢
              
                x
                jk
              
            
          
          ,
          
            
              Y
              ⁢
              
                
              
              ⁢
              2
            
            =
            
              
                ∑
                
                  k
                  =
                  1
                
                n
              
              ⁢
              
                y
                jk
              
            
          
          ,
        
      
    
    
      
        
          
            Z
            =
            
              
                
                  ∑
                  
                    k
                    =
                    1
                  
                  n
                
                ⁢
                
                  x
                  jk
                  2
                
              
              +
              
                y
                jk
                2
              
            
          
          ,
          
            
              C
              ⁢
              
                
              
              ⁢
              1
            
            =
            
              
                
                  ∑
                  
                    k
                    =
                    1
                  
                  n
                
                ⁢
                
                  
                    x
                    ik
                  
                  ⁢
                  
                    x
                    jk
                  
                
              
              +
              
                
                  y
                  ik
                
                ⁢
                
                  y
                  jk
                
              
            
          
          ,
          and
        
      
    
    
      
        
          
            C
            ⁢
            
              
            
            ⁢
            1
          
          =
          
            
              
                ∑
                
                  k
                  =
                  1
                
                n
              
              ⁢
              
                
                  y
                  ik
                
                ⁢
                
                  x
                  jk
                
              
            
            +
            
              
                x
                ik
              
              ⁢
              
                
                  y
                  jk
                
                .
              
            
          
        
      
    
  




Therefore, the transformation parameters are obtained by solving the above linear system. If the above computation results in a value smaller than a predetermined threshold (step S406), the aligning step is finished, otherwise, a mean value of feature points of aligned shape vectors for each block is computed to define a mean shape vector as




  
    x
    _
  
  =
  
    
      1
      N
    
    ⁢
    
      
        ∑
        
          a
          =
          1
        
        N
      
      ⁢
      
        x
        a
      
    
  




(step S407), where xa is aligned shape vector. After the mean shape vector x is assigned as the reference shape vector xi and all aligned shape vectors xa are assigned as the shape vectors xj (step S408), go to step S402 until the process converges.

It is noted that the reference shape vector xi assigned when the aligning step is performed at first time preferably corresponds to a non-inclined face image for reducing system load and operation process. However, inclined face images are also available because a mean shape vector is regarded as the reference shape vector since the aligning step is performed at second time (equivalent to steps S402-S408 of FIG. 4). Namely, the mean shape vector is regarded as the reference shape vector for gradually aligning the difference among the shape vectors xj to convergence. Briefly, major function of performing the aligning step at first time is that all scaling shape vectors xj are aligned to be alike to each other, thereby gradually modifying results at sequential aligning steps on performance until the process converges.
After all shape vectors xj are aligned with the reference shape vectors xi assigned, a principal component analysis (PCA) technique is used to compute a plurality of principal components and further form a statistical face shape model (step S104) according to aligned shape vectors xa, wherein the statistical face shape model is a point distribution model (PDM) and represents the shape vectors xj, with conjunction to a plurality of projection coefficients.
For a step of computing the statistical face shape model, refer to the flowchart of FIG. 5. As shown in FIG. 5, a mean value of feature points of aligned shape vectors is computed to define a mean shape vector as




  
    x
    _
  
  =
  
    
      1
      N
    
    ⁢
    
      
        ∑
        
          a
          =
          1
        
        N
      
      ⁢
      
        x
        a
      
    
  




(step S501). Next, the result dxa=xa− x obtained by subtracting the mean shape vector x from each aligned shape vector xa forms a matrix A=└dx1,dx2, . . . ,dxN┘ (step S502). Next, the covariance matrix C of matrix A is computed to find the equation C=AAT (step S503). Next, the plurality of principal components are computed according to eigenvectors derived from the equation Cvks=λksvks with eigenvalues corresponding to the covariance matrix C, to form the statistical face shape model (step S504), wherein λks represents eigenvalues of the covariance matrix C, vks represents eigenvectors of the covariance matrix C, and 1≦k≦m, where m is the dimension of the covariance matrix C for λ1s≧λ2s≧ . . . ≧λms.

Further, in this embodiment, each shape vector xj consists of six (i.e. n=6) feature vectors sj located in different blocks, so an average value, evaluated by the equation




  
    t
    =
    
      
        1
        N
      
      ⁢
      
        
          ∑
          
            j
            =
            1
          
          N
        
        ⁢
        
          s
          j
        
      
    
  
  ,




of feature vectors sj corresponding to special blocks of all shape vector xj is defined as a feature template.

When the cited steps in the training phase are performed, the statistical face shape model and the feature templates are created for facial feature extraction in a following executing phase.
The Executing Phase (Feature Extracting Phase):
Refer to the flowchart of FIG. 1 and a schematic diagram of test face image 2 of FIG. 6. After the test face image 2 is selected (step S105), the mean shape vectors x obtained in the training phase are regarded as initial positions of test feature points of the test face image 2 (step S106). It is noted that scaling of an initial test shape formed by the test feature points is preferably aligned similarly to the test face image 2. Based on each initial position, six search ranges are respectively defined in the test face image 2 (step S107), wherein the sizes of search ranges can vary with different test face images 2. Refer to FIG. 7, in which search ranges respectively corresponding to a different block (i.e., one of corners of eyes and mouth) are shown. That is, assume that actual feature points of the test face image 2 are respectively located in the search ranges.
An actual feature point of the test face image 2 may be located in the search ranges at any coordinate value. Therefore, a more precise candidate feature point is defined in the search ranges (step S108). With integrable reference to the flowchart of FIG. 8, a plurality of reference points derived by




  
    
      I
      i
    
    ≅
    
      t
      +
      
        
          ∑
          
            j
            =
            1
          
          k
        
        ⁢
        
          
            b
            j
          
          ⁢
          
            p
            j
          
        
      
    
  
  ,




are respectively labeled in each search range (step S801), where t is the feature template of block corresponding to a search range, pj is j-th principal component of the statistical face shape model computed from the training feature vectors, and bj is associated projection coefficient. Next, an error value between a reference point and the corresponding principal component pj and projection coefficient bj is computed as





  ɛ
  =
  
    
      
        
        
          
            I
            i
          
          -
          t
          -
          
            
              ∑
              
                j
                =
                1
              
              k
            
            ⁢
            
              
                b
                j
              
              ⁢
              
                p
                j
              
            
          
        
        
      
      2
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          step
          ⁢
          
            
          
          ⁢
          S802
        
        )
      
      .
    
  




Finally, k smallest error values are selected to define as candidate feature points of the search range (step S803).

Therefore, all combinations for candidate feature points located in different ranges are done to form kn test shape vectors (step S109). In this embodiment, n represents the number of feature points, for example, in this case, n=6. If two of the six feature points have smaller error values and are extracted, 26(=64) different combinations of test shape vectors are obtained. All test shape vectors are respectively matched with the mean value of aligned shape vector xa and the principal component of statistical face shape model to compute a similarity (step S110). As a result, one candidate feature point corresponding to the test shape vector with the best similarity is assigned as facial feature of the test face image 2 (step S111).
This embodiment is based on the decision flowchart of FIG. 9 to find facial features of the test face image 2. After an approximate value of test shape vector is represented as




  x
  ≅
  
    
      x
      _
    
    +
    
      
        ∑
        
          j
          =
          1
        
        k
      
      ⁢
      
        
          b
          j
          x
        
        ⁢
        
          p
          j
          x
        
      
    
  




by a mean shape vector x and the principal components of the statistical face shape model (step SA01), a 2D scaled rigid transform algorithm aligns test shape vector using the equation





  
    x
    ≅
    
      
        
          M
          ⁡
          
            (
            
              α
              ,
              θ
            
            )
          
        
        ⁡
        
          [
          
            
              x
              _
            
            +
            
              
                ∑
                
                  j
                  =
                  1
                
                k
              
              ⁢
              
                
              
              ⁢
              
                
                  b
                  j
                  x
                
                ⁢
                
                  p
                  j
                  x
                
              
            
          
          ]
        
      
      +
      
        t
        ⁢
        
          
        
        ⁢
        
          (
          
            step
            ⁢
            
              
            
            ⁢
            SA
            ⁢
            
              
            
            ⁢
            02
          
          )
        
      
    
  
  ,




where θ, α and t are a rotating angle, a scaling factor and a shifting vector respectively. Next, a normalized distance for aligned test shape vectors aligned at step SA02 is computed by





  
    d
    ⁡
    
      (
      x
      )
    
  
  =
  
    
      
        ∑
        
          j
          =
          1
        
        k
      
      ⁢
      
        
      
      ⁢
      
        
          (
          
            
              b
              j
              x
            
            
              λ
              j
              x
            
          
          )
        
        2
      
    
  




(step SA03). The normalized distance d(x) is considered as the criterion to determine which combination of candidate feature points is the most similar to a face shape. Therefore, one candidate feature point corresponding to one, having the smallest normalized distance, of the aligned test shape vectors is assigned as facial feature of the test face image (step SA04).

In addition, the invention also provides another embodiment of decision flow to find facial features of the test face image 2. With reference to FIG. 10, steps SB01 and SB02 are the same as steps SA01 and SA02 of FIG. 9, but step SB03 in this embodiment computes an error value between a test shape vector and corresponding mean shape vector x as follows.




  
    
      ɛ
      ⁡
      
        (
        x
        )
      
    
    =
    
      
        
          w
          1
        
        ⁢
        
          
            ∑
            
              i
              =
              1
            
            6
          
          ⁢
          
            
          
          ⁢
          
            
              
              
                
                  
                    I
                    i
                  
                  ⁡
                  
                    (
                    x
                    )
                  
                
                -
                
                  t
                  i
                
                -
                
                  
                    ∑
                    
                      j
                      =
                      1
                    
                    k
                  
                  ⁢
                  
                    
                  
                  ⁢
                  
                    
                      b
                      j
                      i
                    
                    ⁢
                    
                      p
                      j
                      i
                    
                  
                
              
              
            
            2
          
        
      
      +
      
        
          w
          2
        
        ⁢
        
          d
          ⁡
          
            (
            x
            )
          
        
      
    
  
  ,




where





  
    ∑
    
      i
      =
      1
    
    6
  
  ⁢
  
    
  
  ⁢
  
    
      
      
        
          
            I
            i
          
          ⁡
          
            (
            x
            )
          
        
        -
        
          t
          i
        
        -
        
          
            ∑
            
              j
              =
              1
            
            k
          
          ⁢
          
            
          
          ⁢
          
            
              b
              j
              i
            
            ⁢
            
              p
              j
              i
            
          
        
      
      
    
    2
  




is a similarity of the test shape vector to corresponding aligned shape vector xa, and d(x) is the normalized distance of xa. The cited error value equation can be also rewritten as





  
    
      ɛ
      ⁡
      
        (
        x
        )
      
    
    =
    
      
        
          w
          1
        
        ⁡
        
          (
          
            
              ∑
              
                i
                =
                1
              
              n
            
            ⁢
            
              
            
            ⁢
            
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  k
                
                ⁢
                
                  
                
                ⁢
                
                  
                    (
                    
                      
                        b
                        j
                        i
                      
                      
                        λ
                        j
                        i
                      
                    
                    )
                  
                  2
                
              
            
          
          )
        
      
      +
      
        
          w
          2
        
        ⁢
        
          d
          ⁡
          
            (
            x
            )
          
        
      
    
  
  ,




based on the error value equation used by step S802. Finally, one candidate feature point corresponding to one, having the shortest error value, of the test shape vectors is assigned as facial feature of the test face image (step SB04??).

As cited above, the invention applies the principal component analysis (PCA) technique to more precisely describe appearance and geometric variances of facial features and further extracts entire facial features by combining statistical data of geometric and photometric properties on appearance obtained in the training phase. Thus, the problem that only extracts facial feature of a single portion in the prior art is improved. In addition, the invention does not need a proper initial guess value because only candidate feature positions (shapes) are required to be found in candidate search ranges of each facial feature, as based on face images completely detected by a face detection algorithm, thereby reducing system load.
Although the present invention has been explained in relation to its preferred embodiment, it is to be understood that many other possible modifications and variations can be made without departing from the spirit and scope of the invention as hereinafter claimed.

## Claims

1. A statistical facial feature extraction method, comprising:
a first procedure for creating a statistical face shape model based on a plurality of training face images, including:
an image selecting step, to select N training face images;
a feature labeling step, to respectively label feature points located in n different blocks of the training face images to define corresponding shape vectors of the training face images;
an aligning step, to align each shape vector with a reference shape vector to thus obtain aligned shape vectors; and
a statistical face shape model computing step, to use a principal component analysis (PCA) process to compute a plurality of principal components based on the aligned shape vectors to create a statistical face shape model, wherein the statistical face shape model represents the shape vectors by combining a plurality of projection coefficients, and the statistical face shape model computing step includes: computing a mean value of the feature points of the aligned shape vectors to define a mean shape vector x as





  
    x
    _
  
  =
  
    
      1
      N
    
    ⁢
    
      
        ∑
        
          a
          =
          1
        
        N
      
      ⁢
      
        
      
      ⁢
      
        x
        a
      
    
  




where xa is an aligned shape vector, subtracting each aligned shape vector xa by the mean shape vector x to form a matrix A=└dx1,dx2, . . . ,dxN┘ and dxa=xa− x, computing a covariance matrix C of the matrix A, and computing a plurality of principal components according to eigenvectors vks, which are derived from Cvks=λks vks with eigenvalues λks corresponding to the covariance matrix C formed as C=AAT for 1≦k≦m where m is the dimension of the covariance matrix C for λ1s≧λ2s≧ . . . ≧λms, to thereby form the statistical face shape model; and
a second procedure for extracting a plurality of facial features from a test face image, including:
an initial guessing step, to guess initial positions of n test feature points located in the test face image, wherein the initial position of each test feature point is a mean value of the feature points of the aligned shape vectors;
a search range defining step, to define n search ranges in the test face image, based on the initial position of each test feature point, wherein each search range corresponds to a different block;
a candidate feature point labeling step, to label a plurality of candidate feature points for each search range;
a test shape vector forming step, to do combination of the candidate feature points in different search ranges in order to form a plurality of test shape vectors; and
a determining step, to match the test shape vectors respectively to both the mean value and the principal components for computing a similarity, and to accordingly assign one feature point corresponding to one, having the best similarity, of the test shape vectors as facial features of the test face image.

2. The method as claimed in claim 1, wherein in the feature labeling step of the first procedure, the feature points are coordinates for corners of eyes and mouth on each training face image.

3. The method as claimed in claim 1, wherein the feature labeling step of the first procedure manually labels the feature points of each training face image.

4. The method as claimed in claim 1, wherein the reference shape ector is one of the shape vectors.

5. The method as claimed in claim 1, wherein the aligning step of the first procedure uses a 2D scaled rigid transform algorithm to align each shape vector with the reference shape vector.

6. The method as claimed in claim 5, wherein the aligning step of the first procedure further comprises the steps of:
selecting the reference shape vector as xi=(xi1,yi1, . . . ,xin,yin) and one of the shape vectors as xj=(xj1,yj1, . . . ,xjn,yjn);
computing a squared Euclidean distance E between the vectors xi, and xj based on the following equation


E=(xi−M(N)(α,θ)[xj]−t)T(xi−M(N)(α,θ)[xj]−t), where



M(N)(α,θ)[xj]−t is a geometric transform function defining with a plurality of transfer parameters to align the vector xj, the transfer parameters include a rotating angle θ, a scaling factor α, and a shifting vector represented by t=(tx,ty), and M(N)(α,θ) is a 2n×2n diagonal blocked matrix as well as




  
    
      M
      ⁡
      
        (
        
          α
          ,
          θ
        
        )
      
    
    ⁡
    
      [
      
        
          
            
              x
              jk
            
          
        
        
          
            
              y
              jk
            
          
        
      
      ]
    
  
  =
  
    (
    
      
        
          
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
              ⁢
              
                
              
              ⁢
              
                x
                jk
              
            
            -
            
              α
              ⁢
              
                
              
              ⁢
              sin
              ⁢
              
                
              
              ⁢
              θ
              ⁢
              
                
              
              ⁢
              
                y
                jk
              
            
          
        
      
      
        
          
            
              α
              ⁢
              
                
              
              ⁢
              sin
              ⁢
              
                
              
              ⁢
              θ
              ⁢
              
                
              
              ⁢
              
                x
                jk
              
            
            +
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
              ⁢
              
                
              
              ⁢
              
                y
                jk
              
            
          
        
      
    
    )
  




for 1≦k≦n, as




  
    
      M
      ⁡
      
        (
        
          α
          ,
          θ
        
        )
      
    
    =
    
      (
      
        
          
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
            
          
          
            
              
                -
                αsin
              
              ⁢
              
                
              
              ⁢
              θ
            
          
        
        
          
            
              α
              ⁢
              
                
              
              ⁢
              sin
              ⁢
              
                
              
              ⁢
              θ
            
          
          
            
              α
              ⁢
              
                
              
              ⁢
              cos
              ⁢
              
                
              
              ⁢
              θ
            
          
        
      
      )
    
  
  ;



finding the smallest squared Euclidean distance and corresponding rotating angle θj, scaling factor αj and shifting vector represented by tj=(txj,tyj) to align the shape vector xj so similar as the reference shape vector xi;
computing a sum of smallest squared Euclidean distances after the N shape vectors are all aligned so similar as the reference shape vector, ending the aligning step when the sum is smaller than a predetermined threshold;
computing a mean value of the feature points in each block for the aligned shape vectors to define a mean shape vector for each aligned shape vector as





  
    
      x
      _
    
    =
    
      
        1
        N
      
      ⁢
      
        
          ∑
          
            a
            =
            1
          
          N
        
        ⁢
        
          
        
        ⁢
        
          x
          a
        
      
    
  
  ,




wherein xa is the aligned shape vector; and
assigning the mean shape vector as the reference shape vector and the aligned shape vectors as the shape vectors and then repeating the aligning step until all shape vectors are aligned.

7. The method as claimed in claim 6, wherein the transfer parameters is obtained by a least square algorithm.

8. The method as claimed in claim 1, wherein the statistical face shape model is a point distribution model (PDM).

9. The method as claimed in claim 1, wherein each shape vector xj consists of n feature vectors sj located in different blocks, so an average value as




  t
  =
  
    
      1
      N
    
    ⁢
    
      
        ∑
        
          j
          =
          1
        
        N
      
      ⁢
      
        
      
      ⁢
      
        s
        j
      
    
  




of the feature vectors sj corresponding to special blocks of all shape vectors xj is defined as a feature template.

10. The method as claimed in claim 1, wherein in the initial guessing step of the second procedure, scaling of initial guess shapes formed by the test feature points is aligned so similar as the test face image.

11. The method as claimed in claim 9, wherein the candidate feature point labeling step of the second procedure further comprises the steps of:
labeling a plurality of reference points derived from





  
    I
    i
  
  ≅
  
    t
    +
    
      
        ∑
        
          j
          =
          1
        
        k
      
      ⁢
      
        
      
      ⁢
      
        
          b
          j
        
        ⁢
        
          p
          j
        
      
    
  




respectively in each search range, where t is the feature template of block corresponding to a search range, pj is j-th principal component of the statistical face shape model computed from the training feature vectors, and bj is an associated projection coefficient; using




  ɛ
  =
  
    
      
      
        
          I
          i
        
        -
        t
        -
        
          
            ∑
            
              j
              =
              1
            
            k
          
          ⁢
          
            
          
          ⁢
          
            
              b
              j
            
            ⁢
            
              p
              j
            
          
        
      
      
    
    2
  




to compute an error value between one of the reference points and the corresponding principal component pj and projection coefficient bj; and
selecting preceding k smallest error values and defining the k smallest error values as feature points of the search range.

12. The method as claimed in claim 11, wherein the test shape vector forming step of the second procedure does combination of the candidate feature points in different search ranges to thus form kn test shape vectors.

13. The method as claimed in claim 9, wherein the determining step of the second procedure further comprises the steps of:
using the average value of the aligned shape vectors and the principal components of the statistical face shape model to represent an approximate value of the test shape vector as





  
    x
    ≅
    
      
        x
        _
      
      +
      
        
          ∑
          
            j
            =
            1
          
          k
        
        ⁢
        
          
        
        ⁢
        
          
            b
            j
            x
          
          ⁢
          
            p
            j
            x
          
        
      
    
  
  ,




where x is a mean shape vector defined according to the mean value of the feature points of the aligned shape vectors, pjx is j-th principal component of the statistical face shape model, and bjx is a corresponding projection coefficient;
using a 2D scaled rigid transform algorithm to align the test shape vector represented by





  
    x
    ≅
    
      
        
          M
          ⁡
          
            (
            
              α
              ,
              θ
            
            )
          
        
        [
        
          
            x
            _
          
          +
          
            
              ∑
              
                j
                =
                1
              
              k
            
            ⁢
            
              
            
            ⁢
            
              
                b
                j
                x
              
              ⁢
              
                p
                j
                x
              
            
          
        
        ]
      
      +
      t
    
  
  ,




where θ, α and t are a rotating angle, a scaling factor and a shifting vector respectively;
computing a normalized distance of the aligned test shape vectors by





  
    
      d
      ⁡
      
        (
        x
        )
      
    
    =
    
      
        
          ∑
          
            j
            =
            1
          
          k
        
        ⁢
        
          
        
        ⁢
        
          
            (
            
              
                b
                j
                x
              
              
                λ
                j
                x
              
            
            )
          
          2
        
      
    
  
  ;




and
assigning one candidate feature point corresponding to one, having the smallest normalized distance, of the aligned test shape vectors as facial feature of the test face image.

14. The method as claimed in claim 9, wherein the determining step of the second procedure further comprises the steps of:
using the average value of the aligned shape vectors and the principal components of the statistical face shape model to represent an approximate value of the test shape vector as





  
    x
    ≅
    
      
        x
        _
      
      +
      
        
          ∑
          
            j
            =
            1
          
          k
        
        ⁢
        
          
        
        ⁢
        
          
            b
            j
            x
          
          ⁢
          
            p
            j
            x
          
        
      
    
  
  ,




where x is a mean shape vector defined according to the mean value of the feature points of the aligned shape vectors, pjx is j-th principal component of the statistical face shape model, and bjx is a corresponding projection coefficient;
using a 2D scaled rigid transform algorithm to align the test shape vector represented by





  
    x
    ≅
    
      
        
          M
          ⁡
          
            (
            
              α
              ,
              θ
            
            )
          
        
        [
        
          
            x
            _
          
          +
          
            
              ∑
              
                j
                =
                1
              
              k
            
            ⁢
            
              
            
            ⁢
            
              
                b
                j
                x
              
              ⁢
              
                p
                j
                x
              
            
          
        
        ]
      
      +
      t
    
  
  ,




where θ, α and t are a rotating angle, a scaling factor and a shifting vector respectively;
computing an error value between the test shape vector and the average value of the aligned test shape vectors by





  
    
      ɛ
      ⁡
      
        (
        x
        )
      
    
    =
    
      
        
          w
          1
        
        ⁢
        
          
            ∑
            
              i
              =
              1
            
            n
          
          ⁢
          
            
          
          ⁢
          
            
              
              
                
                  
                    I
                    i
                  
                  ⁡
                  
                    (
                    x
                    )
                  
                
                -
                
                  t
                  i
                
                -
                
                  
                    ∑
                    
                      j
                      =
                      1
                    
                    k
                  
                  ⁢
                  
                    
                  
                  ⁢
                  
                    
                      b
                      j
                      i
                    
                    ⁢
                    
                      p
                      j
                      i
                    
                  
                
              
              
            
            2
          
        
      
      +
      
        
          w
          2
        
        ⁢
        
          d
          ⁡
          
            (
            x
            )
          
        
      
    
  
  ,
  
    where
    ⁢
    
      
    
    ⁢
    
      
        ∑
        
          i
          =
          1
        
        n
      
      ⁢
      
        
      
      ⁢
      
        
          
          
            
              
                I
                i
              
              ⁡
              
                (
                x
                )
              
            
            -
            
              t
              i
            
            -
            
              
                ∑
                
                  j
                  =
                  1
                
                k
              
              ⁢
              
                
              
              ⁢
              
                
                  b
                  j
                  i
                
                ⁢
                
                  p
                  j
                  i
                
              
            
          
          
        
        2
      
    
  




is a similarity of the test shape vector to corresponding aligned shape vector xa, and d(x) is the normalized distance of the aligned test shape vectors; and
assigning one candidate feature point corresponding to one, having the smallest error value, of the test shape vectors as facial feature of the test face image.

15. The method as claimed in claim 14, wherein the error value is computed by an equation




  
    ɛ
    ⁡
    
      (
      x
      )
    
  
  =
  
    
      
        w
        1
      
      ⁡
      
        (
        
          
            ∑
            
              i
              =
              1
            
            n
          
          ⁢
          
            
          
          ⁢
          
            
              
                ∑
                
                  j
                  =
                  1
                
                k
              
              ⁢
              
                
              
              ⁢
              
                
                  (
                  
                    
                      b
                      j
                      i
                    
                    
                      λ
                      j
                      i
                    
                  
                  )
                
                2
              
            
          
        
        )
      
    
    +
    
      
        w
        2
      
      ⁢
      
        
          d
          ⁡
          
            (
            x
            )
          
        
        .