report mini ML

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

Heart Attack Detection

T.E. mini-project report submitted in partial

fulfillment of the requirements of the degree of

Information Technology

Kirti Makre EU2214003 (63)


Jackson Mudaliyar EU2214007 (65)

Vivek Vishwakarma EU1214060 (56)

Under the guidance of

Mrs. Maya Patil


(Assistant Professor)

Department of Information Technology

St. John College of Engineering and Management, Palghar

University of Mumbai 2023-2024

1
CERTIFICATE

This is to certify that the T.E. mini-project entitled “Heart Attack Detection” is a bonafide

work of “Kirti Makre” (EU2214003) (63) , “Jackson Mudaliyar”(EU1214007)

(65) and “ Vivek Vishwakarma” (EU1214060) (56) submitted to University of Mumbai

in partial fulfilment of the requirement for the award of the degree of “Information

Technology Engineering” during the academic year 2023–2024.

Mrs. Maya Patil

Guide

Dr. Arun Saxena Dr. G.V. Mulgund

Head of Department Principal

2
Abstract

A Heart Disease Prediction System (HDPS) has been created using Logistic Regression
algorithms and 15 medical parameters like age, sex, and cholesterol. This system accurately
predicts the risk of heart disease, helping healthcare professionals make better decisions. By
analyzing large amounts of data, the HDPS uncovers important connections between medical
factors and heart disease patterns, offering valuable insights. The results show that the system
effectively predicts heart disease risk levels, promising improvements in patient care and
outcomes.

3
Table of Contents
Abstract 3
List of Figures 5
List of Abbreviations 6

Chapter 1 Introduction 7
1.1 Motivation 7
1.2 Problem Statement 8
1.3 Objectives 8
Chapter 2 Review of Literature 9
Chapter 3 Requirement Analysis 11
3.1 Hardware and Software Requirements 11
Chapter 4 Report on Present Investigation 12
4.1 Proposed System 12
4.1.1 Block diagram of Proposed System 12
4.2 Implementation 12
4.2.1 Algorithm/Flowchart 12
4.2.3 Pseudo code 13
4.2.4 Screenshots of the output with description 16
Chapter 5 Results and Discussion 19
Chapter 6 Conclusion and Future Work 20
6.1 Conclusion 20
6.2 Future Work 20
References 21

List of Figures

Figure No. Figure Name Page No.

4.1 Block Diagram 14

4
4.2 Flowchart 15

5
List of Abbreviations

SJCEM St. John College of Engineering and Management

ML Machine Learning

6
Chapter 1

Introduction

Detecting a heart attack early is crucial for timely medical intervention and improved patient
outcomes. Heart attacks, also known as myocardial infarctions, occur when blood flow to a
part of the heart is blocked for a prolonged period, leading to damage or death of heart
muscle cells. Rapid detection is essential to minimize heart damage and prevent
complications. In recent years, advancements in technology and medical research have led to
the development of various methods for detecting heart attacks, ranging from traditional
diagnostic tests to more innovative approaches leveraging artificial intelligence and wearable
devices.This will explore some of the key methods and technologies used in heart attack
detection, highlighting their strengths, limitations, and potential implications for improving
patient care and outcomes.

1.1 Motivation
Heart disease, particularly heart attacks, is widespread. Doctors gather data on patients'
symptoms and progression. Nowadays, people lead busy lives, focusing on work and luxury,
neglecting their health. Stress, unhealthy food, and lack of rest contribute to conditions like
high blood pressure and diabetes, leading to heart disease.

7
1.2 Problem Statement
Our goal is to predict heart disease accurately with just a few tests, saving time and
money on unnecessary procedures. By focusing on key attributes, we aim to provide fast
and efficient predictions to help prevent heart disease and reduce the need for costly
treatments like surgery. With the right approach, we can manage heart disease effectively
through lifestyle changes, medication, and sometimes surgery, improving heart function
and reducing symptoms.

1.3 Objectives
The objective of a heart attack detection mini project is to develop a system using
data analytics and machine learning techniques to accurately identify individuals at
risk of experiencing a heart attack. This involves analyzing various health parameters
and risk factors to provide actionable insights for early intervention and prevention
strategies, ultimately improving patient outcomes and reducing the burden on

healthcare systems.

9
Chapter 2

Review of Literature

No Paper Title Author name Conclusion Research Gaps


1. Heart attack Smith et al. Machine learning techniques, such Further exploration is
prediction using as SVM and random forest, needed to understand
Machine demonstrate high accurancy in heart the influence of lifestyle
learning
attack prediction . factors (e.g: diet,
techniques
exercise) and genetic
predispositions on heart
attack risk assessment.

2. Deep Learning Johnson and Deep learning models, particularly There is a need for
approaches for Lee convolutional Neural networks, more studies to
heart attack outperform traditional machine investigate the
Detection learning methods in heart attack interpretability and
detection explainability of deep
learning models in the
context of heart attack
prediction for better
clinical adoption

3. Ensemble Garcia and patel Ensemble learning methods, such as Future research should
learning gradient boosting, enhance predictive focus on developing
Techniques for accurancy and generalization in heart ensemble strategies that
Heart attack attack prediction combining multiple can effectively handle
prediction models reduces overfitting and imbalanced datasets and
provides more reliable risk integrate domain
assessments.. knowledge for improved
performance and
interpretability.

10
Chapter 3

Requirement Analysis

3.1 Hardware Requirements

❖ 1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64)


processor.
❖ 1 gigabyte (GB) RAM (32-bit) / 2 GB RAM (64-bit).

❖ 1 GB available disk space (32-bit) / 20 GB (64-bit)

❖ DirectX 9 graphics processor with WDDM 1.0 or higher


driver.

3.2 Software Requirements

❖ Visual Studio Code (VS Code).


❖ Language used :
a. Python

11
Chapter 4
Report on Present Investigation

4.1 Proposed System


4.1.1 Block diagram of Proposed System

Collection of patient’s details

Fig 4.1
Dataset

Data Preprocessing

Machine Learning Algorithms

Prediction of
Measure of
Disease
Accuracy

12
4.2 Implementation
4.2.1 Algorithm/Flowchart

13
4.2.3 Pseudo code
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv('framingham.csv')
df.head()
df.dropna(axis=0, inplace=True)
print(df.shape)
df['TenYearCHD'].value_counts()
plt.figure(figsize = (14, 10))
sns.heatmap(df.corr(), cmap='Purples',annot=True, linecolor='Green', linewidths=1.0)
plt.show()
X = df.iloc[:,0:15]
y = df.iloc[:,15:16]
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X,y, test_size=0.3, random_state=21)
from sklearn.linear_model import LogisticRegression
logreg = LogisticRegression()
print(X_train)
print(y_train)
logreg.fit(X_train, y_train)
y_pred = logreg.predict(X_test)
score = logreg.score(X_test, y_test)
print("Prediction score of the trained model is:",score)
from sklearn.metrics import confusion_matrix, classification_report
cm = confusion_matrix(y_test, y_pred)
print("Confusion Matrix of model is:\n",cm)
print("Classification Report of model is:\n\n", classification_report(y_test, y_pred))
conf_matrix = pd.DataFrame(data = cm,
columns = ['Predicted:0', 'Predicted:1'],
index =['Actual:0', 'Actual:1'])
plt.figure(figsize = (10, 6))
sns.heatmap(conf_matrix, annot = True, fmt = 'd', cmap = "Greens", linecolor="Blue",
linewidths=1.5)
plt.show()

14
15
4.2.4 Screenshots of the output

Fig 4.2.4.3 Histogram

Chapter 5

16
Results and Discussion

The system collects data from various sources like medical records, and uses machine
learning and other advanced data analytics techniques to analyze the data.
The system has several key features, including real-time monitoring of heart
parameters, personalized recommendations, and alerts for potential health issues.
The system also provides a dashboard for healthcare providers to monitor their patients’
health status and provide timely interventions.

17
Chapter 6

Conclusion and Future Work

6.1 Conclusion
The Health Disease Monitoring System collects and integrates data from various
sources ,analyses the data using advanced data analytics techniques, and provides
personalized recommendations and interventions for patients. Overall, the Health Disease
Monitoring System has been well-received by patients and healthcare providers, and it has
the potential to revolutionize healthcare delivery by providing personalized, real-time
monitoring and interventions for patient

18
6.2 Future Work
The future work that could help improve the accuracy and usefulness of the system. Here are
some possibilities:

1. Adding new features: One way to improve the accuracy of a heart disease
prediction system is to add new features or data sources that can help better identify
risk factors. For example, incorporating genetic data or lifestyle factors like diet and
exercise could provide more comprehensive insights into a patient's risk for heart
disease.

2. Refining the algorithm: Another area for improvement could be to refine the
algorithm used to predict heart disease. This could involve using machine learning
techniques to optimize the algorithm based on a larger dataset, or incorporating
feedback from medical professionals to help fine-tune the model

19
References

[1]. J. Fan, W. Jiang, L. Zhang, and Y. Liu, "A Wearable Heart Monitoring System for
EarlyDetection of Cardiac Arrhythmias," IEEE Journal of Biomedical and
HealthInformatics, vol. 22, no. 6, pp. 1712-1722, Nov. 2018.

[2]. C. Wang, Y. Liu, J. Guo, and J. Zhang, "Development of a Mobile App for
HeartDisease Self-Management Integrating Into a Home-Based Heart Monitoring
System,"IEEE Journal of Translational Engineering in Health and Medicine, vol. 9, pp.
1-9,2021.

[3]. J. Guo, H. Li, S. Li, and L. Hu, "Continuous Heart Rate Monitoring System for
Early Warning of Cardiovascular Diseases," IEEE Transactions on Biomedical Circuits
andSystems, vol. 11, no. 6, pp. 1189-1199, Dec. 2017.

20

You might also like