{"id":13627635,"url":"https://github.com/TalkAI/facial-emotion-recognition-gluon","last_synced_at":"2025-04-17T00:32:20.685Z","repository":{"id":37606635,"uuid":"142320164","full_name":"TalkAI/facial-emotion-recognition-gluon","owner":"TalkAI","description":"Apache MXNet Gluon implementation for state of the art FER+ paper for Facial Emotion Recognition - https://arxiv.org/abs/1608.01041","archived":false,"fork":false,"pushed_at":"2022-11-22T03:48:09.000Z","size":15406,"stargazers_count":57,"open_issues_count":9,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-08T18:45:06.308Z","etag":null,"topics":["deeplearning","facial-emotion-recognition","facial-expression-recognition","fer","gluon","model-server","mxnet"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TalkAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-25T15:36:02.000Z","updated_at":"2024-10-25T08:59:55.000Z","dependencies_parsed_at":"2023-01-20T22:17:17.444Z","dependency_job_id":null,"html_url":"https://github.com/TalkAI/facial-emotion-recognition-gluon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkAI%2Ffacial-emotion-recognition-gluon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkAI%2Ffacial-emotion-recognition-gluon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkAI%2Ffacial-emotion-recognition-gluon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkAI%2Ffacial-emotion-recognition-gluon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TalkAI","download_url":"https://codeload.github.com/TalkAI/facial-emotion-recognition-gluon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249293032,"owners_count":21245671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deeplearning","facial-emotion-recognition","facial-expression-recognition","fer","gluon","model-server","mxnet"],"created_at":"2024-08-01T22:00:36.512Z","updated_at":"2025-04-17T00:32:17.972Z","avatar_url":"https://github.com/TalkAI.png","language":"Jupyter Notebook","funding_links":[],"categories":["\u003ca name=\"Vision\"\u003e\u003c/a\u003e2. Vision"],"sub_categories":["2.5 Face Detection and Recognition"],"readme":"# Facial Emotion Recognition with Apache MXNet\n\nThis repository demonstrates the implementation and deployoment of a facial expression recognition deep learning model using Apache MXNet, based on the [FER+ paper by Barsoum et. al.](https://arxiv.org/abs/1608.01041).\n\nThe repository consists of the following resources:\n1. Scripts for data pre-processing as suggested in the paper.\n1. Notebook for model building and training, using [Apache MXNet](http://mxnet.io).\n1. Model deployment for online inference, using [MXNet Model Server](http://modelserver.io)\n\nCheck out a working [FER+ web application demo](http://bit.ly/mxnet-fer), powered by AWS.\n\n\n# Before you start\n\n## Pre-requisites\n\n```\n# Install MXNet\n\npip install mxnet-mkl # for CPU machines\npip install mxnet-cu92 # for GPU machines with CUDA 9.2\n    \n# Other Dependencies\n\npip install Pillow # For image processing\npip install graphviz # For MXNet network visualization\npip install matplotlib # For plotting training graphs\n\n# Install MXNet Model Server and required dependencies for inference model serving\n\npip install mxnet-model-server\npip install scikit-image\npip install opencv-python\n```\n\n*Note: please refer to [MXNet installation guide](http://mxnet.incubator.apache.org/install/index.html?platform=Linux\u0026language=Python\u0026processor=CPU) for more detailed installation instructions.*\n\n## Data preparation\n\nClone this repository\n\n```\ngit clone https://github.com/TalkAI/facial-emotion-recognition-gluon\ncd facial-emotion-recognition-gluon\n```\n\nDownload FER dataset `fer2013.tar.gz` from the [FER Kaggle competition](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data).\n\n*Note: You cannot download the dataset with `wget`. You will have to register on Kaggle, and then login to download the dataset.*\n\nOnce downloaded:\n\n* Extract the tar file - `fer2013.tar.gz`\n* Copy `fer2013.csv` dataset to `facial-emotion-recognition-gluon/data` directory. \n\nWe will now generate `FER+` train/test/validation dataset from the downloaded `FER` data by executing the command below:\n\n```\n# In this step, we read the raw FER data, correct the labels using FER+ labels, and save as png images.\n\n# -d : path to \"data\" folder in this repository. It has folder for Train/Test/Validation data with corrected labels.\n# -fer : path to fer dataset that you have extracted.\n# -ferplus : path to fer2013new.csv file that comes with this repository in the data folder\n    \npython utils/prepare_data.py -d ./data -fer ./data/fer2013.csv -ferplus ./data/fer2013new.csv\n```\n\nLastly, we will process the `FER+` train/test/validation dataset\n\n```\n# This script reads the FER+ dataset (png images) we prepared in the previous step, applies the transformation suggested in the FER+ paper, and saves the processed images as NumPy binaries (npy files).\n\n# -d : path to data folder. This is where we have created data from the previous step.\n\npython utils/process_data.py -d ./data\n```\n \n## Deep Learning Basics You Will Need\nGo over [this notebook](https://github.com/TalkAI/facial-emotion-recognition-gluon/tree/master/notebooks/Deep_Learning_Basics_Intuitions.ipynb) that provides basic overview and intuitiion for various deep learning concepts and techniaues used in building and training the model.\n\n# Model Building, Training and Deployment\nHead over to the [FER+ tutorial](https://github.com/TalkAI/facial-emotion-recognition-gluon/tree/master/notebooks/Gluon_FERPlus.ipynb), to go over the process for building, training and deploying FER+ model. It is best to run as a live Jupyter Notebook, and you would need a GPU machine to complete training in a reasonable time. \n\n# Advanced Stuff - Left To The Reader\n\nBelow are few areas of improvements and next steps for the advanced reader. Contributions back to the repository are welcomed!\n\n* Hyper-parameter optimization - In this implementation, I have not optimized hyper-parameters (learning rate scheduler for SGD) for best possible result.\n* Implement multi-gpu version of model training. This script provides single GPU implementation only. Time per epoch on single GPU is around 1 minute =\u003e approx 50 minutes for full model training (Model converges at around 50th epoch)\n\n# Contributors\n\n* [Sandeep Krishnamurthy](https://github.com/sandeep-krishnamurthy/) \n* [Saravana Kumar](https://github.com/codewithsk)\n* [Hagay Lupesko](https://github.com/lupesko)\n\n# Citation / Credits\n\n* Barsoum, Emad \u0026 Zhang, Cha \u0026 Canton Ferrer, Cristian \u0026 Zhang, Zhengyou (2016). [Training Deep Networks for Facial Expression Recognition with Crowd-Sourced Label Distribution](https://arxiv.org/abs/1608.01041). In ACM International Conference on Multimodal Interaction (ICMI).\n* CNTK implementation of FER+ paper - https://github.com/Microsoft/FERPlus\n* FER demo built by https://github.com/codewithsk. (GitHub repo will be public soon)\n\n# Resources\n\n* Apache MXNet (incubating) - http://mxnet.incubator.apache.org/\n* Learn Deep Learning with Gluon - https://gluon.mxnet.io/\n* Productionizing Deep Learning Models with MXNet Model Server - https://github.com/awslabs/mxnet-model-server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTalkAI%2Ffacial-emotion-recognition-gluon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTalkAI%2Ffacial-emotion-recognition-gluon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTalkAI%2Ffacial-emotion-recognition-gluon/lists"}