+ All Categories
Home > Documents > Face Detection Using PCA

Face Detection Using PCA

Date post: 07-Apr-2018
Category:
Upload: thinh-nguyen
View: 224 times
Download: 0 times
Share this document with a friend

of 32

Transcript
  • 8/3/2019 Face Detection Using PCA

    1/32

    Face Detection using Principal

    Component Analysis

    Abhishek Roy Anuj Jain Arpit Gupta

    2K3/EC/603 2K3/EC/613 2K3/EC/614

    Guide: Ms S Indu, ECE Dept, DCE

  • 8/3/2019 Face Detection Using PCA

    2/32

    To do face detection using Principal Component Analysis (PCA).

    Objective

  • 8/3/2019 Face Detection Using PCA

    3/32

    Why face detection ?

    Various potential applications, such as

    Applications in biometrics

    Video surveillance

    Human-computer interaction.

    Image database management systems

  • 8/3/2019 Face Detection Using PCA

    4/32

    Principal Components Analysis

    It is a way of identifying patterns in data, and expressing the

    data in such a way as to highlight their similarities and

    differences.

    Eigenvector approach Data Compression

  • 8/3/2019 Face Detection Using PCA

    5/32

    Some important terms

    Standard Deviation -- a measure of how spread out the

    data is.

    Variance -- is the square of standard deviation.

    These two measures are purely 1-dimensional.

  • 8/3/2019 Face Detection Using PCA

    6/32

    Covariance -- is always measured between 2 dimensions.

    Covariance is the measure of how much two random variables

    vary together. If the value is +ve then both dimensions increase

    together & if ve, they are inversely proportional.

  • 8/3/2019 Face Detection Using PCA

    7/32

    Covariance Matrix

    where S is the covariance matrix, sjk

    is the covariance of

    variables Xj

    and Xk

    when j

    k and the diagonal element

    sjj

    is

    the variance of variable Xj

    when j = k.

  • 8/3/2019 Face Detection Using PCA

    8/32

    Method

    1. Obtain the data in the form of a matrix.

    2. Obtain the covariance matrix for the data.

    3. Calculate the eigenvectors and eigenvalues of the covariance

    matrix. The eigenvector with the highesteigenvalue is the

    principle componentof the data set.

    4. Select the eigenvectors with the highest eigenvalues and

    form a matrix which is smaller in size compared to the data

    matrix.

  • 8/3/2019 Face Detection Using PCA

    9/32

    PCA projects the data along the directions

    where the data varies the most.

    Directions are determined by the eigenvectors of the

    covariance matrix corresponding to the largest eigenvalues

  • 8/3/2019 Face Detection Using PCA

    10/32

    EIGENFACES

    Set of eigenvectors

    Develpoed by Matthew Turk and Alex Pentland

    Eigenfaces can be extracted out of the image

    data by means of the mathematical tool called

    Principal Component Analysis (PCA)

    http://en.wikipedia.org/wiki/Image:Eigenfaces.png
  • 8/3/2019 Face Detection Using PCA

    11/32

    Face detection based on eigenface approach

    Acquire a set of training images of same size.

    Calculate the covariance matrix for the training set.

    Calculate the eigenfaces from the covariance matrix,

    keeping only the bestMimages with the highest eigenvalues.

    TheseMimages define the face space.

  • 8/3/2019 Face Detection Using PCA

    12/32

    Given an image, calculate a set of weights of theM

    eigenfaces by projecting it onto each of the eigenfaces

    Determine if the image is a face at all by checking tosee if the image is sufficiently close to the face space

  • 8/3/2019 Face Detection Using PCA

    13/32

    Image Representation

    A square, N by N image can be expressed as an N2dimensional vector.

    Say we have 20 images. Each image is N

    pixels high by

    N pixels wide. Write each image as an image vectorand put all the images together in one big image-matrixlike this:

  • 8/3/2019 Face Detection Using PCA

    14/32

    The Space of Faces

    An image is a point in a high dimensional

    space

    x is an image of N pixels anda point in N-dimensional space

    x

    Pixel2

    gray

    value

    Pixel 1 gray value

  • 8/3/2019 Face Detection Using PCA

    15/32

    Training Set

  • 8/3/2019 Face Detection Using PCA

    16/32

    Experiment

    JAFFE image database 20 images(M) 256 x 256 (N x N)

    Each image converted into a column vector of N2 x 1

    Column vectors stacked together to get a matrix (N2 x M)

    Covariance matrix needed (N2 x N2) over 4 billionentries

    Calculate eigenvectors of the covariance matrix

  • 8/3/2019 Face Detection Using PCA

    17/32

    Problem: Size of Covariance Matrix C

    Each data point is N2 -dimensional (N2 pixels)

    The size of covariance matrix A is N2 x N2

    The number of eigenfaces is N2

    Example: For N2 = 256 x 256 pixels,

    Size of C will be 65536 x 65536 !

    Number of eigenvectors will be 65536 !

    Typically, only a few eigenvectors suffice. So, this methodis very inefficient!

  • 8/3/2019 Face Detection Using PCA

    18/32

    Efficient Computation of Eigenvectors

    If B is N2xM and MMxM

    M number of images, N2 number of pixels

    use BTB instead, eigenvector of BTB is easily

    converted to that of BBT

    (BTB) y = e y

    => B(BTB) y = e (By)

    => (BBT)(By) = e (By)

    => By is the eigenvector of BBT

  • 8/3/2019 Face Detection Using PCA

    19/32

    Eigenfaces PCA extracts the Eigenfaces of the set of images

    Gives a set of vectors v1,v2,v3

    Each vector represents a dimension in the face space

    What do they look like?

  • 8/3/2019 Face Detection Using PCA

    20/32

    Projecting an image onto face space

    The eigenfaces v1vk span the face space.

    A face is projected onto eigen coordinates by

    )

    a9v9 a10v10

  • 8/3/2019 Face Detection Using PCA

    21/32

    Projections

  • 8/3/2019 Face Detection Using PCA

    22/32

    Procedure

    1. Process the image database (training set of images)

    Run PCAcompute eigenfaces

    2. Given a new image (to be detected) x, calculate K coefficients

    3. Detect if x is a face

  • 8/3/2019 Face Detection Using PCA

    23/32

    Detection

    Result

  • 8/3/2019 Face Detection Using PCA

    24/32

    Result

    Image name Distance

    Images part of the training set

    KA.HA1.29 3.0430e+012

    MK.NE3.115 1.4271e+012

    Images not part of training set but belonging to people in the

    set

    YM.HA2.53 4.4622e+012

    KA.NE2.27 1.3121e+012

  • 8/3/2019 Face Detection Using PCA

    25/32

    Images with no relation to the training set

    Containing a face

    lena 2.6338e+012

    Not containing a face

    nens 7.9097e+012

    wheel 8.8347e+012grey 3.4745e+012

    2356R 8.9020e+012

    CT_scan 5.9903e+012

    Lone 3.8256e+012

  • 8/3/2019 Face Detection Using PCA

    26/32

    Threshold value

    Threshold value = 3.4745e+12 (corresponding to image grey)

    fails to detect a face in the image -- YM.HA2.53.

    If the threshold value is increased to the distance corresponding

    to the image -- YM.HA2.53, then 100% detection takes place but

    accuracy goes down as the program will detect faces in images

    with no human face in them.

    Also, the image nens consists of a number of faces, but they are

    not detected.

  • 8/3/2019 Face Detection Using PCA

    27/32

    Implementation

    MATLAB

    Imread

    Reshape

    DoubleClear

    Eig

    Zeros

    Pdist

    Uint8

  • 8/3/2019 Face Detection Using PCA

    28/32

    Eigenfaces summary in words

    Eigenfaces are the eigenvectors of the covariance matrixobtained from the training set.

    Eigenfaces are the standardized face ingredients derivedfrom the statistical analysis of many pictures of humanfaces

    A human face may be considered to be a combination ofthese standardized faces

  • 8/3/2019 Face Detection Using PCA

    29/32

    Conclusion

    Project images onto a low-dimensional linear subspace

    face space, defined by eigenfaces.

    The distance between an image and its projection in face

    space is compared to a threshold value determined

    experimentally.

    This approach was tested on a number of images giving gooddetection results.

  • 8/3/2019 Face Detection Using PCA

    30/32

    Advantage

    Ease of implementation

    Simplicity of the maths behind the concept.

    No knowledge of geometry or specific feature of the

    face is required.

  • 8/3/2019 Face Detection Using PCA

    31/32

    Limitation

    Applicable only to front views

    Input images should be of the same type(size, color,

    etc) as the images in the trainig set

    Refrences

  • 8/3/2019 Face Detection Using PCA

    32/32

    Refrences

    1.Eigenfaces for recognition, M. Turk and A. Pentland

    2. Face recognition using eigenfaces, M. Turk and A. Pentland

    3. Stellar Spectral Classification using Principal Component

    Analysis and artificial neural networks, Harinder P Singh, Ravi KGulati and Ranjan Gupta

    4. http://en.wikipedia.org/wiki/Eigenface

    5. http://en.wikipedia.org/wiki/Principal_Component_Analysis

    6. Advanced Engineering Mathematics by Erwin Kreyszig

    7. JAFFE image database "Coding Facial Expressions with Gabor

    Wavelets, Michael J. Lyons, Shigeru Akamatsu, Miyuki Kamachi,

    Jiro Gyoba


Recommended