Inspiration

Bioinformatics has become a major research area in the field of artificial intelligence and machine learning. One of our team members works with the Ashburn Fire Department and was able to see the effects of inadequate diagnostic tools, especially with volunteers' skills in diagnosis of heartbeats.

What it does

Our project uses a convolutional neural network (CNN) and a long short-term memory (LSTM) with multi-class classification of heartbeats. The network is situated on a website for .wav file upload for our algorithm to apply sine pad sequences to extract quantitative data from the audio file for analysis.

How we built it

CardioIntel's website was built using Python3, HTML5, CSS, JavaScript, and the Flask python micro-framework to accommodate for our python backend. Our file upload system was built using JQuery and was passed via a POST request to an Ajax handler. The algorithm itself was built initially using a Random Forest model, but due to the bad specificity, the model was determined to be inappropriate. We attempted to fix this problem by introducing more leaf nodes and deeper trees, but this still didn't solve the problem. We finally added a 1-dimensional CNN and then a GPU-optimized [CUDA] LSTM, trained the model on the Google Colab platform, and finally achieved a validation accuracy of 74.6%. Once the model was trained, we exported the neuron weights and model architecture into an HDF5 and JSON file, respectively. We used this with our main website code to rebuild the model and classify heartbeats based on the user uploaded files.

Challenges we ran into

One of the major issues we ran into integrating the website files with the structure required by Flask. After organizing the folders properly, we ended up having to deal with internal server errors because we attempted to use PHP for file handling, but Flask has deprecated support for PHP, so we had to reroute the POST request through Ajax and JQuery for secure file uploads that would save to a temporary storage on the server. When running our application locally after improving our model architecture with the CNN and LSTM, we ran into errors with our local machine's capability in terms of RAM allocation and GPU power. To solve this problem, we had to decide between using Amazon Web Services and Google Cloud Platform, but based on costs, we used the Google Cloud Platform to train our model. Throughout the process, we ran our application on debug mode in Flask and in PyCharm so that we could properly diagnose our errors and be able to solve the specific problem to prevent any waste of valuable time.

Accomplishments that we're proud of

We are especially proud of learning and integrating the Flask framework with the Python backend, running the neural network, and the front-end website. We are also proud of being able to develop the entire CNN/LSTM model within 24 hours.

What we learned

The most significant thing we learned throughout this project was to plan and design all of our tasks before we launched into working on them, as we had to deal with many minute issues that not only wasted time, but also made the project much more complicated and intricate.

What's next for Team80A: CardioIntel

CardioIntel would initially like to improve the validation accuracy of our model. Eventually, we would like to analyze heartbeats in real time using an iOS/Android application. We also want to send the website onto the production server, something we weren't able to accomplish during this event because of the lack of a domain.

Built With

Share this project:

Updates