Full text
46,537 characters
· extracted from
preprint-html
· click to expand
A deep learning ECG model for localization of occlusion myocardial infarction | medRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (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];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-P4HH5NV'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search A deep learning ECG model for localization of occlusion myocardial infarction View ORCID Profile Stefan Gustafsson , View ORCID Profile Antônio H. Ribeiro , View ORCID Profile Daniel Gedon , View ORCID Profile Petrus E. O. G. B. Abreu , View ORCID Profile Nicolas Pielawski , View ORCID Profile Gabriela M. M. Paixão , View ORCID Profile Antonio Luiz P. Ribeiro , View ORCID Profile Daniel Lindholm , View ORCID Profile Thomas B. Schön , View ORCID Profile Johan Sundström doi: https://doi.org/10.1101/2025.09.11.25335407 Stefan Gustafsson 1 Clinical Epidemiology Unit, Department of Medical Sciences, Uppsala University , Uppsala, Sweden PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Stefan Gustafsson Antônio H. Ribeiro 2 Division of Systems and Control, Department of Information Technology, Uppsala University , Uppsala, Sweden PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Antônio H. Ribeiro Daniel Gedon 3 Machine Learning in Science, University of Tübingen, Tübingen, Germany; and Tübingen AI Center , Tübingen, Germany PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Daniel Gedon Petrus E. O. G. B. Abreu 4 Postgraduate Program in Health Sciences: Infectious Diseases and Tropical Medicine, Universidade Federal de Minas Gerais , Belo Horizonte, Brazil PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Petrus E. O. G. B. Abreu Nicolas Pielawski 5 Department of Information Technology, Uppsala University , Uppsala, Sweden PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Nicolas Pielawski Gabriela M. M. Paixão 6 Department of Internal Medicine, Faculdade de Medicina, and Telehealth Center, Hospital das Clínicas, Universidade Federal de Minas Gerais , Belo Horizonte, Brazil MD, PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Gabriela M. M. Paixão Antonio Luiz P. Ribeiro 7 Department of Internal Medicine, Faculdade de Medicina, and Telehealth Center and Cardiology Service, Hospital das Clínicas, Universidade Federal de Minas Gerais , Belo Horizonte, Brazil MD, PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Antonio Luiz P. Ribeiro Daniel Lindholm 8 Department of Medical Sciences, Uppsala University, Uppsala, Sweden; and Department of Medicine, Norrtälje hospital (Tiohundra AB) , Norrtälje, Sweden MD PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Daniel Lindholm Thomas B. Schön 2 Division of Systems and Control, Department of Information Technology, Uppsala University , Uppsala, Sweden PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Thomas B. Schön Johan Sundström 9 Clinical Epidemiology Unit, Department of Medical Sciences, Uppsala University, Uppsala, Sweden; and The George Institute for Global Health, University of New South Wales , Sydney, Australia MD PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Johan Sundström For correspondence: johan.sundstrom{at}uu.se Abstract Full Text Info/History Metrics Supplementary material Preview PDF Abstract Rapid identification and localization of an acute coronary occlusion are vital to prevent myocardial damage, yet reliance on ST-segment ECG criteria misses many acute occlusion myocardial infarctions (OMI) and triggers unnecessary acute angiographies. Here, we trained and validated a deep learning model using 540,372 emergency ECGs paired with definitive catheterization outcomes. The model achieved a C-statistic of >0.95 for OMI and >0.87 for non-OMI infarctions and could localize culprit lesions in the left main/LAD, LCX, and RCA coronary branches, which can guide the angiographer. Performance was similar across age, sex, and ECG hardware subgroups. Obviating dependence on ST-elevations and troponins, this model for identification and localization of OMI has the potential to shorten time to reperfusion of an acute coronary occlusion and save resources. Because human oversight of OMI detection on the ECG is limited, randomized clinical trials with patient-relevant outcomes are warranted. Acute myocardial infarction is the leading cause of death globally. 1 When a patient presents with a suspected acute coronary syndrome, the goal is to decide if the patient needs to be urgently transported to a coronary intervention lab or if the angiography can wait, e.g. until office hours. If the coronary artery is acutely occluded, time equals dying myocardium. The electrocardiogram (ECG) is, therefore, of great utility because it can often be obtained already in the ambulance and could herald an acute occlusion before permanent myocardial damage entails. The current ECG paradigm mainly utilizes the ST-segment for these decisions, but ST-elevations are only present in a fraction of acute occlusion myocardial infarctions (OMI), 2 ST-elevations can have other causes than OMI, and physicians disagree in their interpretations of ST-elevations. 3 , 4 This leads to lost time, 5 , 6 lost lives, 2 high costs and risks associated with unnecessary coronary angiographies. Recent dramatic advances in ECG interpretation using machine learning offer the potential to better identify an OMI, potentially saving time, lives and costs. 7 Machine learning models using parameterized 8 or raw 9 ECG data have shown promise for OMI classification. The ECG can also be useful for determining the localization of pathologies, and machine learning models have been shown to have the capacity to localize a non-occlusive coronary stenosis, i.e., the potential to localize coronary artery narrowing in the absence of a complete occlusion. 10 Some patients have chronic coronary occlusions in addition to an ongoing acute OMI, making the choice of which coronary occlusion to intervene on difficult but critical. 11 Correctly identifying the localization of the acute occlusion would therefore be of great clinical value. We developed and validated such a machine learning model for the identification of OMI and its localization, by using more than half a million ECGs and detailed anatomical coronary angiography and intervention results in emergency department patients. We utilized 540,372 ECGs from 465,471 emergency department (ED) visits and 225,824 patients in the Swedish Emergency Department Database (SwED; Supplementary Figure 1). 12 Of these ECGs, 1,583 (0.3%), 4,279 (0.8%), and 534,510 (98.9%) cases were labeled at time of coronary catheterization by the coronary angiographer as OMI, nOMI (myocardial infarction not classified as OMI), and control (no myocardial infarction), respectively. OMI was defined as the presence of a newly formed coronary total occlusion or very close to total occlusion (TIMI blood flow 0). Of those with an OMI, 595 (37.6%), 359 (22.7%), and 629 (39.7%) had the left main or left anterior descending artery (LM/LAD), the left circumflex artery (LCX), and the right coronary artery (RCA) as the culprit vessel (the acutely blocked artery responsible for this myocardial infarction), respectively ( Figure 1 , panels A and B). We used 70% of the SwED data (data split on patients, not ECGs) for training, 10% for validation, and 20% for testing (one random test set, and one temporal test set with patients whose first visit occurred in the final year of the study period). The numbers in each outcome class (defined in Supplementary Figure 2) and data split are shown in Supplementary Table 1, and the numbers in each subclass over time are shown in Supplementary Figures 3 and 4. The number of samples in each sub class increased over the years, likely due to multiple factors, e.g. including expanded ECG data coverage and a growing proportion of NSTEMI patients managed invasively (with available angiography). The clinical characteristics by OMI class are shown in Table 1 for all data splits of SwED combined, showing that the OMI cases were on average younger than the nOMI cases, had a higher proportion of men, and had less known underlying cardiovascular comorbidities and use of cardiovascular drugs at the time of the ED visit. The OMI cases also had markedly elevated levels of cardiac troponin levels, an elevated risk of death within 30 days ( Table 1 ), and all underwent percutaneous coronary intervention (PCI) within the first week after ED admission (Supplementary Figure 5). View this table: View inline View popup Table 1. Clinical characteristics of the study sample Download figure Open in new tab Figure 1. Localization of occlusion myocardial infarctions and model performance Panel A shows an anatomical heart with the three main branches of the coronary tree, where the model tries to predict the location of an occlusion. RCA (right coronary artery) in purple, LM/LAD (left main coronary artery+left anterior descending artery) in red, and LCX (left circumflex artery) in green, where a lighter color corresponds to a coronary artery that is hidden behind the current view of the heart. Panel B shows a schematic illustration of the coronary artery segments centered around the aorta. The same color scheme is used as in Panel A, but the color intensity corresponds to how frequent occlusive myocardial infarctions were in the given segment. Panel C shows the discriminative performance (C-statistic) when comparing a given class (x-axis) with all other classes in the random or temporal test set. The dashed horizontal line represents a random guess. The model performance in the random and temporal test sets is presented in Figure 1 , panel C (discriminatory performance of the super-classes of the model), Supplementary Figure 6 (discriminatory performance of the sub-classes of the model), and Supplementary Table 2 (metrics of both discrimination and calibration for all super- and sub-classes, including model uncertainty over ten different initialization seeds). Supplementary Figure 7 presents the receiver operating characteristic (ROC) and precision-recall curves across both test datasets. These above-mentioned results present metrics comparing one given class vs all the other classes (OvA) or multiclass comparisons. Supplementary Figure 8 presents metrics for one vs one (OvO) comparisons. In the SwED test sets, the model demonstrated excellent discriminatory performance for the OMI superclass, achieving an OvA C-statistic of >0.95. For the nOMI superclass, the model yielded a OvA C-statistic of >0.87. The model also performed well in identifying the OMI culprit vessel, but with variability in the results for some specific subclasses and test splits. This applied to OvA comparisons; the discriminatory performance was poor for one OvO comparison, OMI LCX vs OMI RCA. We also tested model performance in the publicly available PTB-XL test dataset (European) and the CODE-II test dataset (Brazilian); the model achieved excellent performance (Supplementary Table 3) in differentiating STEMI vs non-infarctions and NSTEMI (the only available labels in these test sets). Calibration plots indicated acceptable agreement between predicted probabilities and observed outcomes, as shown in Supplementary Figure 9. The resolution of the binned calibration plots was sometimes low due to few cases in the outcome classes. To assess the robustness of our model and rule out the influence of proxy variables, we stratified performance by several potential confounders. Stratified C-statistics are presented in Supplementary Figure 10 for the following subsets: age tertiles, sex, did the patient visit the emergency department at Karolinska Hospital (main source of data) or another emergency department in the Stockholm region, ECGs recorded using the most common machine type (MAC55) or not, ECGs recorded using the most common software (v237) or not, prior hospitalisation due to cardiovascular disease, and prevalent left bundle-branch block (LBBB). The discriminatory performance was mostly comparable across strata, but some differences should be highlighted. The model performed better in patients free from LBBB, younger patients, and patients free from prior cardiovascular disease hospitalisations. Some comorbidities were over-or underrepresented among certain high probability misclassifications as shown in Supplementary Table 4. A manual review (GMMP, consultant cardiologist) of CODE-II ECGs misclassified with a high probability suggested that many discrepancies were due to incorrect reference diagnoses. In several cases, the reviewer agreed more with the model than with the original label. Among the false positives, all ECGs showed ST-segment elevation, with eight displaying classic STEMI patterns and two showing features of pericarditis or a dyskinetic segment. Half of the false negatives showed clear STEMI patterns, while the rest included confounding features such as LBBB, subendocardial ischemia, left ventricular hypertrophy, premature ventricular contractions, sinus tachycardia, and atrial fibrillation with high ventricular rate, which may explain the model’s low confidence (Supplementary Table 5). The model displayed excellent discrimination but lower average precision; it seemed unsure on the right occasions, e.g. with challenging ECGs such as with technical noise that the normalization had not removed, in cases with very early ECGs on arrival at the ED or very late when thrombolysis treatment or even PCI hay have been performed, and with possible (but not probable) STEMI in PTB-XL. A manual review (JS, consultant cardiologist) of test set patients with multiple ECGs at the same visit but where the model outputs very different probabilities showed that the ECGs given a high OMI probability indeed had a clear infarction pattern whereas ECGs with a low probability often had issues such as a much weaker infarction pattern or major technical noise. Weaknesses include test sets’ geographical similarity to the training set with all ECGs in a similar format albeit with some differences in machines, analysis software version, and sampling frequency; no availability of independent test sets with same OMI labels; test sets from other geographical regions (likely with different machine setup) only include STEMI labels. Certain subgroups remain an issue; perimyocarditis still 12 raises some confusion for the model, and discrimination of nOMI in the LBBB subgroup is poor but better than chance. Strengths of this study include a strict OMI definition based solely on catheterization data that can differentiate acute from chronic coronary occlusions. OMI definitions that rely on cardiac troponin levels are suboptimal; STEMI cases are rushed past the ED to the catheterization lab without stopping for cardiac troponin testing; troponin levels are low in the most acute phase; and the acuity of less than total or near-total occlusions is unknown. Our model does not rely on troponins or any other external dependencies that may lead to delays. Most myocardial infarction deaths occur in low- and middle-income countries, where timely access to reperfusion therapy is often limited. In these settings, accurate and affordable tools such as machine learning-based ECG interpretation could play a vital role in increasing access to early diagnosis and life-saving treatment 13 . An unanticipated observation is that our model’s STEMI predictions 12 outperform a STEMI model trained on the CODE-II dataset itself, when testing it on the CODE-II dataset. Hence, a model trained on human labels (the CODE-II data) can reach the best conceivable human level, while a model trained on objective outcome labels (our coronary catheterization data) can acquire beyond-human capabilities, even when the test set is based on human labels. We herein developed and validated a first machine learning model for identification and localization of OMI. The clinical usefulness of such a model can be substantial as it can (1) identify OMI patients that are in need of urgent revascularization, and avoid acute activation of the catheterization lab if there is no OMI; and (2) guide the angiographer to the critical coronary branch, in the case of concurrent chronic occlusions 11 . This is a major development over the current STEMI/NSTEMI paradigm, as ST-elevations are only present in a fraction of OMIs in need of acute revascularization 2 , leading to unnecessary delays 5 , 6 , deaths 2 , and costs. Prior machine learning models using ECG data 8 , 9 have shown high performance for classification of OMI. Our model reached similar or higher performance, and can additionally point out the localization of the occlusion. These findings further strengthen the notion that OMI is a potentially useful clinical entity, and the potential usefulness of machine learning models for its timely detection and localization. Because human oversight of OMI detection on the ECG is limited, randomized clinical trials with patient-relevant outcomes are needed before clinical deployment of such models. Inclusion and Ethics The inclusion criteria were kept as wide as possible: only minors and patients without a personal identification number were excluded. The study was approved by the Swedish Ethics Authority, accession numbers 2022-07108-01, 2023-05042-02, 2023-09-22, and 2024-04058-02. Data availability statement The data that support the findings of this study are available from the Swedish Board of Health and Welfare and the included healthcare regions, but restrictions apply to the availability of these data, which were used under license for the current study. Code availability statement All code together with the parameter/hyperparameter estimates of the presented models is available upon request. Competing interests The authors declare the following competing interests: JS reports direct or indirect stock ownership in companies (Anagram kommunikation AB, Sence Research AB, Symptoms Europe AB, MinForskning AB) providing services to companies and authorities in the health sector including Amgen, AstraZeneca, Bayer, Boehringer, Eli Lilly, Gilead, GSK, Göteborg University, Itrim, Ipsen, Janssen, Karolinska Institutet, LIF, Linköping University, Novo Nordisk, Parexel, Pfizer, Region Stockholm, Region Uppsala, Sanofi, STRAMA, Takeda, TLV, Uppsala University, Vifor Pharma, WeMind. AHR reports acting as consultant to Einthoven Technology LTDA, with vesting options. Funding Open access funding provided by Uppsala University. The study was funded by The Kjell and Märta Beijer Foundation, Anders Wiklöf, the Wallenberg AI, Autonomous Systems and Software Program (WASP) funded by Knut and Alice Wallenberg Foundation, and Uppsala University. This project has received funding from the European Research Council (ERC) under the European Union’s Horizon Europe research and innovation programme (grant agreement n° 101054643). The computations were enabled by resources in project sens2020005 and sens2020598 provided by the Swedish National Infrastructure for Computing (SNIC) at UPPMAX, partially funded by the Swedish Research Council through grant agreement no. 2018-05973. AHR is partially supported by the eSSENCE strategic collaborative research programme. DG was funded by the University of Tübingen and Boehringer Ingelheim AI & Data Science Fellowship Program. PEOGBA is a CNPq scholarship holder – Brazil. ALPR is supported in part by CNPq (National Council for Scientific and Technological Development), FAPEMIG (Minas Gerais State Foundation for Research Support), CIIA-S (Innovation Center on Artificial Intelligence for Health), and IATS-CARE (Institute for Health Assessment and Translation for Chronic and Neglected Diseases of High RElevance). The funders had no role in in study design; collection, analysis, and interpretation of data; writing of the report; or decision to submit the paper for publication. Online methods Main study sample The main study sample used in training and validation of the model was obtained from a subset of the Swedish Emergency Department Database (SwED), as described in a previous study of the prediction of ST-elevation and non-ST-elevation myocardial infarction (STEMI and NSTEMI). 12 In brief, the SwED sample includes patients >= 18 years old with available ED data from multiple emergency departments in Sweden, between 2003 and 2017. The sample was linked to national registries (the patient [inpatient and specialized outpatient], prescribed drug, and death registries), national quality registries (SWEDEHEART [Swedish Web-system for Enhancement and Development of Evidence-based care in Heart disease Evaluated According to Recommended Therapies; a Swedish nation-wide quality register] sub-registries RIKS-HIA [Register of Information and Knowledge About Swedish Heart Intensive Care Admissions] and SCAAR [Swedish Coronary Angiography and Angioplasty Registry]), as well as a regional database of ECGs (Karolinska ECG database) and electronic health records. ECG availability restricted the present study to the Karolinska ECG database, Stockholm, Sweden and the years covered by all required data sources at time of the SwED data extraction was limited to 2005-2016. The Karolinska ECG database mainly consists of patients admitted to the Karolinska Hospital, Stockholm, Sweden (85%) but also includes other Region Stockholm hospitals such as Södertälje and Norrtälje. Hence, the study sample included all adult patients who presented to the emergency department (ED) in Region Stockholm, Sweden, between 2005 and 2016, where a standard 12-lead ECG was recorded within 24 hours of their visit. The inclusion and exclusion criteria used to define the study sample are described in Supplementary Figure 1, which were largely consistent with the prior study 12 . Notable differences were the requirement that all myocardial infarction (MI) cases have undergone angiography within seven days of their ED visit (in order to differentiate between acute and chronic occlusions and to determine localization), the additional inclusion of patients with prevalent left bundle branch block (LBBB; as this is a non-negligible fraction of all acute occlusions that any MI model should be able to identify), and the inclusion of controls from the years 2005-2006 (the granular MI subclasses described below were not recorded for these years, hence only controls were included). Ethical approval was obtained from the Swedish Ethical Review Agency (application number 2020-01654), and informed consent was waived as per applicable ethical guidelines. Exposures and outcomes As in the previous study 12 , high-quality data on exposures and outcomes were available from emergency department discharge records, electronic health records, the SWEDEHEART registry, and linked hospitalizations, with patient records joined using the Swedish personal identifier number. The exposures included digital ECG data, age at time of the ED visit, and sex. The ECG recordings were available in the GE MUSE (v9) XML format, with each lead represented by a numerical signal vector together with detailed meta-data of the recording. Standard 10-second, 12-lead ECG recordings sampled at 250 to 500 Hz were used; eight leads were retained (I, II, V1-V6) as four of the standard leads are linear combinations of these and thus redundant. All ECGs were resampled to 400 Hz and normalized as described previously 12 . The outcome labels are primarily defined using data from the SWEDEHEART quality registry where an overall data accuracy of around 96% has been reported from monitor visits. Further, SWEDEHEART has a coverage of 100% for Swedish patients undergoing angiography, which is an inclusion criteria for the myocardial infarction cases in the present study. 14 The study extended the three outcome classes of the prior study 12 (control, STEMI, and NSTEMI) into ten mutually exclusive MI subclasses, incorporating additional granularity regarding OMI and culprit vessel localization (definitions described below). Additionally, controls were stratified into those with and without perimyocarditis, a subgroup previously found to be frequently misclassified as STEMI. 12 The MI subclasses included: Control with perimyocarditis Control without perimyocarditis NSTEMI, nOMI NSTEMI, OMI, LM/LAD NSTEMI, OMI, LCX NSTEMI, OMI, RCA STEMI, nOMI STEMI, OMI, LM/LAD STEMI, OMI, LCX STEMI, OMI, RCA OMI was defined as a newly formed occlusion with complete or close to complete blockage requiring more urgent intervention as opposed to old chronic occlusions that have slowly been built up (where the heart, to some extent, might have adapted, by forming collateral vessels bypassing the blockage). OMI was defined based on the SWEDEHEART SCAAR variable OCKL. The culprit vessel of the OMI was defined as the segment marked as having the newly formed occlusion. The SCAAR database contains information on the coronary segments affected, with twenty segment labels according to a modified version of a previous definition 15 . The fraction of MI cases with an occlusion in some of these segments is very small, and it is sufficient to guide the angiographer to the correct main branch; therefore the segments were grouped into the three main branches: left main coronary artery together with the left anterior descending artery and the intermediary (LM/LAD), left circumflex artery (LCX), and right coronary artery (RCA) as illustrated in Figure 1 , which shows all segments together with the main branches. Instead of excluding patients with prevalent LBBB as in the STEMI/NSTEMI study, the presence of LBBB was incorporated as a separate outcome label that could co-occur with the ten MI classes. LBBB classification was based on the LBBB predictions from an external, machine learning model trained on Brazilian data, which has been shown to outperform cardiology resident medical doctors in the classification of LBBB from ECGs. 16 The model predictions were supplemented with prevalent ICD10:I44.6-I44.7 diagnoses from the patient registry and SWEDEHEART annotations of LBBB. A patient was classified as having an LBBB at the ED visit if all ECGs of the ED visit had a Pr(LBBB)>0.5 (cutoff selected by visual inspection of Supplementary Figure 11) or if a prevalent LBBB diagnosis was present in any of the other data sources. Outcome combinations For the ten non-overlapping MI outcome sub classes, several super categories were of particular interest: OMI = combination of all OMI classes OMI LM/LAD = combination of all OMI classes with LM/LAD as the culprit vessel OMI LCX = combination of all OMI classes with LCX as the culprit vessel OMI RCA = combination of all OMI classes with RCA as the culprit vessel MI = combination of all MI classes NSTEMI = combination of all NSTEMI classes STEMI = combination of all STEMI classes The ability to predict each individual OMI case – along with their location – was paramount in order to guide PCI operators to the culprit vessel in high urgency patients. Compared to the previous STEMI/NSTEMI study, predicting all MI cases not only has clinical applications but also helps evaluating model performance in test sets where only MI (yes/no) labels are available. Data splitting Data were split into 70% training, 10% validation, and 20% test sets, where a patient could only be included in one of these sets. The test set was further divided equally into a random test set and a temporal test set, with the latter including patients whose first visit occurred in the final year (>=2016-01-01) of the study period. To augment the training data, multiple ECGs recorded at the same ED visit of a patient were used. In contrast, only one ECG per ED visit of a patient was used for validation and testing, and if multiple ECGs had been recorded at the ED visit for patients in the validation or test set, only one of these ECGs were retained at random. Model architecture and training The model was based on a convolutional neural network (CNN) using a residual network (ResNet) architecture with skip connections, adapted for one-dimensional ECG signals. The model architecture has been described previously 16 , and the present study extends that previous model architecture. In addition to the ECGs, age and sex were used as predictors. Age and sex were first mapped to a higher-dimensional space (n=64), through a fully connected linear layer using ReLU activation to capture non-linear relationships. Age, sex, and ECGs were then concatenated before the final fully connected prediction layer. As in the STEMI/NSTEMI study, an ensemble of five independently trained model members was used, with their logits averaged to generate final predictions. The same hyperparameters as in the STEMI/NSTEMI study were used. Besides the weighted loss described below, the model architecture of the present study is identical to that of the STEMI/NSTEMI study. 12 The model was trained using cross-entropy loss for the MI subclasses and binary cross-entropy loss was used for LBBB. These losses were combined as: weight CE *loss CE + weight BCE *loss BCE, where weight CE +weight BCE = 1. A hyperparameter search was conducted for determining the optimal BCE:CE weight ratio while all other hyperparameters were held fixed. The BCE:CE weight ratio of 0.3 yielded the best performance trade-off between MI subclass and LBBB classification (Supplementary Figure 12). The model loss was minimized over up to 150 epochs (Supplementary Figure 13). Model validation sets The model was primarily evaluated in the SwED random and temporal test set described above, drawn from the same database used to train the model, including all outcomes which the model was trained to predict. Further, two external test sets (PTB-XL and CODE-II) including labels only for STEMI vs not STEMI were used to evaluate the model’s discriminatory performance for STEMIs. The PTB-XL is a publicly available European database of 21,837 10-second 12-lead ECGs annotated with 71 different ECG statements, including cases of myocardial infarction. 17 , 18 From PTB-XL, 63 acute myocardial infarction cases with a confirmed ST-elevation and 197 randomly selected controls without ST-elevation were manually curated from the PTB-XL database. The inclusion criteria of the PTB-XL test set used in this study has been described previously. 12 The CODE-II dataset is an updated version of the first CODE dataset 16 , with exams collected and annotated using significant improvements in the internal operational system of the Telehealth Network of Minas Gerais (TNMG), Brazil. This system ensures standardized, high-quality ECG diagnostic classes. A complete description of the CODE-II dataset is under review and will be available soon at https://code.telessaude.hc.ufmg.br/ . The dataset comprises 2,742,497 exams from 2,097,369 unique patients, recorded between January 2019 and December 2022. For this study, only the first exam from each patient was included, resulting in a total of 2,097,369 exams. The dataset primarily includes patients from primary care centers, along with some from hospitals, emergency departments, and ambulances. The median age is 54.2 years (IQR: 40.9, 66.3), with 40.9% of the patients being male. Among the 66 ECG CODE diagnostic classes, there is one comparable to STEMI (2,747 exams, 0.13%) and LBBB (40,490 exams, 1.93%) diagnostic classes, with the remaining classes aggregated as not STEMI (2,084,678 exams, 99.39%) for this study. Overlap is observed between exams labeled as LBBB with STEMI (56 exams) and not STEMI (30,485 exams). To better understand the model’s classification errors in the CODE II dataset, we manually reviewed 20 ECGs that were misclassified by the model. This set included 10 false positives, defined as cases not labeled as STEMI where the model predicted a STEMI probability greater than 0.9, and 10 false negatives, where STEMI cases received a predicted probability less than 0.1. The ECGs were reviewed by a consultant cardiologist (GMMP), who was aware of the predicted probability. Metrics of discrimination and calibration The C-statistic and average precision were calculated to evaluate the model’s discriminatory performance. These metrics were primarily assessed using one vs all other (OvA) comparisons, where each class was evaluated against all other classes combined, resulting in the ‘rest’ group being dominated by controls without myocarditis or pericarditis. Additionally, C-statistics were also computed using one vs one (OvO) comparisons, where each class was directly compared to another specific class. As metrics of model calibration, the Brier score and the Expected Calibration Error (ECE) were calculated. The Brier score was calculated as the mean squared error on the probability scale, both in binary OvA calculation but also as multiclass calculation, averaging the OvA Brier scores across all classes. The Expected Calibration Error (ECE) was computed as the weighted average of the absolute differences between the accuracy and the predicted confidence within 10 probability bins. Confidence for each prediction was defined as the maximum predicted probability across classes, reflecting the model’s certainty in its top choice. We visualized the calibration of our model using binned calibration plots of the observed case frequency vs the average predicted probability. Given the low number of cases for some of the outcomes, which can result in very few cases in a bin, we used the combined random and temporal test set for these plots to increase the total number of cases. Up to 20 bins were used, defined based on quantile cutoffs of the predicted probabilities of the evaluated outcome class ensuring that at least 10 cases of the given outcome were present in a given bin. Model performance in subgroups We evaluated whether the model made incorrect predictions (with a high probability) for any of the recorded comorbidities of the patients. For each outcome class, we selected all records with a predicted probability of the class >0.5. Among these, we compared correctly versus incorrectly classified patients based on the true class labels. A non-parametric conditional independence test based on the maximum test statistic was then used to assess whether specific 3-character ICD-10 diagnosis codes were over-or underrepresented among the misclassified patients vs correctly classified patients. All available 3-character ICD-10 codes were tested, and those with a false discovery rate (FDR) < 0.01 were highlighted. In a manually selected list of subgroups, where the model performance might differ, we calculated the C-statistic in OvA comparisons. Given that some subgroups are small, we used the combined random and temporal test set in SwED for the groups control, nOMI, and OMI. Acknowledgements References 1. ↵ GBD 2021 Causes of Death Collaborators. Global burden of 288 causes of death and life expectancy decomposition in 204 countries and territories and 811 subnational locations, 1990-2021: a systematic analysis for the Global Burden of Disease Study 2021 . Lancet 403 , 2100 – 2132 ( 2024 ). OpenUrl CrossRef PubMed 2. ↵ Khan , A. R. et al. Impact of total occlusion of culprit artery in acute non-ST elevation myocardial infarction: a systematic review and meta-analysis . Eur Heart J 38 , 3082 – 3089 ( 2017 ). OpenUrl PubMed 3. ↵ McCabe , J. M. et al. Physician accuracy in interpreting potential ST-segment elevation myocardial infarction electrocardiograms . J Am Heart Assoc 2 , e000268 ( 2013 ). OpenUrl Abstract / FREE Full Text 4. ↵ Soares , W. E. , 3rd . et al. Accuracy Screening for ST Elevation Myocardial Infarction in a Task-switching Simulation . West J Emerg Med 20 , 177 – 184 ( 2019 ). OpenUrl PubMed 5. ↵ Sharp , A. L. et al. Missed acute myocardial infarction in the emergency department-standardizing measurement of misdiagnosis-related harms using the SPADE method . Diagnosis (Berl) 8 , 177 – 186 ( 2021 ). OpenUrl PubMed 6. ↵ Pope , J. H. et al. Missed diagnoses of acute cardiac ischemia in the emergency department . N Engl J Med 342 , 1163 – 1170 ( 2000 ). OpenUrl CrossRef PubMed Web of Science 7. ↵ McLaren , J. , de Alencar , J. N. , Aslanger , E. K. , Meyers , H. P. & Smith , S. W. From ST-Segment Elevation MI to Occlusion MI: The New Paradigm Shift in Acute Myocardial Infarction . JACC Adv 3 , 101314 ( 2024 ). OpenUrl PubMed 8. ↵ Al-Zaiti , S. S. et al. Machine learning for ECG diagnosis and risk stratification of occlusion myocardial infarction . Nat Med 29 , 1804 – 1813 ( 2023 ). OpenUrl CrossRef PubMed 9. ↵ Herman , R. et al. International evaluation of an artificial intelligence-powered electrocardiogram model detecting acute coronary occlusion myocardial infarction . Eur Heart J Digit Health 5 , 123 – 133 ( 2024 ). OpenUrl PubMed 10. ↵ Huang , P.-S. et al. An Artificial Intelligence-Enabled ECG Algorithm for the Prediction and Localization of Angiography-Proven Coronary Artery Disease . Biomedicines 10 , ( 2022 ). 11. ↵ Shanmuganathan , M. et al. Cardiovascular Magnetic Resonance Before Invasive Coronary Angiography in Suspected Non-ST-Segment Elevation Myocardial Infarction . JACC Cardiovasc Imaging 17 , 1044 – 1058 ( 2024 ). OpenUrl PubMed 12. ↵ Gustafsson , S. et al. Development and validation of deep learning ECG-based prediction of myocardial infarction in emergency department patients . Sci Rep 12 , 19615 ( 2022 ). OpenUrl PubMed 13. ↵ Nascimento , B. R. , Brant , L. C. C. , Marino , B. C. A. , Passaglia , L. G. & Ribeiro , A. L. P. Implementing myocardial infarction systems of care in low/middle-income countries . Heart 105 , 20 – 26 ( 2019 ). OpenUrl Abstract / FREE Full Text 14. ↵ Jernberg , T. et al. The Swedish Web-system for enhancement and development of evidence-based care in heart disease evaluated according to recommended therapies (SWEDEHEART) . Heart 96 , 1617 – 1621 ( 2010 ). OpenUrl Abstract / FREE Full Text 15. ↵ Austen , W. G. et al. A reporting system on patients evaluated for coronary artery disease. Report of the Ad Hoc Committee for Grading of Coronary Artery Disease, Council on Cardiovascular Surgery, American Heart Association . Circulation 51 , 5 – 40 ( 1975 ). OpenUrl CrossRef PubMed 16. ↵ Ribeiro , A. H. et al. Automatic diagnosis of the 12-lead ECG using a deep neural network . Nat Commun 11 , 1760 ( 2020 ). OpenUrl CrossRef PubMed 17. ↵ Wagner , P. et al. PTB-XL, a large publicly available electrocardiography dataset . Sci Data 7 , 154 ( 2020 ). OpenUrl PubMed 18. ↵ Goldberger , A. L. et al. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals . Circulation 101 , E215 – 20 ( 2000 ). OpenUrl CrossRef PubMed Web of Science View the discussion thread. Back to top Previous Next Posted September 12, 2025. Download PDF Supplementary Material Email Thank you for your interest in spreading the word about medRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following A deep learning ECG model for localization of occlusion myocardial infarction Message Subject (Your Name) has forwarded a page to you from medRxiv Message Body (Your Name) thought you would like to see this page from the medRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share A deep learning ECG model for localization of occlusion myocardial infarction Stefan Gustafsson , Antônio H. Ribeiro , Daniel Gedon , Petrus E. O. G. B. Abreu , Nicolas Pielawski , Gabriela M. M. Paixão , Antonio Luiz P. Ribeiro , Daniel Lindholm , Thomas B. Schön , Johan Sundström medRxiv 2025.09.11.25335407; doi: https://doi.org/10.1101/2025.09.11.25335407 Share This Article: Copy Citation Tools A deep learning ECG model for localization of occlusion myocardial infarction Stefan Gustafsson , Antônio H. Ribeiro , Daniel Gedon , Petrus E. O. G. B. Abreu , Nicolas Pielawski , Gabriela M. M. Paixão , Antonio Luiz P. Ribeiro , Daniel Lindholm , Thomas B. Schön , Johan Sundström medRxiv 2025.09.11.25335407; doi: https://doi.org/10.1101/2025.09.11.25335407 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Cardiovascular Medicine Subject Areas All Articles Addiction Medicine (568) Allergy and Immunology (863) Anesthesia (298) Cardiovascular Medicine (4421) Dentistry and Oral Medicine (443) Dermatology (382) Emergency Medicine (607) Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1507) Epidemiology (15215) Forensic Medicine (30) Gastroenterology (1122) Genetic and Genomic Medicine (6582) Geriatric Medicine (667) Health Economics (996) Health Informatics (4522) Health Policy (1366) Health Systems and Quality Improvement (1611) Hematology (540) HIV/AIDS (1264) Infectious Diseases (except HIV/AIDS) (15907) Intensive Care and Critical Care Medicine (1103) Medical Education (621) Medical Ethics (144) Nephrology (667) Neurology (6580) Nursing (345) Nutrition (998) Obstetrics and Gynecology (1143) Occupational and Environmental Health (956) Oncology (3328) Ophthalmology (970) Orthopedics (369) Otolaryngology (420) Pain Medicine (435) Palliative Medicine (129) Pathology (663) Pediatrics (1690) Pharmacology and Therapeutics (691) Primary Care Research (710) Psychiatry and Clinical Psychology (5436) Public and Global Health (9215) Radiology and Imaging (2193) Rehabilitation Medicine and Physical Therapy (1368) Respiratory Medicine (1194) Rheumatology (593) Sexual and Reproductive Health (709) Sports Medicine (529) Surgery (709) Toxicology (99) Transplantation (288) Urology (265) (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9ff6e9cfefadf047',t:'MTc3OTQwMTQ0OA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();
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.