Git Product home page Git Product logo

facial-expression-recognition-svm's Introduction

#Facial expression recognition using SVM

Extract face landmarks using Dlib and train a multi-class SVM classifier to recognize facial expressions (emotions).

##Motivation Fer2013 images are not aligned and it's difficult to classify facial expression from it.

The best accuracy for Fer2013 (as I know) is 67%, the author trained a Convolutional Neural Network during several hours in a powerful GPU to obtain this results. Let's try a much simpler (and faster) approach by extracting Face Landmarks and HOG features and feed them to a multi-class SVM classifier.

##Results:

/--------------------------------------------------------
| Features | 7 emotions | 5 emotions | |--------------------------------------------------------| | HoG features | 29.0% | 34.4% | | Face landmarks | 39.2% | 46.9% | | Face landmarks + HOG | 48.2% | 55.0% | |--------------------------------------------------------| | Max training time | 443 sec | 288 sec | --------------------------------------------------------/

While the training time is very short compared to CNN, we lost 19% in accuracy compared to the actual best result that uses CNN.

Note: It's possible to obtain better results by changing parameters. One may implement a hyperparameters search to find the best parameters.

##How to use

  1. Extract "fer2013_landmarks+hog.zip" file

  2. Install dependencies

pip install Numpy
pip install argparse
pip install sklearn
  1. Train model:
python train.py --train=yes
  1. Evaluate model

If you have already a pretrained model

python train.py --evaluate=yes
  1. Train and evaluate [instead of step 3 and 4]
python train.py --train=yes --evaluate=yes 

facial-expression-recognition-svm's People

Contributors

aminehorseman avatar

Watchers

James Cloos avatar Bo Wang 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.