Deep Learning Projects

Emotion Recognition from Facial Expressions Using CNN

Look at the camera (or upload a photo of a face). The system finds every face, predicts the emotion and shows how confident it is.

Uploaded photo
Start the camera or upload a photo
Loading the model...
Detected emotion
-
No face yet

How it works

  1. Face detection - a small CNN (Tiny Face Detector) looks at the frame and returns a box around each face.
  2. Cropping - each face is cut out and resized to a small grayscale-like input for the second network.
  3. Emotion classification - a CNN trained on labelled face pictures gives a probability for each of the 7 emotions.
  4. Result - the emotion with the highest probability is shown with its confidence, and this repeats for every video frame.

Model details

PartDetails
Face detectorTiny Face Detector (CNN, about 190 KB)
Emotion modelFace Expression Net (CNN, about 330 KB)
Classesneutral, happy, sad, angry, fearful, disgusted, surprised
Libraryface-api.js running on TensorFlow.js in the browser

Where it can be used

Student engagement monitoring in online classes, mental health and mood tracking tools, and making computers react better to the people using them (human-computer interaction).

Note: emotion recognition is not always correct. Lighting, glasses, head angle and the fact that people show emotions differently all affect the result.