https://github.com/noxs1d/cv-emotion-classification
This project is a deep learning-based system for detecting human emotions from facial images using TensorFlow, OpenCV, and NumPy.
https://github.com/noxs1d/cv-emotion-classification
cnn cnn-classification dockerfile keras numpy opencv tensorflow transfer-learning
Last synced: 3 months ago
JSON representation
This project is a deep learning-based system for detecting human emotions from facial images using TensorFlow, OpenCV, and NumPy.
- Host: GitHub
- URL: https://github.com/noxs1d/cv-emotion-classification
- Owner: noxs1d
- Created: 2025-07-31T19:53:17.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-08-15T06:30:33.000Z (10 months ago)
- Last Synced: 2025-08-15T08:25:06.012Z (10 months ago)
- Topics: cnn, cnn-classification, dockerfile, keras, numpy, opencv, tensorflow, transfer-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 23 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emotion Detection Project (FER-2013)
This project is a deep learning-based system for detecting human emotions from facial images using TensorFlow, OpenCV, and NumPy. It is trained on the FER-2013 dataset and offers two model variants:
* A custom-built CNN (Convolutional Neural Network)
* A transfer learning model based on pre-trained VGG16
---
## 🧠 Features
* Real-time emotion detection via webcam (OpenCV)
* FER-2013 dataset support (7 emotion classes)
* Two models: scratch-trained CNN and VGG16-based transfer learning
* Pretrained models included
* Architecture overview diagram included (see assets)
---
## 🔍 Emotion Classes
* Angry
* Disgust
* Fear
* Happy
* Sad
* Surprise
* Neutral
---
## 📂 Project Structure
```
.
├── main.py # Main script for webcam-based emotion detection
├── README.md
│
├── models/ # Saved model files
│ ├── fer2013_model_tensorflow.h5
│ └── pretrained_model.keras
│
├── notebook/ # Jupyter Notebook for exploration and training
│ └── CV_project.ipynb
│
├── __pycache__/ # Compiled Python cache
│ └── main.cpython-312.pyc
│
└── .idea/ # IDE configuration (PyCharm)
```
---
## 🧱 Model Architecture Diagram

---
## 🚀 Getting Started
### Install Requirements
```bash
pip install -r requirements.txt
```
### Run the Application
```bash
python main.py
```
### Train Your Own Model (optional)
Open the notebook:
```
notebook/CV_project.ipynb
```
---
## 🐳 Docker Support
Dockerfile example:
```Dockerfile
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "main.py"]
```
Build & run:
```bash
docker build -t emotion-detector .
docker run --rm -it emotion-detector
```
---
## 📈 Results
| Model | Accuracy | Val Accuracy |
| ------------------------- |----------| ------------ |
| Custom CNN | \~60% | \~54% |
| VGG16 (Transfer Learning) | \~94% | \~65% |
---
## 📄 License
This project is released under the MIT License.
---
## 🙌 Credits
* FER-2013 Dataset (Kaggle)
* TensorFlow / Keras
* OpenCV
* NumPy