cs582 / facial-expression-recognition

Implemented deep neural networks to classify facial expressions, as well as object detection using the haar algorithm to make real-time facial expression recognition.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facial Expression Recognition

Trump vs Biden

In this project, I built a deep learning model in Keras using Convolutional Neural Networks (CNNs) for facial expression recognition.

This project also makes use of the Haar Cascade algorithm for object detection and is deployed in a website using Flask.

Model

The CNN model is very simple, it has 5 convolutional neural networks with a Dropout rate of 0.25 and Batch Normalization and 2 Fully connected layers with a Dropout rate of 0.25 and Batch Normalization as well.

This model uses the Adam optimizer with a learning rate of 0.0005 and categorical cross entropy loss.

The model was trained in 20 epochs and achieved an in-sample accuracy of 68.1% and out-of-sample accuracy of 64.4%.

CNN architecture

Libraries used

tensorflow = 2.5.0

numpy

seaborn

livelossplot

How to use?

This algorithm can recognize and classify facial expression on videos or using your webcam.

To input your own file, you can simply modify the file called camera.py and replace the string "videos/F&F9_Reaction2.mp4" with the file you choose or write 0 if you want to use your webcam instead.

To run it, just run main.py in the console.

This code was writen for my guided project at Coursera in 2020.

About

Implemented deep neural networks to classify facial expressions, as well as object detection using the haar algorithm to make real-time facial expression recognition.


Languages

Language:Jupyter Notebook 99.6%Language:Python 0.3%Language:HTML 0.1%