Africa/Tunis
Projects

Facial Emotion Recognition with Deep Learning

image
March 15, 2024
This project focused on building a facial emotion prediction system trained on the FER-2013 dataset, capable of identifying seven emotions in real-time through facial expressions. The project combined deep learning model experimentation with full stack development to deliver both strong model performance and a working web application using a live camera feed.
  • Multiple Deep Learning Models: Implemented and evaluated four different models — VGG16, GoogleNet, and two custom CNN architectures.
  • Model Comparison: Benchmarked each model using accuracy, confusion matrices, and ROC curves.
  • Web-Based Live prediction: Developed a live camera-based web app using Flask to showcase real-time emotion recognition.
  • Performance Optimization: Designed custom CNN architectures that surpassed the accuracy of VGG16 and GoogleNet on the FER-2013 dataset.
  • Python & Keras: For model development and training.
  • TensorFlow: Backend engine powering deep learning operations.
  • NumPy, Matplotlib, Seaborn: For data manipulation and visualization.
  • OpenCV: Used for facial image preprocessing and real-time video capture.
  • Flask: Built the web interface to host the emotion prediction system.
  • Scikit-learn: For evaluation metrics like confusion matrices and ROC curves.
  • VGG16: Achieved 24.71% accuracy — limited performance due to dataset constraints.
  • GoogleNet: Improved performance with 48.96% accuracy; struggled with subtle emotional distinctions.
  • Custom Model 1 (ResNet-based): Reached 43.06% accuracy; introduced skip connections to reduce gradient issues.
  • Custom Model 2: Achieved the best result at 53.71%, surpassing both standard models.
Working with the FER-2013 dataset proved difficult due to its imbalanced and low-resolution data. Through iterative training, architecture redesigns, and analysis using ROC curves and confusion matrices, we improved the system's ability to classify complex emotions. Deploying the system in a Flask web app with live prediction also helped bridge the gap between theoretical model performance and practical application.
The final solution was a fully functional web app that performs real-time emotion prediction through a webcam interface. The second custom model achieved the best accuracy and demonstrated how architectural tuning and data understanding can lead to significant improvements. This project enhanced my expertise in computer vision, deep learning model evaluation, and deploying AI systems in production.
🔗 GitHub – Emotion Prediction Models