Skip to content

A 5-layer CNN model for facial emotion recognition trained on FER-2013. Achieved 76% validation and 63% test accuracy using data augmentation. Key features include convolutional layers, max pooling, and dropout. Suitable for human-computer interaction applications.

Notifications You must be signed in to change notification settings

farshad257/CNN_FER-2013

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

CNN Image Classification with EfficientNetB4

This project presents an image classification pipeline using a convolutional neural network (CNN) based on EfficientNetB4 architecture. The model is designed to handle a custom image dataset, leveraging advanced data augmentation and regularization techniques to enhance performance and prevent overfitting.

🏒 Model Architecture

  • Base Model: EfficientNetB4 (pre-trained on ImageNet)
  • Top Layers: Custom classification head
  • Regularization: L1, L2 weight penalties
  • Augmentation: Random flip, rotation, zoom
  • Training Strategy:
    • EarlyStopping to avoid overfitting
    • ModelCheckpoint to save the best model

πŸ“ Dataset

FER_2013

  • Structure:
/train
  /class_1
    image1.jpg
    image2.jpg
  /class_2
    ...
/test
  /class_1
    ...
  /class_2
    ...
  • Images are automatically loaded and labeled from directory structure using TensorFlow's ImageDataGenerator.

βš™οΈ Dependencies

  • Python 3.x
  • TensorFlow 2.x
  • NumPy, Pandas, Matplotlib, Seaborn
  • scikit-learn

πŸ“Š Evaluation

The model's performance is assessed using:

  • Confusion Matrix
  • Classification Report (Precision, Recall, F1-score)
  • Accuracy metrics over training epochs

πŸ“ˆ Visualization

  • Loss and Accuracy plots
  • Confusion matrix heatmap
  • Example predictions

πŸš€ How to Run

  1. Clone this repository:

    git clone https://github.com/your-username/your-repo-name.git
    cd your-repo-name
  2. Install the required packages:

    pip install -r requirements.txt
  3. Place your dataset inside the train and test directories.

  4. Run the notebook:

    jupyter notebook CNN_Model.ipynb

πŸ“Œ Notes

  • Make sure the dataset is well-organized as described.
  • You can easily swap EfficientNetB4 with other architectures using Keras Applications.

πŸ“§ Contact

For questions or suggestions, feel free to open an issue or contact the maintainer.


Author: Farshad Tofighi (farshad257)
License: MIT Email: farshadtfgh@gamil.com

About

A 5-layer CNN model for facial emotion recognition trained on FER-2013. Achieved 76% validation and 63% test accuracy using data augmentation. Key features include convolutional layers, max pooling, and dropout. Suitable for human-computer interaction applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published