Inspiration

My grandma had a stroke and thankfully there was someone to help her and take her to the hospital, but it made me think that with so much technology and so many people we still worried so much. Now she is never left alone and sometimes it creates problems with schedule. So we created this model that would be able to detect if someone has a stroke.

What it does

Our model is able to predict if someone has a stroke based on a cropped in image of their face with around a 98% testing accuracy. Since our model struggles to predict accuractely without a cropped in face, we wrote more code that used YoloV8 to crop into images.

How we built it

We found a dataset on kaggle that had over 3000 images of people that have and didn't have stroke. Then we converted these images and labels into numpy arrays and then trained a Convolutional Neural Network (CNN) to detect if these people had stroke or not. Next we made some code that would be able to take images and crop into them in the same way the dataset was. We used the YoloV8 face detection and then cropped into the image where the mask was present.

Challenges we ran into

Our biggest challenge was label encoding section of the machine learning algorithm. This was extremely difficult to solve as this error would pop up during the training section and return results which were difficult to understand or process for further steps. In addition to this, an entire code anaylization has to be done so we were certain our dataset data was the right type for the keras library. Furthermore, we also experienced the challenge implementing an input image. This was due an issue with the installation of tensorflow which claimed we set up the wrong envoirnment; therefore, it took a while to debug the input section. Another problem we faced was with the front end HTML; we were planning to make this a whole website but with the environment we were unable too. The Conda environment was not compatible with the libraries we needed for front end development. So we pushed forward and manually insert images into the folders.

Accomplishments that we're proud of

We are proud of just how much we were able to make everything work together. Except from sending the photos to the backend where we process them, our program works together perfectly. We were able to send a perfect cropped image to the backend where it is extremely accurate in detecting if a stroke was present. Another thing that we are proud of is just how accurate our program is, we found that it was not accurate when it came to normal images but using the YoloV8 model made it extremely precise.

What we learned

We learned about using a Tensor / Numpy Array to make a CNN work. We also learnt how important a perfect enviroment is for a program since a perfect environment where things were going to different folders and files, it was accurate no matter what data was given. We also learnt a lot about how a YoloV8 mask works to crop into images and change backgrounds since it was very important to our program/model accuracy.

What's next for StrokePrediction

Our first step would be to make a whole project with a frontend and a backend. If someone is able to sponsor is in a nursing home, this would extremely helpful in the context of stroke detection at any time. But it would need to be redone to match a security camera software.

Built With

Share this project:

Updates