Automated Heart Disease Detection Using Swin Transformer and ECG Signal Processing: A High-Accuracy Approach

preprint OA: closed
Full text JSON View at publisher
Full text 15,804 characters · extracted from preprint-html · click to expand
Automated Heart Disease Detection Using Swin Transformer and ECG Signal Processing: A High-Accuracy Approach | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Article Automated Heart Disease Detection Using Swin Transformer and ECG Signal Processing: A High-Accuracy Approach Muhammad Faisal Abrar, Muhammad Saqib, Salman Jan, Sikandar Ali, and 2 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7198800/v1 This work is licensed under a CC BY 4.0 License Status: Published Journal Publication published 10 Nov, 2025 Read the published version in Scientific Reports → Version 1 posted 13 You are reading this latest preprint version Abstract Cardiovascular diseases (CVDs) are a leading cause of global mortality, necessitating early and accurate detection for improved patient outcomes. Electrocardiography (ECG) is a fundamental diagnostic tool for identifying cardiac abnormalities; however, traditional methods rely on manual interpretation and conventional machine learning (ML) models, which often struggle with feature extraction and long-range dependencies. Recent advancements in deep learning (DL) have led to the adoption of transformer-based architectures for ECG classification. In this study, we propose the Swin Transformer, a hierarchical vision transformer model, for automated ECG-based heart disease detection. By leveraging shifted window self-attention mechanisms, the Swin Transformer effectively captures both local and global dependencies, overcoming the limitations of convolutional and recurrent architectures. The proposed approach was evaluated on benchmark ECG datasets and compared with traditional ML models, including Random Forest, Gradient Boosting, Support Vector Machine (SVM), and Neural Networks. Experimental results demonstrate that the Swin Transformer significantly outperforms existing methods, achieving 99.8% accuracy, 99.72% precision, 99.91% recall, and an AUC of 99.99%, establishing a new benchmark in ECG classification. Additionally, eigenvalue analysis confirms the model’s ability to retain essential features while minimizing redundancy, ensuring robust generalization across diverse ECG patterns. Despite its superior performance, challenges such as computational complexity and interpretability remain, necessitating future research into Explainable AI (XAI) techniques, model optimization for real-time applications, and hybrid deep learning frameworks. Overall, our findings suggest that the Swin Transformer is a highly effective, scalable, and clinically viable solution for automated ECG-based cardiac disease detection, offering unprecedented accuracy and reliability over traditional approaches. Health sciences/Cardiology Biological sciences/Computational biology and bioinformatics Physical sciences/Engineering Health sciences/Health care Physical sciences/Mathematics and computing Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Published Journal Publication published 10 Nov, 2025 Read the published version in Scientific Reports → Version 1 posted Editorial decision: Revision requested 03 Sep, 2025 Reviews received at journal 28 Aug, 2025 Reviews received at journal 25 Aug, 2025 Reviews received at journal 23 Aug, 2025 Reviewers agreed at journal 18 Aug, 2025 Reviewers agreed at journal 15 Aug, 2025 Reviewers agreed at journal 13 Aug, 2025 Reviewers agreed at journal 13 Aug, 2025 Reviewers invited by journal 12 Aug, 2025 Editor assigned by journal 12 Aug, 2025 Editor invited by journal 08 Aug, 2025 Submission checks completed at journal 28 Jul, 2025 First submitted to journal 28 Jul, 2025 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7198800","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Article","associatedPublications":[],"authors":[{"id":502274230,"identity":"c48fb554-3e28-404b-969f-ffe57da2f0b9","order_by":0,"name":"Muhammad Faisal Abrar","email":"","orcid":"","institution":"University of Ha'il","correspondingAuthor":false,"prefix":"","firstName":"Muhammad","middleName":"Faisal","lastName":"Abrar","suffix":""},{"id":502274231,"identity":"afd2b90d-5f13-456e-a55a-0857431c1cce","order_by":1,"name":"Muhammad Saqib","email":"","orcid":"","institution":"University of Engineering \u0026 Technology, Peshawar, 25000, Pakistan","correspondingAuthor":false,"prefix":"","firstName":"Muhammad","middleName":"","lastName":"Saqib","suffix":""},{"id":502274234,"identity":"19da3f11-84a8-4288-9498-51e91152e19e","order_by":2,"name":"Salman Jan","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA6ElEQVRIiWNgGAWjYFAC5gYwCUQHYEJszPi1MMK0sCWQpgUIeAyI0yLffrB1w88dDOz8s3s+fvjYxiBn3r+A7XEBHi0GZxLbbvaeYWCWuHN2s+TMNgZjmRsP2I1n4NPCkNh2g7cN6JcbuRukgYzEGRIH2KR58Dms/2Hbzb9ALfI3ch7/JkoLw43EttsgWwxu5LBBbOFvwK/F4MbDttuybRLMhjfSzCxnnJMwlpBgbDfG77DkYzffttkky91IfnzjQ5mNnAT/4WOP8ToMAiSSYQwgSmwgrAEI7BBM/gNE6RgFo2AUjIKRAwBB80k9Gc+7RAAAAABJRU5ErkJggg==","orcid":"","institution":"Arab Open University","correspondingAuthor":true,"prefix":"","firstName":"Salman","middleName":"","lastName":"Jan","suffix":""},{"id":502274239,"identity":"25d36659-63ce-40c5-b511-e1c5c39c069f","order_by":3,"name":"Sikandar Ali","email":"","orcid":"","institution":"University of Haripur","correspondingAuthor":false,"prefix":"","firstName":"Sikandar","middleName":"","lastName":"Ali","suffix":""},{"id":502274240,"identity":"04072955-9a11-4954-8163-4de3292a8a0a","order_by":4,"name":"Arshad Khan","email":"","orcid":"","institution":"Yoobee College of Creative Innovation","correspondingAuthor":false,"prefix":"","firstName":"Arshad","middleName":"","lastName":"Khan","suffix":""},{"id":502274243,"identity":"9945df4d-8361-41f1-a2e2-dea4b4ddb775","order_by":5,"name":"Ahmed Alkhayyat","email":"","orcid":"","institution":"The Islamic University","correspondingAuthor":false,"prefix":"","firstName":"Ahmed","middleName":"","lastName":"Alkhayyat","suffix":""}],"badges":[],"createdAt":"2025-07-23 17:23:20","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7198800/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7198800/v1","draftVersion":[],"editorialEvents":[{"content":"https://doi.org/10.1038/s41598-025-23097-6","type":"published","date":"2025-11-10T15:57:14+00:00"}],"editorialNote":"","failedWorkflow":false,"files":[{"id":96104979,"identity":"ab9b4b6b-8e35-4d4e-9922-e95879d0c8f5","added_by":"auto","created_at":"2025-11-17 16:05:49","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1063270,"visible":true,"origin":"","legend":"","description":"","filename":"ManuscriptSwinTransformerPaper.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7198800/v1_covered_43401855-7313-41e8-a5dc-6cf3c02445a9.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Automated Heart Disease Detection Using Swin Transformer and ECG Signal Processing: A High-Accuracy Approach","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":true,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"scientific-reports","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"scirep","sideBox":"Learn more about [Scientific Reports](http://www.nature.com/srep/)","snPcode":"","submissionUrl":"","title":"Scientific Reports","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Scientific Reports","inReviewEnabled":true,"inReviewRevisionsEnabled":true},"keywords":"","lastPublishedDoi":"10.21203/rs.3.rs-7198800/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7198800/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"Cardiovascular diseases (CVDs) are a leading cause of global mortality, necessitating early and accurate detection for improved patient outcomes. Electrocardiography (ECG) is a fundamental diagnostic tool for identifying cardiac abnormalities; however, traditional methods rely on manual interpretation and conventional machine learning (ML) models, which often struggle with feature extraction and long-range dependencies. Recent advancements in deep learning (DL) have led to the adoption of transformer-based architectures for ECG classification. In this study, we propose the Swin Transformer, a hierarchical vision transformer model, for automated ECG-based heart disease detection. By leveraging shifted window self-attention mechanisms, the Swin Transformer effectively captures both local and global dependencies, overcoming the limitations of convolutional and recurrent architectures. The proposed approach was evaluated on benchmark ECG datasets and compared with traditional ML models, including Random Forest, Gradient Boosting, Support Vector Machine (SVM), and Neural Networks. Experimental results demonstrate that the Swin Transformer significantly outperforms existing methods, achieving 99.8% accuracy, 99.72% precision, 99.91% recall, and an AUC of 99.99%, establishing a new benchmark in ECG classification. Additionally, eigenvalue analysis confirms the model’s ability to retain essential features while minimizing redundancy, ensuring robust generalization across diverse ECG patterns. Despite its superior performance, challenges such as computational complexity and interpretability remain, necessitating future research into Explainable AI (XAI) techniques, model optimization for real-time applications, and hybrid deep learning frameworks. Overall, our findings suggest that the Swin Transformer is a highly effective, scalable, and clinically viable solution for automated ECG-based cardiac disease detection, offering unprecedented accuracy and reliability over traditional approaches.","manuscriptTitle":"Automated Heart Disease Detection Using Swin Transformer and ECG Signal Processing: A High-Accuracy Approach","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-08-20 03:49:19","doi":"10.21203/rs.3.rs-7198800/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2025-09-03T08:29:57+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-08-28T23:11:24+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-08-25T05:56:33+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-08-23T14:59:30+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"165159317619021247015076275567222295254","date":"2025-08-19T03:27:05+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"50492838388045304396269350999525832096","date":"2025-08-15T04:51:48+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"62819280465031596987856988570060375614","date":"2025-08-14T01:30:09+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"230303106153463734623593598859466033960","date":"2025-08-13T06:01:41+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2025-08-12T19:59:06+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2025-08-12T10:18:49+00:00","index":"","fulltext":""},{"type":"editorInvited","content":"","date":"2025-08-08T06:09:15+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2025-07-28T16:36:46+00:00","index":"","fulltext":""},{"type":"submitted","content":"Scientific Reports","date":"2025-07-28T12:17:40+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"scientific-reports","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"scirep","sideBox":"Learn more about [Scientific Reports](http://www.nature.com/srep/)","snPcode":"","submissionUrl":"","title":"Scientific Reports","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Scientific Reports","inReviewEnabled":true,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"24f2c0a2-e238-457b-bfc9-227d8d3636d9","owner":[],"postedDate":"August 20th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"published-in-journal","subjectAreas":[{"id":53348392,"name":"Health sciences/Cardiology"},{"id":53348393,"name":"Biological sciences/Computational biology and bioinformatics"},{"id":53348394,"name":"Physical sciences/Engineering"},{"id":53348395,"name":"Health sciences/Health care"},{"id":53348396,"name":"Physical sciences/Mathematics and computing"}],"tags":[],"updatedAt":"2025-11-17T16:00:03+00:00","versionOfRecord":{"articleIdentity":"rs-7198800","link":"https://doi.org/10.1038/s41598-025-23097-6","journal":{"identity":"scientific-reports","isVorOnly":false,"title":"Scientific Reports"},"publishedOn":"2025-11-10 15:57:14","publishedOnDateReadable":"November 10th, 2025"},"versionCreatedAt":"2025-08-20 03:49:19","video":"","vorDoi":"10.1038/s41598-025-23097-6","vorDoiUrl":"https://doi.org/10.1038/s41598-025-23097-6","workflowStages":[]},"version":"v1","identity":"rs-7198800","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7198800","identity":"rs-7198800","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00