Skip to content

About

artificial-intelligence computer-vision deep-learning emotion-detection facial-expression-recognition tensorflow opencv cnn machine-learning python real-time-ai

Topics

Resources

Stars

19 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Multi Emotion Detection System

Project Description

An AI-powered real-time facial emotion recognition system developed using TensorFlow, OpenCV, and Deep Learning. The system detects human facial expressions from live webcam video streams and classifies them into multiple emotional categories in real time.

The project uses a Convolutional Neural Network (CNN) trained on the FER2013 dataset for emotion classification and OpenCV DNN-based face detection for fast and optimized real-time performance.

This project demonstrates practical applications of:

  • Computer Vision
  • Deep Learning
  • Real-Time AI Inference
  • Facial Expression Recognition
  • Human Emotion Analysis

Features

  • Real-time webcam emotion detection
  • Multiple emotion classification
  • Optimized OpenCV DNN face detector
  • TensorFlow CNN emotion classifier
  • FPS counter for performance monitoring
  • Prediction stabilization using emotion smoothing
  • Low-latency inference pipeline
  • Lightweight and beginner-friendly architecture
  • Model checkpoint saving
  • Data augmentation support

Emotions Detected

Emotion
Angry
Disgust
Fear
Happy
Sad
Surprise
Neutral

Technologies Used

Technology Purpose
Python Core Programming Language
TensorFlow Deep Learning Framework
OpenCV Real-Time Computer Vision
NumPy Numerical Processing
Matplotlib Visualization
Scikit-learn Class Weight Computation
FER2013 Dataset Emotion Training Dataset

Project Architecture

Webcam Input
      ↓
OpenCV DNN Face Detection
      ↓
Face Preprocessing
      ↓
CNN Emotion Classification
      ↓
Prediction Smoothing
      ↓
Real-Time Emotion Display

Project Structure

EmotionDetectionAI/
│
├── dataset/
│   ├── train/
│   └── test/
│
├── models/
│   ├── best_emotion_model.h5
│   ├── deploy.prototxt
│   └── res10_300x300_ssd_iter_140000.caffemodel
│
├── src/
│   ├── train.py
│   └── realtime.py
│
├── outputs/
│
├── requirements.txt
│
└── README.md

Dataset

Dataset Used:

FER2013 - Facial Expression Recognition Dataset

Dataset Link: https://www.kaggle.com/datasets/msambare/fer2013


Installation Guide

1. Clone Repository

git clone https://github.com/your-username/EmotionDetectionAI.git

2. Navigate to Project Folder

cd EmotionDetectionAI

3. Create Virtual Environment

python -m venv venv

4. Activate Virtual Environment

Windows

venv\Scripts\activate

5. Install Dependencies

pip install -r requirements.txt

Train the Model

python src/train.py

Run Real-Time Detection

python src/realtime.py

Performance

Metric Result
Validation Accuracy ~60%–75%
Real-Time FPS 15–30 FPS
Emotion Classes 7
Detection Type Real-Time

Optimization Techniques Used

  • Data Augmentation
  • Batch Normalization
  • Dropout Regularization
  • Emotion Prediction Smoothing
  • OpenCV DNN Face Detection
  • Model Checkpoint Saving
  • Early Stopping
  • Class Weight Balancing

Future Improvements

  • MobileNetV2 Transfer Learning
  • Multi-face emotion detection
  • TensorFlow Lite optimization
  • GPU acceleration
  • Flask/Streamlit deployment
  • Emotion analytics dashboard
  • Emotion history tracking
  • Voice emotion analysis integration

Screenshots

Real-Time Emotion Detection

Training Accuracy

Training Loss

Applications

  • Smart Surveillance Systems
  • Human Behavior Analysis
  • AI-Based Customer Analytics
  • Emotion-Aware Assistants
  • Mental Health Monitoring
  • Educational AI Systems
  • Interactive AI Applications

Learning Outcomes

This project helped in understanding:

  • Deep Learning Fundamentals
  • CNN Architecture Design
  • Real-Time Computer Vision
  • TensorFlow Model Training
  • OpenCV Face Detection
  • Model Optimization Techniques
  • Emotion Recognition Systems

Author

Dharshiyan

AI & Machine Learning Enthusiast

GitHub: https://github.com/dharshiyan

LinkedIn: https://linkedin.com/in/dharshiyan


License

This project is licensed under the MIT License.


About

artificial-intelligence computer-vision deep-learning emotion-detection facial-expression-recognition tensorflow opencv cnn machine-learning python real-time-ai

Topics

Resources

Stars

19 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages