0% found this document useful (0 votes)
7 views39 pages

4th Year Project

The project report titled 'Cardiac Care' presents a web-based Clinical Decision Support System (We-CDSS) developed using Django, aimed at improving healthcare accessibility and decision-making for Coronary Artery Disease (CAD). It integrates predictive analytics with the LWGMK-NN algorithm to assess CAD risk and provides personalized lifestyle recommendations, promoting early diagnosis and proactive care management. The project is submitted by students of CMR Institute of Technology as part of their Bachelor of Engineering in Computer Science and Engineering requirements.

Uploaded by

Rishabh Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views39 pages

4th Year Project

The project report titled 'Cardiac Care' presents a web-based Clinical Decision Support System (We-CDSS) developed using Django, aimed at improving healthcare accessibility and decision-making for Coronary Artery Disease (CAD). It integrates predictive analytics with the LWGMK-NN algorithm to assess CAD risk and provides personalized lifestyle recommendations, promoting early diagnosis and proactive care management. The project is submitted by students of CMR Institute of Technology as part of their Bachelor of Engineering in Computer Science and Engineering requirements.

Uploaded by

Rishabh Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belgaum-590018

A PROJECT REPORT (21CSP76) ON

“CARDIAC CARE”
Submitted in Partial fulfillment of the Requirements for the Degree of

Bachelor of Engineering in Computer Science & Engineering


By

SAKSHAM SINGH (1CR21CS161)

SAMEER SINGH (1CR21CS162)

SAMPADA R DESAI (1CR21CS163)

Under the Guidance of,


Dr. Kavitha P
Associate Professor, Dept. of CSE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CMR INSTITUTE OF TECHNOLOGY

#132, AECS LAYOUT, IT PARK ROAD, KUNDALAHALLI, BANGALORE-560037


CMR INSTITUTE OF TECHNOLOGY
#132, AECS LAYOUT, IT PARK ROAD, KUNDALAHALLI, BANGALORE-560037

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE
Certified that the project work entitled “CARDIAC CARE” carried out by Mr. SAKSHAM SINGH,
USN 1CR21CS161 Mr. SAMEER SINGH, USN 1CR21CS162, Ms. SAMPADA R DESAI, USN
1CR21CS163, bonafide students of CMR Institute of Technology, in partial fulfillment for the award
of Bachelor of Engineering in Computer Science and Engineering of the Visveswaraiah
Technological University, Belgaum during the year 2024-2025. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the Report
deposited in the departmental library.

The project report has been approved as it satisfies the academic requirements in respect of Project
work prescribed for the said Degree.

________________ ________________ ________________


Dr. Kavitha P Dr.R Kesavamoorthy Dr. Sanjay Jain
Associate Professor Professor & Head Principal
Dept. of CSE, CMRIT Dept. of CSE, CMRIT CMRIT

External Viva

Name of the Examiners Signature with Date

1. ___________________________ ________________________

2. ___________________________ ________________________

ii
DECLARATION

We, the students of Computer Science and Engineering, CMR Institute of Technology,
Bangalore declare that the work entitled "CARDIAC CARE" has been successfully completed
under the guidance of Prof. Kavitha P, Computer Science and Engineering Department, CMR
Institute of Technology, Bangalore. This dissertation work is submitted in partial fulfillment of
the requirements for the award of Degree of Bachelor of Engineering in Computer Science and
Engineering during the academic year 2024 - 2025. Further, the matter embodied in the project
report has not been submitted previously by anybody for the award of any degree or diploma to
any university.

Place:Bengaluru

Date:18/12/24

Team members: Signature

SAKSHAM SINGH (1CR21CS161) __________________

SAMEER SINGH (1CR21CS162) __________________

SAMPADA R DESAI (1CR21CS163) __________________

iii
ABSTRACT

This project presents a web-based Clinical Decision Support System (We-CDSS) developed
using Django, focused on improving healthcare accessibility and decision-making. The system
integrates predictive analytics with the LWGMK-NN algorithm to assess Coronary Artery
Disease risk and utilizes prescriptive analytics to generate personalized lifestyle
recommendations. With a user-friendly interface, compatible with both computers and mobile
devices, We-CDSS enables early diagnosis, prevention, and personalized care management. It
bridges the gap between technology and healthcare, empowering clinicians and individuals to
make informed decisions, promoting better health outcomes, and fostering a proactive approach
to heart disease management.

iv
ACKNOWLEDGEMENT

I take this opportunity to express my sincere gratitude and respect to CMR Institute of
Technology, Bengaluru for providing me a platform to pursue my studies and carry out my final
year project
I have a great pleasure in expressing my deep sense of gratitude to Dr. Sanjay Jain,
Principal, CMRIT, Bangalore, for his constant encouragement.
I would like to thank Dr.R Kesavamoorthy, Professor and Head, Department of
Computer Science and Engineering, CMRIT, Bangalore, who has been a constant support and
encouragement throughout the course of this project.
I consider it a privilege and honor to express my sincere gratitude to my guide
Dr. Kavitha P, Associate Professor, Department of Computer Science and Engineering, for the
valuable guidance throughout the tenure of this review.
I also extend my thanks to all the faculty of Computer Science and Engineering who
directly or indirectly encouraged me.
Finally, I would like to thank my parents and friends for all their moral support they have
given me during the completion of this work.

v
TABLE OF CONTENTS

Page No.
Certificate ii
Declaration iii
Abstract iv
Acknowledgement v
Table of contents vi
List of Figures viii
List of Tables ix
List of Abbreviations x
1 INTRODUCTION 1-4
1.1 Problem Statement
1.2 Objectives
1.3 Methodology
1.4 Relevance
1.5 Gantt Chart

2 LITERATURE SURVEY 5
3 SYSTEM DESIGN 6-12
3.1 System Architecture
3.2 Software Requirements
3.3 Hardware Requirements
4 IMPLEMENTATION 13-15
4.1 Algorithm
5 RESULTS AND DISCUSSION 16-22
5.1 OUTPUT
6 TESTING 23-25

vi
6.1 Unit Testing
6.2 Integration Testing
6.3 Hybrid Testing
7 CONCLUSION AND FUTURE SCOPE 26-27
7.1 CONCLUSION
7.2 FUTURE SCOPE

8 REFERENCES 28
APPENDIX 29

vii
LIST OF FIGURES

Page No.
Fig 5.11 Home-page 17
Fig 5.12 Clinician’s Form 17
Fig 5.13 Prediction for Clinician’s Form 18
Fig 5.14 Patient’s Form 18
Fig 5.15 Prediction for Patiemt’s Form 19
Fig 5.16 Comparision of various Algorithms with LWGMKNN 27

viii
LIST OF TABLES

Tables Page No.


Table 5.11 Performance Comparison of Machine Learning Algorithms for 19
Predictive Analytics

ix
LIST OF ABBREVIATIONS

LWGMKNN Locally Weighted Global Mean K-Nearest Neighbour

x
Cardiac Care

CHAPTER 1

INTRODUCTION
The challenge lies in creating a system that integrates both predictive and prescriptive
analytics, providing accurate predictions for CAD risk and actionable, personalized
recommendations. The goal is to make this solution available on web and mobile
platforms for maximum accessibility.

We will develop a web-based Clinical Decision Support System (We-CDSS) using


the Django framework, incorporating the following features:

 Predictive Analytics: Implement the LWGMK-NN algorithm to predict CAD risk


based on patient data.

 Prescriptive Analytics: Generate personalized lifestyle recommendations to


mitigate risk, offering prescriptive care based on predictive results.

 User Accessibility: Ensure the system is available on both computers and mobile
devices for use by clinicians and the general public alike.

1.1 Problem Satatement


Goal of the Project:
The goal of this project is to develop a system that facilitates early detection and
prevention of Coronary Artery Disease (CAD) by providing accessible diagnostic
tools and personalized medical advice. This aims to empower individuals, especially
those without regular access to healthcare, to monitor their heart health and take
preventive actions.
The gap between the existing systems in place and the ideal system
 Limited Accessibility: Existing systems are primarily clinician-focused and not
readily accessible to the general public.
 Lack of Integration: Few systems integrate both predictive and prescriptive
analytics for Coronary Artery Disease.
 Non-personalized Recommendations: Most systems do not offer tailored
lifestyle recommendations based on predictive results, limiting their usefulness
for preventive care.

Dept of CSE, CMRIT 2023-2024 Page 1


Cardiac Care

1.2 Objectives
Develop a Predictive Model for CAD: Implement the LWGMK-NN algorithm to
accurately predict the likelihood of Coronary Artery Disease based on user input,
addressing the need for early diagnosis in both clinical and public settings.
Integrate Prescriptive Analytics: Create a prescriptive engine that generates
personalized lifestyle recommendations for users based on their predictive CAD risk,
helping reduce the likelihood of disease progression.
Ensure Multi-Platform Accessibility: Build a web-based system that is responsive
and accessible on both computers and mobile devices, making it easy for clinicians
and the public to use the CDSS from anywhere.
Provide a User-Friendly Interface: Design an intuitive user interface for both
medical professionals and non-expert users, ensuring ease of use while delivering
actionable insights on CAD risk and prevention.

1.3 Methodology
Data Collection:
 Use publicly available datasets or clinical data that contain patient information,
including health metrics (e.g., age, blood pressure, cholesterol levels, BMI) and
lifestyle factors (e.g., smoking, exercise habits).
 Ensure the data includes labeled instances of CAD cases and non-CAD cases for
training and validation.
Predictive Analytics:
 Implement a machine learning model, such as the LWGMK-NN algorithm
(Lightweight Generalized Minkowski k-Nearest Neighbors), for CAD risk
prediction.
 Train the model to classify individuals as high or low risk based on health and
lifestyle factors.
Feature Selection:
Identify key predictors of CAD, such as age, gender, family history, blood pressure,
cholesterol, and exercise frequency, to improve model performance and
interpretability.

Dept of CSE, CMRIT 2023-2024 Page 2


Cardiac Care

System Design:
 Frontend: Create a web-based interface using Django for ease of access.
 Backend: Integrate the predictive model with a clinical decision support system
(We-CDSS).
 Database: Use a relational database to store user information, risk scores, and
recommendations securely.
Prescriptive Analytics:
 Design an algorithm to provide personalized lifestyle recommendations, such as
diet plans, exercise routines, and habits to reduce CAD risk.
 Use evidence-based clinical guidelines to create recommendations tailored to
user profiles.
Testing and Validation:
 Validate the system using clinical and real-world data to ensure accuracy and
usability.
 Conduct user testing with clinicians and general users to refine the interface and
functionality.
Deployment and Maintenance:
 Host the system on a cloud platform for scalability and accessibility.
 Regularly update the model with new data and clinical guidelines.

1.4 Relevance
Early Detection:Facilitates timely identification of CAD risk, enabling individuals to
take preventive measures early.
Accessibility:Provides an easy-to-use platform that bridges the gap between clinical
expertise and public healthcare needs, especially in remote or underserved areas.
Personalized Care:Offers tailored lifestyle interventions, improving the effectiveness
of preventive measures and promoting healthier living.
Support for Clinicians:Enhances decision-making by providing clinicians with a
risk assessment tool backed by predictive analytics.
Cost-Effective Solution:Reduces healthcare costs by preventing severe
complications through early intervention.

Dept of CSE, CMRIT 2023-2024 Page 3


Cardiac Care

Scalability and Public Health Impact:A scalable system that can be adapted for

global use, potentially lowering the overall burden of CAD on healthcare systems.

1.5 Gantt Chart

Task Duration Start Date End Date


Planning & Requirements 2 weeks Sep 2024 Sep 2024
Data Collection &Pre-processing 2 weeks Oct 2024 Oct 2024
Model Development & Testing 2 weeks Oct 2024 Dec 2024
System Integration & UI Design 1 week Dec 2024 Dec 2024
Deployment & Evaluation 1 week Ongoing Ongoing
Post-Deployment Monitoring 1 week Ongoing Ongoing
Fig 1.1 Gantt Chart

Dept of CSE, CMRIT 2023-2024 Page 4


Cardiac Care

CHAPTER 2

LITERATURE SURVEY

References Technique Objective/ Existing Advantages Demerits


Feature Algorithms

[1] Point of Care Community Clinical Enhanced Limited


CDSS Health Support Workflows Monitoring Access
Implementation

[2] P3-EX (Prioritize Exercise Exercise Personalized Needs


Personalize Prescription Prescription Care Validation
Prescribe
Exercise) CDSS

[3] HDPM (Heart Disease Multiple High Accuracy Data Issues


Disease Prediction ML
Prediction Algorithms
Model) with
XGB

[4] SMARTool Risk Tree-based Comprehensive Unclear


Platform Assessment Models Platform Results

[5] Web-based GDSI Guideline Support Systematic Limited


(Graphical Implementation Rules Approach Access
Decision Support
System)

Dept of CSE, CMRIT 2023-2024 Page 5


Cardiac Care

CHAPTER 3

SYSTEM DESIGN
The system architecture for the Coronary Artery Disease (CAD) Prediction and
Recommendation System is designed using a three-layer architecture comprising
the User Interface Layer, Application Layer, and Data Layer. This modular
structure ensures seamless interaction between users, the backend server, and
machine learning components. The User Interface Layer serves as the access point
for users through a web-based frontend, enabling data input and visualization of
results. The Application Layer, powered by the Django framework, handles the
business logic, processes user inputs, and interacts with machine learning models to
generate predictions. Finally, the Data Layer manages data storage in the database
and hosts machine learning models, ensuring efficient computation and reliable
storage of inputs and outputs. This design bridges the gap between users and
advanced predictive analytics, providing an accessible, scalable, and user-friendly
system for CAD risk assessment and lifestyle recommendations.

3.1 System Architecture

Fig 3.1 System Architecture

Dept of CSE, CMRIT 2023-2024 Page 6


Cardiac Care

1. User Interface Layer


User Devices (Web Browser):

 This module serves as the entry point for users to interact with the system.

 Users can access the web application through browsers on devices like laptops,
desktops, or mobile phones.

 It allows users to input data (e.g., health details) and view predictions or
recommendations.

Frontend (HTML, CSS, JS):

 The frontend is developed using standard web technologies like HTML, CSS,
and JavaScript.

 It provides a user-friendly interface for users to input health-related data and


receive outputs like CAD risk predictions and lifestyle recommendations.

 This layer ensures a seamless user experience with interactive components and
visualization tools.

2. Application Layer
Web Server:

 The web server acts as a bridge between the user interface and the backend logic.

 It manages HTTP requests from the user's browser and returns the appropriate
responses.

 It ensures efficient communication between the frontend and the backend


components.

Django Framework:

 The Django framework handles the core application logic of the system.

 It processes user inputs, interacts with the database and machine learning models,
and manages the flow of data.

Dept of CSE, CMRIT 2023-2024 Page 7


Cardiac Care

 Django ensures data validation, routing, and integration with the backend
services to generate predictions.

3. Application Layer
Database:

 The database stores user inputs, CAD-related risk data, and historical information.

 It allows efficient data retrieval and management, ensuring the system can store
large amounts of health and user data securely.

Example: User health metrics (e.g., age, cholesterol levels, blood pressure) can be
stored for future reference.

ML Models Server:

 This module hosts the machine learning models used for predictive analytics.

 It processes input data, applies the trained CAD prediction models, and generates
results.

 The ML models perform calculations to assess CAD risk and provide


personalized recommendations.

 It ensures that the predictive analytics are accurate, reliable, and delivered
quickly to the user.

3.2 Software Requirements

1. Backend: Django (Python 3.8+)

Django:

 A high-level Python web framework used for building robust and scalable web
applications.

 It provides built-in features like ORM (Object Relational Mapping), user


authentication, and admin interface to speed up development.

 Supports rapid development, clean design, and secure coding practices.

Dept of CSE, CMRIT 2023-2024 Page 8


Cardiac Care

Python 3.8+:

 The programming language used for Django development.

 Python is versatile, easy to learn, and widely used for both web development and
machine learning tasks.

2. Frontend: HTML, CSS, JavaScript, Bootstrap

HTML (HyperText Markup Language):

 The backbone for creating the structure of web pages.

 It is used to define headings, forms, tables, and input fields.

CSS (Cascading Style Sheets):

 Used for styling the web pages (e.g., layout, colors, fonts, and responsive design).

 Ensures the user interface is visually appealing.

JavaScript:

 Adds interactivity and dynamic behavior to web pages.

 For example, it enables real-time input validation, data visualization, and user
interactions.

Bootstrap (Optional):

A front-end framework that provides ready-to-use UI components and responsive


design capabilities.

React/Vue (Optional):

 JavaScript libraries/frameworks for building highly interactive, reusable, and


efficient user interface components.

 Optional for enhancing frontend performance and modular design.

Dept of CSE, CMRIT 2023-2024 Page 9


Cardiac Care

3. Database:PostgreSQL/MySQL(Production), SQLite (Development)

PostgreSQL/MySQL (Production):

 Both are relational databases that efficiently store and manage structured data.

 PostgreSQL: Known for reliability, advanced querying, and data integrity.

 MySQL: Popular for speed, performance, and ease of use in production


environments.

SQLite (Development):

 A lightweight, file-based database used during development for faster testing and
deployment.

 Requires minimal configuration and setup.

4. Machine Learning Libraries: scikit-learn, NumPy, pandas

scikit-learn:

 A machine learning library for Python used to implement predictive models.

 It supports tasks like classification, regression, and clustering for CAD risk
analysis.

NumPy:

A numerical computing library for Python used to handle large multi-dimensional


arrays and perform mathematical operations efficiently.

pandas:

 A data analysis library used for cleaning, manipulating, and analyzing input data
in a structured format (e.g., tables).

 Essential for data preprocessing before feeding data into ML models.

Dept of CSE, CMRIT 2023-2024 Page 10


Cardiac Care

5. Authentication: Django Auth, Firebase


Django Auth:

 A built-in authentication system in Django to manage user registration, login, and


security features.

 Provides password hashing, session management, and role-based permissions.

Firebase:

 A cloud-based authentication service for managing user authentication and real-


time databases.

 Offers easy integration for mobile or web applications.

6. Version Control: Git, GitHub/GitLab

Git:

A distributed version control system used for tracking code changes, collaboration,
and maintaining a development history.

GitHub/GitLab:

Platforms for hosting Git repositories to manage codebase, collaborate among teams,
and ensure smooth deployment.

7. Deployment: Gunicorn, Nginx/Apache

Gunicorn:

 A Python WSGI server that runs the Django application in production.

 It handles requests efficiently and works with Nginx/Apache for load balancing.

Nginx/Apache:

 Web servers used to serve static files, handle client requests, and reverse proxy
requests to Gunicorn.

 Nginx: Known for high performance and scalability.

Dept of CSE, CMRIT 2023-2024 Page 11


Cardiac Care

 Apache: Versatile and widely used server with customizable modules.

3.3 Hardware Requirements


1. CPU: Quad-core 2.5 GHz+

 A quad-core processor ensures the system can handle multiple tasks


simultaneously.

 Essential for running ML computations, database queries, and web server


processes efficiently.

2. RAM: 8 GB (16 GB Recommended)

 8 GB: Minimum requirement for running the Django server, ML model


computations, and database queries efficiently.

 16 GB (Recommended): Provides better performance for handling large data


and multiple users simultaneously without system lags.

3. Storage: 10 GB SSD

10 GB SSD:

 Ensures fast read/write operations, which are critical for database queries and
system responsiveness.

 Provides enough storage for project code, ML models, and databases.

4. Backup: Cloud or Physical Storage

 Regular backups are necessary to prevent data loss due to hardware failures or
accidental deletions.

 Cloud Storage: Services like AWS, Google Cloud, or Azure provide secure and
scalable backup solutions.

 Physical Storage: External hard drives or on-premise servers for local backup.

Dept of CSE, CMRIT 2023-2024 Page 12


Cardiac Care

CHAPTER 4

IMPLEMENTATION
The project implements a modified K-Nearest Neighbors algorithm, LWGMK-NN,
which uses weighted geometric mean for predictions. It calculates distances using
Euclidean and Manhattan metrics, applying inverse distance weighting for accuracy.
Input data is preprocessed with RobustScaler to handle outliers, and grid search
optimizes the k value. The prediction functionality is implemented using predict()
views, which process JSON inputs, validate them, and return risk predictions with
probability scores, enabling accurate Coronary Artery Disease assessment.

4.1 ALGORITHM

class LWGMKNN:
def __init__(self, k=5, distance_metric='euclidean'):
self.k = k
self.distance_metric = distance_metric
self.scaler = RobustScaler()
self.X_train = None
self.y_train = None

def fit(self, X, y):


# Scale and store training data
if not isinstance(X, pd.DataFrame):
X = pd.DataFrame(X)
self.X_train = pd.DataFrame(
self.scaler.fit_transform(X),
columns=X.columns,
index=X.index

Dept of CSE, CMRIT 2023-2024 Page 13


Cardiac Care

)
self.y_train = y

def predict(self, X):


# Scale and prepare test data
if not isinstance(X, pd.DataFrame):
X = pd.DataFrame(X)
X_scaled = pd.DataFrame(
self.scaler.transform(X),
columns=X.columns,
index=X.index
)
predictions = []
for _, test_instance in X_scaled.iterrows():
distances = self._compute_distances(test_instance.values)
predictions.append(self._predict_class(distances))
return np.array(predictions)

def _compute_distances(self, test_instance):


# Calculate distances based on the chosen metric
if self.distance_metric == 'euclidean':
distances = np.linalg.norm(self.X_train.values - test_instance, axis=1)
elif self.distance_metric == 'manhattan':
distances = np.sum(np.abs(self.X_train.values - test_instance), axis=1)
else:
raise ValueError(f"Unsupported distance metric: {self.distance_metric}")
return distances

def _predict_class(self, distances):

Dept of CSE, CMRIT 2023-2024 Page 14


Cardiac Care

# Predict class using weighted geometric mean


neighbors_idx = np.argsort(distances)[:self.k]
neighbor_classes = self.y_train.iloc[neighbors_idx].values
lw = 1 / (distances[neighbors_idx] + 1e-6)
class_scores = {c: np.prod(lw[neighbor_classes == c]) for c in
np.unique(self.y_train)}
return max(class_scores, key=class_scores.get)

def predict_proba(self, X):


# Predict probabilities for each class
if not isinstance(X, pd.DataFrame):
X = pd.DataFrame(X)
predictions = []
for _, test_instance in X.iterrows():
distances = self._compute_distances(test_instance.values)
neighbors_idx = np.argsort(distances)[:self.k]
neighbor_classes = self.y_train.iloc[neighbors_idx].values
positive_ratio = np.mean(neighbor_classes)
predictions.append([1 - positive_ratio, positive_ratio])
return np.array(predictions)

Dept of CSE, CMRIT 2023-2024 Page 15


Cardiac Care

CHAPTER 5

RESULTS AND DISCUSSION

The LWGMKNN model was developed to predict Coronary Artery Disease (CAD)
based on a range of clinical features, utilizing the Least Weighted Geometrical Mean
Kernel K-Nearest Neighbors (LWGMKNN) algorithm for accurate classification. The
model achieved an impressive accuracy of 98%, demonstrating its ability to
effectively discriminate between high-risk and low-risk patients. It also exhibited
balanced performance in both precision and recall, ensuring that both false positives
and false negatives were minimized. Key features that contributed significantly to the
model's predictions included age, chest pain type, cholesterol levels, and maximum
heart rate. These features were identified as the most influential factors for predicting
CAD risk, highlighting their importance in clinical diagnostics.

The model was designed to classify patients into high-risk or low-risk categories with
assigned probabilities, which facilitates early diagnosis and personalized treatment
plans. This approach provides a more comprehensive assessment of a patient's
condition, empowering healthcare professionals with decision support for timely
interventions. By leveraging clinical data such as blood pressure, ECG results, and
other cardiac markers, the model demonstrated the ability to offer predictions with a
high degree of confidence, ensuring that it is both reliable and robust in various
clinical settings.

Furthermore, the model's ability to generalize across different patient demographics


adds to its versatility, making it applicable to a wide range of populations. As a result,
the LWGMKNN model offers a valuable tool for improving early CAD detection,
optimizing treatment strategies, and reducing the overall burden on healthcare
systems.

Dept of CSE, CMRIT 2023-2024 Page 16


Cardiac Care

5.1 OUTPUT

Fig 5.11 Home-Page

This homepage serves as an entry point for the CARDIAC CARE platform,
prompting users to select their role: Clinician or Patient, enabling tailored access for
heart condition prediction. It ensures a user-friendly interface with a clean design for
easy navigation

Fig 5.12 Clinician’s Form

Dept of CSE, CMRIT 2023-2024 Page 17


Cardiac Care

The Clinician's Form is designed to collect essential patient details like age, sex, chest
pain type, blood pressure, cholesterol, and other key health indicators. This data is
used to predict Coronary Artery Disease (CAD) risk accurately

Fig 5.13 Prediction for Clinician’ Form

The Prediction Result section provides the risk level for Coronary Artery Disease
(CAD), such as "High Risk," along with actionable recommendations. These include
consulting a cardiologist, undergoing further diagnostic tests, and considering
medications to manage the condition effectively.

Fig 5.14 Pateint’s Form

Dept of CSE, CMRIT 2023-2024 Page 18


Cardiac Care

This is a Patient's Form interface designed to collect health-related data such as age,
gender, height, weight, blood pressure, and cholesterol levels. It likely serves as input
for a healthcare application or clinical decision support system for monitoring and
assessing patient health.

Fig 5.15 Prediction for Patient’s Form

The prediction indicates a low cardiovascular risk. Recommendations include


maintaining a balanced diet, engaging in regular physical activity, avoiding risk
factors like alcohol and smoking, and managing stress through mindfulness or
relaxation techniques.

Table 5.11 Performance Comparison of Machine Learning Algorithms for Predictive Analytics

Dept of CSE, CMRIT 2023-2024 Page 19


Cardiac Care

1.Localized Feature Weighting for Precision

CAD prediction is highly sensitive to features such as age, cholesterol, and chest pain
type.Unlike traditional KNN, LWGMKNN assigns weights to neighbors based on
their distances and importance. This localized feature weighting ensures more
accurate and clinically relevant predictions.

2. Better Handling of Clinical Data Characteristics

CAD data is often heterogeneous, involving numerical (age, cholesterol) and


categorical features (chest pain type, sex).The algorithm considers generalized means,
making it flexible in combining distances for diverse feature types.It avoids
overfitting common with more complex algorithms like Random Forest or SVM.

3. Transparency and Interpretability

In healthcare, decisions must be explainable to clinicians and patients.Offers better


transparency than Random Forest or SVM.Weights for neighbors can be visualized
and interpreted to explain why certain predictions were made.

4. Balances Predictive Power and Simplicity

Performance: Achieves competitive accuracy (85%) with good precision and recall
while avoiding the complexity of algorithms like Random Forest and SVM.

Simplicity: Compared to black-box models, LWGMKNN is easier to implement and


computationally efficient for mid-sized datasets common in CAD studies.

5. Robustness to Outliers

Clinical datasets may have outliers due to human or measurement errors.Incorporates


RobustScaler during preprocessing to minimize the impact of outliers.Weighted
distances ensure that distant neighbors (potential outliers) contribute less to
predictions.

6. Flexibility for Real-Time CAD Risk Assessment

The model needs to integrate with clinical systems for quick


predictions.Computationally less intensive during predictions compared to Random

Dept of CSE, CMRIT 2023-2024 Page 20


Cardiac Care

Forest and SVM.Suitable for deployment in real-time systems with low latency
requirements.

7. Customizability for Clinical Context

Every CAD prediction model must adapt to specific clinical datasets and population
demographics.Parameters like the number of neighbors (k) and generalized mean
calculation can be fine-tuned to optimize for CAD-specific datasets.Easily extendable
to include additional clinical features.

8. Balanced Approach to Imbalanced Data

CAD datasets often have class imbalance (e.g., more low-risk patients than high-
risk).Weighted neighbors and localized distance measures ensure the minority class is
not ignored, unlike unweighted methods like traditional KNN.

9. Proven in Similar Clinical Applications

Studies using LWGM-like techniques for healthcare have shown high efficacy in
predicting diseases with complex relationships among features. For CAD specifically,
this approach aligns well with the multi-factorial nature of the disease.

10. Cost-Effective Deployment

Healthcare systems often prioritize low-cost, interpretable, and easy-to-deploy


solutions.Requires fewer computational resources than ensemble methods (Random
Forest).Scales well for small-to-medium clinical datasets typical in CAD research.

Dept of CSE, CMRIT 2023-2024 Page 21


Cardiac Care

5.16 Comparision of various Algorithms with LWGMKNN

The bar chart visualizes the performance comparison of different machine learning
algorithms. LWGMKNN has the highest F1-Score, while Logistic Regression has the
lowest training time. Random Forest has the highest accuracy and precision, but it has
the lowest interpretability.

Dept of CSE, CMRIT 2023-2024 Page 22


Cardiac Care

CHAPTER 6

TESTING
Testing played a critical role in ensuring the accuracy, reliability, and robustness of
the LWGMKNN model developed for Coronary Artery Disease (CAD) prediction.
Various testing methodologies were implemented to evaluate the model’s
performance and verify its functionality across different stages of development. The
testing process involved unit testing, integration testing, and hybrid testing, which
were essential for validating the core components and the entire system. Below is an
overview of the testing done during the project

6.1 Unit Testing

Unit testing focused on validating individual components or functions within the


model. These tests ensured that each function in the code worked as expected,
minimizing errors in isolated parts of the model before integrating them into the
overall system.

Model Components: We conducted unit testing on different sections of the code,


such as data preprocessing, feature selection, and model training. Each function, such
as handling missing values or normalizing data, was tested to ensure it produced the
correct output.

Algorithm Implementation: We verified that the LWGMKNN algorithm was


working properly by testing specific functions like distance calculations, kernel
transformations, and nearest neighbor searching to confirm they produced accurate
results.

Output Verification: The output generated by the model was also tested using
known test cases to ensure that the predicted classes (high-risk or low-risk) and the
probabilities of each class were computed accurately.

Dept of CSE, CMRIT 2023-2024 Page 23


Cardiac Care

6.2 Integration Testing

After validating individual components, integration testing was performed to ensure


that the different modules worked together seamlessly within the full system.

Data Flow: The integration of data input, model processing, and output generation
was tested. For instance, data preprocessed through various functions was passed into
the model, and the output was checked for consistency and correctness.

Model Accuracy Evaluation: We also tested how well the LWGMKNN model
interacted with the feature selection and data preprocessing modules to ensure that the
model was trained correctly and its predictions aligned with the expected results. We
used performance metrics like accuracy, precision, and recall to evaluate this
integration.

System Performance: Integration tests were run to verify that the system could
handle large datasets and that the model's predictions remained consistent with
various sets of test data.

6.3 Hybrid Testing


Hybrid testing combined both unit and integration testing to test the model as a whole
system, ensuring all components work together as expected while focusing on the
overall performance of the CAD prediction model.

End-to-End Testing: Hybrid testing was crucial for verifying the system's ability to
predict CAD risk from raw input data to the final output. This end-to-end process
tested whether the entire pipeline—from data collection, preprocessing, training the
model, and producing predictions—worked effectively.

Performance under Load: The hybrid testing approach also involved assessing how
the model handled a variety of data inputs and tested its scalability. Large datasets
were used to simulate real-world scenarios, verifying that the model could handle
varying patient profiles without compromising performance.

Real-World Data Simulation: Hybrid testing included testing the model under
various conditions such as noisy data, missing values, and data imbalances (common

Dept of CSE, CMRIT 2023-2024 Page 24


Cardiac Care

in healthcare datasets). This was important to ensure the model could handle
variations in real-world clinical data effectively.

Model Interpretability: Hybrid tests also assessed the interpretability of the model’s
predictions, ensuring healthcare providers could trust the risk categorization (high-
risk or low-risk) and the probability scores provided by the system.

Dept of CSE, CMRIT 2023-2024 Page 25


Cardiac Care

CHAPTER 7

CONCLUSION AND FUTURE SCOPE

7.1 CONCLUSION
The LWGMKNN-based Coronary Artery Disease (CAD) Prediction System was
successfully developed and tested, demonstrating its potential as a reliable tool for
early diagnosis of CAD. The model achieved an 98.5% accuracy rate, with balanced
performance across precision and recall, making it suitable for classifying patients
into high-risk and low-risk categories. By incorporating clinical features such as age,
cholesterol levels, chest pain type, and maximum heart rate, the model was able to
predict the likelihood of CAD, helping healthcare professionals make informed
decisions.

The system's ability to predict CAD with reasonable accuracy demonstrates its value
in clinical settings, offering an aid for early intervention and personalized treatment
plans. The unit, integration, and hybrid testing confirmed the robustness of the model,
ensuring its reliability and performance across various scenarios. This CAD
prediction system can serve as a Clinical Decision Support System (CDSS), helping
healthcare providers assess patient risks and recommend appropriate lifestyle
interventions.

7.2 FUTURE SCOPE

The LWGMKNN-based CAD Prediction System has several opportunities for


enhancement:

Model Improvement: Incorporating more clinical features (e.g., family history,


diabetes) and exploring advanced algorithms like Deep Learning or XGBoost could
boost accuracy.

Data Handling: Addressing class imbalance with techniques like SMOTE could
improve predictions for low-risk patients.

Dept of CSE, CMRIT 2023-2024 Page 26


Cardiac Care

Real-Time Use: Integrating the model into clinical systems for live risk assessments
and wearable devices for continuous monitoring would enhance its clinical utility.

Interpretability: Using tools like SHAP or LIME to improve model transparency for
healthcare professionals.

Dataset Expansion: Testing on larger and diverse datasets would improve the
model's robustness.

Prescriptive Analytics: Adding personalized treatment recommendations (lifestyle,


diet, exercise) could complement risk predictions.

Expert Collaboration: Engaging healthcare professionals to refine the system and


ensure it meets clinical needs.

Dept of CSE, CMRIT 2023-2024 Page 27


Cardiac Care

REFERENCES
Machine Learning in Cardiovascular Risk Prediction
Yang, L., Wu, H., Jin, X., Zheng, P., Hu, S., Xu, X., Yu, W., and Yan, J., “Study of
cardiovascular disease prediction model based on random forest in eastern
China,” Sci. Rep., vol. 10, no. 1, p. 5245, Dec. 2020.
Predictive Models for Coronary Artery Disease
Anooj, P. K., “Clinical decision support system: Risk level prediction of heart disease
using weighted fuzzy rules,” J. King Saud Univ.-Comput. Inf. Sci., vol. 24, no.
1, pp. 27–40, 2012.

Dept of CSE, CMRIT 2023-2024 Page 28


Cardiac Care

APPENDIX

DATASETS
Clinician

https://ieee-dataport.org/open-access/heart-disease-dataset-comprehensive

Patient

https://www.kaggle.com/datasets/sulianova/cardiovascular-disease-dataset

Dept of CSE, CMRIT 2023-2024 Page 29

You might also like