Sie sind auf Seite 1von 9

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 prere"uisite to understand eigenface is #$A %principal component analysis& algorithm.
Basic Overview: PCA
It is a way of identifying patterns in data! and e'pressing the data in such a way as to highlight their
similarities and differences. (ince patterns in data can be hard to find in data of high dimension! where the
lu'ury of graphical representation is not available! #$A is a powerful tool for analysing data.
The other main advantage of #$A 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.
)ethod
*. +et some data
In this e'ample we have ta,en -. .ata.
' -./ 0./ -.- *.1 2.* -.2 - * *./ *.*
y -.3 0.4 -.1 -.- 2 -.4 *.5 *.* *.5 0.1
-. (ubtract the mean
Find the mean of ' and y and subtract
them from data. The mean ad6usted
data for this e'ample is shown below
7' 0.51 8*.2* 0.21 0.01 *.-1 0.31 0.*1 80.9* 80.2* 80.4*
7y 0.31 8*.-* 0.11 0.-1 *.01 0.41 80.2* 80.9* 80.2* 8*.0*
2. $alculate the covariance matri' of
-1.5 -1 -0.5 0 0.5 1 1.5
-1.5
-1
-0.5
0
0.5
1
1.5
Adjusted Data
x axis
y

a
x
i
s
0 0.5 1 1.5 2 2.5 3 3.5
0
0.5
1
1.5
2
2.5
3
3.5
Original Data
x axis
y

a
x
i
s
mean ad6usted data
cov. : 0.5*5/////5 0.5*/333333
0.5*/333333 0.4*5/////5
3. $alculate the eigenvectors and eigenvalues of the covariance matri'
eigenvalues : 0.0310922191 *.-930-44*
eigenvectors : 80.42/*495/5 80.544942211
0.544942211 80.42/*495/5
/. $hoosing components and forming a feature vector
The vectors with the higher eigenvalues represents the ma6ority of data.
Eigenface Approach
Eigenface is derived
from #$A. (o! 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 ma6or bloc,s! 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.
*. Obtain face images I
1
! I
2
! ... ! I
M
%training faces&.
-. Represent every image I
i
as a vector
i
. And ma,e the image *8 channeled ! 2- bit floating
point.
2. $ompute the average face vector .

=
=
M
i
i
M
1
1
3. (ubtract the mean face from the all training images to obtain mean ad6usted images.
=
i
/. $ompute covariance matri' $.
To find a covariance matri' for large number of images with each si;e as <
-
! 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 B
Column B
Linear (Column B)
Column B
Linear (Column B)
! "mage

#
!$ %ector
matrix) M (N ] , , [ = A Where
matrix) N (N AA =
M
= C
M
M
= n
T T
n n

2
2 1
1
2 2
....
1
To reduce the operation! if number of images ) is less then si;e of images <
-
! then compute
the eigenvectors and values of AA
T
.
scalars are and vectors are v and Av = u where u = C
Av = CAv
Av = Av AA
v = Av A
i i i i i i i
i i i
i i i
T
i i i
T

Ta,ing the transpose of images vector will result to ) eigenvectors and eigenvalues instead
of <
-
.
5. <ow! ,eep only = eigenvectors %corresponds to the = largest eigenvalues! #E %v
,
& &. >e have
chosen = as -0? of total number of images. There other way as well for the selection of the
value of =! li,e! R)( of pi'el8by8pi'el error is nearly about -?.
4. Form = Eigenfaces by multiplying #E vectors with mean ad6usted images.
M) , ( = l where v = u
M
=
l l
2,...... 1,
1

9. Then normali;e the eigenfaces. >hy it is important@ The eigenfaces are the principal vectors
of your database faces. (o! by normalising them will ma,e there length unit but wonAt
change the vectors direction %data pattern&.
1. 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.

i
=[
*
i

-
i
.. . .. .
k
i
] i=*! -! . . .. M

k
=u
k
T

i
*0. <e't step is to find the threshold which ma,es the system intelligent to detect face in
input7un,nown images. The weight matri' of values using ) eigenfaces! letAs define the
face space as an )8dimensional sphere encompassing all weight vectors in the entire
database. A fairly appro'imate 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. (o! 8


mean one will all i.e. first vector distance with rest and same fro all.

) ( max
2
1 2
c
= !

This completes the training of training images. The flow chart below will give the "uic, overview of
the training process.
I
1
! I
2
! ... ! I
M

i

M
= i
i
"
M
= #
1
1
# " =
i i

matrix) M (N ] , , [ = A Where
matrix) N (N AA =
M
= C
M
M
= n
T T
n n

2
2 1
1
2 2
....
1
CAv
i
=
i
Av
i

v
u
l
=

k=*
M
v
lk

i
=[
*
i

-
i
.. . .. .
k
i
] i=*! -! . . .. M

k
=u
k
T

i
) ( max
2
1 2
c
= !
Recognition
Recognition is a process in which the facial recognition system will try to recogni;e the input un,nown
image. The steps of recognition process are listed below.
*. +iven an un,nown face image B.
-. $onvert the image into image vector .
2. (ubtract the mean from the un,nown image.
ima$es trainin$ o% mean the is where
" =


3. $alculate the weights of this mean ad6usted image by multiplying it with the eigenface
vectors.
] ..... [
2 1
T
i i
& & & =
u = &

/. #ro6ect it into eigenspace by the weight vectors with eigenface vectors.


i

= i
i
u & =

1
5. Find the Euclidian distance %

& between the mean ad6usted un,nown image % & and


pro6ected image %

&. #ro6ected image is actually a recovered image form


eigenfaces. (o! if the un,nown image has a face then it will have minimum
distance.
2

=
4. <ow! if about image has a face! then we need to chec, if it belong to our database. Find the
Euclidian distance between the weights of the un,nown image and weights of all training
image %one against all&. The minimum distance indicates a CmatchD. For e'ample the
minimum distance for training image number C,D! then the un,nown image of the person at
number C,D.
M] , [ = where ' ' = (

.... 2, 1,
2

9. At East we have a decision logic which defined as follows


This completes the recognition process. The flow chart below will give the "uic, overview of the
recognition process.
c
! ) ( ! * ( ! * (
c
&
%see Threshold for &
! ( ! * (
c
&
Image <ot Face =nown Face! Image <umber C,D Un,nown Face

Thresholds
.eciding thresholds for facial recognition system is very critical process. >e cannot e'pect a simple
formula or e"uation to decide threshold for this system. It is been chosen heuristically doing data
analysis %also see =8nearest neighbor algorithm&.
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 ,nown person in a given image. This threshold is been decided
heuristically. In ORE .ataset! we have trained the system with first 1 images of each individual and
recognition test was run. Obtain the ma'imum

for all the cases. (imilarly! run 283 test more test and
ma,e the ma'imum value among all as . In case! database is huge then *8- test can ma,e fare decision.
An overview of the system with face images
"mplementation
The software implementation is written in $ using Open$F and $EA#A$= libraries. Open$F is used
for computer vision li,e reading! editing! display of images etc. And $EA#A$= is used for dense
mathematics calculation li,e eigenvectors! matri' 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 e'act same way the flow
chart is drawn.
*. Eibraries cv.h and highgui.h are opencv headers and f-c.h and clapac,.h are clapac, headers.
$blas.h is the header of $GEA( library! which is re"uired to run $EA#A$=.
-. .efine There are four variables constants need to be defined by the user.
*. I)A+EH<U) : define the total number of images in training set.
-. I)A+EH>I.TI : defines the width of image.
2. I)A+EHIEI+IT : defines the height of image. Image size is normall width x height.
3. eigenfaceHnum : used for debugging !ur!ose, shows the eigenfa"e.
2. The first step in flow is save the images in vector format. That is done with
Reference
*. A tutorial on #rincipal $omponents Analysis by Eindsay I (mith.
-. Eigenfaces for Recognition by )atthew Tur, and Ale' #entland
2. Eearning Open$F Gary Bradski and Adrian Kaehler
3. #ERFOR)A<$E A<. EFAEUATIO< OF FA$E RE$O+<ITIO< AE+ORITI)(
by Arati =othari* and (ampat,umari )aruti Gandagar World Journal of Siene and
Tehnolo!y 2"11# 1$12%& "1'"( I((< --2* J -/94 www.world6ournalofscience.com
/. Analy;ing #$A8based Face Recognition Algorithms Eigenvector (election and
.istance )easures by >endy (. Bambor Gruce A. .raper K. Ross Geveridge $olorado
(tate University.
5. "mplementation of face recognition system in %irte! "" Pro platform &y Ameni
BE<+UI KA))OU((I! (ameh FA=IFA=I +IRIGI and .orra (AEEA)I
)A()OU.I.
4. Face Recognition Using #eA8Gased )ethod by Tahia Fahrin =arim! )olla (hahadat
Iossain Eipu! )d. Eushanur Rahman! Faria (ultana 1498*83-338512-8***07L-5.00
M-0*0 IEEE
9. Face Recognition Eigenface! Elastic )atching! and <eural <ets by KU< NIA<+!
)E)GER! IEEE! BO<+ BA<! )E)GER! IEEE! A<. )ARTI< EA.E(! )E)GER!
IEEE
1. Face Recognition 'sing Eigenfaces and e'ral etwor(s &y *)ohamed Ri;on!
-)uhammad Firdaus Iashim! -#uteh (aad! *(a;ali Baacob American Kournal of
Applied (ciences - %5& *94-8*94/! -005 I((< */3581-21
*0. Face Recognition using Eigenfaces by )arshall G. Robinson! )atthew Escarra! Kon
=rueger! .oug =ochele,
**. Face Recognition Using "mproved Fast PCA Algorithm &y <eer6a and E,ta >alia
149808451/82**181709 L-/.00 M -009 IEEE
*-. Face recognition using the mi'ture8of8eigenfaces method by Iyun8$hul =im! .ai6in
=im O! (ung Bang Gang www.elsevier.com7locate7patrec
*2. Face Recognition: Ro&'stness of the )Eigenface* Approach &y $armen Au*! Kean8
(ebastien Eegare- P Reehan (hai,h-
*3. A <ew Fast Facial Recognition Algorithm Applicable to Earge .atabases by )oata; ).
Abdelwahab >asfy G. )i,hael *83-33803*4847057L-0.00 M-005 IEEE
*/. An Efficient FP+A "mplementation of Principle Component Analysis &ased
etwor( "ntr'sion ,etection -ystem &y Abhishe, .as (anchit )isra (umeet Koshi)
Koseph Nambreno* +o,han )emi, Alo, $houdhary 14982819*090*828*7.ATE09 M
-009 E.AA
*5. FP+A.Based Face ,etection -ystem Using /aar Classifiers &y Kungu, $hoQ
(hahnam )ir;ae Kason ObergR Ryan =astner
*4. .esign and Implementation of an F#+A8based Real8Time Face Recognition (ystem by
Kanarbe, )atai! Ali Irtur, and Ryan =astner
*9. Iardware Acceleration of )ulti8view Face .etection by Kungu, $ho! Gridget Genson!
and Ryan =astner
$01 -tatistical 2odels for Face Recognition -ystem 3ith ,ifferent ,istance 2eas'res
&y R1Thiyagara4an -1Ar'lselvi +1-ainarayanan
#51 Face ,etection6 Recognition and Reconstr'ction 'sing Eigenfaces &y -e7in 8ayma(
-*. 2'lti.Pipeline Architect're for face recognition on FP+A &y (athaporn Fisa,hasart
and Orachat $hitsobhu,
--. A <ew Optimi;ed Approach to Face Recognition Using EigenFaces by (heifali +upta
S*T! O.#.(ahoo S-T! A6ay +oelS2T! Rupesh +upta
-2. #ARAEEEE AR$IITE$TURE FOR #$A I)A+E FEATURE .ETE$TIO< U(I<+
F#+A +an! ,hon!# -avid W. Ca/son -erek C. Shuur0an
-3. #$A GA(E. FA$E RE$O+<ITIO< A<. TE(TI<+ $RITERIA GRU$E #OO<! ).
A(IRAFUE A)I<-! IO<+ BA<
-/. #erformance of )ahalanobis .istance in Face Recognition (ystem .r.(.Falarmathy!
-).Arun =umar and 2(.(ruthi
-5. A <onparametric (tatistical $omparison of #rincipal $omponent and Einear
,iscriminant -'&spaces for Face Recognition 91 Ross Geveridge! =ai (he and Gruce
A1 .raper +eof I. +ivens
-4. Recent Advances in Face Recognition Edited by =resimir .elac! )islav +rgic and
)arian (tewart Gartlett
-9. Two8.imensional #$A A <ew Approach to Appearance8Gased Face Representation
and Recognition Kian Bang! .avid Nhang! Ale6andro F. Frangi! and King8yu Bang

Das könnte Ihnen auch gefallen