This project implements Emotion Detection using Convolutional Neural Networks (CNN). The model is trained to recognize facial expressions such as happiness, sadness, anger, surprise, disgust, and fear. Emotion detection using Convolutional Neural Networks (CNNs) is a popular and effective method in the field of computer vision and machine learning. CNNs are particularly well-suited for this task because they excel at detecting patterns and features in images, which is crucial for recognizing facial expressions and emotions.
The model is trained on the FER2013 dataset, which consists of 35,887 grayscale images of size 48x48 pixels, each labeled with one of seven emotions.
- Python 3.x
- TensorFlow
- Keras
- OpenCV (cv2)
- Matplotlib
- NumPy
You can install the required libraries using pip:
pip install tensorflow keras opencv-python matplotlib numpy
-
Clone the Repository:
git clone https://github.com/TARUN2K3/Emotion-Detection-CNNn.git
-
Navigate to the Project Directory:
cd Emotion-Detection-CNN
-
Train the Model:
Use the provided Jupyter notebook or Python script to train the CNN model on the FER2013 dataset.
TrainEmotionDetector.py
-
Run Inference:
Once the model is trained, you can run inference on images or real-time video using the provided scripts.
website.py
The trained model achieves an accuracy of approximately 70% on the test set.
- The FER2013 dataset is provided by Pierre-Luc Carrier and contains images from the Facial Expression Recognition 2013 Challenge.
- Inspired by various tutorials and resources on CNN-based emotion detection.