{"id":20199187,"url":"https://github.com/csoren66/emotion-detection","last_synced_at":"2025-03-03T08:26:26.842Z","repository":{"id":119790736,"uuid":"607703246","full_name":"csoren66/Emotion-detection","owner":"csoren66","description":"Implementing a CNN model for facial emotion recognition with real-time implementation","archived":false,"fork":false,"pushed_at":"2023-03-23T11:58:23.000Z","size":18988,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T19:52:00.655Z","etag":null,"topics":["cnn-model","deep-learning","detection","haarcascade-frontalface","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csoren66.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-28T14:08:53.000Z","updated_at":"2024-09-22T15:25:24.000Z","dependencies_parsed_at":"2023-03-24T05:33:10.283Z","dependency_job_id":null,"html_url":"https://github.com/csoren66/Emotion-detection","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/csoren66%2FEmotion-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csoren66%2FEmotion-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csoren66%2FEmotion-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csoren66%2FEmotion-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csoren66","download_url":"https://codeload.github.com/csoren66/Emotion-detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241631782,"owners_count":19994091,"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":["cnn-model","deep-learning","detection","haarcascade-frontalface","opencv","python"],"created_at":"2024-11-14T04:36:18.720Z","updated_at":"2025-03-03T08:26:26.835Z","avatar_url":"https://github.com/csoren66.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\u003ccenter\u003e Emotion Detection \u003c/center\u003e\u003ch1\u003e\n\n## Overview\nThe aim of the project is to display facial expressions (happy, sad, anger, fear, disgust, surprise, neutral) by performing fast \u0026 accurate face detection with OpenCV using a deep learning face detector model.\n\nThe model is trained on the FER-2013 dataset which was published on International Conference on Machine Learning (ICML). This dataset consists of 35887 grayscale, 48x48 sized face images with seven emotions - angry, disgusted, fearful, happy, neutral, sad and surprised.\n\n\n## Methodology\n1. **Load and preprocess the dataset:** Use the Fer2013 dataset, which contains images of faces categorized into seven emotions (angry, disgusted, fearful, happy, neutral, sad, surprised). Load the images and their corresponding labels, then preprocess the images by resizing them to the appropriate size and normalizing their pixel values.\n2. **Performing Exploratory Data Analysis (EDA) to the given dataset:**\n![My Image](eda.png)\n\n\n        **(0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral)**\n\n3. **Split the dataset into training, validation, and test sets:** divide the dataset into three sets - training, validation, and test sets. The training set is used to train the model, the validation set is used to evaluate the model's performance during training.\n4. **Define the architecture of the neural network (e.g., convolutional neural network)**\n\n\n        _________________________________________________________________\n        Layer (type)                Output Shape              Param #    \n        =================================================================\n        conv2d (Conv2D)             (None, 46, 46, 64)        640       \n                                                                 \n        conv2d_1 (Conv2D)           (None, 44, 44, 64)        36928     \n                                                                 \n        max_pooling2d (MaxPooling2D)  (None, 22, 22, 64)       0         \n                                                                                                                            \n        dropout_2 (Dropout)         (None, 22, 22, 64)        0         \n                                                                 \n        conv2d_2 (Conv2D)           (None, 20, 20, 64)        36928     \n                                                                 \n        conv2d_3 (Conv2D)           (None, 18, 18, 64)        36928     \n                                                                 \n        max_pooling2d_1 (MaxPooling  (None, 9, 9, 64)         0         \n        2D)                                                             \n                                                                 \n        dropout_3 (Dropout)         (None, 9, 9, 64)          0         \n                                                                 \n        conv2d_4 (Conv2D)           (None, 7, 7, 128)         73856     \n                                                                 \n        conv2d_5 (Conv2D)           (None, 5, 5, 128)         147584    \n                                                                 \n        max_pooling2d_2 (MaxPooling  (None, 2, 2, 128)        0         \n        2D)                                                             \n                                                                 \n        flatten (Flatten)           (None, 512)               0         \n                                                                 \n        dense_1 (Dense)             (None, 1024)              525312    \n                                                                 \n        dropout_4 (Dropout)         (None, 1024)              0         \n                                                                 \n        dense_2 (Dense)             (None, 1024)              1049600   \n                                                                 \n        dropout_5 (Dropout)         (None, 1024)              0         \n                                                                 \n        dense_3 (Dense)             (None, 7)                 7175      \n                                                                 \n        =================================================================\n        Total params: 1,914,951\n        Trainable params: 1,914,951\n        Non-trainable params: 0\n        _________________________________________________________________\n\n\n5. **Train the model on the training set**\n6. **Evaluate the model on the validation set**\n7. **Test the model on the testing set**\n\n## Dataset \u0026 Description\n\n\nThe data consists of **48x48 pixel grayscale images** of faces. The faces have been automatically registered so that the face is more or less centred and occupies about the same amount of space in each image.\nThe training set consists of 28,709 examples and the public test set consists of 3,589 examples.\n\n[Dataset link ](https://www.kaggle.com/msambare/fer2013)\n\n## Business Segments\n1. Facial Recognition\n2. Speech and Voice Recognition\n3. Bio-sensing\n4. AI application\n    - Government\n    - Healthcare\n    - Retail\n    - Entertainment\n    - Transportation\n    - Other End-user Verticals\n  \n\n\u003c!-- Papers --\u003e\n## Papers\n\n- [Very deep convolutional networks for large-scale image recognition](https://arxiv.org/pdf/1409.1556.pdf) by Karen Simonyan \u0026 Andrew Zisserman\n\n- [Challenges in Representation Learning: A report on three machine learning contests](https://arxiv.org/pdf/1307.0414v1.pdf) by Ian J. Goodfellow, Dumitru Erhan, Pierre Luc Carrier, Aaron Courville, Mehdi Mirza, Ben Hamner, Will Cukierski, Yichuan Tang, David Thaler, Dong-Hyun Lee, Yingbo Zhou, Chetan Ramaiah, Fangxiang Feng, Ruifan Li, Xiaojie Wang, Dimitris Athanasakis, John Shawe-Taylor, Maxim Milakov, John Park, Radu Ionescu, Marius Popescu, Cristian Grozea, James Bergstra, Jingjing Xie, Lukasz Romaszko, Bing Xu, Zhang Chuang, and Yoshua Bengio\n\n\n## Contributer\n[Chandan Soren](https://github.com/csoren66)\n\n## Demo\n[link](https://drive.google.com/file/d/1YShNLcqdjTcgyRFq_fEHc4Yqz_z9MnqC/view?usp=sharing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsoren66%2Femotion-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsoren66%2Femotion-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsoren66%2Femotion-detection/lists"}