F F ace ace R R ecognition ecognition E E igen-faces with 99 PCA igen-faces with 99 PCA coefficients coefficients Project Presentation Project Presentation Ashish Tiwari Ashish Tiwari MAS622J/1.126J MAS622J/1.126J Pattern Classification and Analysis Pattern Classification and Analysis
29
Embed
F ace R ecognition E igen-faces with 99 PCA coefficients Project Presentation Ashish Tiwari MAS622J/1.126J Pattern Classification and Analysis.
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
FFace ace RRecognitionecognitionEEigen-faces with 99 PCA igen-faces with 99 PCA
MAS622J/1.126JMAS622J/1.126JPattern Classification and AnalysisPattern Classification and Analysis
Problem StatementProblem Statement
• GivenGiven• 20002000 Training data points Training data points• 20002000 Test data points Test data points• faceDRfaceDR and and faceDSfaceDS: :
Description files for both Description files for both training and testing data training and testing data points.points.
• faceRfaceR: Matlab data file : Matlab data file containing 99 PCA containing 99 PCA coefficients for training coefficients for training imagesimages
• faceSfaceS: Matlab file : Matlab file containing 99 PCA containing 99 PCA coefficients for test coefficients for test images. images.
• Required to classifyRequired to classify
GenderGender MaleMale FemaleFemale
AgeAge ChilChildd
TeeTeenn
AduAdultlt
SeniSenioror
RacRacee
White /Hispanic/ Asian/ Black/ White /Hispanic/ Asian/ Black/ OtherOther
Facial Facial ExpressioExpressionsns
SerioSeriousus
FunFunnyny
SmilinSmilingg
HatHat YesYes NoNo
MoustachMoustachee
YesYes NoNo
GlassesGlasses YesYes NoNo
BandanaBandana YesYes NoNo
ObjectiveObjective
• The Objective is to implement, test and The Objective is to implement, test and compare performance of the various ‘ compare performance of the various ‘ Pattern Classification Algorithms ’ on Pattern Classification Algorithms ’ on
different facial features and to come up different facial features and to come up with a quantitative analysis of with a quantitative analysis of
effectiveness of Algorithms in different effectiveness of Algorithms in different scenarios.scenarios.
• To develop insight of a designer’s To develop insight of a designer’s perspective.perspective.
Summary of the WorkSummary of the Work
Parzen WindowParzen Window
K- nearest neighborhoodK- nearest neighborhood
Generalized linear discriminantGeneralized linear discriminant
Neural networkNeural network
BoostingBoosting (neural nets as component (neural nets as component classifiers)classifiers)
I have implemented all 5 Algorithms for almost I have implemented all 5 Algorithms for almost all feature classification excluding Facial all feature classification excluding Facial
Expressions.Expressions.
Bad Data IssuesBad Data Issues
As it invariably happens with any real-As it invariably happens with any real-world problem data base, this problem world problem data base, this problem also contains few bad faces, missing also contains few bad faces, missing
faces and outliers.faces and outliers.
In the implementation here the faces In the implementation here the faces with missing descriptors are taken out with missing descriptors are taken out from the data base where as outliers from the data base where as outliers
and bad faces are kept as it is.and bad faces are kept as it is.
• Developed in 1991 by Developed in 1991 by M.TurkM.Turk• Based on PCABased on PCA
• Relatively simpleRelatively simple• FastFast
&&• RobustRobust
EigenfacesEigenfaces• PCA seeks directions that are efficient PCA seeks directions that are efficient
for representing the datafor representing the data• PCA reduces the dimension of the dataPCA reduces the dimension of the data• Speeds up the computational timeSpeeds up the computational time
efficient
not effic
ient
Class A
Class B
Class A
Class B
Eigenfaces, the Eigenfaces, the algorithmalgorithm
• Original ImagesOriginal Images
2
1
2
N
h
h
h
2
1
2
N
b
b
b
2
1
2
N
a
a
a
……
Eigenfaces, the Eigenfaces, the algorithmalgorithm
• The mean face The mean face can be can be computed as:computed as:
Mean-FaceMean-Face
2 2 2
1 1 1
2 2 21, 8
N N N
a b h
a b hm where M
M
a b h
Eigenfaces, the Eigenfaces, the algorithmalgorithm
• Then subtract it from the training Then subtract it from the training facesfaces
2 2 2 2 2 2 2 2
2 2
1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2
1 1 1 1
2 2
, , , ,
,
m m m m
N N N N N N N N
m m
N N
a m b m c m d m
a m b m c m d ma b c d
a m b m c m d m
e m f m
e m fe f
e m
2 2 2 2 2 2
1 1 1 1
2 2 2 2 2 2, ,m m
N N N N N N
g m h m
m g m h mg h
f m g m h m
Eigenfaces, the Eigenfaces, the algorithmalgorithm
• Now we build the matrix which is Now we build the matrix which is NN22
by by MM
• The covariance matrix which is The covariance matrix which is NN22 by by NN22
m m m m m m m mA a b c d e f g h
Cov AA
Eigenfaces, the Eigenfaces, the algorithmalgorithm
• Find eigenvalues of the covariance matrixFind eigenvalues of the covariance matrix– The matrix is very largeThe matrix is very large– The computational effort is very bigThe computational effort is very big
• We are interested in at most We are interested in at most M (?)M (?) eigenvalueseigenvalues– And in the given problem we have taken 99 And in the given problem we have taken 99
most significant Eigen directions to most significant Eigen directions to represents the data.represents the data.
• Huge Dimensional space, few Huge Dimensional space, few training pointstraining points
• Very few examples of Very few examples of categories other than whitecategories other than white
• Classifiers tend to bias Classifiers tend to bias towards White class towards White class
• Caution: Even a trivial Caution: Even a trivial classifier (classify all as classifier (classify all as
white) can attain a accuracy white) can attain a accuracy of 85%of 85%
What is the solution?What is the solution?
• Gather more training Gather more training data of different data of different
classes.classes.
• Synthesize data from Synthesize data from existing ones.existing ones.
• Boosting Boosting
Race - Race - DiscussionDiscussionLet us try to scrutinize the reasons for fairly poor performance Let us try to scrutinize the reasons for fairly poor performance
ofof
the Parzen Window and K- nearest neighborhood methods.the Parzen Window and K- nearest neighborhood methods.
ReasonReason
1.1. Very few training points are given for the classes other than the Very few training points are given for the classes other than the white class (85%), so by the inherent structure of the dataset, white class (85%), so by the inherent structure of the dataset, the whites points are most likely to be present in any chosen the whites points are most likely to be present in any chosen volume in the space. volume in the space.
2.2. Also it is clear from the projection of data as if white data form a Also it is clear from the projection of data as if white data form a sphere in the space and other classes are wrapped around the sphere in the space and other classes are wrapped around the sphere like ribbons (this is also the case when the data sphere like ribbons (this is also the case when the data inherently don’t have that much dimension in which it is actually inherently don’t have that much dimension in which it is actually projected). Owing to the above mentioned reason whenever we projected). Owing to the above mentioned reason whenever we try to develop a volume around a point, it is more likely to try to develop a volume around a point, it is more likely to contain points of white data than one of itself because of its contain points of white data than one of itself because of its many fold character. many fold character.
3.3. Had it been these faces were projected onto lower dimensional Had it been these faces were projected onto lower dimensional space should have obtained better results for KNN and Parzen. space should have obtained better results for KNN and Parzen. ((IntuitionIntuition))
Fisher Projected Race Fisher Projected Race data on 3Ddata on 3D
Courtesy - Larissa
Results – Results – Age ClassificationAge Classification
KNNKNN Correctly Correctly ClassifiedClassified
AccuraAccuracycy
ChildChild 47/6847/68 69.1169.11%%
TeenTeen 0/830/83 0%0%
AdultAdult 1688/17301688/1730 97.5797.57%%
SenioSeniorr
1/1151/115 0.860.86%%
Overall Accuracy: Overall Accuracy: 86.97% 86.97%
ParzeParzenn
Correctly Correctly ClassifiedClassified
AccuraAccuracycy
ChildChild 23/6823/68 33.8233.82%%
TeenTeen 0/830/83 0%0%
AdultAdult 1707/17301707/1730 98.6798.67%%
SenioSeniorr
0/1150/115 0%0%
Overall Accuracy: Overall Accuracy: 86.67% 86.67%
Results – Results – Age ClassificationAge Classification
NNETNNET Correctly Correctly ClassifiedClassified
AccuraAccuracycy
ChildChild 12/6812/68
(3)(3)69.1169.11
%%
TeenTeen 10/8310/83
(3)(3)0%0%
AdultAdult 1390/17301390/1730
(1695)(1695)97.5797.57
%%
SenioSeniorr
19/11519/115
(1)(1)0.860.86
%%
Overall Accuracy: Overall Accuracy: 71.69% 71.69%
BoostiBoostingng
Correctly Correctly ClassifiedClassified
AccuraAccuracycy
ChildChild 16/6816/68 23.5223.52%%
TeenTeen 27/8327/83 32.5332.53%%
AdultAdult 1219/17301219/1730 70.4670.46%%
SeniorSenior 33/11533/115 28.6928.69%%
Overall Accuracy: Overall Accuracy: 64.87% 64.87%
Discussion - Discussion - Age ClassificationAge Classification
Q:Q: Although it looks like both child and teens are in almost Although it looks like both child and teens are in almost equal proportion (68 - 83) then why both KNN and Parzen equal proportion (68 - 83) then why both KNN and Parzen always favoring child over teen??always favoring child over teen??
A: A: This proportion is actually reflecting the fact about Testing This proportion is actually reflecting the fact about Testing set, whereas in Training set this thing is much more clearer set, whereas in Training set this thing is much more clearer where number of child (240) dominates number of teen data where number of child (240) dominates number of teen data points significantly. points significantly.
NNETNNET:: Although the evidence curve suggested highest Although the evidence curve suggested highest accuracy can accuracy can be achieved at n = 23 neurons in the hidden be achieved at n = 23 neurons in the hidden layer, I deliberately chosen layer, I deliberately chosen 8 neurons. The idea was to not 8 neurons. The idea was to not allow the net to build complex allow the net to build complex boundaries so that it may boundaries so that it may have good generalization on the unseen data. have good generalization on the unseen data. And the And the results support the argument too. Bracketed results are from results support the argument too. Bracketed results are from
n=23 neurons.n=23 neurons.
Boosting - Boosting - CommentsCommentsIn almost all of the implementations boosting helped In almost all of the implementations boosting helped improving performance of the week classes but have improving performance of the week classes but have not shown very encouraging results. The reasons I not shown very encouraging results. The reasons I sort out may besort out may be::
1.1. The amount of data needed to actually The amount of data needed to actually implement boosting implement boosting was not sufficient.was not sufficient.
2.2. In constructing the second dataset sometimes In constructing the second dataset sometimes we do not we do not find appropriate proportion to maximize find appropriate proportion to maximize disorder at the disorder at the same time utilizing full training same time utilizing full training resource. (A part of the resource. (A part of the expensive data set left expensive data set left unutilized)unutilized)
3.3. More often than not the condition to More often than not the condition to construct third data construct third data set further excludes most of set further excludes most of the remaining data points, the remaining data points, hence reducing the size hence reducing the size of available samples for training.of available samples for training.
NO BEARDNO BEARD 17201720 00 100%100%BEARDBEARD 00 276276 100%100%
Overall Accuracy: Overall Accuracy: 100% 100%
NNETNNET NONO YESYES AccuraAccuracycy
NO BEARDNO BEARD 16961696 2424 98.6098.60%%
BEARDBEARD 271271 55 1.841.84%%
Overall Accuracy: Overall Accuracy: 85.22% 85.22%
BOOSTINBOOSTINGG
NONO YESYES AccuraAccuracycy
NO BEARDNO BEARD 16881688 3232 98.1398.13%%
BEARDBEARD 6161 215215 77.8977.89%%
Overall Accuracy: Overall Accuracy: 95.34% 95.34%
ConclusionConclusion
In this project I have In this project I have made an effort to made an effort to compare various compare various algorithms on various algorithms on various classification tasks such classification tasks such as Gender, Age, Race as Gender, Age, Race and other properties and other properties like Hat, Moustache etc. like Hat, Moustache etc. and where ever possible and where ever possible I also tried to compare I also tried to compare the results obtained the results obtained from simplest ‘Minimum from simplest ‘Minimum distance classifier’distance classifier’
GenderGender PW, GLD, PW, GLD, KNNKNN
RaceRace NNETNNETAgeAge NNET NNET
with with BoostingBoosting
MoustachMoustache, Hat, e, Hat, Beard, Beard, Bandana, Bandana, GlassesGlasses