Git Product home page Git Product logo

facial-recognition's Introduction

cs221_project

This repository contains the Tensorflow codebase of our implementation to tackle the task Facial Expression Recognition and this is the project we have done for Stanford course CS221: Artificial Intelligence. We train MLP (Multiple-layer Perceptron) and CNN (Convolutional Neural Network) models to tackle the classification task. We use the training data from Kaggle Facial Expression Recognition Challenge and our best model achieves 69.0% of testing accuracy, approaching the state of the art method as stated in the Kaggle Leadboard.

Detailed Project Report:

http://www.cs.stanford.edu/~kaichun/resume/cs221_project_report.pdf

Data Download and Pre-processing

  • All data can be downloaded from the official Kaggle challenge webpage: Kaggle Facial Expression Recognition Challenge

  • We convert the data into HDF5 file format by running the script

          python write_hdf5.py
    
  • We use the following script to compute the mean and scale of the training images in order to perform whitening during training and testing.

          python compute_mean_scale.py
    

Code Organization

  • All the codes are in the exp folder.

  • exp/cnn contains the code for our CNN experiments

  • exp/fcn contains the code for our MLP experiments

  • The other Python scripts under exp folder are used to draw the training curves, confusion matrix and other analysis and visualization that are presented in the final report.

  • Insides each of exp/cnn and exp/mlp folders, there are three main Python scripts: train.py, model.py, eval.py. Different version of the three files exist in both folders. They are different variants of training scripts and network architectures that we experimented.

  • To train a model, you should run train.py like the following

          python train.py [python_model_file_prefix] --gpu [gpu_id] --batch [batch_size] 
          --epoch [training_epochs] --describe [other_descriptive_comments_for_this experiments] --wd [weight_decay]
    

Run the following command to get the detailed usage for train.py.

        python train.py -h
  • Network architecture are defined in model.py.

  • After training, we use eval.py script to test the model on testing split by running the following command.

          python eval.py [python_model_file_prefix] [path_to_pretrained_model_checkpoint] [output_file] --gpu [gpu_id] --batch [batch_size]
    

[output_file] stores the logs of this evaluation.

Contact

Webpage: http://www.cs.stanford.edu/~kaichun/

E-mail: kaichun [at] cs.stanford.edu

facial-recognition's People

Contributors

daerduocarey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

facial-recognition's Issues

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.