The aim of this project is to implement different classifiers to achieve face recognition given a set of faces and their corresponding labels. You need to split the data into training and testing sets and use the training data to train your classifiers. The whole pipeline is described in the following section.
This is a midterm project completed for ENEE633/CMSC828C Statistics and Pattern Recognition class University of Maryland College Park
Bayes’ Classifier
KNN
Kernel SVM
Boosted SVM
PCA
MDA
data.mat
200 subjects
3 faces per subject
size: 24 x 21
The file 'data.mat' has a variable ”face” of size (24x21x600). The images corresponding to the
person labeled n, n = {1, . . . , 200}, can be indexed in Matlab as face(:,:,3*n-2), face(:,:,3*n-1)
and face(:,:,3*n). The first image is a neutral face, the second image is a face with facial
expression, and the third image has illumination variations.
pose.mat
68 subjects
13 images per subject (13 different poses)
size: 48 x 40
The file 'pose.mat' has a variable "pose" of size 48x40x13x68.
pose(:,:,i,j) gives i^th image of j^th subject.
illumination.mat
68 subjects
21 images per subject (21 different illuminations)
size: 48x40
The file 'illumination.mat' has a variable "illum" of size 1920x21x68.
reshape(illum(:, i,j), 48, 40) gives i^th image of j^th subject.
Load the notebook in any compatible IDE and click run all.
All notebooks eveluate the classification first without dimensionality reduction, then with various variations of PCA followed by various variations of MDA
-
Bayes classifier: Bayes.ipynb -> runs illumination testing data against neutral and facial expression trainingdata for data.mat and prints accuracy at the end of each cell after classification. Similiar patter is followed forother data sets.
All 3 datasets are evaluated in this notebook -
k-Nearest Neighbors : KNN.ipynb -> ( Same as above ) runs illumination testing data against neutral and facialexpression training data for data.mat and prints accuracy at the end of each cell after classification. Similiarpatter is followed for other data sets.
All 3 datasets are evaluated in this notebook
- Bayes classifier: Bayes_Q2.ipynb -> Evaluates the data.mat data to classify neutral vs facial expression input with PCA, MDA and without it
- k-Nearest Neighbors: KNN_Q2.ipynb -> ( Same as above ) Evaluates the data.mat data to classify neutral vs facial expression input with PCA, MDA and without it
- Kernel SVM: SVM.ipynb -> Here the classification is done with three different kernels: rbf, polynomial and linear.
- Boosted Kernel SVM: SVM.ipynb -> Here the classification is done with PCA and using a linear kernel.
The helper classes and methods are present in the .py files:
Read and load train/test data:
get_train_test_data_2.py
get_train_test_data1.py
PCA, MDA:
pca.py
mda.py
Classifiers:
bayes_classifier.py
knn.py
svm.py