Skip to content

Human facial expression detector using CNN, Random Forests and Bayes

Notifications You must be signed in to change notification settings

ericsheng495/facial-expression-recognition

Repository files navigation

Facial Emotion Recognition for Smart Homes Appliances

Shize Sheng, Yuanhong Zhou, Chunzhen Hu, Jiasheng Cao, Xingyu Hu

Repo Structure

.
├── CNN                          # CNN related files.
│   ├── cnn_train.ipynb          # Notebook for preprocessing, training, and evaluating the CNN model.
│   └── model       
│       └── trained_cnn_model.h5
│ 
├── Random Forests               # Random Forest related files.
│   ├── model
│   │   └── trained_cnn_model.h5
│   └── rf_train.ipynb
│ 
├── Naive_Bayes                 # Naive Bayes related files.
│   └── naive_bayes_train.ipynb
│ 
├── README.md                   
├── requirements.txt             # List of python packages required for the project.
├── docs                         # GitHub Pages.
└── setData                      # Dataset directory.
    ├── original_data_set       
    │   ├── test                 # Testing set
    │   │   ├── angry
    │   │   ├── disgust
    │   │   ├── fear
    │   │   ├── happy
    │   │   ├── neutral
    │   │   ├── sad
    │   │   └── surprise
    │   └── train                # Training set
    │       ├── angry
    │       ├── disgust
    │       ├── fear
    │       ├── happy
    │       ├── neutral
    │       ├── sad
    │       └── surprise
    └── processed_data_set       # Processed dataset, simplified into numpy arrays for direct use in models.
        ├── test                
        │   └── data.npy
        └── train                # Processed training data in a numpy array.
            └── data.npy


Directories

  • /CNN/: Contains files related to Convolutional Neural Networks model training
    • cnn_train.ipynb: Jupyter notebook for the CNN that performs data preprocessing, visualization, CNN training, model evaulation
    • model/trained_cnn_model.h5: A saved model file that contains the weights and architecture of the trained convolutional neural network, no retraining needed for new datasets
  • /Random Forests/: Contains files related to Random Forest model training
  • /Naive Bayes/: Contains files related to Naive Bayes model training
  • /setData/: Contains datasets for the project. It includes:
    • Original dataset (/setData/original_data_set/): Prepared for initial data analysis. It is organized into test and train folders, each containing subfolders for different emotions such as angry, disgust, fear, happy, neutral, sad, and surprise.
      • /test/: Contains images for testing the model, divided into categories based on emotions
      • /train/: Contains images for training the model, similarly divided into emotional categories.
    • Preprocessed dataset (/setData/processed_data_set/): Contains pre-processed data
      • /test/: Contains a data.npy file with preprocessed testing data.
      • /train/: Contains a data.npy file with preprocessed training data.
  • /docs/: Used for GitHub Pages hosting; includes markdown, HTML, and other resources needed to build the project's webpage.

Files

  • /requirements.txt: Specifies all Python dependencies required by the project, which can be installed via pip.
  • /.gitignore: Lists all files and directories that git should ignore, preventing them from being tracked or added to the repository.
  • /README.md: Provides an overview of the project, setup instructions, and essential information for users and contributors.

Development

Setup

  1. Clone this project to your computer
git clone https://github.com/ericsheng495/facial-expression-recognition.git
  1. Navigate to this project in your terminal
cd facial-expression-recognition
  1. Pulling the latest update from main
git pull 
  1. Creating your branch
git checkout -b your-branch-name
  1. Running the model

Commit & Push

  1. See which files you have modified
git status
  1. Add your files to "staging"
git add .
  1. Commit with message
git commit -m "your commit message"
  1. Push your branch to main (remote)
git push

Jekyll Setup (github pages)

  1. Navigate to docs directory (this is where we keep github pages themes)
cd docs
  1. Run Locally (on localhost:4000)
bundle exec jekyll serve  

Additional Notes:

  • Git Branching
  • Git Commit & Push

About

Human facial expression detector using CNN, Random Forests and Bayes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published