This repository contains the code for a neural network trained for multi-class classification, developed for an AI challenge. The task is to classify human emotions into one of the 7 categories - surprise, angry, happy, sad, fear, disgust or neutral. The application of the neural network was extended to real time facial emotion recognition using the haar frontalface cascade. The code and examples of detection during real time detection are shown in Real Time Detection.
The training data consists of 28709 images and the testing data consists of 7178 images. The split up of the images according to the classes can be seen below.
Clearly, there is a class imbalance (much lesser data for the 'disgust' class). Methods like SMOTE or assigning class weights to the different classes based on the number of data samples they contain can be used to mitigate the class imbalance in the training data.
Without fixing the class imbalance, the train accuracy obtained is 78.5% and the test accuracy obtained is 67.82%.