This project implements facial emotion recognition using two models: a custom CNN model and a ResNet50 model. It allows users to view real-time facial emotion predictions through a Streamlit user interface.
Facial emotion recognition is a computer vision task that involves detecting emotions from images of human faces. This project uses a dataset containing 35,000 grayscale images, each with a resolution of 48x48 pixels. The dataset is split into training and test sets for model training and evaluation.
Model | Description |
---|---|
Custom CNN | A convolutional neural network (CNN) model implemented using Keras. |
- Consists of multiple convolutional and pooling layers followed by fully connected layers. | |
- Trained on the provided dataset to recognize emotions from facial images. | |
ResNet50 | A pre-trained deep convolutional neural network (CNN) architecture. |
- Utilizes residual connections to mitigate vanishing gradient problem. | |
- Fine-tuned on the facial emotion dataset using transfer learning. |
The Streamlit user interface allows users to interact with the facial emotion recognition models in real-time. Users can access their webcam to capture live video feed, and the models will predict the dominant emotion present in the detected faces. The predicted emotion labels are displayed directly on the faces in the video feed.
The dataset used in this project consists of grayscale images of human faces, each labeled with one of several emotion categories. The images are preprocessed and resized to 48x48 pixels before being used for model training and evaluation.
To run the project locally:
- Clone this repository to your local machine.
- Install the required dependencies listed in
requirements.txt
. - Run the Streamlit application using the command
streamlit run app.py
. - Access the application in your web browser and interact with the models.