The problem
The Facial Emotion Detection system is a deep-learning final-year project that finds faces in a live webcam feed and classifies the emotion on each face — happy, sad, angry, fear, surprise, disgust or neutral — using a convolutional neural network trained on the FER2013 dataset (35,887 grayscale 48×48 face images). Branded EmoSense, the Streamlit application overlays live emotion labels with confidence bars on the video feed and includes an analytics view showing the distribution of emotions across a session. With a trained model, training notebooks and real-time inference all included, this is one of the most viva-friendly deep-learning projects a student can present.
This is a built-to-order project: every deliverable is prepared fresh for you — full source code, trained model, report PDF, PPT and viva Q&A — so nothing looks recycled.
Captures live video frames for face detection.
Follow the working sequence
How it works
- The webcam frame is captured and faces are detected with OpenCV's DNN face detector.
- Each detected face is cropped, converted to grayscale, resized to 48×48 and normalized to match FER2013's input format.
- The preprocessed face is passed through the trained CNN: stacked convolution + batch-normalization + max-pooling blocks, followed by dense layers with dropout and a 7-way softmax output.
- The softmax probabilities become the emotion label (argmax) and the confidence bars shown in the UI.
- Predictions are smoothed over a short sliding window to avoid flicker between adjacent emotions.
- The analytics view aggregates per-session statistics — emotion distribution, dominant emotion, average confidence — rendered as charts.
Project features
- Real-time face detection with OpenCV DNN / Haar cascade, then CNN emotion classification
- CNN trained on FER2013: 35,887 images, 7 emotion classes, ~65–70% validation accuracy
- Live webcam inference at 15–25 FPS on CPU with per-face emotion labels
- Confidence bars for every prediction — shows model certainty, not just the top class
- EmoSense Streamlit app: live detection view + session analytics dashboard
- Emotion-over-time graph and distribution pie chart for a full demo session
- Snapshot capture: save frames with predicted emotions for the report
- Training notebook included — retrain, tune hyperparameters, plot learning curves
- Data augmentation pipeline (rotation, shift, zoom, flip) to reduce overfitting
- Multi-face support: detects and classifies several faces in one frame
What is included
- Complete, commented Python source code (training + inference + app)
- Pre-trained CNN model weights (.h5) — no GPU training needed on your machine
- Jupyter training notebook with augmentation, learning curves and confusion matrix
- Project report PDF (literature survey, CNN architecture, experiments, results, conclusion)
- PPT presentation for final review
- Viva Q&A preparation document (convolution math, FER2013 details, overfitting controls)
- Installation and run guide
Advantages
- Real-time face detection (OpenCV DNN / Haar cascade) followed by CNN emotion classification — happy, sad, angry, fear, surprise, neutral, disgust.
- CNN trained on FER2013: 35,887 images across 7 emotion classes, with ~65–70% validation accuracy reported transparently.
- Live webcam inference at 15–25 FPS on CPU with per-face emotion labels — no GPU needed for the demo.
- Confidence bars for every prediction show model certainty, not just the top class — useful for the viva discussion on uncertainty.
- EmoSense Streamlit app: live detection view plus a session analytics dashboard with emotion-over-time graphs and distribution pie charts.
- Training notebook included (retrain, tune hyperparameters, plot learning curves), data-augmentation pipeline to reduce overfitting, and multi-face support in a single frame.
Disadvantages
- ~65–70% validation accuracy means roughly one in three predictions is wrong — the confidence bars, not the headline label, are the honest signal.
- FER2013 is web-scraped with known label noise and demographic bias; performance drops on faces unlike the training distribution.
- Poor lighting, occlusions (masks, hands) and extreme angles degrade both face detection and classification.
- Visually similar emotions (fear vs. surprise, sad vs. neutral) get confused more often — the report's confusion matrix documents this honestly.
Components & software requirements
- Python 3.9+ (NumPy, Pandas, Matplotlib/Seaborn)
- TensorFlow/Keras (CNN model definition, training, inference)
- OpenCV (face detection, frame preprocessing)
- Streamlit (EmoSense web application)
- scikit-learn (confusion matrix, classification report metrics)
- FER2013 dataset (35,887 labeled 48×48 grayscale faces)
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.