This project focuses on detecting human emotions from facial images using Convolutional Neural Networks (CNN). Trained on the FER-2013 dataset, the system can classify seven basic emotions: Angry, Disgust, Fear, Happy, Sad, Surprise, Neutral.
- Group No: 8
- Group Name: leisurely_loco
- Arbin Zaman (ID: 2125051006)
- Sohana Afrin (ID: 2125051013)
- Safin Ahamed Sajid (ID: 2125051022)
- Md. Fahim Abrar Asif (ID: 2125051116)
- Build a CNN model to recognize facial emotions
- Use the FER-2013 dataset for training and validation
- Enable emotion detection in real-time from static images or webcam
- Evaluate model performance and optimize for accuracy and generalization
- Language: Python
- IDE: Google Colab
- Libraries: TensorFlow/Keras, OpenCV, Matplotlib, NumPy
- Dataset: FER-2013 (from Kaggle)
-
Clone the repository:
git clone https://github.com/arbinzaman/Emotion-Detection-System.git cd Emotion-Detection-System
-
Install required libraries:
pip install tensorflow opencv-python matplotlib numpy
-
Download FER-2013 dataset:
- Register and accept terms on Kaggle.
- Use
kaggle datasets download -d msambare/fer2013
or manually upload the dataset to Colab.
The CNN consists of:
- 2 convolutional layers with ReLU activation and max pooling
- Dropout layers to reduce overfitting
- Dense layers with softmax for emotion classification (7 classes)
Run the Jupyter Notebook (emotion_detection_colab.ipynb
) step-by-step:
- Preprocess dataset
- Train CNN model
- Use
predict_emotion(img_path)
function to test images
Input Image | Predicted Emotion |
---|---|
![]() |
😄 Happy |
- Validation Accuracy: ~60%
- Real-time predictions on unseen images work reliably under various lighting conditions
- Robust against moderate noise and variations
- Struggles with underrepresented emotions like "Disgust" and "Fear"
- Grayscale images only – lacks color cues
- Sensitive to extreme lighting or occluded faces
- Use colored, high-resolution images
- Add real-time webcam support
- Deploy via TensorFlow Lite for mobile apps
- Integrate multimodal data (voice/text)
- FER-2013 Dataset on Kaggle
- François Chollet, Deep Learning with Python, Manning, 2017
- TensorFlow Keras API
- OpenCV Documentation
https://github.com/arbinzaman/Emotion-Detection-System