Giter VIP home page Giter VIP logo

kavyadevd / face-pose-illumination-classifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12.36 MB

Label classification for three datasets: Face, Pose and Illumination. Bayes Classifier, KNN Classier, Kerner SVM and Boosted SVM algorithms are written from scratch in Python. The results were evaluated and compared to understand the effectr of dimentionality reduction techniques including PCA, LDA and MDA validation using K-fold cross validation.

License: Apache License 2.0

Jupyter Notebook 98.83% Python 1.17%
bayes-classifier boosted-svm k-fold-cross-validation kernel-svm knn lda machine-learning mda pca

face-pose-illumination-classifier's Introduction

Face, Pose, Illumination Classifier

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.

Setup1        

This is a midterm project completed for ENEE633/CMSC828C Statistics and Pattern Recognition class University of Maryland College Park

Classifiers implemented:

Bayes’ Classifier
KNN
Kernel SVM
Boosted SVM

Dimensionality reduction methods implemented:

PCA
MDA

Dataset:

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.

Steps to run:

Wrapper code that calls the methods to classify is present in the Jupyter notebooks

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

Part 1:

  1. 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

  2. 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

Part 2:

  1. Bayes classifier: Bayes_Q2.ipynb -> Evaluates the data.mat data to classify neutral vs facial expression input with PCA, MDA and without it
  2. 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
  3. Kernel SVM: SVM.ipynb -> Here the classification is done with three different kernels: rbf, polynomial and linear.
  4. Boosted Kernel SVM: SVM.ipynb -> Here the classification is done with PCA and using a linear kernel.

Helper classes:

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

Some of the Graph outputs are present in the result folder

face-pose-illumination-classifier's People

Contributors

kavyadevd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.