Why This Project

I was inspired to create this program because many in my community suffer from heart disease. This program is aimed to make a data driven prediction to prevent others from suffering from heart disease. Data driven predictions can help individuals better understand the impacts of their lifestyle choices and give patients a more comprehensive analysis of results of medical tests. By making data driven analysis of medical results more accessible, I hope to encourage others to lead a healthier lifestyle. While this tool is not a diagnosis tool, it can help make data-driven evaluation of medical results more accessible to the general public.

Functionality

This program is composed of two parts that work in unison. The front end HTML receives user input. The main page has a form which takes the user's medical information. The backend is a neural network that processes the user information. After submitting the HTML form, the backend neural network returns information regarding the user's risk for heart disease. The analysis will appear next to the form that the user submits. Below the analysis are lifestyle recommendations to help the user live a healthier lifestyle. Note that this website is intended to encourage users to lead a healthy lifestyle, and alert them when they are at high risk for heart disease. However, this website should not be used as a diagnosis tool.

Building Process At the heart of this program is a neural network. A neural network is a form of machine learning that predicts outcomes by drawing associations between elements of the data. The structure of a neural network is made to replicate the structure of the human mind's method of processing data. The input layer is the stimulus, or the information entered. The layers are the connections between the training data. The input data is processed based on the connections between the training data. The output layer is the returning layer that gives the final outcome from the layers between. Through these complex network neurons, a neural network connects different nodes when faced with new data. It then uses these connections to produce a result.

To start this project, I used a data set to predict the chance of heart disease from kaggle. I trained a neural network using this dataset using tensorflow. This training process starts with loading the data into the program via a csv file. To assist with this process, I used pandas. I then split my data into an 80% training set and a 20% testing set. Next, I set up the layers of the neural network and programmed the neurons. The final stage of creating a neural network is optimization. When training a neural network, there are many possible resulting networks; an epoch is an iteration of optimization. The more epochs one runs, the more likely one is to find the most optimized neural network. Since my data set is only 271 lines, smaller than most data sets used to train neural networks, I choose to run only 5 epochs.

The final stage of my project was the outward code interaction. To make my neural network accessible, I created a web page. In this web page, one must enter basic information about themselves. Upon submission, the program loads the information into the completed neural network. The neural network returns a result and the webpage prints this result.

While this program is not intended for medical use, my intention is to take a step in facilitating access of medically driven analysis to the general public. Through data driven analysis, one can encourage others to lead a healthier life.

Challenges As a high school student, machine learning is a new topic to me. Learning the technique of creating a neural network was challenging, and took up the majority of the time I spent in this competition. Furthermore, configuring an IDE to work with a package such as tensorflow proved to be a challenge. I spent a great deal of time reconfiguring my programming IDE and hoping my computer would not crash.

The above challenges were expected setbacks in my program, however, the most unexpected setback was not in a learning process, but in a known topic. I learned HTML programming in my school. I enjoy how HTML allows me to mix creativity with programming. However, I did not enjoy how HTML is difficult to mix with non-web design programming languages. Combining python and HTML proved to be a challenge on many levels. The online IDE Replit allowed me to use both programming languages in an easy to use user interface. The first challenge I encountered was sending information from HTML to python. After many struggles and experimenting with different libraries, I figured out that the solution was far simpler than I had anticipated, and involved a simple call between files.

The next struggle I faced was sending the results from the neural network back to the html file. This struggle left me stumped for hours. The solution to this problem came to me in an unconventional way. While observing a bird pecking the ground in search of a worm, I realized that a solution to the issue I was facing was simple, to move the information between files, similar to how the bird moved the soil. Rather than having the neural network directly return information to the html webpage, I made the neural network write information to a text file. Then I had the html file read the text file and display its contents. Through the journey of creating this project, I had many setbacks. But each setback was not only a chance to grow, but also helped with problem solving. Through the mistakes I made, I learned how to look at setbacks through different lenses and solutions as patterns found in reality and implemented in programming.

Accomplishments

Prior to the start of this project, I had never created a neural network. I had studied different forms of machine learning in my free time, but I had never had the reason to create a neural network. This Hackathon gave me the push needed to take the step of creating my first neural network. I hope to use the experience I gained from this hackathon in other pursuits in my journey as a programmer.

Another achievement that I made was I was able to use python as a backend to HTML. Prior to this submission, I had only used php and javascript to handle HTML events. However, after this hackathon, I look forward to using python as a backend to HTML. This new capability opens up many doors in programming, but has also taught me that looking for solutions in unconventional ways can help solve many problems.

Learned

One of the most impactful lessons I learned from this Hackathon is that solutions to problems are rarely found in a conventional way. So far in my journey as a student, I have always been trained to look for solutions through analyzing the problem. But in this hackathon, I learned that solutions to problems can manifest in common events in life. I learned how to knit together a neural network and an HTML page not through reading books, but through observing a bird eat a worm. This taught me that true learning takes place by combining the knowledge of a book with daily life.

What's next for Using Deep Learning to Predict the Chance of Heart Disease

Throughout the course of my project, I focused on the back end neural network. In a future version of my project, I would like to create a more aesthetic front end page that will be more user-friendly and exciting than the current version. Furthermore, the current lifestyle analysis that the neural network gives is very basic. I would like to expand the training data set that I used to create the neural network to allow it to give a more personalized response to user input.

Built With

Share this project:

Updates