Skip to content

mihir86/Emotion-Detection

 
 

Repository files navigation

Emotion-Detection

Codacy Badge

Introduction

This is an Emotion Detection project, which classifies the emotion of a person in the image into 'sad' and 'not sad' categories, with the help of Genetic Algorithms by making use of the best subset of features.

Method

  • Developed in Python, with the help of libraries like numpy, pandas, skit-learn and matplot.
  • Initially, the image dataset is preprocessed using the OpenFace Toolkit (http://cmusatyalab.github.io/openface), which generates a csv file containing the facial landmarks of each image fed in as an input.
  • These features are then normalized, and the dataset is divided into 70% for training, 10% for validation and 20% for testing.
  • To select the best features, the data is preprocessed by constructing a binary matrix which tells the user, whether to take the particular feature for classification or not.
  • 1: Represents feature selected in the best subset.
  • 0: Represents feature excluded from the best subset.
  • Next, the Genetic Algorithm runs over the training dataset, training the classifier models Logistic Regression and Support Vector Machine over the training dataset and validating them over the validation data.
  • Accuracy of the model = No. of correctly classified samples/ Total No. of Samples
  • The Genetic algorithm is implemeted with 3 different variations of Parent Selection, Crossover and Mutation.
  • Finally the best subset of features is obtained through the algorithm.

Hyperparameters:

(Tuned through Grid Search)

  • The type of parent selection technique
  • The type of crossover technique
  • The type of mutation technique
  • The type of classifier model
  • The No of Generations
  • The Population Size
  • The No. of Parents involved in mating
  • The Mutation Rate

Types of Parent Selection implemented

  • Rank Selection
  • Tournament Selection
  • Roulette wheel Selection

Types of Crossover implemented

  • Uniform crossover
  • Two point crossover
  • Single point crossover

Types of Mutation implemented

  • Bit flip mutation
  • Swap mutation
  • Inverse mutation

Types of Classification Models used

  • Logistic Regression
  • Support Vector Machines

Please check results.xlsx for more Details about the Results obtained.

About

Emotion Detection using OpenFace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.8%
  • Other 0.2%