Giter Site home page Giter Site logo

tf_sklearn_facialrecog's Introduction

tf_sklearn_facialrecog

Evaluation of Eigenfaces System Luvai Hassanali
*sklearn, tensorflow, and matplotlib required (installed using pip3)

Notes:

  • /.cache folder contains LFW dataset
  • /experiments folder contains four .txt files with results from experimentation
  • /figures folder contains images used in paper and additional ones which were excluded There are 6 models discussed in my paper and 5 .py files (#2 contains two models). Each .py file can be run as is to display accuracy and time measurements discussed about in my paper:
  1. eigenfaces.py has the basic eigenface system:
  • running the file will load LFW set, split into test/training, calculate weights of training set, then classify the test set
  • the file will also display the first 12 eigenvectors computed by PCA
  • line 61 - 67 can be uncommented and the last 52 predictions will be visually displayed, examples of these figures are used in Figure 2 of my paper
  1. eigenfaces_v2.py contains implementation for Scikit-Learn eigenface system AND Scikit-Learn mlp model:
  • the .py file is setup to run scikit-learn eigenface system which uses KNN algorithm
  • it will load LFW set, split into test/training, project into eigenspace, then classify the test set
  • this file also contains implementation of mlp fully dependent on Scikit-Learn which is an experiment discussed in my paper
  • to change from knn to mlp implementation all you need to do is uncomment line 52 and comment line 53
  • with mlp classifier epoch + loss will be printed to console during execution and you can uncomment line 58-62 to display a plot of this
  • the end of the file will display plot for predictions and projections separately, regardless of implementation
  1. mlp.py contains TensorFlow implementation of MLP:
  • the file will load data and train for 100 epochs
  • accuracy is displayed to console every 10 epochs
  • line 64 - 71 can be uncommented to visualize last 10 epoch predictions
  • plot of accuracy over 100 epochs is displayed at end
  1. cnn_grey.py has implementation of CNN with greyscale input:
  • the file will load and split data then begin training for 20 epochs
  • accuracy at epoch will be printed to console for each epoch
  • top 4 patch plots along with orignal images (one for each class) will display at end
  1. cnn_rgb.py has implementation of CNN with RGB input:
  • the file will load and split data then begin training for 20 epochs
  • accuracy at epoch will be printed to console and patch plots will display at end
  • you may find it useful to reduce number of epochs as each version of the cnn takes about 10 minutes for 20

The /experiments folder contains four text files each with examples of accuracy results for the network specified:

  • cnn_greyscale_accuracy_different_ksize: results from testing different ksize on max pool layer on CNN with greyscale input
  • cnn_rgb_accuracy_different_ksize: results from teseting different ksize on max pool layer but with CNN that takes RGB input
  • mlp_accuracy_different_weights: results from different weight configurations of the 2 hidden layers of TensorFlow implementation of MLP
  • sklearn_mlp_loss_different_hidden: results from mlp fully-dependent on Scikit-Learn library from testing different number of hidden layer sizes

tf_sklearn_facialrecog's People

Contributors

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