Skip to content

Rohitth007/Face-Recognition-using-PCA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face-Recognition-using-PCA

This project uses the faces94 database to perform Face Recognition for 45 people using Principle Component Analysis.

Prinicple Component Analysis, also known as, Karhunen Loeve Transform (KLT) or Hotelling Transform is a data dependent transform which represents a stochastic process as a linear combination of orthogonal vectors such that it minimizes error and maximizes variance. Hence, this is often used for decorrelating data as the Covariance Matrix can be diagonalized to get a Decorrelation Efficiency of 100%, courtesy Spectram Theorem for Normal Matrices.

Turns out the rows of this unitary transform happens to be the eigenvectors of the Covariance matrix, in this case eigenfaces which look quite scary. This can be found using the SVD of X/√n, where X.X^T/n is the Covariance Matrix.

PCA really helps in dimentionality reduction as we can keep only those eigenfaces that contribute more to the data.

Original 100 PCs 50 PCs 25PCs 10PCs

Energy Packing Efficiency ( EPE, Cumulative Variance Ratio ) or Explained Variance Ratio ( Energy Fraction per Principle Component ) can be useful in deciding which dimension to use.

The model was trained using 10 images for each person by creating an "Average Face" of each person in the reduced eigen space. These along with the "Average Human Face" and the top x eigenfaces are stored in memory to recognize any new test image given from the same class.

Input Face Recognized Face

Use python3 pca.py to run the program

Database Description

  • Resolution: 180x200 (downscaled to 90x100)
  • Backgrounds: the background is plain green
  • Head Scale: none
  • Head turn,tilt and slant: very minor variation in these attributes
  • Position of face in image: minor changes
  • Image lighting variation: none
  • Expression variation: considerable expression changes
  • Additional comment: there is no individual hairstlyle variation as the images were taken in a single session.

Potential Issues of Basic PCA

  • Not robust to Shading, Illumination, Expressions, Hairstyles, Spectacles, Non Frontal Images
  • PCA works only for Linear Basis and Large Variance having importance

Potential Explorations

  • Try out different distance measures.
  • Try selecting only those eigenfaces which encode useful features.
  • Try ordering eigenfaces based on Like-Face characteristics.
  • Try preprocessing images to align faces, histogram equilize lighting/shading, etc.
  • Try tracking faces using DELAUNAY TRIANGULATION.
  • Try Kernel PCA

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages