0% found this document useful (0 votes)
296 views

Final Year Project Proposal: Heart Attack Predictor Using Artificial Intelligence

The document describes a proposed final year project to develop a mobile application to predict heart attacks using artificial intelligence. The project aims to predict heart attacks using either facial images and posture analyzed with convolutional neural networks, or by inputting heart-related attributes like blood pressure and sugar levels into an artificial neural network. A dataset of images showing infarct and non-infarct situations will be used to train the CNN, while a second dataset of medical attributes will be used to train the ANN. If an emergency is detected, the application will recommend contacting doctors and emergency contacts listed in the user's profile.

Uploaded by

ABDUL -
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
296 views

Final Year Project Proposal: Heart Attack Predictor Using Artificial Intelligence

The document describes a proposed final year project to develop a mobile application to predict heart attacks using artificial intelligence. The project aims to predict heart attacks using either facial images and posture analyzed with convolutional neural networks, or by inputting heart-related attributes like blood pressure and sugar levels into an artificial neural network. A dataset of images showing infarct and non-infarct situations will be used to train the CNN, while a second dataset of medical attributes will be used to train the ANN. If an emergency is detected, the application will recommend contacting doctors and emergency contacts listed in the user's profile.

Uploaded by

ABDUL -
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Final Year Project Proposal

SUMMER 2022

Project Title: Heart Attack Predictor Using Artificial Intelligence

Degree Program/
Title:
BSCS

Project
Supervisor Name Signature:
Muhammad Wajih uddin
and Designation:
Project Co-
Supervisor Name and Signature:
Designation (if any):

1. Aleena Iqbal (17513) 3.4


CGPA 1.
Student Name(s),
2. Ariba Azam (17385) 3.26 2.
Registration # & Signature(s):
CGPA 3.
CGPA’s:
3. Khawaja Hammad Hassan
(12573) 2.36 CGPA

1. 0315-2557725 Student [email protected]


Student
2. 0304-2394500 Email [email protected]
Mobile Number(s):
3. 0323-2034173
Address(es): [email protected]
Project Details:
A. Project Title: Health attack predictor using Artificial Intelligence
B. Project Start Date: July
C. Project Finish Date: January
D. Project Summary:

Heart attack is the leading cause of death in both men and women around the globe. According to the
report of WHO Cardiovascular disease is the main cause of death which approximately takes 17.9 million
lives throughout the year. From which 85% people died because of heart attack. According to American
heart association (AHA) 40% people died of heart attack at age of 40-59, 75% from 60-79 and 86% above
the age of 80 years. Also in many abroad countries a lot of elderly people prefer to stay at home and be
independent and they don't want to go to care center. However, choosing to live alone increase the risk
that you won't get help in time in an emergency, and even more. Therefore, when a person resides in a
remote area. The position in which the individual puts their hands to their chest and moves their upper
body forward is a result of the severe discomfort in the chest caused by a heart attack, which is present
in the majority of instances.

The ability to seek assistance quickly can mean the difference between life and death. Under all the
circumstances we are going to develop a mobile application which can predict the chances of getting
heart attack. Whenever the person is having symptoms of heart attack like excessive of sweating, serve
chest pain or shortness of breath can able to know about his heart condition. He can also be able to
communicate to his doctor in case of any emergency.

Heart attack predictor works in a way that a person can login or sign up. By Signing up he has to
complete his profile. He is also required to add three important contact numbers one must of his doctor
so he can communicate to his doctor in case of emergency. After adding the information, he could be
able to predict in two ways heart attack through images or by providing heart related features. For
classification from images we use Convolutional neural networks to classify whether the person is in an
infarct situation (possibly getting heart attack) or not. Also the person can predict heart attack through
giving heart related features like pulse rate, blood pressure, chest pain type, sugar rate. In case of an
emergency he can contact his doctor or two other people to help him. We use two datasets one is of
Images of non-infarct situation and infarct situation while other dataset is of attributes that are related
to heart attack. The frontend of this software is built on React Naive which is an advanced platform for
mobile application.
E. Project Scope & Objectives:

Many peoples are dying because of cardiovascular disease therefore if that specific person
would get assist in time can save his/her life. If someone is exhibiting symptoms of Heart
attack, shortness of breath, having chest pain, abnormal blood pressure, excessive sweating,
nausea and vomiting can immediately predict his heart condition and contact to the doctor
through this he will have less chances of being died.

The main objective of this application is to predict heart attack so many preciouses would be
save. This project is more affection with patients that need regular checkup and heart
managing system. Our application also ask person to recommend the doctor in case of any
dangerous situation. Our application is super budget and user friendly. A common man
without having any knowledge of medical can also aware about his heart health.

This system will work in two ways, first by taking human facial and posture images, which
will be passed on to Convolutional neural network. This model was developed by training
images. CNN will detect whether the person is possibly getting a heart attack or not.
Secondly by taking input from person about his pulse rate, blood pressure, cholesterol and
sugar rate and many more. This information will be passed to Artificial Neural network.
ANN works in three layers first is inputs which accepts the input value and pass it to hidden
layer which modifies the values by using weight values and transfer this value to output
layer which process information and produces an output. We also use some Machine
Learning model for classification of attributes data, like K-nearest neighbor, SVM , Logistic
Regression, Random forest and Decision tree classifier
F. Project Implementation Method:

Features:
 Splash screen
 Signup
 Login
 Predict heart attack through images of facial expression and posture.
 Predict heart attack trough providing heart related features like (chestpain,
cholesterol blood pressure, Sugar level and many more).
 Take 3 contact numbers for any kind of emergency.
 Predict heart attack on the basis of symptoms.
 Our application will recommend him to visit the doctor.
 Time and cost efficient.
 User-friendly.
 A person with less medical knowledge can also aware about his heart condition.
 A user can be able to send his report to doctor through Email.
G. Diagram:
ENTITY RELATIONSHIP DIAGRAM:
1. UML DIAGRAM:
i. Use-case Diagram:
ii. Activity Diagram:
2. Architectural Diagram:
Gant Chart:
Software Development Life cycle:
The software development life cycle serves as a framework for the project. It provides a
flexible medium to accommodate changes and perform the task to meet its objectives. The
SDLC methodology we used for this mobile application is Waterfall Model. It is simple and
easy to understand and use. The phases of the waterfall model include:

1. Requirement Analysis Phase

2. Design phase

3. Implementation phase:

4. Testing phase

1. Requirement Analysis Phase:


 In this phase, we have studied many Research papers related to heart attack prediction to
learn about different methods involved in the prediction. We discussed the requirements
to achieve the goal and how the requirement is going to be fulfilled. The problem
statement, Objectives, Scope, and the expected result were identified in this phase.

2. Design phase:
    The next phase of SDLC is the Design phase. To illustrate how the project is going to
work, we need to draw diagrams like Activity diagram, use-case diagram, Data Flow
diagram (DFD), and Entity Relationship Diagram (ERD).

3. Implementation phase:
After the requirement and designing phase, the next phase of SDLC is the
Implementation or development of the software. In this phase, we start the code
according to our requirements. We created the frontend, and select the different Machine
learning and Deep learning model which gives better accuracy, creation of backend, and
integration of the backend.

4. Testing phase:
The testing phase is the last phase of SDLC before the software is used. During
testing, we start to test the system against the requirements. The aim is to verify whether
this application behaves as expected and whether it is according to what was documented.
This phase is repeated until all the requirements have been tested and all the defects have
been fixed and the software is ready to use.
H. Methodology:
The aim of this application is to developed an algorithm that automatically predict
whether the person is possibly having a heart attack by analyzing images or by using the
input of heart data he provide.

I. Dataset:
We have two kinds of dataset first one is a dataset of images that are of two types one of
the infarct situation when person is possibly having a heart attack and the other is of non-
infarct situation when the person is healthy and there is no sign of the heart attack

Dataset for facial expression and posture[14]

The second dataset we use in our project is feature based. In which input attributes are
age, sex, and chest pain type, blood pressure, cholesterol and rate of sugar. Through this
he can detect whether he is getting heart attack.

Dataset for features[13]


J. Deep Learning Model:

1. CONVOLUTIONAL NEURAL NETWORK:


In our application the Convolutional neural network will be used to analyze the posture of
person. As CNN works in layers so the first layer will be of is the Convolutional layers which
extract the features from the image. Secondly there's a pooling layer to keep the number of
variable of network low so it will be easy to compute in that size. Thirdly there's a dropout layer
to prevents the generated model from presenting an envelope training. In the last there will be
Activation layer of Relu which classify whether the person having heart attack or not in the
image.

Convolutional Neural Network [3]


2. Artifical Neural Network:
Among the machine learning models we also use a deep learning model Artifical Neural Network
to better accuracy. ANN workd in three layers first the input layer, second the hidden layer and lastly the
output. INPUT LAYER: It accept the input values and pass to hidden layer by input layer this value is then
multiplied by a weight and added to the sum. HIDDEN LAYER : weight is multiplied to the input then a
combined value is produced by adding the resulting weighted values from each hidden layer neuron.
The combined outputs obtained from the hidden layer neurons are then given to the neurons in output
layer. OUTPUT LAYER: it will show the result in 0 and 1 form.

Artifical Neural Network[4]


ARTIFICIAL NEURAL NETWORK GRAPHS:
ANN MODEL ACCURACY GRAPH:

ANN MODEL LOSS GRAPH:


Accuracy 97.077%

Precision 100%

Recall 94.478%

F1 score 97.160%

DEEP NEURAL NETWORK:


A deep neural network (DNN) is an ANN with multiple hidden layers between the input
and output layers. DNNs can model complex non-linear relationships. The main
purpose of a neural network is to receive a set of inputs, perform progressively complex
calculations on them, and give output to solve real world problems like classification.
We have an input, an output, and a flow of sequential data in a deep network. The
weights and biases change from layer to layer. The DNN classifier consists of neuron
layers, which work using the activation function.

Deep neural network [18]


DEEP NEURAL NETWORK GRAPHS:
DNN MODEL ACCURACY GRAPH:
DNN MODEL LOSS GRAPH:

Accuracy 99.705%

Precision 100%

Recall 99.447%

F1 score 99.722%
K. Machine Learning Models:

1. K- NEAREST NEIGHBOUR
Another Machine Learning model that we use in our project is K-nearest neighbor; it is based on
supervised learning technique.

 KNN algorithm assumes the similarity between the new data and available data and put the new
data into category that is most similar to available category.
 KNN stores available data and classifies a new data based on similarity. This means when new
data appears it can be easily classified into a well suite category.

The Training Accuracy of this Model in our dataset is 91.77% and Testing Accuracy is 81.82%.

Working:
1. Select number K of neighbor. It can find by sqrt(n), where n is the total number of data points.
2. Calculate the Euclidian distance of K neighbor.
3. Take K nearest neighbor as per calculated Euclidean distance.
4. Among these Count number of data points in each category.
5. Assign the new data points to that category for which the number of neighbor is maximum.
6. Our model is ready.

KNN [7]
2. Logistic Regression

Another model that we used in our project is Logistic Regression. Logistic regression is one of the most
popular Machine Learning algorithms, which comes under the Supervised Learning technique. It is used
for predicting the categorical dependent variable using a given set of independent variables.

 The outcome of Logistic Regression must be either 1 or 0, yes or no, True or false.
 In logistic regression instead of fitting Regression line we fit an “S” shaped function.

Sigmoid Function in logistic Regression [8]

 Values map within the range of 0 and 1.


 Logistic regression is used for solving the classification problems.
 The value of the logistic regression must be between 0 and 1, which cannot go beyond this limit,
so it forms a curve like the "S" form. The S-form curve is called the sigmoid function or the
logistic function.
 In logistic regression, we use the concept of the threshold value, which defines the probability of
either 0 or 1. Such as values above the threshold value tends to 1, and a value below the
threshold values tends to 0.
Working:
1. Data preprocessing
2. Extract independent and dependent variable.
3. Split the dataset into training set and test set,
4. Predict the result.
5. Test Accuracy.
6. Visualize the training set result.

The Training Accuracy of this Model in our dataset is 89.54% and Testing Accuracy is 81.82%.
3. Support Vector Machine:
SVM is also one of the models that we have used in our project. It is based on supervised learning
model.

 It’s for regression and classification both, but widely used for classification.
 The goal of SVM algorithm is used to create the best line or decision boundary that can
segregate n-dimensional space into classes. This boundary is called hyperplane.
 SVM choses the close points/ vectors that can help in creating the hyperplane. These are called
support vectors.

Support vector Machine graph [10]

Working:
Working of linear SVM CLASSIFIER:

1. Let’s imagine we have two tags: green and blue, and our data has two features: x and y. We
want a classifier that, given a pair of (x,y) coordinates, outputs if it’s either green or blue.
We plot our already labeled training data on a plane :
2. A support vector machine takes these data points and outputs the hyperplane that best
separates the tags. This line is the decision boundary: anything that falls to one side of it we
will classify as blue, and anything that falls to the other as green.

The Training Accuracy of this Model in our dataset is 95.40% and Testing Accuracy is 90.26%.
4. Random Forest Classifier:
We also use another model for train and test our text dataset and that is random forest
classifier machine learning model. It is a supervised learning model which is used for both
classification as well as regression also. It works in to the 4 steps which as follows:

1. It takes the random samples from the given dataset


2. After taking dataset, it constructs the decision tree on every step. Then it will predict the
results from every decision tree.
3. After prediction, it will perform voting.
4. Then it will select the most voted prediction result as a final prediction result.

Training accuracy of our dataset with random forest classifier machine learning model is 97.08%
and the testing accuracy is 93.07%.

Random Forest Classifier [11]


5. Decision Tree Classifier:
We used another model for train and test our text dataset and that is decision tree machine
learning model. It is a supervised learning model which is used for both classification as well as
regression also. But mostly it is used in classification. A decision tree only asks a question and
divides the tree into sub trees according to the response (Yes/No). It starts with the root node
(complete dataset is present in the root node) then it will further have divided into sub trees.
There are the two nodes that are decision node and leaf node. Leaf node is also known as the
final output. And decision node is used to take decision.

Working:

1. Start with root node which contains a complete dataset.


2. After that find the best attribute using Attribute selection measure.
3. Divide the root node in to subsets according to the best attribute.
4. Create the best attribute-containing decision tree node.
5. Using the subsets of the dataset generated in step 3, repeatedly design new decision
trees. Continue along this path until you reach a point when you can no longer
categories the nodes and you refer to the last node as a leaf node.
Training accuracy of our dataset with Decision tree classifier machine learning model is 96.05%
and the testing accuracy is 91.08%.
Decision Tree Classifier [12]
TRAINING AND TESTING ACCURACY OF ML MODELS:

Chart Title
Training Accuracy % Testing Accuracy %

96.05 97.08
95.4
93.07
91.77 91.08
89.54 90.26

81.82 81.82

io
n rs ne er er
s bo hi s ifi s ifi
es g h a c
as as
e gr ne
i
rM Cl Cl
cR t to ee st
sti es c Tr re
gi ear Ve on F o
Lo n rt i
K- po cis om
up De a nd
S R

ML MODEL GRAPHS:
L. Frontend:
Our front end will consist of 6 screens in total that we will be building on vs code using
react native and node.

We have used Expo Cli for this project. We have used functional components instead of
making class components we have used numerous expo and react native packages to
improve the user experience. The first screen will be our splash screen which will be
showing our logo and slogan that takes us to our first welcome screen that is our login
page that will have our logo and a Welcome text beneath this we have email and
password options. if the user is new we will have an option at the bottom for sign up that
will take us to our third screen our signup page our sign up page consists of our app logo
and text that says “Enter your correct Information below” after this we have a sign up
form that has following fields:

Full Name

Age

Sex

Email

Password

Doctors Contact

Relatives Contact

Friends Contact

Once the user has filled all the information there’s a sign up button that takes the user to
login page. When the user has signed in that screen takes you to our main page that is
where the user will see our app logo a Text that says “Please choose from the options
below” and two buttons below either of the two of options which are Detect via image or
Detect via form. Detect via image will ask permission to use camera and will take an
image once the image is taken the user will be allowed to see if its right or not if its not
and the user wishes to take another there will be a discard option as well if the image is
correct and user wishes to save there’s a save button when pressed our image will be
stored in the gallery and used by our machine learning models to check if the person is
having a heart attack or not. The second option takes you to another screen where user
can see our logo and a form to enter their information such as BP, Pulse, Age, etc. Once
that is done the user will wait for the ML models to detect and check and show the results
and if the condition is not well the app shows you your three close contacts immediately
that u can contact and just via a click these contacts will be taken at the time of signup.
We have used Expo CLI for this project. We have used functional components instead of
making class components we have used numerous expos and react native packages to
improve the user experience.

M. Backend:
We will be using Node JS APIs that will be helping us with our front end development.
The first Api that we will be using is our CRUD Api for sign up this Api will basically be
used to take user data at registration time and connect the user to our database that will be
built in MYSQL that will store all the user information as such as their age their sex their
medical history if any and any of the three contacts that if in any emergency can be
contacted to. Another Api that we will be using is our Login Api that will take the user
email password and check with the database if the user exists or not and if not the user
will be prompted to enter the correct information. One of the Apis we will use is going to
be used to take user health information that the user will enter in the Detect via form page
as well as we will be using Python flask API to integrate AI models with front end to
show Check if the user is going to have a heart attack or not.
N. Key Milestones of the Project:

S. No. Elapsed time since start of the Milestone Deliverable


project
1. Week 01 – 03 Ideas discussion Mockups
2. Week 04 – 06 Frontend Front end development
Development, ML on react native using
model learning, expo Cli 60%
Dataset exploration. Development done.
Learning
Dataset exploration,
ML algorithms
learning

3. Week 07 – 09 Backend Database design and


Development, More 40% Apis made and
about ML models tested. Supervised and
Unsupervised learning.
4. Week 10 – 12 Project Review so Frontend, backend
Far Reviewed and Further
steps to be taken
decided, and start
leaning python
5. Week 13 – 14 Project integration, Backend integrated
Implementation of with Frontend and
ML models, system further few
architecture diagram. amendments made in
Apis as well as
Frontend Screens. ML
models
implementations and
system architecture
diagram.
6. Week 15 – 18 Front end Progress, Frontend completed
Broucher ready and 80% and Deep
UML diagrams learning models
implementation,
Broucher and UML
diagrams
7. Week 19-24 Backend Progress Backend Completed
and 70%
8. Week 25 – 30 Project Completion Frontend integration
with backend complete
Mobile app ready.
9. Week 31 – 36 Full documentation Documentation
10. Week 37 – 40 Project submission deployment

O. Final deliverable of the project :(Please tick one of the following)

□ Hardware system □ Software system □ HW/SW integrated


system
□ Software simulation □ Comparative study □ Theoretical design
results architecture
□ Simulator design □ Other (please
specify)
P. Please specify technical details of final deliverable:

Background:
Heart attack detection is a user-friendly mobile application where a common person can
aware of his infarct situation in an easy and cheap way. He will be able to detect to know
about his prediction of getting heart condition through two means. One by image
detection of the person posture where the Convolutional neural network will classify
whether the person is going through infarct situation or not. In the same he can be able to
detect his heart condition via form based where have to give input about his pulse rate,
blood pressure, cholesterol and sugar rate then Artificial Neural network will predict the
chances of getting a heart attack.

Working:
1. First a person has to login or sign up to this application.
2. Then he has to complete his profile also he has to provide 3 important contact one
must of his doctor in case of emergency.
3. Then he has two options displaying on his screen one is to detect heart attack via
images and other is to detect via features.
4. For instance, he clicks on detection via images so he required to add images of his
posture through which Convolutional neural network will predict whether he is in
infarct situation or not.
5. Now let suppose he click on the button to detect via form so screen will display
which required adding some details about his pulse rate, blood pressure,
cholesterol and sugaring rate.
6. By filling the form, a pop-up screen will appear which will predict the chances of
getting heart attack.

Q. Equipment required for the project:


 Mobile
 WIFI
 Laptop
 Camera
R. Benefits of the project:
1. A common person who has no background of medicine can also predict the chances
of getting heart attack.
2. This application will provide easy and cheap means for heart attack prediction.
3. A person can communicate with doctor in case of emergency.
4. By this he will do self-care to prevent from any miserable situation.
5. This application will provide ease for people who have checkups on regular basis.
6. He can easily use this application when he is not feeling well.
7. We are promise to predict 91% accurate results.

S. Budget of the project

Tools Description Price (rupees)

Web hosting One year’s websites hosting ₨:4000


with backup
Domain One-year domain ₨:5000
toqreeb.com

Android For deploy on play store RS:3,000


Others For need per like API or etc. RS:10000
Total RS :22000
References
[1] https://www.who.int/health-topics/cardiovascular-diseases/#tab=tab_1

[2] https://www.medicalnewstoday.com/articles/heart-attack-age-range#incidence-rate

[3] Yahaya, S.W.; Lotfi, A.; Mahmud, M. A Consensus Novelty Detection Ensemble Approach for
Anomaly Detection in Activities of Daily Living. Appl. Soft Comput. 2019, 83, 105613

[4] https://www.sqlshack.com/implement-artificial-neural-networks-anns-in-sql-server/

[5] https://www.bmc.com/blogs/deep-neural-network

[6] Ankita R. Mokashi, N. Tambe, T. Walke Review on Heart Disease Prediction using Ann and
Classifier 2015, 2278-0181

[7] https://towardsdatascience.com/knn-visualization-in-just-13-lines-of-code-32820d72c6b6

[8] cloud.smartdraw.com/editor.aspx?templateId=c5f87982-5d73-462e-b500-
1b0fe9d057b9&flags=128#depoId=37113725&credID=-40410646

[9] https://medium.com/analytics-vidhya/logistic-regression-b35d2801a29c

[10] https://www.javatpoint.com/machine-learning-support-vector-machine-algorithm

[11]https://www.tutorialspoint.com/machine_learning_with_python/
machine_learning_with_python_classification_algorithms_random_forest.htm

[12] https://www.javatpoint.com/machine-learning-decision-tree-classification-algorithm

[13] https://www.kaggle.com/datasets/johnsmith88/heart-disease-dataset

[14] https://github.com/Turing-IA-IHC/Heart-Attack-Detection-In-Images/tree/master/
dataset

[15] https://vemanait.edu.in/pdf/cse/18-19-Paper/Mrs.Jayashree-L%20K-Heart-Disease-
Protection-System.pdf

[16] https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3884968

[17] https://www.mdpi.com/2076-3417/9/23/5065

[18] https://www.bmc.com/blogs/deep-neural-network

You might also like