inner-banner-bg

Biomedical Science and Clinical Research(BSCR)

ISSN: 2835-7914 | DOI: 10.33140/BSCR

Impact Factor: 1.7

Research Article - (2025) Volume 4, Issue 1

Enhancing Cardiovascular Health Through Machine Learning

Mohammad Salman Khan and Mahrukh *
 
Pakistan
 
*Corresponding Author: Mahrukh, Pakistan

Received Date: Jan 06, 2025 / Accepted Date: Feb 04, 2025 / Published Date: Feb 12, 2025

Copyright: ©©2025 Mahrukh, et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

Citation: Khan, M. S., Mahrukh. (2025). Enhancing Cardiovascular Health Through Machine Learning. Biomed Sci Clin Res, 4(1), 01-04.

Abstract

Heart disease remains a leading cause of mortality worldwide, emphasizing the need for early and accurate prediction to improve patient outcomes. This study explores the application of Artificial Intelligence (AI) in predicting the risk of heart disease using machine learning algorithms. By analyzing patient data, including age, cholesterol levels, blood pressure, and lifestyle factors, AI models can identify patterns and generate risk assessments. Using the publicly available Cleveland Heart Disease Dataset, we trained and evaluated machine learning models such as Logistic Regression, Random Forest, and Neural Networks. The Random Forest model achieved an accuracy of 89%, highlighting its potential for reliable prediction.

This research also examines the importance of key features in disease prediction, such as cholesterol and resting blood pressure, and discusses the challenges of data quality, model interpretability, and ethical considerations in deploying AI for healthcare. The results demonstrate that AI offers a scalable and cost-effective solution for early detection and personalized risk assessment of heart disease, paving the way for smarter, data-driven decision-making in cardiology.

Keywords

Heart Disease Prediction, Artificial Intelligence in Healthcare, Machine Learning, Algorithms, Cardiovascular Risk Assessment, Predictive Analytics, Healthcare Data Analysis

Introduction

Heart disease is a global health concern, accounting for millions of deaths annually and imposing a significant burden on healthcare systems. Early diagnosis and intervention are crucial in reducing mortality and improving patient outcomes. Traditional methods of diagnosing heart disease often rely on manual analysis of patient data, which can be time-consuming and prone to human error. With advancements in technology, Artificial Intelligence (AI) has emerged as a powerful tool to revolutionize healthcare by providing faster, more accurate, and data-driven insights.

AI, particularly machine learning, uses algorithms to analyze complex datasets and uncover patterns that may not be apparent to the human eye. In the context of heart disease, these algorithms can process vast amounts of patient data, such as age, cholesterol levels, blood pressure, and lifestyle habits, to predict an individual’s risk of developing cardiovascular conditions. By identifying high-risk patients early, AI enables healthcare providers to take preventative measures and tailor treatments, ultimately improving the quality of care.

This study focuses on the application of AI in predicting heart disease, using the Cleveland Heart Disease Dataset as a case study.

We explore the performance of various machine learning models, such as Logistic Regression, Random Forest, and Neural Networks, in terms of accuracy and feature importance. Additionally, the research highlights the challenges of implementing AI in healthcare, including data quality, ethical considerations, and model interpretability.

By leveraging AI for heart disease prediction, this research aims to demonstrate the potential of machine learning to enhance diagnostic accuracy, reduce costs, and pave the way for a more personalized approach to cardiology. This paper provides a foundation for integrating AI into routine clinical practices and improving patient outcomes in the fight against cardiovascular diseases.

Methodology

Data Acquisition

For this study, we used the Cleveland Heart Disease Dataset, which is publicly available and widely used for heart disease prediction. The dataset contains 303 patient records with 14 attributes, including factors such as age, sex, blood pressure, cholesterol levels, and a target variable that indicates whether the patient has heart disease (1) or not (0).

Data Preprocessing

To prepare the data for analysis, the following steps were performed:

1. Handling Missing Values: Missing data was either filled in with average values or removed if it was too incomplete.

2. Normalization: The values for features like cholesterol and blood pressure were normalized to ensure that they are on the same scale.

3. Train-Test Split: The data was divided into two parts: 80% for training the model and 20% for testing the model's performance.

Model Selection

We used three different machine learning models to predict heart disease:

1. Logistic Regression: A simple model for binary classification, which helps in understanding the relationship between the features and the target variable.

2. Random Forest: A more advanced model that combines many decision trees to make predictions.

3. Neural Networks: A model that mimics the human brain, useful for more complex relationships in the data.

Model Training

We trained each model using the training data. The models were first run with basic settings, and then fine-tuned to improve their accuracy. Cross-validation was used to ensure that the models perform well with new, unseen data.

Model Evaluation

We evaluated the performance of each model using the following:

• Accuracy: The percentage of correct predictions made by the model.

• Precision: How many of the predicted heart disease cases were actually correct.

• Recall: How many of the actual heart disease cases were correctly identified.

• F1-Score: A balance between precision and recall.

• ROC-AUC: A measure of how well the model distinguishes between patients with and without heart disease.

Feature Importance

Using the Random Forest model, we examined which features (e.g., cholesterol, age, blood pressure) were most important in predicting heart disease. This helped us understand which factors contribute most to the prediction.

Tools and Technologies

The following tools were used:

• Python: For data analysis and building models.

• scikit-learn: A library in Python for machine learning.

• Pandas and NumPy: For handling and processing data.

• Matplotlib and Seaborn: For visualizing data and results.

Workflow

The steps followed in the methodology were:

1. Collecting the data

2. Preprocessing the data

3. Choosing and training machine learning models

4. Evaluating the models' performance

5. Analyzing the most important features

This methodology allowed us to build and evaluate models that can predict the risk of heart disease based on patient data.

Experiments

Experiment Setup

To test the effectiveness of the models, we used the Cleveland Heart Disease Dataset, which contains 303 patient records and 14 features. The dataset was split into 80% for training and 20% for testing. The following machine learning algorithms were used in the experiments:

• Logistic Regression

• Random Forest

• Neural Networks

Each model was trained using the training data, and predictions were made using the test data. The models were evaluated based on various performance metrics: accuracy, precision, recall, F1-score, and ROC-AUC.

Model Training and Evaluation

Logistic Regression

• Training: The logistic regression model was trained with default settings. It is a simple linear model that predicts the probability of heart disease based on input features.

• Evaluation: The model's performance was assessed using accuracy, precision, recall, and F1-score.

Random Forest

• Training: The Random Forest model was trained using default hyperparameters. This model works by creating many decision trees and then averaging their predictions to improve accuracy.

• Evaluation: After training, the model’s performance was evaluated using the same metrics. Random Forest also provides feature importance scores, which help identify which factors most influence heart disease prediction.

Neural Networks

• Training: A simple neural network was trained with a single hidden layer to capture complex patterns in the data. The training was done with a learning rate adjustment to improve convergence.

• Evaluation: The model’s prediction accuracy and performance were assessed using the same metrics as the other models.

Results and Discussions

The following results were obtained for each model:

Model

Accuracy

Precision

Recall

F1-Score

ROC-AUC

Logistic Regression

82%

80%

75%

77%

0.85

Random Forest

89%

87%

90%

88%

0.92

Neural Networks

85%

84%

83%

83%

0.88

                                               Table 1: Model Performance Comparison

Feature Importance Analysis (Random Forest)

Random Forest also provided insights into the importance of various features in heart disease prediction. The top five most important features were:

1. Cholesterol levels

2. Age

3. Maximum heart rate

4. Resting blood pressure

5. Fasting blood sugar

These features were found to have the most significant impact on the prediction of heart disease, with cholesterol levels and age being the most influential.

Comparison of Models

1. Logistic Regression showed a good performance but was outperformed by both the Random Forest and Neural Network models in terms of accuracy and recall.

2. Random Forest achieved the highest accuracy and recall, making it the best performing model for heart disease prediction in this experiment.

3. Neural Networks, while more complex, also performed well but did not outperform Random Forest in this case.

Conclusion from Experiments

From the experiments conducted, it is evident that Random Forest is the most effective model for heart disease prediction, providing the best balance between accuracy and recall. Logistic Regression is a good starting point but lacks the ability to capture complex patterns in the data. Neural Networks, while showing promising results, may require further tuning and a larger dataset to achieve better performance.

Random Forest

These results suggest that Random Forest is suitable for practical applications in predicting heart disease, allowing for early intervention and better healthcare management.

Discussion

In this study, we evaluated several machine learning models to predict heart disease using the Cleveland Heart Disease Dataset. The models tested were Logistic Regression, Random Forest, and Neural Networks, with each model being assessed on key performance metrics: accuracy, precision, recall, F1-score, and ROC-AUC.

Performance Comparison

Among the models tested, Random Forest outperformed both Logistic Regression and Neural Networks in terms of accuracy and recall. Random Forest achieved an accuracy of 89% and a recall of 90%, indicating its ability to correctly identify patients with heart disease. This performance is particularly important in medical applications, where the cost of false negatives (failing to diagnose heart disease) can be very high.

The Neural Networks model, while more complex, achieved an accuracy of 85% and recall of 83%. Although it performed reasonably well, the complexity of the model did not lead to a significant improvement over Random Forest. This highlights that, for this dataset, simpler models such as Random Forest may be more effective and easier to interpret.

Logistic Regression performed adequately with an accuracy of 82%, but it struggled to capture the complexities in the dataset, leading to lower recall and precision compared to the other models.

Feature Importance Analysis

Random Forest also provided insights into which features were most important in predicting heart disease. Cholesterol levels and age were identified as the most influential features, followed by maximum heart rate and resting blood pressure. These findings align with medical knowledge, where factors like cholesterol and age are well-known risk factors for heart disease. This highlights the interpretability of Random Forest, which can be advantageous in a medical setting where understanding the reasoning behind predictions is crucial [1-10].

Hyperparameter Tuning

Through experiments, it was observed that hyperparameter tuning significantly improved model performance. By optimizing parameters such as the number of trees in Random Forest or the learning rate in Neural Networks, the models demonstrated better predictive capabilities. This emphasizes the importance of fine-tuning models to achieve optimal results in real-world applications

Model Generalizability

We used cross-validation to assess the robustness of the models. Cross-validation provided a more reliable estimate of each model's performance, reducing the risk of overfitting and ensuring that the models were generalized. It was found that Random Forest maintained its top performance across different folds, demonstrating its reliability.

Data Imbalance

We also explored the effect of data imbalance, where one class (e.g., no heart disease) was more prevalent than the other. It was observed that models, particularly Logistic Regression, performed less effectively under imbalanced conditions, with a notable drop in recall for the minority class. This suggests that special techniques like oversampling or under sampling could be employed to improve model performance when dealing with imbalanced datasets.

Limitations

While the models performed well, there are certain limitations to this study. The data set used is relatively small, which might limit the generalizability of the results. Additionally, the dataset lacks more detailed medical history, lifestyle factors (such as smoking, diet, and exercise), and genetic data, which could further enhance the accuracy of the predictions. Future studies could include more diverse datasets and other factors contributing to heart disease risk.

Conclusion

This study demonstrated the application of machine learning models to predict heart disease using the Cleveland Heart Disease Dataset. Among the models tested, Random Forest emerged as the most effective model, providing the best balance of accuracy and recall. This model was able to correctly identify patients with heart disease and showed great potential for practical use in medical diagnostics.

The analysis also highlighted the importance of feature selection and hyperparameter tuning in improving model performance. Cholesterol levels and age were found to be the most important features, aligning with medical knowledge. Furthermore, cross-validation ensured that the results were not biased and that the models could generalize well to new data.

While Neural Networks showed promise, their added complexity did not significantly improve performance over Random Forest, suggesting that simpler models may be more suitable for heart disease prediction in this case. Logistic Regression, though simple and interpretable, struggled to achieve the same level of performance as the other models.

This study provides valuable insights into the use of machine learning for heart disease prediction. The results can be used to inform healthcare professionals and support decision-making processes in diagnosing heart disease. Future work may involve incorporating more comprehensive datasets and exploring additional advanced models to further enhance prediction accuracy.

References

  1. Dua, D., & Graff, C. (2019). UCI Machine Learning Repository: Heart Disease Data Set. University of California, Irvine.
  2. Tang, L., & Sun, H. (2018). A hybrid machine learning model for predicting heart disease using feature selection. Expert Systems with Applications, 101, 1-9.
  3. Kotsiantis, S. B., & Kanellopoulos, D. (2006). Data Mining: A Knowledge Discovery Approach. Springer Science & Business Media.
  4. Bashiri, M., & Parsa, M. (2020). A comparison of machine learning algorithms for heart disease prediction. Journal of Electrical Engineering & Technology, 15(3), 1085-1094.
  5. Chaurasia, V., & Pal, S. (2018). Heart disease prediction using machine learning algorithms: A survey. Proceedings of the 2nd International Conference on Data Science and Engineering, 1-6.
  6. Bhatia, K., & Kumar, P. (2017). Random Forest for classification in medical data. International Journal of Advanced Research in Computer Science and Software Engineering, 7(9), 1-5.
  7. Breiman, L. (2001). Random forests. Machine Learning,45(1), 5-32.
  8. Raschka,  S.  (2015).  Python  Machine  Learning.  Packt Publishing. ISBN: 978-1788621755
  9. Kumar, R., & Patel, H. (2019). Predicting heart disease using machine learning techniques: A survey. International Journal of Computer Applications, 178(5), 1-6.
  10. Hao, X., & Chen, Z. (2020). Heart disease prediction using artificial neural networks: A case study. Journal of Computational Biology, 27(2), 185-192.