Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Jan 4;14(1):514.
doi: 10.1038/s41598-024-51184-7.

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

Affiliations

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

Atta Ur Rahman et al. Sci Rep. .

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.

PubMed Disclaimer

Conflict of interest statement

The authors declare no competing interests.

Figures

Figure 1
Figure 1
Overview of the proposed model.
Figure 2
Figure 2
Architecture of proposed model used for heart disease prediction.
Figure 3
Figure 3
Training and testing accuracy of the model.
Figure 4
Figure 4
Training and testing loss of the model.

Similar articles

Cited by

References

    1. Virani SS, Alonso A, Aparicio HJ, Benjamin EJ, Bittencourt MS, Callaway CW, Carson AP, Chamberlain AM, Cheng S, Delling FN, et al. Heart disease and stroke statistics—2021 update: A report from the american heart association. Circulation. 2021;143(8):e254–e743. doi: 10.1161/CIR.0000000000000950. - DOI - PubMed
    1. Groenewegen A, Rutten FH, Mosterd A, Hoes AW. Epidemiology of heart failure. Eur. J. Heart Fail. 2020;22(8):1342–1356. doi: 10.1002/ejhf.1858. - DOI - PMC - PubMed
    1. Ghosh SK, Ponnalagu R, Tripathy R, Acharya UR. Automated detection of heart valve diseases using chirplet transform and multiclass composite classifier with pcg signals. Comput. Biol. Med. 2020;118:103632. doi: 10.1016/j.compbiomed.2020.103632. - DOI - PubMed
    1. Ahsan MM, Siddique Z. Machine learning-based heart disease diagnosis: A systematic literature review. Artif. Intell. Med. 2022;128:102289. doi: 10.1016/j.artmed.2022.102289. - DOI - PubMed
    1. Torre-Cruz J, Martinez-Muñoz D, Ruiz-Reyes N, Muñoz-Montoro A, Puentes-Chiachio M, Canadas-Quesada F. Unsupervised detection and classification of heartbeats using the dissimilarity matrix in pcg signals. Comput. Methods Programs Biomed. 2022;221:106909. doi: 10.1016/j.cmpb.2022.106909. - DOI - PubMed