Enhancing heart disease prediction using a self-attention-based transformer model

Abstract Cardiovascular diseases (CVDs) continue to be the leading cause of more than 17 million mortalities worldwide. The early detection of heart failure with high accuracy is crucial for clinical trials and therapy. Patients will be categorized into various types of heart disease based on charac...

Full description

Bibliographic Details
Main Authors: Atta Ur Rahman, Yousef Alsenani, Adeel Zafar, Kalim Ullah, Khaled Rabie, Thokozani Shongwe
Format: Article
Language:English
Published: Nature Portfolio 2024-01-01
Series:Scientific Reports
Online Access:https://doi.org/10.1038/s41598-024-51184-7
_version_ 1797363410837438464
author Atta Ur Rahman
Yousef Alsenani
Adeel Zafar
Kalim Ullah
Khaled Rabie
Thokozani Shongwe
author_facet Atta Ur Rahman
Yousef Alsenani
Adeel Zafar
Kalim Ullah
Khaled Rabie
Thokozani Shongwe
author_sort Atta Ur Rahman
collection DOAJ
description Abstract Cardiovascular diseases (CVDs) continue to be the leading cause of more than 17 million mortalities worldwide. The early detection of heart failure with high accuracy is crucial for clinical trials and therapy. Patients will be categorized into various types of heart disease based on characteristics like blood pressure, cholesterol levels, heart rate, and other characteristics. With the use of an automatic system, we can provide early diagnoses for those who are prone to heart failure by analyzing their characteristics. In this work, we deploy a novel self-attention-based transformer model, that combines self-attention mechanisms and transformer networks to predict CVD risk. The self-attention layers capture contextual information and generate representations that effectively model complex patterns in the data. Self-attention mechanisms provide interpretability by giving each component of the input sequence a certain amount of attention weight. This includes adjusting the input and output layers, incorporating more layers, and modifying the attention processes to collect relevant information. This also makes it possible for physicians to comprehend which features of the data contributed to the model's predictions. The proposed model is tested on the Cleveland dataset, a benchmark dataset of the University of California Irvine (UCI) machine learning (ML) repository. Comparing the proposed model to several baseline approaches, we achieved the highest accuracy of 96.51%. Furthermore, the outcomes of our experiments demonstrate that the prediction rate of our model is higher than that of other cutting-edge approaches used for heart disease prediction.
first_indexed 2024-03-08T16:20:59Z
format Article
id doaj.art-00798c3286cf4be296693df06d182a77
institution Directory Open Access Journal
issn 2045-2322
language English
last_indexed 2024-03-08T16:20:59Z
publishDate 2024-01-01
publisher Nature Portfolio
record_format Article
series Scientific Reports
spelling doaj.art-00798c3286cf4be296693df06d182a772024-01-07T12:20:07ZengNature PortfolioScientific Reports2045-23222024-01-0114111310.1038/s41598-024-51184-7Enhancing heart disease prediction using a self-attention-based transformer modelAtta Ur Rahman0Yousef Alsenani1Adeel Zafar2Kalim Ullah3Khaled Rabie4Thokozani Shongwe5Riphah Institute of System Engineering, Riphah International University IslamabadDepartment of Information Systems, FCIT, King Abdulaziz UniversityRiphah Institute of System Engineering, Riphah International University IslamabadDepartment of Zoology, Kohat University of Science and TechnologyDepartment of Engineering, Manchester Metropolitan UniversityDepartment of Electrical and Electronic Engineering Science, University of JohannesburgAbstract Cardiovascular diseases (CVDs) continue to be the leading cause of more than 17 million mortalities worldwide. The early detection of heart failure with high accuracy is crucial for clinical trials and therapy. Patients will be categorized into various types of heart disease based on characteristics like blood pressure, cholesterol levels, heart rate, and other characteristics. With the use of an automatic system, we can provide early diagnoses for those who are prone to heart failure by analyzing their characteristics. In this work, we deploy a novel self-attention-based transformer model, that combines self-attention mechanisms and transformer networks to predict CVD risk. The self-attention layers capture contextual information and generate representations that effectively model complex patterns in the data. Self-attention mechanisms provide interpretability by giving each component of the input sequence a certain amount of attention weight. This includes adjusting the input and output layers, incorporating more layers, and modifying the attention processes to collect relevant information. This also makes it possible for physicians to comprehend which features of the data contributed to the model's predictions. The proposed model is tested on the Cleveland dataset, a benchmark dataset of the University of California Irvine (UCI) machine learning (ML) repository. Comparing the proposed model to several baseline approaches, we achieved the highest accuracy of 96.51%. Furthermore, the outcomes of our experiments demonstrate that the prediction rate of our model is higher than that of other cutting-edge approaches used for heart disease prediction.https://doi.org/10.1038/s41598-024-51184-7
spellingShingle Atta Ur Rahman
Yousef Alsenani
Adeel Zafar
Kalim Ullah
Khaled Rabie
Thokozani Shongwe
Enhancing heart disease prediction using a self-attention-based transformer model
Scientific Reports
title Enhancing heart disease prediction using a self-attention-based transformer model
title_full Enhancing heart disease prediction using a self-attention-based transformer model
title_fullStr Enhancing heart disease prediction using a self-attention-based transformer model
title_full_unstemmed Enhancing heart disease prediction using a self-attention-based transformer model
title_short Enhancing heart disease prediction using a self-attention-based transformer model
title_sort enhancing heart disease prediction using a self attention based transformer model
url https://doi.org/10.1038/s41598-024-51184-7
work_keys_str_mv AT attaurrahman enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel
AT yousefalsenani enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel
AT adeelzafar enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel
AT kalimullah enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel
AT khaledrabie enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel
AT thokozanishongwe enhancingheartdiseasepredictionusingaselfattentionbasedtransformermodel