A real-time Facial Emotion Recognition (FER) system that detects and analyzes student emotions during learning sessions. The model classifies facial expressions into:
Engaged, Disengaged, Surprise, Neutral, and Frustration
The system uses your webcam to detect faces and apply a color-coded bounding box that reflects the detected emotion. At the end of a session, it generates a summary of emotional trends over the duration.
FER_Model_CNN_Project/
│
├── Emotion_program.ipynb # Real-time detection via webcam
├── Models_Evaluation_Finished_CNN.ipynb # Builds and saves the CNN model
├── fer2013_data.zip # The data the model is being trained on
├── images.ipynb # Gives a visualization of the models graphical analysis
├── deploy.prototxt # Facial Recognition software(Model Architeciture)
├── res10_300x300.caffemodel # Facial Recognition software (trained weights)
├── emotion_recognition_metadata # Stores metadata for the Emotion_program.ipynb
├── images/ # Demo GIFs, session summaries, etc.
└── README.md # Project documentation
git clone https://github.com/yourusername/FER_Model_CNN_Project.git
cd FER_Model_CNN_ProjectEnsure you’re using Python 3.8+ and install the requirements:
pip install -r requirements.txt
⚠️ The trained model file is not included in this repository due to size constraints.
To build the model manually:
Run this notebook:
Models_Evaluation_Finished_CNN.ipynbThis will:
- Train the CNN-based emotion recognition model
- Save it as a
.h5file (e.g.,emotion_model.h5)
To start detecting emotions via your webcam:
Run this notebook:
Emotion_program.ipynbFeatures:
- Activates your webcam
- Detects faces and classifies emotions in real time
- Draws a bounding box around detected faces with a color representing the emotion:
| Emotion | Box Color |
|---|---|
| Engaged | 🟩 Green |
| Disengaged | 🟦 Blue |
| Surprise | 🟨 Yellow |
| Neutral | ⬜ White |
| Frustration | 🟥 Red |
When the session ends (or is manually stopped), the notebook displays a summary of emotions detected during the session.
At the end of each session, the system generates a visual report of emotional distribution over time.
Example Output:
| Emotion | Description |
|---|---|
| Engaged | Focused, attentive |
| Disengaged | Low attention, distracted |
| Surprise | Sudden reaction, unexpected event |
| Neutral | Passive, non-expressive |
| Frustration | Confused or struggling to understand |
This project is licensed under the terms of the GNU General Public License v3.0.
- Built with ❤️ using OpenCV, TensorFlow, and Keras
- Inspired by academic research in affective computing and educational psychology

