Skip to content

brihati/Emotion-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emotion-Recognition

This repository deals with the recognition of emotions by extracting the facial expressions. I used Convolutional Neural Network for the same using the tflearn library. In total, I detected seven degrees of emotions: Angry, Disgusted, Happy, Fearful, Neutral, Sad and Surprised. My model achived an accuracy of 75% using the FER 2013 Dataset.

Preprocessing

In the preprocessing step, I scaled the images using standard deviation which was caculated from the sample data. Also, I zero sampled the images using the mean calculated from the sample data. These pre-processing methods were used both during the training and testing time.

CNN Model

self.network = input_data(shape = [None, SIZE_FACE, SIZE_FACE, 1], data_preprocessing = img_preProcess)
self.network = conv_2d(self.network, 64, 5, activation = 'relu')
self.network = max_pool_2d(self.network, 3, strides = 2)
self.network = conv_2d(self.network, 64, 5, activation = 'relu')
self.network = max_pool_2d(self.network, 3, strides = 2)
self.network = conv_2d(self.network, 128, 4, activation = 'relu')
self.network = dropout(self.network, 0.3)
self.network = fully_connected(self.network, 3072, activation = 'relu')
self.network = fully_connected(self.network, len(EMOTIONS), activation ='softmax')
self.network = regression(self.network, optimizer = 'momentum', loss = 'categorical_crossentropy',learning_rate=0.001)

Usage

1) Install python3, tensorflow, anaconda and pandas in your system.
2) The default configuration used for the training can be seen in emotion_cnn.py
3) The dataset has 11179 images in total in which 20% is validation images and rest 80 validation images
4) To run the code: run the below command by going into emotion_recognition folder
python -c "import model.emotion_cnn"

Results

The accuracy of the model is 75%. I implemented a live application too through which you can detect emotions through a live video feed by using webcam

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages