<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article article-type="research-article" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="EN">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Cardiovasc. Med.</journal-id>
<journal-title>Frontiers in Cardiovascular Medicine</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Cardiovasc. Med.</abbrev-journal-title>
<issn pub-type="epub">2297-055X</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fcvm.2023.1229743</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Cardiovascular Medicine</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Machine learning-based detection of cardiovascular disease using ECG signals: performance vs. complexity</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Pham</surname><given-names>Huy</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref><uri xlink:href="https://loop.frontiersin.org/people/2305716/overview"/></contrib>
<contrib contrib-type="author"><name><surname>Egorov</surname><given-names>Konstantin</given-names></name>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref><uri xlink:href="https://loop.frontiersin.org/people/2347238/overview" /></contrib>
<contrib contrib-type="author"><name><surname>Kazakov</surname><given-names>Alexey</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref><uri xlink:href="https://loop.frontiersin.org/people/2347115/overview" /></contrib>
<contrib contrib-type="author" corresp="yes"><name><surname>Budennyy</surname><given-names>Semen</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<xref ref-type="aff" rid="aff4"><sup>4</sup></xref>
<xref ref-type="corresp" rid="cor1">&#x002A;</xref><uri xlink:href="https://loop.frontiersin.org/people/2346940/overview" /></contrib>
</contrib-group>
<aff id="aff1"><label><sup>1</sup></label><addr-line>Department of Computer Science</addr-line>, <institution>HSE University</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<aff id="aff2"><label><sup>2</sup></label><addr-line>AI for Medicine</addr-line>, <institution>Sber AI Lab</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<aff id="aff3"><label><sup>3</sup></label><addr-line>Applied Research Center</addr-line>, <institution>Sber AI Lab</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<aff id="aff4"><label><sup>4</sup></label><addr-line>New Materials Discovery Group</addr-line>, <institution>Artificial Intelligence Research Institute (AIRI)</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<author-notes>
<fn fn-type="edited-by"><p><bold>Edited by:</bold> Han Feng, Tulane University, United States</p></fn>
<fn fn-type="edited-by"><p><bold>Reviewed by:</bold> Mario Mekhael, Tulane University, United States, Chengxue Zhong, Boehringer Ingelheim, United States, Wei Hong, Baylor College of Medicine, United States</p></fn>
<corresp id="cor1"><label>&#x002A;</label><bold>Correspondence:</bold> Semen Budennyy <email>sanbudenny@sberbank.ru</email></corresp>
</author-notes>
<pub-date pub-type="epub"><day>31</day><month>07</month><year>2023</year></pub-date>
<pub-date pub-type="collection"><year>2023</year></pub-date>
<volume>10</volume><elocation-id>1229743</elocation-id>
<history>
<date date-type="received"><day>26</day><month>05</month><year>2023</year></date>
<date date-type="accepted"><day>05</day><month>07</month><year>2023</year></date>
</history>
<permissions>
<copyright-statement>&#x00A9; 2023 Pham, Egorov, Kazakov and Budennyy.</copyright-statement>
<copyright-year>2023</copyright-year><copyright-holder>Pham, Egorov, Kazakov and Budennyy</copyright-holder><license license-type="open-access" xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License (CC BY)</ext-link>. The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<sec><title>Introduction</title>
<p>Cardiovascular disease remains a significant problem in modern society. Among non-invasive techniques, the electrocardiogram (ECG) is one of the most reliable methods for detecting cardiac abnormalities. However, ECG interpretation requires expert knowledge and it is time-consuming. Developing a novel method to detect the disease early improves the quality and efficiency of medical care.</p>
</sec>
<sec><title>Methods</title>
<p>The paper presents various modern approaches for classifying cardiac diseases from ECG recordings. The first approach suggests the Poincar&#x00E9; representation of ECG signal and deep-learning-based image classifiers. Additionally, the raw signals were processed with the one-dimensional convolutional model while the XGBoost model was facilitated to predict based on the time-series features.</p>
</sec>
<sec><title>Results</title>
<p>The Poincar&#x00E9;-based methods showed decent performance in predicting AF (atrial fibrillation) but not other types of arrhythmia. XGBoost model gave an acceptable performance in long-term data but had a long inference time due to highly-consuming calculations within the pre-processing phase. Finally, the 1D convolutional model, specifically the 1D ResNet, showed the best results in both studied CinC 2017 and CinC 2020 datasets, reaching the F1 score of 85&#x0025; and 71&#x0025;, respectively, and they were superior to the first-ranking solution of each challenge. The 1D models also presented high specificity. Additionally, our paper investigated efficiency metrics including power consumption and equivalent CO<sub>2</sub> emissions, with one-dimensional models like 1D CNN and 1D ResNet being the most energy efficient. Model interpretation analysis showed that the DenseNet detected AF using heart rate variability while the 1D ResNet assessed the AF patterns in raw ECG signals.</p>
</sec>
<sec><title>Discussion</title>
<p>Despite the under-performed results, the Poincar&#x00E9; diagrams are still worth studying further because of the accessibility and inexpensive procedure. In the 1D convolutional models, the residual connections are useful to keep the model simple but not decrease the performance. Our approach in power measurement and model interpretation helped understand the numerical complexity and mechanism behind the model decision.</p>
</sec>
</abstract>
<kwd-group>
<kwd>ECG</kwd>
<kwd>cardiovascular disease</kwd>
<kwd>arrhythmia</kwd>
<kwd>deep learning</kwd>
<kwd>Poincar&#x00E9; diagram</kwd>
</kwd-group>
<counts>
<fig-count count="6"/>
<table-count count="6"/><equation-count count="46"/><ref-count count="25"/><page-count count="0"/><word-count count="0"/></counts><custom-meta-wrap><custom-meta><meta-name>section-at-acceptance</meta-name><meta-value>General Cardiovascular Medicine</meta-value></custom-meta></custom-meta-wrap>
</article-meta>
</front>
<body>
<sec id="s1" sec-type="intro"><label>1.</label><title>Introduction</title>
<p>Cardiovascular disease is the serious public health problem that affects millions of people worldwide and is also a leading cause of death (<xref ref-type="bibr" rid="B1">1</xref>). The expense of healthcare, lost productivity, and a diminished quality of life due to heart illness has a significant economic and social impact on individuals, families, and the society as a whole (<xref ref-type="bibr" rid="B2">2</xref>). This emphasizes the value of early disease identification. While the electrocardiogram (ECG) is considered the most crucial method for detecting and diagnosing cardiac problems (<xref ref-type="bibr" rid="B3">3</xref>), it takes time and requires trained professionals with specialized skills to interpret ECGs. Furthermore, the availability of devices that can record ECG signals is increasing exponentially. Nowadays, many types of wearable devices are able to collect these signals. However, the number of research studies on this type of data is limited.</p>
<p>The ECG analysis task includes beat annotation and signal classification. While the former deals with aligning the signal segment to the heart contraction, the latter tries to predict the disease from the signal data.</p>
<p>In the domain of ECG classification, there are a number of methods ranging from feature-based models to deep learning&#x2013;based ones. In the feature-based model, the most common features are the domain-dependent features, statistical descriptors, morphological characteristics, and frequency-based features (<xref ref-type="bibr" rid="B4">4</xref>). Meanwhile, the deep learning models are also diverse. The work by Jun et al. (<xref ref-type="bibr" rid="B5">5</xref>) took advantage of AlexNet, VGGNet, and their customized CNN architect to predict arrhythmia diseases based on <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM1"><mml:mn>128</mml:mn><mml:mo>&#x00D7;</mml:mo><mml:mn>128</mml:mn></mml:math></inline-formula> grayscale images of ECG signal. The best model reached 0.989 Area under the ROC Curve (AUC) and over 99&#x0025; accuracy. Two years later, there was a concerted effort by Hong et al. (<xref ref-type="bibr" rid="B6">6</xref>) to develop an ensemble system to process the waveform data. With several types of CNN-based deep learning models, this system scored an accuracy of 95&#x0025;. Also, Ribeiro et al. (<xref ref-type="bibr" rid="B7">7</xref>) used 1D ResNet to predict six types of cardiovascular disease and got an F1 score of over 80&#x0025;. After that, the work by Zhang et al. (<xref ref-type="bibr" rid="B8">8</xref>) proved the dominant results of deep learning compared to the traditional machine learning model. Their model could classify nine subtypes of arrhythmias with an F1 score of over 80&#x0025;. The impressive idea of this work is to use the SHapley Additive exPlanations (SHAP) value to explain the model output at the individual and population levels.</p>
<p>To improve the quality of models, the scientific community organized many challenges with large-scale datasets, including The PhysioNet/Computing in Cardiology Challenge (CinC) 2017 and 2020 (<xref ref-type="bibr" rid="B9">9</xref>, <xref ref-type="bibr" rid="B10">10</xref>). While CinC 2017 focused on arrhythmia disease, CinC 2020 contained ECG signals in a wide range of cardiac abnormalities. There are many efforts to apply machine learning/deep learning approaches to reach the highest performance. In the challenge CinC 2017, Kamaleswaran et al. (<xref ref-type="bibr" rid="B11">11</xref>) used a convolutional neural network in signal processing and got the best ranking in arrhythmia prediction. After that, Natarajan et al. (<xref ref-type="bibr" rid="B12">12</xref>) took advantage of transformer architecture to get the highest place at challenge CinC 2020.</p>
<p>Besides the improvement of classification performance, the architecture of models becomes more complicated, so they require more energy to train and have a long inference time. This problem limits the application of the method, especially in handheld and wearable devices.</p>
<p>In this study, we focused on enhancing ECG classification approaches in terms of performance, numerical complexity, inference time, and its interpretability.</p>
<p><italic>Contribution.</italic> The contribution of our paper is threefold:</p>
<list list-type="simple">
<list-item><label>&#x2022;</label><p>First, we introduce a pipeline for ECG classifier evaluation in terms of performance and numerical complexity.</p></list-item>
<list-item><label>&#x2022;</label><p>Second, we achieved a state-of-the-art level (with regard to CinC 2017 and CinC 2020 challenges) performance with the 1D ResNet model for both CinC 2017 and CinC 2020 benchmarks.</p></list-item>
<list-item><label>&#x2022;</label><p>Third, we provided interpretation techniques for Poincar&#x00E9;-based DenseNet121 and 1D ResNet models.</p></list-item>
</list>
</sec>
<sec id="s2" sec-type="methods"><label>2.</label><title>Materials and methods</title>
<sec id="s2a"><label>2.1.</label><title>Data</title>
<p>The data were collected from two challenges: PhysioNet/CinC Challenge 2017 and 2020 (<xref ref-type="bibr" rid="B9">9</xref>, <xref ref-type="bibr" rid="B10">10</xref>). These collections were chosen because they are both open-sourced datasets with well-annotated labels, as well as massive sources of ECG recordings, which are suitable for training deep learning models. We intentionally did not apply any inclusion/exclusion criteria for data selection. The total number of disclosure data samples was split into train/validation/test subsets with the ratio 60/20/20. The partition was done by splitting randomly the dataset based on the number of recordings. In this study, we intentionally did not apply any inclusion/exclusion criteria for data selection to capture the full spectrum of patient profiles and maximize the generalizability of our findings. The details of the data are shown in Table <xref ref-type="table" rid="T1">Table&#x00A0;1</xref>.</p>
<table-wrap id="T1" position="float"><label>Table 1</label>
<caption><p>Descriptive statistics and demographics information of CinC 2017 and CinC 2020 datasets.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="left"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left" rowspan="2">Measures</th>
<th valign="top" align="center" rowspan="2">Factors</th>
<th valign="top" align="center" colspan="3">CinC 2017</th>
<th valign="top" align="center" colspan="3">CinC 2020</th>
</tr>
<tr>
<th valign="top" align="center">Train</th>
<th valign="top" align="center">Validation</th>
<th valign="top" align="center">Test</th>
<th valign="top" align="center">Train</th>
<th valign="top" align="center">Validation</th>
<th valign="top" align="center">Test</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" colspan="2">&#x0023; samples</td>
<td valign="top" align="center">5,116</td>
<td valign="top" align="center">1,706</td>
<td valign="top" align="center">1,706</td>
<td valign="top" align="center">25,860</td>
<td valign="top" align="center">8,620</td>
<td valign="top" align="center">8,621</td>
</tr>
<tr>
<td valign="top" align="left" colspan="2">Rate (Hz)</td>
<td valign="top" align="center">300</td>
<td valign="top" align="center">300</td>
<td valign="top" align="center">300</td>
<td valign="top" align="center">257&#x2013;1,000</td>
<td valign="top" align="center">257&#x2013;1,000</td>
<td valign="top" align="center">257&#x2013;1,000</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="4">Signal length (s)</td>
<td valign="top" align="left">Mean</td>
<td valign="top" align="center">32.4</td>
<td valign="top" align="center">32.8</td>
<td valign="top" align="center">32.5</td>
<td valign="top" align="center">15.4</td>
<td valign="top" align="center">16.1</td>
<td valign="top" align="center">16.1</td>
</tr>
<tr>
<td valign="top" align="left">Min</td>
<td valign="top" align="center">9.1</td>
<td valign="top" align="center">9.8</td>
<td valign="top" align="center">9.0</td>
<td valign="top" align="center">5.0</td>
<td valign="top" align="center">5.0</td>
<td valign="top" align="center">5.0</td>
</tr>
<tr>
<td valign="top" align="left">Median</td>
<td valign="top" align="center">30.0</td>
<td valign="top" align="center">30.0</td>
<td valign="top" align="center">30.0</td>
<td valign="top" align="center">10.0</td>
<td valign="top" align="center">10.0</td>
<td valign="top" align="center">10.0</td>
</tr>
<tr>
<td valign="top" align="left">Max</td>
<td valign="top" align="center">61.0</td>
<td valign="top" align="center">60.6</td>
<td valign="top" align="center">60.8</td>
<td valign="top" align="center">1,800.0</td>
<td valign="top" align="center">1,800.0</td>
<td valign="top" align="center">18,00.0</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="7">Age (&#x0025;)</td>
<td valign="top" align="left">Younger than 18</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">0.7</td>
<td valign="top" align="center">0.7</td>
<td valign="top" align="center">0.8</td>
</tr>
<tr>
<td valign="top" align="left">18&#x2013;29</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">5.4</td>
<td valign="top" align="center">5.2</td>
<td valign="top" align="center">5.2</td>
</tr>
<tr>
<td valign="top" align="left">30&#x2013;39</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">6.4</td>
<td valign="top" align="center">6.8</td>
<td valign="top" align="center">7.0</td>
</tr>
<tr>
<td valign="top" align="left">40&#x2013;49</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">11.1</td>
<td valign="top" align="center">11.3</td>
<td valign="top" align="center">10.9</td>
</tr>
<tr>
<td valign="top" align="left">50&#x2013;64</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">30.9</td>
<td valign="top" align="center">31.1</td>
<td valign="top" align="center">30.8</td>
</tr>
<tr>
<td valign="top" align="left">65 and older</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">45.0</td>
<td valign="top" align="center">44.3</td>
<td valign="top" align="center">44.9</td>
</tr>
<tr>
<td valign="top" align="left">Missing data</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">0.5</td>
<td valign="top" align="center">0.6</td>
<td valign="top" align="center">0.4</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="3">Gender (&#x0025;)</td>
<td valign="top" align="left">Male</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">53.3</td>
<td valign="top" align="center">53.1</td>
<td valign="top" align="center">52.5</td>
</tr>
<tr>
<td valign="top" align="left">Female</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">46.7</td>
<td valign="top" align="center">46.9</td>
<td valign="top" align="center">47.5</td>
</tr>
<tr>
<td valign="top" align="left">Missing data</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">&#x2014;</td>
<td valign="top" align="center">0.0</td>
<td valign="top" align="center">0.0</td>
<td valign="top" align="center">0.0</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The CinC 2017 dataset was recorded by AliveCor device and contains 8,528 single-lead signals. The length of recordings is from 9 to 60&#x2009;s, and the average length is about 32&#x2009;s. Every ECG signal was recorded at 300&#x2009;Hz and already filtered by the recorder. The host provided the data in WFDB format with a .mat file containing signal data and a <monospace>.hea</monospace> file containing headers for basic information including ID and recording parameters.</p>
<p>The CinC 2020 dataset contains 12-lead signals which come from five different sources: CPSC Database and CPSC-Extra Database, INCART Database, PTB and PTB-XL Database, The Georgia 12-lead ECG Challenge (G12EC) Database, and the Private Database.</p>
<p>The dataset CPSC is the collection of the ECG signals of Chinese patients, which were recorded at 500&#x2009;Hz. The patient&#x2019;s gender and age were disclosed in this dataset; however, the age of over-89-year-old patients is masked as 92 due to the HIPAA guidelines. The INCART database contains 30-min recordings at 257&#x2009;Hz while the PTB and Georgia datasets consist of 10-s recordings only. The private part of data is not public so this source was not included in our work. The remaining dataset was split into train/test/split with the ratio 60/20/20. Like the CinC 2017 dataset, the data from CinC 2020 is also WFDB-compliant. The header files embedded the demographics information and diagnosis labels.</p>
<p>The embedded headers in CinC 2020 reveal the distribution of age and gender. Most of the subjects in CinC 2020 are aged 65 and older, followed by the age group of 50&#x2013;64&#x2009;years. The remaining age groups have relatively smaller proportions. Additionally, every subset has minimal missing data for age, with less than 1&#x0025; of entries having no specified age information. Regarding gender, the sex ratio is relatively balanced. Notably, there are nearly zero missing data points for gender in CinC 2020.</p>
<p>In term of label distribution, while the CinC 2017 dataset was limited to four classes, including Normal, Atrial Fibrillation (AF), Other, and Noisy, the CinC 2020 dataset has 28 categories of cardiovascular disease (<xref ref-type="fig" rid="F1">Figure&#x00A0;1</xref>). The distribution of classes is very imbalanced. In CinC 2017, the AF samples are under 10&#x0025; of the dataset while the Normal samples are nearly 60&#x0025;. Likewise, within the CinC 2020 dataset, the Sinus Rhythm and Other categories exceed 20&#x0025;, whereas the remaining classes fall below 10&#x0025;. The detail description of each class is mentioned in <xref ref-type="sec" rid="s8">Table S1</xref> in the <xref ref-type="sec" rid="s8">Supplementary Material</xref>.</p>
<fig id="F1" position="float"><label>Figure 1</label>
<caption><p>The classes distribution in datasets CinC 2017 (left side) and CinC 2020 (right side).</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g001.tif"/>
</fig>
</sec>
<sec id="s2b"><label>2.2.</label><title>Model architecture, training pipeline, and experiment conditions</title>
<p>This section describes the details of the configuration of each model as well as the flow of data when training the model. The overview of the training pipeline is given in <xref ref-type="fig" rid="F2">Figure&#x00A0;2</xref> and interpreted in the following. There are three main flows of learning in our experiments. They shared the same signal loader and evaluation method. Each flow had a separate way of pre-processing data and model optimization, which will be described in detail below.</p>
<fig id="F2" position="float"><label>Figure 2</label>
<caption><p>The high-level scheme of training pipeline, including data preparation, model optimization, and performance evaluation.</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g002.tif"/>
</fig>
<p>All experiments were conducted on the same computer with 1 <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM2"><mml:mo>&#x00D7;</mml:mo></mml:math></inline-formula> Intel Core i7-9700F CPU, 64 GB RAM, and 1 <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM3"><mml:mo>&#x00D7;</mml:mo></mml:math></inline-formula> NVIDIA GeForce GTX 3060 GPU. The metrics was estimated on both 5-fold cross-validation and a separated test set. In cross-validation experiments, we combined the train and validation subset into one dataset before performing the fivefold cross-validation. To estimate the performance on the unseen data, we trained the models on the train subset and tested on the separated test subset, while the validation subset was used to optimize the hyperparameters.</p>
<sec id="s2b1"><label>2.2.1.</label><title>Learning over Poincar&#x00E9; representation</title>
<p>For the methods based on the Poincar&#x00E9; diagram, the input ECG signals were preprocessed by <monospace>biosppy</monospace> (<xref ref-type="bibr" rid="B13">13</xref>) to extract the R-peak positions from the signal (<xref ref-type="bibr" rid="B14">14</xref>). This library filters the ECG signal in the frequency range from 3 to 45 before using the Hamilton algorithm (<xref ref-type="bibr" rid="B15">15</xref>) to detect the R-peak. The distance between R-peaks (or RR intervals) was evaluated from the R-peak location. Furthermore, in our study, we only used the NN intervals, which are the distances between normal R-peaks collected after removing the noise and artifacts. The Poincar&#x00E9; diagram was constructed by plotting the scatter charts for <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM4"><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM5"><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> intervals. <xref ref-type="fig" rid="F3">Figure&#x00A0;3</xref> shows the examples of Poincar&#x00E9; diagram of a short and long recording.</p>
<fig id="F3" position="float"><label>Figure 3</label>
<caption><p>The Poincar&#x00E9; diagrams of the short-term (<bold>A</bold>) and long-term (<bold>B</bold>) ECGs. The diagrams plot the normal R-peak intervals (or NN intervals).</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g003.tif"/>
</fig>
<p>To predict the cardiovascular disease over the Poincar&#x00E9; diagrams, the default architecture of ResNet50 (<xref ref-type="bibr" rid="B16">16</xref>) and DenseNet121 (<xref ref-type="bibr" rid="B17">17</xref>) were used to train from the scratch (without pre-trained weights). The last layers of these models were also tailored to match the number of classes of each dataset.</p>
</sec>
<sec id="s2b2"><label>2.2.2.</label><title>Learning over 1D signal</title>
<p>In our study, the 1D CNN model comprises 12 base blocks. Each base block consists of a 1D Convolutional layer, 1D Batch Normalization, Activation function, Pooling layer, and Drop-out layer. The 1D Convolutional layer was set with no padding and stride size of 1. The output channel starts at 256 and decreases gradually to 32 in the last convolutional layer, and the kernel size starts at 20 followed by 5 layers with a kernel size of 5, and then 3 for the remaining layers. The Batch Normalization layers have the number of weights the same as the number of output channels of the prior convolutional layer. The momentum of normalization is 0.99 for every block. The Pooling of base block is Max Pooling of which the kernel size and stride size are 2. The dropout probability is set to 0.3 in every place. Before flattening the tensor and feeding to the last fully connected layer for the logit outputs, there is an average pooling layer with a kernel size of 1 and stride size of 2.</p>
<p>The structure of the base block in 1D ResNet includes a 1D Convolutional layer, 1D Batch Normalization, ReLU activation function, a Drop-out layer, another 1D Convolutional layer, and 1D Batch Normalization. In a base block, the input would go through these layers before adding the residual which is also the input tensor. This summation is activated by the ReLU function after leaving the block.</p>
<p>In our work, the 1D ResNet starts with a 1D Convolutional layer with a kernel size of 15 and the number of output channels is 64 followed by a 1D Batch Normalization, ReLU Activation function, and Max Pooling layer. After that, there are four base blocks with kernel sizes increasing from 65 to 256. The output of the last base block goes through two pooling layers: an Average Pooling layer and a Max Pooling layer. These outputs are concatenated before feeding to the final fully connected layer to compute the output logits.</p>
<p>In both 1D CNN and 1D ResNet models, the signals are converted to first-order difference and scaled to zero mean and unit variance before transferring to the models.</p>
</sec>
<sec id="s2b3"><label>2.2.3.</label><title>Learning over XGBoost feature space</title>
<p>In the pipeline of the XGBoost model, the processed ECG signals need to feed to module <monospace>tsfresh</monospace> to extract the features before training model. The features extraction used the list of efficient features set but filtered out the time-consuming features including: entropy-related features, matrix profile, the number of Continuous Wavelet Transform (CWT) peak, partial autocorrelation, aggregated linear trend, and the statistics of Augmented Dickey&#x2013;Fuller test. In the feature matrix, the pipeline filled the missing data with <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM6"><mml:mo>&#x2212;</mml:mo></mml:math></inline-formula>999 and removed the low-variance features.</p>
<p>The hyperparameters of XGBoost were optimized by searching within the predefined space (<xref ref-type="table" rid="T2">Table&#x00A0;2</xref>). The optimum collection was found by Bayesian optimization implemented in the library <monospace>scikit-optimize</monospace>. (<xref ref-type="bibr" rid="B18">18</xref>) The number of search trials was limited to 100 because of time constraints.</p>
<table-wrap id="T2" position="float"><label>Table 2</label>
<caption><p>The hyperparameters searching space of XGBoost.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="left"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left">Component</th>
<th valign="top" align="center">Hyperparameter</th>
<th valign="top" align="center">Range</th>
<th valign="top" align="center">Distribution</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">Feature elimination</td>
<td valign="top"><monospace>min&#x005F;features&#x005F;to&#x005F;select</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM7"><mml:mo stretchy="false">[</mml:mo><mml:mn>10</mml:mn><mml:mo>,</mml:mo><mml:mtext>\# features</mml:mtext><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>max&#x005F;depth</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM8"><mml:mo stretchy="false">[</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mn>100</mml:mn><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>gamma</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM9"><mml:mo stretchy="false">[</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>3</mml:mn></mml:msup><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Log-uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>eta</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM10"><mml:mo stretchy="false">[</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>3</mml:mn></mml:msup><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Log-uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>scale&#x005F;pos&#x005F;weight</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM11"><mml:mo stretchy="false">[</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>3</mml:mn></mml:msup><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Log-uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>reg&#x005F;lambda</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM12"><mml:mo stretchy="false">[</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>3</mml:mn></mml:msup><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Log-uniform</td>
</tr>
<tr>
<td valign="top">XGBClassifier</td>
<td valign="top"><monospace>reg&#x005F;alpha</monospace></td>
<td valign="top"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM13"><mml:mo stretchy="false">[</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>3</mml:mn></mml:msup><mml:mo stretchy="false">]</mml:mo></mml:math></inline-formula></td>
<td valign="top">Log-uniform</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
</sec>
<sec id="s2c"><label>2.3.</label><title>Metrics and model interpretation</title>
<p>The popular metrics for the classification problem include accuracy, precision, recall, and F1 score. While the accuracy is biased if the dataset is heavily imbalanced among classes (<xref ref-type="bibr" rid="B19">19</xref>), precision and recall are preferred in these cases. In this study, we used the harmonic mean of precision and recall (F1 score), which is easy to compare methods with only one measure. Besides the F1 score, sensitivity and specificity were also calculated to get more insight into each model. These scores were calculated as<disp-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="UDM1"><mml:mtable columnalign="right left" rowspacing=".5em" columnspacing="thickmathspace" displaystyle="true"><mml:mtr><mml:mtd><mml:mtext>Precision</mml:mtext></mml:mtd><mml:mtd><mml:mo>=</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>F</mml:mi><mml:mi>P</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>,</mml:mo><mml:mspace width="1em" /><mml:mtext>Recall/Sensitivity</mml:mtext><mml:mo>=</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>F</mml:mi><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext>Specificity</mml:mtext></mml:mtd><mml:mtd><mml:mo>=</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>F</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>T</mml:mi><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>,</mml:mo><mml:mspace width="1em" /><mml:mtext>F1 Score</mml:mtext><mml:mo>=</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mn>2</mml:mn><mml:mo>&#x00D7;</mml:mo><mml:mtext>Precision</mml:mtext><mml:mo>&#x00D7;</mml:mo><mml:mtext>Recall</mml:mtext></mml:mrow><mml:mrow><mml:mtext>Precision</mml:mtext><mml:mo>+</mml:mo><mml:mtext>Recall</mml:mtext></mml:mrow></mml:mfrac></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>where <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM14"><mml:mi>T</mml:mi><mml:mi>P</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM15"><mml:mi>F</mml:mi><mml:mi>P</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM16"><mml:mi>T</mml:mi><mml:mi>N</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM17"><mml:mi>F</mml:mi><mml:mi>N</mml:mi></mml:math></inline-formula> are the number of True Positive, False Positive, True Negative, and False Negative extracted from the confusion matrix, respectively. Because the dataset is multiple classes (in CinC 2017) or multiples labels (in CinC 2020), the average of each metric was reported in our study.</p>
<p>To assess the power efficiency of the proposed methods, we measured the power consumption, the equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM18"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emission, and the inference time of each model. The inference time was calculated by the average time of predictions on the test set. The power consumption and carbon emissions information were monitored and calculated using the open-source library <italic>eco2AI</italic>, which is available at <ext-link ext-link-type="uri" xlink:href="https://github.com/sb-ai-lab/Eco2AI">https://github.com/sb-ai-lab/Eco2AI</ext-link> (<xref ref-type="bibr" rid="B20">20</xref>).</p>
<p>To explore the mechanism behind the decision of (1D and 2D) convolutional model, the Gradient-weighted Class Activation Mapping or GradCAM (<xref ref-type="bibr" rid="B21">21</xref>) was constructed to visualize which region in the input that the model focused on when predicting. The basic idea of GradCAM is to calculate the gradient of output with respect to the feature map of last convolutional layers, and then these gradients are aggregated to obtain the weight for the feature map. An heatmap is built based on these weights to show the contribution of each region to the prediction score.</p>
<p>For the XGBoost model, the feature importance of each feature was calculate based on the frequency of that feature in splitting data when training the tree. Because the number of variables is enormous, they were aggregated into common group.</p>
</sec>
</sec>
<sec id="s3" sec-type="results"><label>3.</label><title>Results</title>
<p>In this section, we summarize the classification performance and power consumption metrics of each classifier. After that, we try to interpret the model decision using the mentioned methods.</p>
<sec id="s3a"><label>3.1.</label><title>Cardiovascular diseases classification</title>
<p>The experiment results showed the superior performance of the 1D ResNet model learned over raw data in both datasets. Especially, in both datasets, this model surpassed the first rank solution in many measurements. The comparison of F1 scores, sensitivity, specificity, and the efficiency metrics (power consumption, equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM19"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula>) are given in <xref ref-type="table" rid="T3">Table&#x00A0;3</xref>.</p>
<table-wrap id="T3" position="float"><label>Table 3</label>
<caption><p>Performance benchmark results on the fivefold cross-validation and the separated test datasets.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="left"/>
<col align="left"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left" rowspan="2">Dataset</th>
<th valign="top" align="center" rowspan="2">Input data</th>
<th valign="top" align="center" rowspan="2">Model</th>
<th valign="top" align="center" colspan="3">Fivefold cross-validation</th>
<th valign="top" align="center" colspan="3">Test set</th>
</tr>
<tr>
<th valign="top" align="center">F1</th>
<th valign="top" align="center">SENS</th>
<th valign="top" align="center">SPEC</th>
<th valign="top" align="center">F1</th>
<th valign="top" align="center">SENS</th>
<th valign="top" align="center">SPEC</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" rowspan="6">CinC 2020</td>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">ResNet50</td>
<td valign="top" align="center">0.70 (0.02)</td>
<td valign="top" align="center">0.64 (0.03)</td>
<td valign="top" align="center">0.82 (0.05)</td>
<td valign="top" align="center">0.71</td>
<td valign="top" align="center">0.64</td>
<td valign="top" align="center">0.79</td>
</tr>
<tr>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">DenseNet121</td>
<td valign="top" align="center">0.75 (0.02)</td>
<td valign="top" align="center">0.71 (0.02)</td>
<td valign="top" align="center">0.82 (0.02)</td>
<td valign="top" align="center">0.77</td>
<td valign="top" align="center">0.73</td>
<td valign="top" align="center">0.80</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D CNN</td>
<td valign="top" align="center">0.81 (0.01)</td>
<td valign="top" align="center">0.79 (0.01)</td>
<td valign="top" align="center">0.86 (0.01)</td>
<td valign="top" align="center">0.84</td>
<td valign="top" align="center">0.83</td>
<td valign="top" align="center"><bold>0.86</bold></td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D ResNet</td>
<td valign="top" align="center"><bold>0.82</bold> (0.01)</td>
<td valign="top" align="center"><bold>0.81</bold> (0.01)</td>
<td valign="top" align="center"><bold>0.87</bold> (0.01)</td>
<td valign="top" align="center"><bold>0.85</bold></td>
<td valign="top" align="center"><bold>0.85</bold></td>
<td valign="top" align="center">0.86</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">Kamaleswaran et al.<xref ref-type="table-fn" rid="table-fn4"><sup>a</sup></xref></td>
<td valign="top" align="center">0.80 (0.02)</td>
<td valign="top" align="center">0.77 (0.02)</td>
<td valign="top" align="center">0.85 (0.03)</td>
<td valign="top" align="center">0.84</td>
<td valign="top" align="center">0.83</td>
<td valign="top" align="center">0.86</td>
</tr>
<tr>
<td valign="top" align="left">Time series</td>
<td valign="top" align="left">XGBoost</td>
<td valign="top" align="center">0.64 (0.02)</td>
<td valign="top" align="center">0.72 (0.09)</td>
<td valign="top" align="center">0.51 (0.15)</td>
<td valign="top" align="center">0.69</td>
<td valign="top" align="center">0.82</td>
<td valign="top" align="center">0.48</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="6">CinC 2020</td>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">ResNet50</td>
<td valign="top" align="center">0.47 (0.03)</td>
<td valign="top" align="center">0.37 (0.03)</td>
<td valign="top" align="center">0.81 (0.03)</td>
<td valign="top" align="center">0.45</td>
<td valign="top" align="center">0.35</td>
<td valign="top" align="center">0.83</td>
</tr>
<tr>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">DenseNet121</td>
<td valign="top" align="center">0.50 (0.00)</td>
<td valign="top" align="center">0.40 (0.01)</td>
<td valign="top" align="center">0.80 (0.01)</td>
<td valign="top" align="center">0.50</td>
<td valign="top" align="center">0.41</td>
<td valign="top" align="center">0.80</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D CNN</td>
<td valign="top" align="center">0.67 (0.00)</td>
<td valign="top" align="center">0.59 (0.01)</td>
<td valign="top" align="center">0.89 (0.01)</td>
<td valign="top" align="center">0.69</td>
<td valign="top" align="center">0.63</td>
<td valign="top" align="center">0.88</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D ResNet</td>
<td valign="top" align="center"><bold>0.71</bold> (0.00)</td>
<td valign="top" align="center">0.65 (0.01)</td>
<td valign="top" align="center"><bold>0.92</bold> (0.01)</td>
<td valign="top" align="center"><bold>0.71</bold></td>
<td valign="top" align="center">0.65</td>
<td valign="top" align="center"><bold>0.92</bold></td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">Natarajan et al.<xref ref-type="table-fn" rid="table-fn4"><sup>a</sup></xref></td>
<td valign="top" align="center">0.61 (0.02)</td>
<td valign="top" align="center"><bold>0.82</bold> (0.02)</td>
<td valign="top" align="center">0.85 (0.02)</td>
<td valign="top" align="center">0.66</td>
<td valign="top" align="center"><bold>0.80</bold></td>
<td valign="top" align="center">0.90</td>
</tr>
<tr>
<td valign="top" align="left">Time series</td>
<td valign="top" align="left">XGBoost</td>
<td valign="top" align="center">0.65 (0.01)</td>
<td valign="top" align="center">0.62 (0.03)</td>
<td valign="top" align="center">0.80 (0.03)</td>
<td valign="top" align="center">0.65</td>
<td valign="top" align="center">0.65</td>
<td valign="top" align="center">0.78</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-fn2"><p>F1, F1 score; SENS, sensitivity; SPEC, specificity.</p></fn>
<fn id="table-fn3"><p>The cross-validation performance metrics are reported with mean (SD). Bold numbers indicate the performance of the best model.</p></fn>
<fn id="table-fn4"><label><sup>a</sup></label><p>The first rank solution.</p></fn>
</table-wrap-foot>
</table-wrap>
<p>For the CinC 2017 dataset, the 1D ResNet is the best-performing model with the highest F1 score in both fivefold cross-validation and separated test dataset. The model also demonstrates high sensitivity and specificity. The 1D CNN on the raw signal input also performs well among the other models. For the CinC 2020 dataset, the 1D ResNet models also outperforms other models in F1 scores and specificity. However, the sensitivity of the model is lower than the transformer-based model (<xref ref-type="bibr" rid="B12">12</xref>).</p>
<p>In detail, the Poincar&#x00E9;-based methods have adequate performance in the CinC 2017 challenge. However, they did not perform well in the CinC 2020 challenge. Particularly, some classes are not discriminated in the Poincar&#x00E9; diagrams. The models ResNet50 and DenseNet121 only identified the types Atrial fibrillation (AF), Sinus bradycardia (SB), Sinus rhythm (SNR), Sinus tachycardia (STach), and other, while the metrics for the remaining types are close to zero. This result is understandable as the information on heart rate variability is not sufficient to identify several types of heart disease.</p>
<p>The XGBoost is under-expected because it ranked lowest in CinC 2017 and only third in CinC 2020 despite the gradient-boosting family usually gaining the highest place at many machine learning benchmarks.</p>
<p>The unidimensional convolutional models yielded excellent results in both classification challenges. The 1D CNN and 1D ResNet shared the top two places in both datasets. In CinC 2017, the 1D ResNet is the best model, followed by the 1D CNN. In CinC 2020, the 1D ResNet surpassed the top-1 solution by a large margin in F1 score and 2&#x0025; higher specificity. However, these models were still not better than the transformer-based model in sensitivity. Regarding the best model (1D ResNet), the metrics for each class are presented in the <xref ref-type="sec" rid="s8">Supplementary Table S2</xref>. This model worked very well on classifying the class Atrial Fibrillation, Sinus tachycardia, and Left/Right bundle branch block while there are a number of minor patterns that were unable to detect such as Q-wave abnormal or T-wave inversion.</p>
<p>The fivefold cross-validation results, especially the standard deviation of performance metrics, reveals the stability and robustness of the models. Because of lower standard deviation in the cross-validation metrics, the 1D convolutional models are more stable than other models in both datasets, while the performance of gradient-boosting model and Poincar&#x00E9;-based models fluctuate among the splits.</p>
<p>To better illustrate the tandem &#x201C;Performance vs. Complexity&#x201D; for examined models, <xref ref-type="fig" rid="F4">Figure&#x00A0;4</xref> shows cross-plots on F1 score and <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM20"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions for both datasets. In particular, one can reveal that DenseNet121 and ResNet50 models learned over Poincar&#x00E9; diagrams stand out from other models as inefficient while ResNet learned on raw ECG signals outperforms.</p>
<fig id="F4" position="float"><label>Figure 4</label>
<caption><p>Test F1 score vs. <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM21"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions: left side&#x2014;models learned over CinC 2017 dataset; right side&#x2014;models learned over CinC 2020 dataset. Dotted red ellipses highlight relatively heavy models.</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g004.tif"/>
</fig>
<p>We also analyzed the performance of investigated models in each source of the CinC 2020 dataset (<xref ref-type="table" rid="T4">Table&#x00A0;4</xref>). The ResNet50 was good at the short-term recordings while performing poorly in long-term data. The DenseNet121 was better than ResNet50 in long-term signal classification but did not surpass the 1D Convolutional model. The XGBoost outperformed the others in long-term ECG. However, the number of long-term signals is not very large, so their metrics might not be stable.</p>
<table-wrap id="T4" position="float"><label>Table 4</label>
<caption><p>The F1 score on each sources in the CinC 2020 dataset.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left">Model</th>
<th valign="top" align="center">G12EC <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM22"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>10</mml:mn></mml:math></inline-formula></th>
<th valign="top" align="center">PTB-XL <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM23"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>10</mml:mn></mml:math></inline-formula></th>
<th valign="top" align="center">CPSC <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM24"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>16</mml:mn></mml:math></inline-formula></th>
<th valign="top" align="center">CPSC-Extra <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM25"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>16</mml:mn></mml:math></inline-formula></th>
<th valign="top" align="center">PTB <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM26"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>109</mml:mn></mml:math></inline-formula></th>
<th valign="top" align="center">INCART <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM27"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>1800</mml:mn></mml:math></inline-formula></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">ResNet50</td>
<td valign="top" align="center">0.28</td>
<td valign="top" align="center">0.56</td>
<td valign="top" align="center">0.35</td>
<td valign="top" align="center">0.33</td>
<td valign="top" align="center">0.16</td>
<td valign="top" align="center">0.20</td>
</tr>
<tr>
<td valign="top" align="left">DenseNet121</td>
<td valign="top" align="center">0.36</td>
<td valign="top" align="center">0.58</td>
<td valign="top" align="center">0.38</td>
<td valign="top" align="center">0.50</td>
<td valign="top" align="center">0.77</td>
<td valign="top" align="center">0.60</td>
</tr>
<tr>
<td valign="top" align="left">1D CNN</td>
<td valign="top" align="center">0.55</td>
<td valign="top" align="center"><bold>0.76</bold></td>
<td valign="top" align="center">0.61</td>
<td valign="top" align="center">0.68</td>
<td valign="top" align="center">0.85</td>
<td valign="top" align="center"><bold>0.74</bold></td>
</tr>
<tr>
<td valign="top" align="left">1D ResNet</td>
<td valign="top" align="center"><bold>0.59</bold></td>
<td valign="top" align="center"><bold>0.76</bold></td>
<td valign="top" align="center"><bold>0.70</bold></td>
<td valign="top" align="center">0.66</td>
<td valign="top" align="center">0.85</td>
<td valign="top" align="center">0.70</td>
</tr>
<tr>
<td valign="top" align="left">XGBoost</td>
<td valign="top" align="center">0.56</td>
<td valign="top" align="center">0.69</td>
<td valign="top" align="center">0.55</td>
<td valign="top" align="center"><bold>0.77</bold></td>
<td valign="top" align="center"><bold>0.87</bold></td>
<td valign="top" align="center"><bold>0.74</bold></td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-fn5"><p><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM28"><mml:mrow><mml:mover><mml:mi>l</mml:mi><mml:mo stretchy="false">&#x00AF;</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula> is the average length of signal in seconds. Bold numbers indicate the performance of the best model.</p></fn>
</table-wrap-foot>
</table-wrap>
</sec>
<sec id="s3b"><label>3.2.</label><title>Efficiency metrics</title>
<p>The results of the efficiency measurement are summarized in <xref ref-type="table" rid="T5">Table 5</xref>. In terms of power consumption, 2D models are also the most power-hungry models: ResNet50 and DenseNet121 consumed two to three times more energy than the others. On the other hand, the 1D models are more efficient than any other models: the 1D ResNet needed more energy than only XGBoost in CinC 2017 and was the most efficient model in CinC 2020. Despite the 1D CNN having a simpler base block than the 1D ResNet, the CNN required more layers than ResNet (12 CNN blocks vs. 4 ResNet blocks). This made the former require more power while performing less well than the latter.</p>
<table-wrap id="T5" position="float"><label>Table 5</label>
<caption><p>Power consumption, equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM29"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emission, and inference time of each model.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="left"/>
<col align="left"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left" rowspan="2">Dataset</th>
<th valign="top" align="center" rowspan="2">Input data</th>
<th valign="top" align="center" rowspan="2">Model</th>
<th valign="top" align="center">Power (Wh)</th>
<th valign="top" align="center"><inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM30"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> (g)</th>
<th valign="top" align="center" colspan="3">Inference time (ms)</th>
</tr>
<tr>
<th valign="top" align="center"/>
<th valign="top" align="center"/>
<th valign="top" align="center">Processing</th>
<th valign="top" align="center">Predicting</th>
<th valign="top" align="center">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" rowspan="6">CinC 2017</td>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">ResNet50</td>
<td valign="top" align="center">127</td>
<td valign="top" align="center">69</td>
<td valign="top" align="center">33.7</td>
<td valign="top" align="center">37.9</td>
<td valign="top" align="center">71.6</td>
</tr>
<tr>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">DenseNet121</td>
<td valign="top" align="center">148</td>
<td valign="top" align="center">81</td>
<td valign="top" align="center">33.7</td>
<td valign="top" align="center">38.2</td>
<td valign="top" align="center">71.8</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D CNN</td>
<td valign="top" align="center">77</td>
<td valign="top" align="center">42</td>
<td valign="top" align="center"><bold>13.5</bold></td>
<td valign="top" align="center">25.5</td>
<td valign="top" align="center">41.0</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D ResNet</td>
<td valign="top" align="center">44</td>
<td valign="top" align="center">24</td>
<td valign="top" align="center"><bold>13.5</bold></td>
<td valign="top" align="center"><bold>18.8</bold></td>
<td valign="top" align="center"><bold>32.2</bold></td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">Kamaleswaran et al.<xref ref-type="table-fn" rid="table-fn1"><sup>a</sup></xref></td>
<td valign="top" align="center">92</td>
<td valign="top" align="center">51</td>
<td valign="top" align="center">14.3</td>
<td valign="top" align="center">66.0</td>
<td valign="top" align="center">80.3</td>
</tr>
<tr>
<td valign="top" align="left">Time series</td>
<td valign="top" align="left">XGBoost</td>
<td valign="top" align="center"><bold>42</bold></td>
<td valign="top" align="center"><bold>23</bold></td>
<td valign="top" align="center">1717.6</td>
<td valign="top" align="center">0.2</td>
<td valign="top" align="center">1717.8</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="6">CinC 2020</td>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">ResNet50</td>
<td valign="top" align="center">630</td>
<td valign="top" align="center">344</td>
<td valign="top" align="center">227.2</td>
<td valign="top" align="center">36</td>
<td valign="top" align="center">263.2</td>
</tr>
<tr>
<td valign="top" align="left">Poincar&#x00E9;</td>
<td valign="top" align="left">DenseNet121</td>
<td valign="top" align="center">740</td>
<td valign="top" align="center">404</td>
<td valign="top" align="center">227.2</td>
<td valign="top" align="center">36.3</td>
<td valign="top" align="center">263.5</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D CNN</td>
<td valign="top" align="center">396</td>
<td valign="top" align="center">216</td>
<td valign="top" align="center"><bold>144.3</bold></td>
<td valign="top" align="center">29.8</td>
<td valign="top" align="center">174.1</td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">1D ResNet</td>
<td valign="top" align="center"><bold>223</bold></td>
<td valign="top" align="center"><bold>122</bold></td>
<td valign="top" align="center"><bold>144.3</bold></td>
<td valign="top" align="center"><bold>21.6</bold></td>
<td valign="top" align="center"><bold>165.9</bold></td>
</tr>
<tr>
<td valign="top" align="left">Raw signal</td>
<td valign="top" align="left">Natarajan et al.<xref ref-type="table-fn" rid="table-fn1"><sup>a</sup></xref></td>
<td valign="top" align="center">497</td>
<td valign="top" align="center">271</td>
<td valign="top" align="center">4.9</td>
<td valign="top" align="center">833.6</td>
<td valign="top" align="center">838.5</td>
</tr>
<tr>
<td valign="top" align="left">Time series</td>
<td valign="top" align="left">XGBoost</td>
<td valign="top" align="center">286</td>
<td valign="top" align="center">156</td>
<td valign="top" align="center">382.7</td>
<td valign="top" align="center">0.0</td>
<td valign="top" align="center">382.7</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-fn81"><p>Bold numbers indicate the performance of the best model.</p></fn>
<fn id="table-fn1"><label><sup>a</sup></label><p>The first rank solution.</p></fn>
</table-wrap-foot>
</table-wrap>
<p>Equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM31"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions are directly related to the power consumption. Higher power consumption leads to higher <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM32"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions. Similar to the power consumption pattern, the DenseNet121 model on the Poincar&#x00E9; input data exhibits the highest <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM33"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions for both datasets, while the 1D ResNet model on the raw signal input has the lowest emissions.</p>
<p>Regarding the inference time, although XGBoost had a lightning prediction time, this model dominated the total inference time benchmark, which comes from the heavy processing steps. This problem leads to the fact that XGBoost still inferred 24 times longer than the second place. The Poincar&#x00E9;-based method requires an approximate twofold longer inference time than the 1D CNN or 1D ResNet. This result complies with the mathematical characteristics of the 1D and 2D convolutional operators.</p>
</sec>
<sec id="s3c"><label>3.3.</label><title>Models interpretation</title>
<sec id="s3c1"><label>3.3.1.</label><title>DenseNet121 on Poincar&#x00E9; diagram classification</title>
<p><xref ref-type="fig" rid="F5">Figure&#x00A0;5</xref> visualized the GradCAM output of DenseNet121 on CinC 2017. We can see how this model processes the Poincar&#x00E9; diagram differently. In the Normal graph, the model focused on the area in the upper left and lower right, while the shape of the point cloud was ignored. In the arrhythmia diagram, the model focuses on the point cloud or the diversion of data.</p>
<fig id="F5" position="float"><label>Figure 5</label>
<caption><p>Explaining CinC 2017 predictions on the Poincar&#x00E9; diagrams using GradCAM.</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g005.tif"/>
</fig>
<p>This behavior of the model is compatible with human knowledge. For ordinary people, we do not expect any data point far away from the diagonal of the diagram. Any data point in the upper left or lower right area is evidence of abnormal changes in heart rate and predicts the problem, whereas in arrhythmia patients, because of the fluctuation in the heartbeat statistics, the data should be very varied and form a spreading cloud in the Poincar&#x00E9; diagram. The bigger cloud shows more variation in heart rate.</p>
</sec>
<sec id="s3c2"><label>3.3.2.</label><title>1D ResNet on ECG signal classification</title>
<p>Our work also took advantage of GradCAM to explore the mechanism of the 1D ResNet model. In medical literature, the ECG of Atrial fibrillation was detected by the irregular pattern in P- and T-waves around the QRS complex.</p>
<p><xref ref-type="fig" rid="F6">Figure&#x00A0;6</xref> shows the focusing points of the 1D ResNet when predicting the AF signal. The yellow area is the segment that the model attracts. These heatmaps show that the classifier focused on the signal at the neighbor of the QRS complex. These regions are corresponding to the P-wave and T-wave of ECG recordings. In fact, the absence or abnormality of P-wave and T-wave is related to the fluctuation of heart rate and predicts arrhythmia disease (<xref ref-type="bibr" rid="B22">22</xref>).</p>
<fig id="F6" position="float"><label>Figure 6</label>
<caption><p>Explaining 1D ResNet decision by GradCAM methods in case of normal regimes and arrhythmia.</p></caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="fcvm-10-1229743-g006.tif"/>
</fig>
</sec>
<sec id="s3c3"><label>3.3.3.</label><title>Feature importance of XGBoost</title>
<p>To explore how model XGBoost predicts classes, the feature importance score is calculated and summarized in <xref ref-type="table" rid="T6">Table&#x00A0;6</xref>. The results show that the features relating to the peak of signal, like <monospace>fft&#x005F;coefficient</monospace> and <monospace>ratio&#x005F;beyond&#x005F;r&#x005F;sigma</monospace>, are the highly important ones. We can see that the XGBoost model infers the heart rate information indirectly via the peak-related features, after which the model could give the prediction of arrhythmia from heart rate. The detailed description of each feature group could be found in <xref ref-type="sec" rid="s8">Supplementary Table S3</xref>.</p>
<table-wrap id="T6" position="float"><label>Table 6</label>
<caption><p>Feature importance score of top 15 feature groups in the model <monospace>XGBoost</monospace>.</p></caption>
<table frame="hsides" rules="groups">
<colgroup>
<col align="left"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th valign="top" align="left">Group</th>
<th valign="top" align="center">No. features</th>
<th valign="top" align="center">Importance score</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left"><monospace>fft&#x005F;coefficient</monospace></td>
<td valign="top" align="center">22</td>
<td valign="top" align="center">0.2138</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>ratio&#x005F;beyond&#x005F;r&#x005F;sigma</monospace></td>
<td valign="top" align="center">10</td>
<td valign="top" align="center">0.1989</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>autocorrelation</monospace></td>
<td valign="top" align="center">8</td>
<td valign="top" align="center">0.0935</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>energy&#x005F;ratio&#x005F;by&#x005F;chunks</monospace></td>
<td valign="top" align="center">5</td>
<td valign="top" align="center">0.0657</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>index&#x005F;mass&#x005F;quantile</monospace></td>
<td valign="top" align="center">5</td>
<td valign="top" align="center">0.0651</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>lempel&#x005F;ziv&#x005F;complexity</monospace></td>
<td valign="top" align="center">5</td>
<td valign="top" align="center">0.0483</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>agg&#x005F;autocorrelation</monospace></td>
<td valign="top" align="center">3</td>
<td valign="top" align="center">0.0444</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>range&#x005F;count</monospace></td>
<td valign="top" align="center">3</td>
<td valign="top" align="center">0.0411</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>spkt&#x005F;welch&#x005F;density</monospace></td>
<td valign="top" align="center">3</td>
<td valign="top" align="center">0.0408</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>change&#x005F;quantiles</monospace></td>
<td valign="top" align="center">3</td>
<td valign="top" align="center">0.0316</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>quantile</monospace></td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">0.0279</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>number&#x005F;peaks</monospace></td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">0.0241</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>count&#x005F;below</monospace></td>
<td valign="top" align="center">1</td>
<td valign="top" align="center">0.0185</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>cwt&#x005F;coefficients</monospace></td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">0.0154</td>
</tr>
<tr>
<td valign="top" align="left"><monospace>number&#x005F;crossing&#x005F;m</monospace></td>
<td valign="top" align="center">1</td>
<td valign="top" align="center">0.0137</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
</sec>
<sec id="s3d"><label>3.4.</label><title>Statement on computational resources and environmental impact</title>
<p>This work contributed totally 1.8 kg equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM34"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> emissions when training on a workstation with 1 CPU Intel Core i7-9700F and 1 GPU NVIDIA RTX 3060.</p>
</sec>
</sec>
<sec id="s4" sec-type="discussion"><label>4.</label><title>Discussion</title>
<p>In the study, we have presented various modern approaches to classify cardiac diseases from ECG recordings. The first approach took advantage of the Poincar&#x00E9; diagram and deep learning&#x2013;based image classifiers. ResNet50 and DenseNet121 architectures were chosen to process the graph. The experimental results figured out that these methods are decent for atrial fibrillation but not good at predicting other types of arrhythmia. In particular, Poincar&#x00E9;-based methods have adequate performance in the CinC 2017 dataset but are not good in the CinC 2020 dataset. The reason is that the information in the Poincar&#x00E9; diagram is limited in NN interval fluctuation, which benefits in predicting arrhythmia but is not much helpful in detecting other cardiovascular disease types. However, NN intervals, and therefore Poincar&#x00E9; diagrams, are much more accessible and can be obtained without the relatively complicated and expensive ECG procedure. Thus, it is still worth studying this approach further.</p>
<p>XGBoost&#x2019;s performance is more impressive in the subset of long-term than the short-term recordings. This model learned more information in the long signal, and we can transfer that knowledge to short signal via data augmentation. This could be done by segmenting the long signal into many short signals, and then combining to the original dataset before training. Besides that, this gradient-boosting model has a long inference time because of the expensive calculation in the feature engineering step. The feature calculation could be improve by narrowing down the number of calculated features based on the feature importance ranking.</p>
<p>The one-dimensional convolutional model showed the best results in both studied datasets. Especially the 1D ResNet was superior to the first-ranking solution of each challenge. The residual connection showed its advantages in transferring information while keeping the model not too deep. Our experiments proved the superior advantage of the 1D CNN&#x2013;based model in ECG signal classification over other deep learning architectures. In the experiments on the CinC 2020 dataset, 1D CNN and 1D ResNet were better than the transformer-based model of Natarajan et al., which is well known in sequence tasks. To explain this behavior, we can consider the ECG classification as local pattern recognition, so the model needs to detect the abnormalities in each P, Q, R, S, and T location in the signal. The intensity, appearance, or absence of any component in that complex is evidence of cardiovascular disease. This is also the way the physician reads the ECG recordings. However, the attention mechanism of the transformer architect is likely to collect the global information by connecting the information in many parts of the sequence than focusing on a particular region of the series (<xref ref-type="bibr" rid="B23">23</xref>). On the other side, when applied to the sequence processing, the CNN model used the small size filter to focus on a short and fixed segment of signal, which was helpful in capturing the local pattern of each region of the recording.</p>
<p>Although there were papers studying the power consumption on ECG classification problem (<xref ref-type="bibr" rid="B24">24</xref>, <xref ref-type="bibr" rid="B25">25</xref>), our paper is the first to investigate the efficiency metrics while training the models, including power consumption, equivalent <inline-formula><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" id="IM35"><mml:msub><mml:mrow><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> emissions, as well as the inference time, in a wide range of models. The numerical complexity is also represented by these metrics. Because of the high workload when processing 2D images, 2D ResNet and 2D DenseNet are at the top in power consumption rankings. The XGBoost is energy efficient for the short term, but the power requirement is multiplied many times when training on long-term signals, which came from the complexity of feature engineering. Since the 1D convolution operator is optimized in calculation, unidimensional models like 1D CNN and 1D ResNet are the most energy efficient among the studied methods.</p>
<p>In the aspect of model interpretation, three models (DenseNet, 1D ResNet, and XGBoost) were analyzed to figure out how they discriminate the normal and AF data. The DenseNet detected AF using the heart rate variability, which was measured by the spreading of the data cloud and the presence of data in the upper left and lower right in the Poincar&#x00E9; diagram. On the other hand, the 1D ResNet assessed the AF pattern in raw ECG signal similar to a medical expert: this model focused on the area around the QRS complex, which is also the location of P- and T-waves.</p>
</sec>
</body>
<back>
<sec id="s5" sec-type="data-availability"><title>Data availability statement</title>
<p>Our study used the public repository of the challenge CinC 2017 and CinC 2020. The code for reproducing results is available at <ext-link ext-link-type="uri" xlink:href="https://github.com/pnhuy/ecg-analysis">https://github.com/pnhuy/ecg-analysis</ext-link>. The original contributions presented in the study are included in the article/<xref ref-type="sec" rid="s8"><bold>Supplementary Material</bold></xref>, further inquiries can be directed to the corresponding author.</p>
</sec>
<sec id="s6" sec-type="author-contributions"><title>Author contributions</title>
<p>KE, AK, and SB contributed to conception and design of the study. HP organized the code repository and performed the experiments. All authors contributed to the article and approved the submitted version.</p>
</sec>
<sec id="s7" sec-type="COI-statement"><title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec id="s9" sec-type="disclaimer"><title>Publisher&#x0027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<sec id="s8" sec-type="supplementary-material"><title>Supplementary material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/fcvm.2023.1229743/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/fcvm.2023.1229743/full&#x0023;supplementary-material</ext-link></p>
<supplementary-material id="SD1" content-type="local-data">
<media mimetype="application" mime-subtype="pdf" xlink:href="Datasheet1.pdf"/>
</supplementary-material>
</sec>
<ref-list><title>References</title>
<ref id="B1"><label>1.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Tsao</surname><given-names>CW</given-names></name><name><surname>Aday</surname><given-names>AW</given-names></name><name><surname>Almarzooq</surname><given-names>ZI</given-names></name><name><surname>Alonso</surname><given-names>A</given-names></name><name><surname>Beaton</surname><given-names>AZ</given-names></name><name><surname>Bittencourt</surname><given-names>MS</given-names></name></person-group>, et al. <article-title>Heart disease, stroke statistics&#x2014;2022 update: a report from the American Heart Association</article-title>. <source>Circulation</source>. (<year>2022</year>) <volume>145</volume>:<fpage>e153</fpage>&#x2013;<lpage>e639</lpage>. <pub-id pub-id-type="doi">10.1161/CIR.0000000000001052</pub-id><pub-id pub-id-type="pmid">35078371</pub-id></citation></ref>
<ref id="B2"><label>2.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Mensah</surname><given-names>GA</given-names></name><name><surname>Roth</surname><given-names>GA</given-names></name><name><surname>Fuster</surname><given-names>V</given-names></name></person-group>. <article-title>The global burden of cardiovascular diseases, risk factors: 2020, beyond</article-title>. <source>J Am Coll Cardiol</source>. (<year>2019</year>) <volume>74</volume>:<fpage>2529</fpage>&#x2013;<lpage>32</lpage>. <pub-id pub-id-type="doi">10.1016/j.jacc.2019.10.009</pub-id><pub-id pub-id-type="pmid">31727292</pub-id></citation></ref>
<ref id="B3"><label>3.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kligfield</surname><given-names>P</given-names></name><name><surname>Gettes</surname><given-names>LS</given-names></name><name><surname>Bailey</surname><given-names>JJ</given-names></name><name><surname>Childers</surname><given-names>R</given-names></name><name><surname>Deal</surname><given-names>BJ</given-names></name><name><surname>Hancock</surname><given-names>EW</given-names></name></person-group>, et al. <article-title>Recommendations for the standardization and interpretation of the electrocardiogram</article-title>. <source>Circulation</source>. (<year>2007</year>) <volume>115</volume>:<fpage>1306</fpage>&#x2013;<lpage>24</lpage>. <pub-id pub-id-type="doi">10.1161/CIRCULATIONAHA.106.180200</pub-id><pub-id pub-id-type="pmid">17322457</pub-id></citation></ref>
<ref id="B4"><label>4.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Berkaya</surname><given-names>SK</given-names></name><name><surname>Uysal</surname><given-names>AK</given-names></name><name><surname>Gunal</surname><given-names>ES</given-names></name><name><surname>Ergin</surname><given-names>S</given-names></name><name><surname>Gunal</surname><given-names>S</given-names></name><name><surname>Gulmezoglu</surname><given-names>MB</given-names></name></person-group>. <article-title>A survey on ECG analysis</article-title>. <source>Biomed Signal Process Control</source>. (<year>2018</year>) <volume>43</volume>:<fpage>216</fpage>&#x2013;<lpage>35</lpage>. <pub-id pub-id-type="doi">10.1016/j.bspc.2018.03.003</pub-id></citation></ref>
<ref id="B5"><label>5.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Jun</surname><given-names>TJ</given-names></name><name><surname>Nguyen</surname><given-names>HM</given-names></name><name><surname>Kang</surname><given-names>D</given-names></name><name><surname>Kim</surname><given-names>D</given-names></name><name><surname>Kim</surname><given-names>D</given-names></name><name><surname>Kim</surname><given-names>YH</given-names></name></person-group>. <article-title>ECG arrhythmia classification using a 2-D convolutional neural network</article-title>. <source>arXiv</source>. (<year>2018</year>) <volume>arXiv</volume>:<fpage>1804.06812</fpage>. <pub-id pub-id-type="doi">10.48550/arXiv.1804.06812</pub-id></citation></ref>
<ref id="B6"><label>6.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Hong</surname><given-names>S</given-names></name><name><surname>Xu</surname><given-names>Y</given-names></name><name><surname>Khare</surname><given-names>A</given-names></name><name><surname>Priambada</surname><given-names>S</given-names></name><name><surname>Maher</surname><given-names>K</given-names></name><name><surname>Aljiffry</surname><given-names>A</given-names></name></person-group>, et al. <comment><italic>HOLMES: health online model ensemble serving for deep learning models in intensive care units</italic>. New York: ACM (2020). p. 1614&#x2013;24. Available from: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1145/3394486.3403212">https://doi.org/10.1145/3394486.3403212</ext-link></comment> <comment>(Accessed September 15, 2022)</comment>.</citation></ref>
<ref id="B7"><label>7.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ribeiro</surname><given-names>AH</given-names></name><name><surname>Ribeiro</surname><given-names>MH</given-names></name><name><surname>Paix&#x00E3;o</surname><given-names>GMM</given-names></name><name><surname>Oliveira</surname><given-names>DM</given-names></name><name><surname>Gomes</surname><given-names>PR</given-names></name><name><surname>Canazart</surname><given-names>JA</given-names></name></person-group>, et al. <article-title>Automatic diagnosis of the 12-lead ECG using a deep neural network</article-title>. <source>Nat Commun</source>. (<year>2020</year>) <volume>11</volume>:<fpage>1760</fpage>. <pub-id pub-id-type="doi">10.1038/s41467-020-15432-4</pub-id><pub-id pub-id-type="pmid">32273514</pub-id></citation></ref>
<ref id="B8"><label>8.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname><given-names>D</given-names></name><name><surname>Yang</surname><given-names>S</given-names></name><name><surname>Yuan</surname><given-names>X</given-names></name><name><surname>Zhang</surname><given-names>P</given-names></name></person-group>. <article-title>Interpretable deep learning for automatic diagnosis of 12-lead electrocardiogram</article-title>. <source>iScience</source>. (<year>2021</year>) <volume>24</volume>:<fpage>102373</fpage>. <pub-id pub-id-type="doi">10.1016/j.isci.2021.102373</pub-id><pub-id pub-id-type="pmid">33981967</pub-id></citation></ref>
<ref id="B9"><label>9.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Clifford</surname><given-names>G</given-names></name><name><surname>Liu</surname><given-names>C</given-names></name><name><surname>Moody</surname><given-names>B</given-names></name><name><surname>wei Lehman</surname><given-names>L</given-names></name><name><surname>Silva</surname><given-names>I</given-names></name><name><surname>Li</surname><given-names>Q</given-names></name></person-group>, et al. <comment>AF classification from a short single lead ECG recording: the physionet computing in cardiology challenge 2017 (2017). Available from: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.22489/CinC.2017.065-469">https://doi.org/10.22489/CinC.2017.065-469</ext-link></comment> <comment>(Accessed September 15, 2022)</comment>.</citation></ref>
<ref id="B10"><label>10.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Alday</surname><given-names>EAP</given-names></name><name><surname>Gu</surname><given-names>A</given-names></name><name><surname>Shah</surname><given-names>AJ</given-names></name><name><surname>Robichaux</surname><given-names>C</given-names></name><name><surname>Wong</surname><given-names>A-KI</given-names></name><name><surname>Liu</surname><given-names>C</given-names></name></person-group>, et al. <article-title>Classification of 12-lead ECGs: the physionet/computing in cardiology challenge 2020</article-title>. <source>Physiol Meas</source>. (<year>2020</year>) <volume>41</volume>:<fpage>124003</fpage>. <pub-id pub-id-type="doi">10.1088/1361-6579/abc960</pub-id></citation></ref>
<ref id="B11"><label>11.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kamaleswaran</surname><given-names>R</given-names></name><name><surname>Mahajan</surname><given-names>R</given-names></name><name><surname>Akbilgic</surname><given-names>O</given-names></name></person-group>. <article-title>A robust deep convolutional neural network for the classification of abnormal cardiac rhythm using single lead electrocardiograms of variable length</article-title>. <source>Physiol Meas</source>. (<year>2018</year>) <volume>39</volume>:<fpage>035006</fpage>. <pub-id pub-id-type="doi">10.1088/1361-6579/aaaa9d</pub-id><pub-id pub-id-type="pmid">29369044</pub-id></citation></ref>
<ref id="B12"><label>12.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Natarajan</surname><given-names>A</given-names></name><name><surname>Chang</surname><given-names>Y</given-names></name><name><surname>Mariani</surname><given-names>S</given-names></name><name><surname>Rahman</surname><given-names>A</given-names></name><name><surname>Boverman</surname><given-names>G</given-names></name><name><surname>Vij</surname><given-names>SG</given-names></name></person-group>, et al. <article-title>A wide, deep transformer neural network for 12-lead ECG classification</article-title>. <source>2020 Comput Cardiol</source>. (<year>2020</year>) <volume>12</volume>:<fpage>1</fpage>&#x2013;<lpage>4</lpage>. <pub-id pub-id-type="doi">10.1088/1361-6579/abc960</pub-id></citation></ref>
<ref id="B13"><label>13.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Carreiras</surname><given-names>C</given-names></name><name><surname>Alves</surname><given-names>AP</given-names></name><name><surname>Louren&#x00E7;o</surname><given-names>A</given-names></name><name><surname>Canento</surname><given-names>F</given-names></name><name><surname>Silva</surname><given-names>H</given-names></name><name><surname>Fred</surname><given-names>A</given-names></name></person-group>, et al. <comment><italic>BioSPPy: Biosignal Processing in Python [Dataset]</italic> (2015). Available at:</comment> <ext-link ext-link-type="uri" xlink:href="https://biosppy.readthedocs.io/">https://biosppy.readthedocs.io/</ext-link> <comment>(Accessed May 21, 2023)</comment>.</citation></ref>
<ref id="B14"><label>14.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Zong</surname><given-names>W</given-names></name><name><surname>Heldt</surname><given-names>T</given-names></name><name><surname>Moody</surname><given-names>G</given-names></name><name><surname>Mark</surname><given-names>R</given-names></name></person-group>. <comment>An open-source algorithm to detect onset of arterial blood pressure pulses. In: Murray A, editor. <italic>Computers in cardiology, 2003</italic>. Thessaloniki Chalkidiki, Greece: IEEE (2003). p. 259&#x2013;62</comment>.</citation></ref>
<ref id="B15"><label>15.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Hamilton</surname><given-names>P</given-names></name></person-group>. <comment>Open source ECG analysis. In: <italic>Computers in cardiology</italic>. IEEE (2002). p. 101&#x2013;4</comment>.</citation></ref>
<ref id="B16"><label>16.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>He</surname><given-names>K</given-names></name><name><surname>Zhang</surname><given-names>X</given-names></name><name><surname>Ren</surname><given-names>S</given-names></name><name><surname>Sun</surname><given-names>J</given-names></name></person-group>. <comment>Deep residual learning for image recognition. <italic>2016 IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA</italic>. Piscataway, NJ: IEEE. (2016). p. 770&#x2013;8</comment>.</citation></ref>
<ref id="B17"><label>17.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Huang</surname><given-names>G</given-names></name><name><surname>Liu</surname><given-names>Z</given-names></name><name><surname>Van Der Maaten</surname><given-names>L</given-names></name><name><surname>Weinberger</surname><given-names>KQ</given-names></name></person-group>. <comment>Densely connected convolutional networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA. Piscataway, NJ: IEEE (2017). p. 4700&#x2013;8</comment>.</citation></ref>
<ref id="B18"><label>18.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Head</surname><given-names>T</given-names></name><name><surname>Kumar</surname><given-names>M</given-names></name><name><surname>Nahrstaedt</surname><given-names>H</given-names></name><name><surname>Louppe</surname><given-names>G</given-names></name><name><surname>Shcherbatyi</surname><given-names>I</given-names></name></person-group>. <comment>scikit-optimize/scikit-optimize (2021) [Dataset]. Available from: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.5281/zenodo.5565057">https://doi.org/10.5281/zenodo.5565057</ext-link></comment>.</citation></ref>
<ref id="B19"><label>19.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>He</surname><given-names>H</given-names></name><name><surname>Garcia</surname><given-names>EA</given-names></name></person-group>. <article-title>Learning from imbalanced data</article-title>. <source>IEEE Trans Knowl Data Eng</source>. (<year>2009</year>) <volume>21</volume>:<fpage>1263</fpage>&#x2013;<lpage>84</lpage>. <pub-id pub-id-type="doi">10.1109/TKDE.2008.239</pub-id></citation></ref>
<ref id="B20"><label>20.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Budennyy</surname><given-names>S</given-names></name><name><surname>Lazarev</surname><given-names>V</given-names></name><name><surname>Zakharenko</surname><given-names>N</given-names></name><name><surname>Korovin</surname><given-names>A</given-names></name><name><surname>Plosskaya</surname><given-names>O</given-names></name><name><surname>Dimitrov</surname><given-names>D</given-names></name></person-group>, et al. <comment>Eco2AI: carbon emissions tracking of machine learning models as the first step towards sustainable AI. In: <italic>Doklady mathematics</italic>. Moscow, Russia: Springer (2023). p. 1&#x2013;11</comment>.</citation></ref>
<ref id="B21"><label>21.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Selvaraju</surname><given-names>RR</given-names></name><name><surname>Cogswell</surname><given-names>M</given-names></name><name><surname>Das</surname><given-names>A</given-names></name><name><surname>Vedantam</surname><given-names>R</given-names></name><name><surname>Parikh</surname><given-names>D</given-names></name><name><surname>Batra</surname><given-names>D</given-names></name></person-group>. <comment>Grad-CAM: visual explanations from deep networks via gradient-based localization. <italic>2017 IEEE international conference on computer vision, Venice, Italy</italic>. Piscataway, NJ: IEEE (2017). p. 618&#x2013;26. Available from: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/ICCV.2017.74">https://doi.org/10.1109/ICCV.2017.74</ext-link> (Accessed September 15, 2022)</comment>.</citation></ref>
<ref id="B22"><label>22.</label><citation citation-type="book"><person-group person-group-type="author"><name><surname>Hampton</surname><given-names>J</given-names></name></person-group>. <source>The ECG made easy</source>. <publisher-loc>New York</publisher-loc>: <publisher-name>Elsevier Health Sciences</publisher-name> (<year>2013</year>).</citation></ref>
<ref id="B23"><label>23.</label><citation citation-type="other"><person-group person-group-type="author"><name><surname>Vaswani</surname><given-names>A</given-names></name><name><surname>Shazeer</surname><given-names>N</given-names></name><name><surname>Parmar</surname><given-names>N</given-names></name><name><surname>Uszkoreit</surname><given-names>J</given-names></name><name><surname>Jones</surname><given-names>L</given-names></name><name><surname>Gomez</surname><given-names>AN</given-names></name></person-group>, et al. <comment>Attention is all you need. In: Guyon I, Luxburg UV, Bengio S, Wallach H, Fergus R, Vishwanathan S, Garnett R, editors. <italic>Advances in neural information processing systems</italic>. Vol. 30. Long Beach, CA: Curran Associates, Inc. (2017)</comment>.</citation></ref>
<ref id="B24"><label>24.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Amirshahi</surname><given-names>A</given-names></name><name><surname>Hashemi</surname><given-names>M</given-names></name></person-group>. <article-title>ECG classification algorithm based on STDP and R-STDP neural networks for real-time monitoring on ultra low-power personal wearable devices</article-title>. <source>IEEE Trans Biomed Circuits Syst</source>. (<year>2019</year>) <volume>13</volume>:<fpage>1483</fpage>&#x2013;<lpage>93</lpage>. <pub-id pub-id-type="doi">10.1109/TBCAS.2019.2948920</pub-id><pub-id pub-id-type="pmid">31647445</pub-id></citation></ref>
<ref id="B25"><label>25.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yan</surname><given-names>Z</given-names></name><name><surname>Zhou</surname><given-names>J</given-names></name><name><surname>Wong</surname><given-names>W-F</given-names></name></person-group>. <article-title>Energy efficient ECG classification with spiking neural network</article-title>. <source>Biomed Signal Process Control</source>. (<year>2021</year>) <volume>63</volume>:<fpage>102170</fpage>. <pub-id pub-id-type="doi">10.1016/j.bspc.2020.102170</pub-id></citation></ref></ref-list>
</back>
</article>