Skip to content

A deep learning-based system that detects facial expressions from webcam input and classifies them into seven emotions — Angry, Disgust, Fear, Happy, Neutral, Sad, and Surprise — using a CNN model and OpenCV for real-time face detection.

Notifications You must be signed in to change notification settings

SusmoyNath/Realtime-emotion-detector

Repository files navigation

🎭 Real-Time Emotion Detector from Camera Face Input

A deep learning-powered real-time emotion detection system that classifies facial expressions captured from a live webcam feed into seven distinct emotions.


📌 Project Overview

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.

🔍 Detectable Emotions:

  • 😠 Angry
  • 🤢 Disgust
  • 😨 Fear
  • 😀 Happy
  • 😐 Neutral
  • 😢 Sad
  • 😲 Surprise

🧠 Features

  • ✅ 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

🏗️ Model Architecture

  • 4 Convolutional Layers (ReLU activation + MaxPooling)
  • Dropout layers for regularization
  • Fully Connected Dense layers
  • Output layer with Softmax (7 classes)

🧰 Tech Stack

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

📦 Dataset

FER-2013: Facial Expression Recognition dataset
🔗 Kaggle Link

  • 48x48 grayscale images
  • 35,900 labeled facial images
  • 7 emotion classes

🚀 Installation & Setup

# 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

About

A deep learning-based system that detects facial expressions from webcam input and classifies them into seven emotions — Angry, Disgust, Fear, Happy, Neutral, Sad, and Surprise — using a CNN model and OpenCV for real-time face detection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published