Top Banner
Face Recognition Using Eigenface Face Recognition A facial recognition system is a computer application for automatically identifying or verifying a person from a digital image or a video frame from a video source. One of the ways to do this is by comparing selected facial features from the image and a facial database. It is typically used in security systems and can be compared to other biometrics such as fingerprint or eye iris recognition systems. Algorithm Used The algorithm or approach used for this system is Eigenface. The eigenface face recognition system can be divided into two main segments: creation of the eigenface basis and recognition, or detection, of a new face. The prerequisite to understand eigenface is PCA (principal component analysis) algorithm. Basic Overview: PCA It is a way of identifying patterns in data, and expressing the data in such a way as to highlight their similarities and differences. Since patterns in data can be hard to find in data of high dimension, where the luxury of graphical representation is not available, PCA is a powerful tool for analysing data. The other main advantage of PCA is that once you have found these patterns in the data, and you compress the data, i.e. by reducing the number of dimensions, without much loss of information. Method 1. Get some data In this example we have taken 2D Data. x 2.5 0.5 2.2 1.9 3.1 2.3 2 1 1.5 1.1 y 2.4 0.7 2.9 2.2 3 2.7 1.6 1.1 1.6 0.9 2. Subtract the mean Find the mean of x and y and subtract them from data. The mean adjusted data for this example is shown below 0 0.5 1 1.5 2 2.5 3 3.5 0 1 2 3 4 Original Data x axis y axis
11

Face Recognition Using Eigenface

Nov 25, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Face Recognition Using Eigenface

Face Recognition Using Eigenface

Face Recognition

A facial recognition system is a computer application for automatically identifying or verifying a person from a digital image or a video frame from a video source. One of the ways to do this is by comparing selected facial features from the image and a facial database.

It is typically used in security systems and can be compared to other biometrics such as fingerprint or eye iris recognition systems.

Algorithm Used

The algorithm or approach used for this system is Eigenface. The eigenface face recognition system can be divided into two main segments: creation of the eigenface basis and recognition, or detection, of a new face. The prerequisite to understand eigenface is PCA (principal component analysis) algorithm.

Basic Overview: PCA

It is a way of identifying patterns in data, and expressing the data in such a way as to highlight their similarities and differences. Since patterns in data can be hard to find in data of high dimension, where the luxury of graphical representation is not available, PCA is a powerful tool for analysing data.

The other main advantage of PCA is that once you have found these patterns in the data, and you compress the data, i.e. by reducing the number of dimensions, without much loss of information.

Method

1. Get some data In this example we have taken 2D Data.

x 2.5 0.5 2.2 1.9 3.1 2.3 2 1 1.5 1.1

y 2.4 0.7 2.9 2.2 3 2.7 1.6 1.1 1.6 0.9

2. Subtract the mean Find the mean of x and y and subtract them from data. The mean adjusted data for this example is shown below

/x 0.69 -1.31 0.39 0.09 1.29 0.49 0.19 -0.81 -0.31 -0.71

/y 0.49 -1.21 0.99 0.29 1.09 0.79 -0.31 -0.81 -0.31 -1.01

3. Calculate the covariance matrix of -1.5 -1 -0.5 0 0.5 1 1.5-1.5

-1-0.5

00.5

11.5

Adjusted Data

x axis

y ax

is

0 0.5 1 1.5 2 2.5 3 3.50

0.51

1.52

2.53

3.5

Original Data

x axis

y ax

is

Page 2: Face Recognition Using Eigenface

mean adjusted data

cov. = 0.616555556 0.615444444

0.615444444 0.716555556

4. Calculate the eigenvectors and eigenvalues of the covariance matrixeigenvalues = 0.0490833989 1.28402771

eigenvectors = -0.735178656 -0.677873399

0.677873399 -0.735178656

5. Choosing components and forming a feature vectorThe vectors with the higher eigenvalues represents the majority of data.

Eigenface Approach

Eigenface is derived from PCA. So, same approach is been used with some addition with enhance the

performance. The data here is the images of individuals for whom you want to build the face recognition system. The system contains two major blocks, one is training and other is recognition.

Training

Training is a process in which you are educating the facial recognition system to process particular type of data, in our case face images.

1. Obtain face images I1, I2, ... , IM (training faces).

2. Represent every image Ii as a vector i. And make the image 1- channeled , 32 bit floating point.

3. Compute the average face vector .

4. Subtract the mean face from the all training images to obtain mean adjusted images.

5. Compute covariance matrix C.To find a covariance matrix for large number of images with each size as N2, is going to be computational intense.

-1.5 -1 -0.5 0 0.5 1 1.5-1.5

-1

-0.5

0

0.5

1

1.5

Column BColumn BLinear (Column B)Column BLinear (Column B)

NxN Image N2x1 Vector

Page 3: Face Recognition Using Eigenface

To reduce the operation, if number of images M is less then size of images N2, then compute the eigenvectors and values of AAT.

Taking the transpose of images vector will result to M eigenvectors and eigenvalues instead of N2.

6. Now, keep only K eigenvectors (corresponds to the K largest eigenvalues, PE (vk) ). We have chosen K as 20% of total number of images. There other way as well for the selection of the value of K, like, RMS of pixel-by-pixel error is nearly about 2%.

7. Form K Eigenfaces by multiplying PE vectors with mean adjusted images.

8. Then normalize the eigenfaces. Why it is important? The eigenfaces are the principal vectors of your database faces. So, by normalising them will make there length unit but won’t change the vectors direction (data pattern).

9. Find the weights vector of the training images. These weights describe the contribution of each eigenface in representing the input face image, treating the eigenfaces as a basis set for face images.

10. Next step is to find the threshold which makes the system intelligent to detect face in input/unknown images. The weight matrix of values using M eigenfaces, let’s define the face space as an M-dimensional sphere encompassing all weight vectors in the entire database. A fairly approximate radius of this face space will then be half the diameter of this sphere, or mathematically, half the distance between the furthest points in the sphere. So, - mean one will all i.e. first vector distance with rest and same fro all.

This completes the training of training images. The flow chart below will give the quick overview of the training process.

I1, I2, ... , IM

Page 4: Face Recognition Using Eigenface

i

Recognition

Recognition is a process in which the facial recognition system will try to recognize the input unknown image. The steps of recognition process are listed below.

1. Given an unknown face image Y.

2. Convert the image into image vector .

3. Subtract the mean from the unknown image.

4. Calculate the weights of this mean adjusted image by multiplying it with the eigenface vectors.

5. Project it into eigenspace by the weight vectors with eigenface vectors.

6. Find the Euclidian distance ( ) between the mean adjusted unknown image ( ) and projected image ( ). Projected image is actually a recovered image form eigenfaces. So, if the unknown image has a face then it will have minimum distance.

Page 5: Face Recognition Using Eigenface

7. Now, if about image has a face, then we need to check if it belong to our database. Find the Euclidian distance between the weights of the unknown image and weights of all training image (one against all). The minimum distance indicates a “match”. For example the minimum distance for training image number “k”, then the unknown image of the person at number “k”.

8. At Last we have a decision logic which defined as follows

This completes the recognition process. The flow chart below will give the quick overview of the recognition process.

(see Threshold for )

Image Not Face Known Face, Image Number “k” Unknown Face

Page 6: Face Recognition Using Eigenface

Thresholds

Deciding thresholds for facial recognition system is very critical process. We cannot expect a simple formula or equation to decide threshold for this system. It is been chosen heuristically doing data analysis (also see K-nearest neighbor algorithm).

Page 7: Face Recognition Using Eigenface

Threshold c

This threshold helps in identifying face in a given image. The formula to get to obtain the value of it is discussed above.

Threshold This threshold helps in identifying a known person in a given image. This threshold is been decided heuristically. In ORL Dataset, we have trained the system with first 9 images of each individual and recognition test was run. Obtain the maximum for all the cases. Similarly, run 3-4 test more test and make the maximum value among all as .In case, database is huge then 1-2 test can make fare decision.

An overview of the system with face images

Implementation

The software implementation is written in C using OpenCV and CLAPACK libraries. OpenCV is used for computer vision like reading, editing, display of images etc. And CLAPACK is used for dense mathematics calculation like eigenvectors, matrix multiplication etc. The software has two set of code one written for training and other written for recognition. A brief idea about both the codes is listed below.

Training

Training process is already discussed above and the code is implemented in the exact same way the flow chart is drawn.

1. Libraries : cv.h and highgui.h are opencv headers and f2c.h and clapack.h are clapack headers. Cblas.h is the header of CBLAS library, which is required to run CLAPACK.

Page 8: Face Recognition Using Eigenface

2. Define: There are four variables constants need to be defined by the user.

1. IMAGE_NUM : define the total number of images in training set.

2. IMAGE_WIDTH : defines the width of image.

3. IMAGE_HEIGHT : defines the height of image. Image size is normally width x height.

4. eigenface_num : used for debugging purpose, shows the eigenface.

3. The first step in flow is save the images in vector format. That is done with

Reference:

1. A tutorial on Principal Components Analysis by Lindsay I Smith.

2. Eigenfaces for Recognition by Matthew Turk and Alex Pentland

3. Learning OpenCV Gary Bradski and Adrian Kaehler

4. PERFORMANCE AND EVALUATION OF FACE RECOGNITION ALGORITHMS by Arati Kothari1 and Sampatkumari Maruti Bandagar World Journal of Science and Technology 2011, 1(12): 01-05 ISSN: 2231 – 2587 www.worldjournalofscience.com

5. Analyzing PCA-based Face Recognition Algorithms: Eigenvector Selection and Distance Measures by Wendy S. Yambor Bruce A. Draper J. Ross Beveridge Colorado State University.

6. Implementation of face recognition system in Virtex II Pro platform by Ameni YENGUI JAMMOUSSI, Sameh FAKHFAKH GHRIBI and Dorra SALLAMI MASMOUDI.

7. Face Recognition Using PeA-Based Method by Tahia Fahrin Karim, Molla Shahadat Hossain Lipu, Md. Lushanur Rahman, Faria Sultana 978-1-4244-6932-1110/$26.00 ©2010 IEEE

8. Face Recognition: Eigenface, Elastic Matching, and Neural Nets by JUN ZHANG, MEMBER, IEEE, YONG YAN, MEMBER, IEEE, AND MARTIN LADES, MEMBER, IEEE

9. Face Recognition using Eigenfaces and Neural Networks by 1Mohamed Rizon, 2Muhammad Firdaus Hashim, 2Puteh Saad, 1Sazali Yaacob American Journal of Applied Sciences 2 (6): 1872-1875, 2006 ISSN 1546-9239

10. Face Recognition using Eigenfaces by Marshall B. Robinson, Matthew Escarra, Jon Krueger, Doug Kochelek

11. Face Recognition Using Improved Fast PCA Algorithm by Neerja and Ekta Walia 978-0-7695-3119-9/08 $25.00 © 2008 IEEE

12. Face recognition using the mixture-of-eigenfaces method by Hyun-Chul Kim, Daijin Kim *, Sung Yang Bang www.elsevier.com/locate/patrec

13. Face Recognition: Robustness of the ‘Eigenface’ Approach by Carmen Au1, Jean-Sebastien Legare2 & Reehan Shaikh2

14. A New Fast Facial Recognition Algorithm Applicable to Large Databases by Moataz M. Abdelwahab Wasfy B. Mikhael 1-4244-0417-7/06/$20.00 ©2006 IEEE

15. An Efficient FPGA Implementation of Principle Component Analysis based Network Intrusion Detection System by Abhishek Das Sanchit Misra Sumeet Joshi† Joseph Zambreno‡ Gokhan Memik Alok Choudhary 978-3-9810801-3-1/DATE08 © 2008 EDAA

16. FPGA-Based Face Detection System Using Haar Classifiers by Junguk Cho† Shahnam Mirzae Jason Oberg‡ Ryan Kastner

Page 9: Face Recognition Using Eigenface

17. Design and Implementation of an FPGA-based Real-Time Face Recognition System by Janarbek Matai, Ali Irturk and Ryan Kastner

18. Hardware Acceleration of Multi-view Face Detection by Junguk Cho, Bridget Benson, and Ryan Kastner

19. Statistical Models for Face Recognition System With Different Distance Measures by R.Thiyagarajan S.Arulselvi G.Sainarayanan

20. Face Detection, Recognition and Reconstruction using Eigenfaces by Sezin Kaymak

21. Multi-Pipeline Architecture for face recognition on FPGA by Sathaporn Visakhasart and Orachat Chitsobhuk

22. A New Optimized Approach to Face Recognition Using EigenFaces by Sheifali Gupta [1], O.P.Sahoo [2], Ajay Goel[3], Rupesh Gupta

23. PARALLEL ARCHITECTURE FOR PCA IMAGE FEATURE DETECTION USING FPGA Fang Zhong, David W. Capson Derek C. Schuurman

24. PCA BASED FACE RECOGNITION AND TESTING CRITERIA BRUCE POON, M. ASHRAFUL AMIN2, HONG YAN

25. Performance of Mahalanobis Distance in Face Recognition System Dr.S.Valarmathy, 2M.Arun Kumar and 3S.Sruthi

26. A Nonparametric Statistical Comparison of Principal Component and Linear Discriminant Subspaces for Face Recognition J. Ross Beveridge, Kai She and Bruce A. Draper Geof H. Givens

27. Recent Advances in Face Recognition Edited by Kresimir Delac, Mislav Grgic and Marian Stewart Bartlett

28. Two-Dimensional PCA: A New Approach to Appearance-Based Face Representation and Recognition Jian Yang, David Zhang, Alejandro F. Frangi, and Jing-yu Yang