About the project
The project uses a Machine learning model for facial and emotion recognition. The model was trained using the AlexNet CNN with preprocessed grayscale images using Tensorflow and Keras. It was then deployed onto a webapp using Flask. The app is able to detect faces and predict emotions in realtime using a webcam and then display the emoji and text corresponding to the emotion.
For the Webapp
Our goal was to have the entire program run as a web application hosted on the internet so that anyone, anywhere could use it for free. We developed the front end using HTML, CSS, and Bootstrap. For the back end, we used Flask.
For the Machine Learning Model
We trained the emotion detection model from scratch using the AlexNet Convolutional Neural Network and fed it preprocessed grayscale 227x227 images of 7 different emotions in google colab. The libraries that we used included tensor flow, Matplotlib, Keras and Numpy. After training our model we saved the weights and imported them to our project. In order to use the model to predict we used cv2 to capture a video using our webcam. The emotions in the video were then predicted using the model and displayed with emojis corresponding to the emotion.
Challenges we ran into
A lot of the libraries had issues when importing for some reason such as Tensorflow, Scipy and Keras. Our model also took some time to train and it was unable to save due to insufficient space in google drive which resulted in us having to retrain the model. We also had trouble importing large files to github (our ML Model was 700mbs). The main challenge that we ran into was efficiently connecting the web app to the machine learning model. The machine learning model is too large (700mbs) which is why it needs. to be downloaded separately (the link to the drive had been provided). Even though our model is fast, the haarcascade facial detection is slow so there is a delay of 1-2 seconds in our video.
Accomplishments that we're proud of
We ended up with a fairly accurate machine learning model that can predict emotions on a live video. We also managed to create a very user friendly UI.
What we learned
We learned how to train a convolutional neural network and properly process our images for the emotion detection model. We also learned about front-end web development and how to deploy our ML Model using flask.
Log in or sign up for Devpost to join the conversation.