A deep learning-powered real-time emotion detection system that classifies facial expressions captured from a live webcam feed into seven distinct emotions.
This application uses a Convolutional Neural Network (CNN) trained on facial expression data to detect and classify human emotions in real-time. The webcam captures a video stream, detects faces, and predicts the emotion being expressed—displaying it with a label overlay.
- 😠 Angry
- 🤢 Disgust
- 😨 Fear
- 😀 Happy
- 😐 Neutral
- 😢 Sad
- 😲 Surprise
- ✅ Real-time face detection using OpenCV
- ✅ Emotion prediction using trained CNN model
- ✅ Visual label overlay on detected faces
- ✅ Clean preprocessing pipeline (grayscale, resize, normalize)
- ✅ Customizable and extendable for more use-cases
- 4 Convolutional Layers (ReLU activation + MaxPooling)
- Dropout layers for regularization
- Fully Connected Dense layers
- Output layer with Softmax (7 classes)
Tool | Purpose |
---|---|
Python 3.10 | Core Programming Language |
TensorFlow / Keras | Deep Learning Framework |
OpenCV | Real-time Computer Vision |
NumPy | Numerical Computation |
Matplotlib | Visualization (optional) |
Jupyter Notebook | Model Training & Development |
FER-2013: Facial Expression Recognition dataset
🔗 Kaggle Link
- 48x48 grayscale images
- 35,900 labeled facial images
- 7 emotion classes
# Clone the repository
git clone https://github.com/SusmoyNath/Realtime-emotion-detector.git
cd Realtime-emotion-detector
# (Optional) Create a virtual environment
python3 -m venv env
source env/bin/activate # or .\env\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txt