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
- 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
| Emotion |
|---|
| Angry |
| Disgust |
| Fear |
| Happy |
| Sad |
| Surprise |
| Neutral |
| 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 |
Webcam Input
↓
OpenCV DNN Face Detection
↓
Face Preprocessing
↓
CNN Emotion Classification
↓
Prediction Smoothing
↓
Real-Time Emotion Display
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 Used:
FER2013 - Facial Expression Recognition Dataset
Dataset Link: https://www.kaggle.com/datasets/msambare/fer2013
git clone https://github.com/your-username/EmotionDetectionAI.gitcd EmotionDetectionAIpython -m venv venvvenv\Scripts\activatepip install -r requirements.txtpython src/train.pypython src/realtime.py| Metric | Result |
|---|---|
| Validation Accuracy | ~60%–75% |
| Real-Time FPS | 15–30 FPS |
| Emotion Classes | 7 |
| Detection Type | Real-Time |
- Data Augmentation
- Batch Normalization
- Dropout Regularization
- Emotion Prediction Smoothing
- OpenCV DNN Face Detection
- Model Checkpoint Saving
- Early Stopping
- Class Weight Balancing
- 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
- Smart Surveillance Systems
- Human Behavior Analysis
- AI-Based Customer Analytics
- Emotion-Aware Assistants
- Mental Health Monitoring
- Educational AI Systems
- Interactive AI Applications
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
Dharshiyan
AI & Machine Learning Enthusiast
GitHub: https://github.com/dharshiyan
LinkedIn: https://linkedin.com/in/dharshiyan
This project is licensed under the MIT License.



