:
xxx 2023

# Optimizing Neural Network Scale for ECG Classification

Byeong Tak Lee<EMAIL_ADDRESS>
Medical AI Inc.
Seoul Byeong Tak Lee and Yong-Yeon Jo contributed equally. Republic of Korea
Yong-Yeon Jo11footnotemark: 1<EMAIL_ADDRESS>
Medical AI Inc.
Seoul  Republic of Korea  Joon-Myoung Kwon<EMAIL_ADDRESS>
Medical AI Inc.
Seoul  Republic of Korea

###### Abstract

We study scaling convolutional neural networks (CNNs), specifically targeting
Residual neural networks (ResNet), for analyzing electrocardiograms (ECGs).
Although ECG signals are time-series data, CNN-based models have been shown to
outperform other neural networks with different architectures in ECG analysis.
However, most previous studies in ECG analysis have overlooked the importance
of network scaling optimization, which significantly improves performance. We
explored and demonstrated an efficient approach to scale ResNet by examining
the effects of crucial parameters, including layer depth, the number of
channels, and the convolution kernel size. Through extensive experiments, we
found that a shallower network, a larger number of channels, and smaller
kernel sizes result in better performance for ECG classifications. The optimal
network scale might differ depending on the target task, but our findings
provide insight into obtaining more efficient and accurate models with fewer
computing resources or less time. In practice, we demonstrate that a narrower
search space based on our findings leads to higher performance.

##  1 Introduction

Electrocardiograms (ECGs) are non-invasive diagnostic tests that record the
electrical activity of the heart over time. They are used to detect and
analyze various heart-related conditions. Over the years, several machine
learning models have been developed for ECG analysis, including recurrent
neural networks (RNNs) (Sevilmiş et al. (2017)), Transformers (Yan et al.
(2020)), and convolutional neural networks (CNNs) (Rajpurkar et al. (2017)).
Although ECG signals are considered multivariate time-series data (Figure 1),
recent studies predominantly employ CNN-based models instead of RNN-based
models (Sun et al. (2023); Vaid et al. (2023)) breaking the convention.

Figure 1:  Example of 12-lead ECG signal.

By adopting such models, they have achieved higher performance in ECG
classifications (Zheng et al. (2020a); Elias et al. (2022); Sun et al.
(2023)). Despite their success, most previous studies have overlooked the
importance of optimization in scaling networks. Optimizing network scale
refers to the process of tuning the architecture of a neural network by
adjusting its scaling parameters. This process is critical for developing
efficient and accurate models (Koutini et al. (2021)). In ECG classification,
there is a single previous study evaluating the effect of scaling parameters
of neural networks. It solely focuses on one aspect (e.g., the depth of the
network) of network architecture (Nonaka and Seita (2021)).

To identify the importance of network scaling across various aspects, we
examined the hyperparameters affecting network scale in ECG analysis. Before
delving into the significance of scaling parameters, we first searched for
widely used neural networks for ECG classifications. As a result, the residual
neural network (ResNet) (Tai et al. (2017)) was chosen as a fundamental
architecture because it is a typical model (Rajpurkar et al. (2017); Nonaka
and Seita (2021); Elias et al. (2022)) used in ECG classifications.

It is widely acknowledged that the depth of network layers, the convolution
kernel size, and the number of input/output channels are the primary scaling
parameters that influence ResNet’s scale and complexity. We conducted
experiments to see how varying combinations of such parameters impacted the
performance of ECG classification models on the Physionet2021 (Reyna et al.
(2021)) and Alibaba (Alibaba) datasets.

Our experiments show that models with a shallower network, a larger number of
channels, and smaller convolution kernel sizes improve performance. This
finding is significant because the performance changes depending on scaling
parameters in ECG classification differ from those observed in image
classifications (Zagoruyko and Komodakis (2016)). Furthermore, optimizing
network scale can be both time-consuming and require considerable computing
resources. However, to attain better performance within a given time,
configuring a narrow search space for scaling parameters based on our findings
helps models approach the best possible outcome more efficiently.
Additionally, we examined the performance variation caused by the optimization
with respect to the labels of the dataset and investigated the reasons behind
our findings.

### Generalizable Insights about Machine Learning in the Context of Healthcare

Determining the appropriate network architecture scale is critical for
classification tasks. However, there hasn’t been extensive research on
evaluating network architecture scaling for analyzing ECGs. In our paper, we
present a comprehensive experimental assessment of the performance of
different network architecture scaling options for ECG classifications. Our
findings reveal that models with a shallower network, a larger number of
channels, and a smaller kernel size improve performance in ECG
classifications. Interestingly, this finding differs from the existing
knowledge in the computer vision domain. We claim that this could be a new
guideline for efficiently tuning network scaling parameters in ECG analysis.
Furthermore, we show that applying our findings to the hyperparameter
optimization process improves the performance of ECG classifications. These
results provide insights into practical architecture scaling in neural
networks. We hope that these observations will assist clinical and engineering
researchers in utilizing deep learning for ECG classification.

##  2 Problem Definition

Although the optimization of network scaling is crucial due to its significant
impact on model performance, existing ECG studies have overlooked this aspect
(Appendix A). Since ResNet (Tai et al. (2017)) is widely used for ECG analysis
as a deep learning model (Rajpurkar et al. (2017); Zheng et al. (2020a);
Nonaka and Seita (2021); Elias et al. (2022); Sun et al. (2023)), we focused
on scaling parameters for ResNet. We investigated scaling parameters to
optimize a model for ECG classifications. We first present the fundamental
architecture of ResNet in detail111We only consider one-dimensional layers,
such as one-dimensional convolution, one-dimensional batch normalization, and
so on, because ECG is a type of time-series data..

###  2.1 Fundamental Architecture

Equation 1 shows the architecture of ResNet.

$y=(\text{FC}\circ\text{GAP}\circ R_{4}\circ R_{3}\circ R_{2}\circ R_{1}\circ
S)(x),$ (1)

where $S$ is a single stem block and $(R_{n})$ is a residual block, GAP is a
global average pooling layer, and FC is a fully connected layer.

The stem block $S$ is composed of a single unit function $F$ with a max
pooling layer, as illustrated in Equation 2.1. The function $F$ consists of a
one-dimensional convolution, batch normalization, and ReLU activation
function. Given that there are 12 leads in an ECG, the number of input
channels for convolution is set at 12 (i.e., $w\in\mathbb{R}^{kernel\times
12\times C_{out}}$).

$\displaystyle F(x,w)=\sigma(\text{BN}(\text{Conv}(x,w))),\quad
w\in\mathbb{R}^{kernel\times C_{in}\times C_{out}}$ $\displaystyle
S=\text{Pool}(F(x,w)))),$ (2)

where $x$ represents the input and $w$ denotes convolution weights, which are
defined by the product of the kernel size ($kernel$), the number of input
channels ($C_{in}$), and the number of output channels ($C_{out}$). Conv
consists of a single one-dimensional convolution, BN refers to a batch
normalization layer, $\sigma$ is a ReLU activation function, and Pool is a max
pooling layer.

The residual block $R$ consists of multiple residual layer $L$ as shown in
Equation 3

$\centering R=(L_{d}\circ\cdot\cdot\cdot\circ L_{1})(x),\@add@centering$ (3)

where $d$ is the layer depth.

Equation 4 illustrates the structure of $L$, which is composed of two
sequential function $F$. In the first residual layer $L$, except for the
initial residual block, the first function $F$ doubles the number of output
channels through a convolution Conv compared to the number of input channels.
Subsequent $F$s maintain an equal number of input and output channels. The
input $x$ is skip-connected with the output after the second batch
normalization layer and then passed through the activation function. Prior to
the skip-connection, the initial $L$ in $R_{n}$ processes $x$ using Pool and
Conv, while the remaining layers perform identity mapping.

$L=\\\ \begin{cases}F(F(x,w)),2w)+\text{Pool}(\text{Conv}(x))&\text{if
}n>1,d=1\\\ F(F(x,2w)),2w)+x&\text{otherwise}\\\ \end{cases}$ (4)

where $w$ is convolution weights, $n$ is an index of blocks, and $d$ is an
index of layers in a block, respectively.

###  2.2 Scaling Parameters on Neural Network

There are three hyperparameters that influence the network scale: the depth of
layers (depth $D$), the number of convolution channels (channels $C$), and the
size of the convolution kernel (kernel size $K$). To examine the impact of
these scaling parameters on optimization performance, we first established
their search spaces. For the number of layers (layer depth $D$), we considered
the minimum $D$ as two, based on ResNet18 (He et al. (2016)), the smallest
variation among the ResNet models. We thus set the search space for the depth
of residual layers to $D\in{2,4,8,16}$, where each corresponds to a total of
18, 34, 66, and 130 convolution layers, respectively.

For ECG analysis as well as tasks in the computer vision domain, small odd
numbers are typically used as the kernel size $K$. The smallest kernel size is
three, so we set the range to $K\in{3,5,9,15}$.

For the number of channels ($C$), most neural networks typically set the final
number of output channels to 512 (He et al. (2016); Elias et al. (2022)). We
were curious about how adjusting the number of channels would affect the
performance on ECG classifications. We considered the search space for the
final output channels to be 128, 256, 512, and 1024, which corresponds to
$C\in{16,32,64,128}$.

Table 1: Network scale of the fundamental architecture. $K$ denotes kernel size, $C$ does the number of channels, $d$ does the depth of residual layers, and $length$ does a input length of ECGs | Output size | Weights
---|---|---
Input | $length\times 12$ |
$S$ | $length/4\times C$ |  | $K\times 12\times C$
---
$R_{1}$ | $length/8\times C$ |  [ | $\begin{cases}K\times C\times C&\text{if }d=1\\\ K\times C\times C&\text{otherwise}\end{cases}+K\times C\times C$
---
] $\times D$
$R_{2}$ | $length/16\times 2C$ |  [ | $\begin{cases}K\times C\times 2C&\text{if }d=1\\\ K\times 2C\times 2C&\text{otherwise}\end{cases}+K\times 2C\times 2C$
---
] $\times D$
$R_{3}$ | $length/32\times 4C$ |  [ | $\begin{cases}K\times 2C\times 4C&\text{if }d=1\\\ K\times 4C\times 4C&\text{otherwise}\end{cases}+K\times 4C\times 4C$
---
] $\times D$
$R_{4}$ | $length/64\times 8C$ |  [ | $\begin{cases}K\times 4C\times 8C&\text{if }d=1\\\ K\times 8C\times 8C&\text{otherwise}\end{cases}+K\times 8C\times 8C$
---
] $\times D$
GAP | $8C$ |
FC | # of labels | $8C\times\text{\\# of labels}$

Table 1 summarizes the network scale by layer depth $D$, kernel size $K$, and
the number of channels $C$. $length$ denotes the input ECG length. The number
of weights increases as the network becomes deeper. The first output has a
quarter of the original length due to the striding of the convolution and a
pooling layer at the stem block. As the input passes through the residual
blocks, the length is halved while the number of channels is doubled. The
number of labels depends on the labels of the ECG datasets.

##  3 Experiment

###  3.1 Dataset

We employed two ECG datasets in our experiment. The first dataset is Physionet
Challenge 2021 (Physionet) dataset (Reyna et al. (2021)). This dataset
contains standard 12-lead ECGs with cardiac arrhythmia labels. It is composed
of seven databases collected from various institutions with unique
demographics. In our experiments, we omitted two of the seven databases that
had fewer than several hundred samples and focused on five databases: PTB-XL
(Wagner et al. (2020)), CPSC (Liu et al. (2018)), Shaoxing (Zheng et al.
(2020b)), G12EC (Reyna et al. (2021)), and Ningbo (Zheng et al. (2020a)). Each
database is collected from the United States (G12EC), Germany (PTB-XL), and
China (CPSC, Shaoxing, Ningbo), with the signal length varying between 10 and
60 seconds. The total number of ECGs is approximately 88,000, and each ECG is
associated with one or more labels among the 26 diagnostic classes, which
cover a wide range of categories. The second one is Alibaba Tianchi
competition (Alibaba) dataset (Tianchi (2020)). The ECG signals have a
duration of 10 seconds each, and the overall collection consists of
approximately 20,000. Each ECG is tagged with one or more labels from 33
classes. Since a few class include extremely small number of class (e.g. only
three ECGs are labeled as QRS Low Voltage), we limited our study to labels
with more than prevalence of 0.1%, and thus used 17 classes for experiments.
More details of datasets are provided in Appendix B.

###  3.2 Evaluation

We use the macro-average F1 score as the evaluation metrics. The F1 score is a
harmonic mean of precision and recall. In multi-label classification, each
sample belongs to multiple classes. The macro-average F1 score calculates the
F1 score for each class independently and then averages them. This approach
treats all classes equally, regardless of class distribution, making it
particularly useful for the imbalanced dataset. We divided the dataset into
train, validation, and test sets at a ratio of 0.7, 0.15, and 0.15,
respectively.

###  3.3 Training Procedure

As ECGs are gathered with varying lengths and sampling rates, we standardize
them. For signal preprocessing, we trimmed the ECG length to 10 seconds. If
the length of the ECG is longer than 10 seconds, we randomly cropped it to a
10-second duration; otherwise, we extended the ECG to 10 seconds by padding
with zeros. Additionally, we resampled all ECGs to a sampling rate of 250Hz.
In addition, for the Alibaba dataset, out of the standard 12 leads of an ECG,
this dataset does not contain leads III, aVR, aVL, and aVF. Thus, by applying
the principles of Einthoven’s Triangle and Goldberger’s augmented lead (Mirvis
and Goldberger (2001)), we filled in the four missing leads using leads I and
II.

Hyperparameter tuning is essential for selecting an appropriate model for a
given task. Without hyperparameter tuning, the performance and
generalizability of a model may be suboptimal, leading to unreliable
conclusions (Bergstra and Bengio (2012)). However, computational limitations
have prevented previous studies from exploring a wide range of hyperparameters
(Strodthoff et al. (2020)). For example, one of the previous studies on ECG
classification benchmark only searched 9 sets of learning rate and batch size
(Nonaka and Seita (2021)), and the majority of studies do not present the
precise procedure of the hyperparameter optimization.

In this study, we explored 50 combinations of hyperparameters for each set of
scaling parameters, thereby resolving a limitation of previous studies. Tuned
hyperparameters consist of learning rate, weight decay, dropout, and other
regularization techniques. The search space used in the experiment is
presented in Table 2. In training, we employed the Adam optimizer (Kingma and
Ba (2014)) and a one-cycle learning rate scheduler (Smith and Topin (2019))
that peaks at epoch 10. The batch size was fixed at 512. We randomly sampled
the learning rate $\in[10^{-4},10^{-2}]$ and weight decay
$\in[10^{-6},10^{-4}]$ for the optimizer. The dropout rate was randomly chosen
from $0$ to $0.3$ in increments of $0.05$. We applied 18 ECG data augmentation
methods (Lee et al. (2022)) using the RandAugment policy (Cubuk et al.
(2020)). The number of augmentation methods was randomly selected from
${0,1,2}$, and their intensity was chosen from 10 levels. Furthermore, we
employed Mixup [Zhang et al. (2017)], randomly selecting a beta distribution
from $\beta\in\\{0.0,0.1,0.2\\}$. During hyperparameter searching, we used the
asynchronous successive halving algorithm (ASHA) with a grace period of 10 and
a reduction factor of 2 (Li et al. (2018)). Our training procedure is
implemented with Ray (Moritz et al. (2018)).

Table 2: Hyperparameter Search Space Hyperparameter | Search Space
---|---
Learning rate | [$10^{-4},10^{-2}$]
Weight decay | [$10^{-6},10^{-4}$]
Dropout rate | {0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3}
Number of augmentation | {0, 1, 2}
Magnitude of augmentation | {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Beta distribution of Mixup | {0, 0.1, 0.2}

##  4 Result

###  4.1 Impact of Optimization for Scaling Parameter on ECG classification

Figure 2 shows the F1 score of the ECG classification for ResNet with
different layer depths ($D$), numbers of channels ($C$), and kernel sizes
($K$). The selected hyperparameters for each network are provided in Appendix
C. In the box color, the more red it is, the higher the performance, while the
more blue it is, the lower the performance.

Layer depth $\bf{(D)}$: We observed a general trend in which the performance
tends to improve as the depth $D$ decreases from both Physionet 2021 and
Alibaba datasets. The trend is found regardless of kernel size $K$ and channel
$C$. This findings clearly exhibit a distinct different pattern compared to
computer vision domain, where it is known that performance increases as
networks become deeper. On the other hand, it is also important to note that a
shallower layer depth is not always advantageous. Depending on the
combinations of kernel size $K$ and the number of channels $C$, the optimal
setting of layer depth can be different.

Number of channels $\bf{(C)}$: We found a positive correlation between the
number of channels $C$ and performance in both Physionet 2021 and Alibaba
datasets. In the majority of cases, as we varied kernel size $K$ and layer
depth $D$, the performance improved when the number of channels $C$ increased.
In fact, for both Physionet and Alibaba datasets, all the best performances
were observed in models with the largest number of channels irrespective to
combinations of kernel size $K$ and layer depth $D$. This result is consistent
with the established knowledge in the computer vision domain, indicating that
wider networks are particularly well-suited for ECG classification tasks.

Kernel size $\bf{(K)}$: The panels on the left side of Figure 2 show a more
reddish hue than those on the right side in both Physionet 2021 and Alibaba
datasets. This indicates that performance tends to decrease as the kernel size
$K$ increases. Although recent studies in the computer vision domain have
reported a positive impact of larger kernels on model performance [Ding et al.
(2022)], our experiments for ECG classification show a contrasting trend, with
larger kernels leading to reduced performance.

In Physionet 2021 dataset, the best combination for ECG classification
performance is a layer depth $D$ of 4, a number of channels $C$ of 128, and a
kernel size $K$ of 3. In contrast, a combination with a layer depth $D$ of 8,
a number of channels $C$ of 16, and a kernel size $K$ of 15 results in the
worst performance. Although the size of dataset and label distribution in
Alibaba differ from those of Physionet, the best and worst combination in
Alibaba dataset were remarkably similar to that of Physionet 2021 one. The
optimal configuration for Alibaba dataset and Physionet 2021 are identical.
The worst performance model is generated when a layer depth $D$ of 4, a number
of channels $C$ of 16, and a kernel size $K$ of 15. Overall, our findings
provide the following scaling parameter setting guide to improve performance
in ECG classification tasks, regardless of datasets: a shallower network, a
larger number of channels, and a smaller kernel size.

Figure 2:  The performance of residual networks with different layer depth
($D$), number of channels ($C$), and kernel size ($K$) for the ECG
classification. The first row is the result of Physionet 2021 challenge
dataset (Reyna et al. (2021)) and the second row is the result from Alibaba
Tianchi competition dataset (Tianchi (2020)). The scores in boxes are the
average of F-1 scores on the multi-label classification. The more red, the
higher performance, while the more blue, the lower performance.

###  4.2 Infusing our insight into hyperparameter optimization

In practice, hyperparameter optimization is essential for achieving
satisfactory performance in a given task (Jaderberg et al. (2017)). The
efficiency of hyperparameter optimization is heavily influenced by the
predefined search space. A vast search space might not guarantee the best
performance and could lead to increased time and resource consumption. Thus,
it is essential to establish a well-designed range for the search space, which
ensures efficient hyperparameter optimization and ultimately results in
improved model performance.

Incorporating insights from our experiments can help researchers increase
their chances of achieving optimal performance. To demonstrate this, we
conducted additional experiments, modifying the range of scaling
hyperparameters, specifically layer depth $D$, the number of channels $C$, and
kernel size $K$. Table 3 shows the best performance depending on the size of
search spaces, defining three distinct ranges: Large, Medium, and Optimal. The
Large range represents a wide hyperparameter search space, while the Medium
range is half of the Large range, reflecting our findings of a shallower
network, smaller kernel size, and larger number of channels. The Optimal range
includes settings that yield the best performance, as shown in Section 4. All
other hyperparameters are configured as mentioned in Section 3.3.

For the experiments, we first sampled 50 combinations in a search space. Then,
we selected the best model by training and evaluating them. As a result, for
both Physionet 2021 and Alibaba datasets, the performance improvement are
observed by reducing the space to $1/8$ (Medium) and $1/64$ (Optimal) compared
with Large, respectively. Larger search spaces make it more challenging to
find the optimal hyperparameters within the given combinations, potentially
leading to suboptimal model performance. These results demonstrate that models
acquired through more precise hyperparameters outperform those obtained using
a wider search space.

Table 3:  Performance depending on the search space of hyperparameter optimization. # Avail. comb. denotes the number of available combinations. F1 represents the best F1 score in the sampled 50 combinations. The selected hyperparameters for each experiment are provided in Appendix D.  Physionet | Depth ($D$) | Channel ($C$) | Kernel ($K$) | # Avail. comb. | F1 |
---|---|---|---|---|---|---
Large | {2,4,6,8} | {16,32,64,128} | {3,5,9,16} | 64 | 0.612 |
Medium | {2,4} | {64,128} | {3,5} | 8 | 0.644 |
Optimal | {4} | {128} | {3} | 1 | 0.669 |
Alibaba | Depth ($D$) | Channel ($C$) | Kernel ($K$) | # Avail. comb. | F1 |
Large | {2,4,6,8} | {16,32,64,128} | {3,5,9,16} | 64 | 0.000 |
Medium | {2,4} | {64,128} | {3,5} | 8 | 0.000 |
Optimal | {4} | {128} | {3} | 1 | 0.000 |

##  5 Discussion

###  5.1 Sub-group Analysis

As described in Table A.2 and Table A.3, both Physionet 2021 and Alibaba
datasets present highly imbalances in their distribution. To determine if our
experimental findings remain consistent across the study population, we
conducted a sub-group analysis. The Physionet 2021 dataset is composted of
various classes and databases, where each of them has its own distict
distribution. For example, the ratio between the NSR and Brady classes is
approximately 100:1, and 65% of NSR labels are from the Ningbo database, while
67% of SB labels are from the G12EC database. Additionally, the distribution
of labels across the database sources is uneven, with no database containing
all 26 classes, and some databases contain fewer classes than others.
Similartly, the Alibaba dataset also exhibits substantial imbalances.
Althought it is collected from a single source, the skewness of class
distribution is comparable to the multi-sourced Physionet 2021 dataset. For
example, the prevalence of NSR approaches nealy 50%, while the prevalence of
NSTAb is only 0.03%.

####  5.1.1 Performance Depending on Labels

Figure 3 and Figure 4 demonstrate the performance of the model across label
categories in Physionet 2021 and Alibaba datasets. In the case of Physionet
2021 dataset, the performance changes in each category are similar to the
performance changes in entire classes. The optimal combination
($D4$-$C128$-$K3$) derived from the experiment in Section 4 may not belong to
the best performance, but it remains among the top-performing models across
all categories. This consistency suggests that the proposed scaling method is
effective across all categories.

However, in the Alibaba dataset, while the overall trend of performance
regarding to depth, width, and kernel size remains consistent across all
categories, the degree of similarity is substantially lower than in the
Physionet 2021 dataset. Specifically, there are numerous outliers that
contradict the general trend, such as $C$4, $D$2, $K$5 and $C$64, $D$4, $K$9\.
One possible explanation for this could be attributed to the number of labels.
Unlike the Physionet 2021 dataset, the prevalence of labels within the Alibaba
dataset is relatively low; only three out of the seventeen classes exhibit a
prevalence of 10% or higher. This significant class imbalance could
potentially lead to unstable results. Appendix B provides a more comprehensive
analysis of the model performance on specific labels. All performances
depending on each label among all available combinations are described in
detail in Appendix E.

Figure 3: Classification performance of networks with different layer depth
($D$), the number of channels ($C$), and kernel size ($K$) on six label
categories in Physionet2021 dataset.

Figure 4: Classification performance of networks with different layer depth
($D$), the number of channels ($C$), and kernel size ($K$) on six label
categories in Alibaba dataset.

####  5.1.2 Performance Depending on Database Sources

Figure 5 shows the model performance according to the database sources in
Physionet 2021 dataset. It appears that results in the Ningbo, PTBXL, G12EC,
and Shaoxing databases are consistent with the entire dataset. On the other
hand, we observe the different performance trend in CPSC database. One
possible reason is that the CPSC database has some rare labels such as NSIVCB,
PR, SA, Brady, TAb, and TInv, where a small number of samples for these
classes can significantly impact the F1 scores since we used the macro-
averaged F1 score as a metric.

Figure 5: Classification performance of networks with different layer depth
($D$), the number of channels ($C$), and kernel size ($K$) depending on
database sources.

###  5.2 Correlation between Scaling Parameters and Performance

Previous research in the computer vision domain has shown that there is a
positive correlation between model performance and all scaling parameters
(Peng et al. (2017); Tan and Le (2019); Ding et al. (2022)). Specifically,
deeper residual layers, larger kernel sizes, and many channels can contribute
to better performance.

However, our findings from ECG analysis provide a different result on the
correlation between model performance and scaling parameters compared to the
computer vision domain. Table 4 shows the correlation between neural networks
with different scales and their performance in both ECG analysis and computer
vision. Contrary to the expectations, we observed a negative correlation
between performance and both layer depth $D$ and kernel size $K$. Only the
number of channels $C$ showed a positive correlation with performance,
consistent with the observatoins in the computer vision.

We conjecture that observed discrepancy is attributed to the periodic nature
of ECG signals and their effect on the receptive field and global average
pooling(GAP). As illustrated in Figure 1, the patterns in each ECG cycle show
consistent and repeat over the time. Because of this periodicity, a receptive
field that spans only a few second of ECG (i.e. one or two cycle of ECG) is
sufficient for extracting the essential information from the signal. Thus, in
contrast to computer vision, where the large receptive field is preferred for
capturing global feature, the advantage of large receptive field is relatively
insignificant in ECG classification. Further, the GAP following small
receptive field functions as an ensemble of different view of signal,
providing generalized and robust representation. On the other hand, a large
receptive field that covers the entire signal does not benefit as much from
GAP as a small receptive field. (See Appendix F for further discussion).

To investigate whether the influence of periodicity persists when it is
removed, we cropped ECG signals into 2-second and 1-second segments to
eliminate the effect of varying heart rates in Physionet 2021 dataset. This
resulted in approximately two cycles present in a 2-second signal and one
cycle in a 1-second signal, respectively. The correlation between network
scaling and performance for the cropped signals is shown in the 2s and 1s at
ECG columns in Table 4, respectively. Specifically, we found that the depth of
layers led to a near-complete loss of correlation, while the kernel size was
less affected. In contrast, the correlation remained high for the number of
channels. While our experimental results cannot fully explain our conjecture,
they support the idea that the periodicity of ECG signals has some influence
on network scaling decisions.

Table 4:  Correlation between the neural network’s scaling parameters and its performance based on ECG length.  |  Computer Vision | ECG
---|---|---
10s | 2s | 1s
Layer depth (D) | Positive (+) | -0.83 | -0.62 | -0.2
Kernel size (K) | Positive (+) | -0.92 | -0.84 | -0.68
Number of channels (C) | Positive (+) | 0.93 | 0.92 | 0.87

##  6 Conclusion

In recent studies, CNN-based models, particularly ResNet, have been widely
used to achieve higher performance in ECG classifications. However, the
optimization of network scaling, which is a vital process for creating
efficient and precise models, has often been overlooked. To address this, we
examined the effects of different combinations of primary scaling parameters,
such as network depth, convolution kernel size, and the number of channels, on
the Physionet2021 dataset and Alibaba dataset.

Our results show that performance enhancement can be achieved by employing
models with shallower networks, a greater number of channels, and smaller
convolution kernel sizes. This finding is crucial because optimizing network
scaling can be both time-consuming and computationally demanding. By refining
the search space for scaling parameters based on our results, researchers can
more effectively reach optimal outcomes within a given time.

Moreover, we investigated the performance variations by network scaling in
relation to the dataset’s labels and inferred the rationale behind our
findings. This research provides a better understanding of network scaling
optimization in ECG analysis and empowers researchers to develop more
efficient and effective models for ECG classification.

## References

  * Bergstra and Bengio (2012) James Bergstra and Yoshua Bengio.  Random search for hyper-parameter optimization.  _Journal of machine learning research_ , 13(2), 2012.
  * Cubuk et al. (2020) Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le.  Randaugment: Practical automated data augmentation with a reduced search space.  In _Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops_ , pages 702–703, 2020.
  * Ding et al. (2022) Xiaohan Ding, Xiangyu Zhang, Jungong Han, and Guiguang Ding.  Scaling up your kernels to 31x31: Revisiting large kernel design in cnns.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , pages 11963–11975, 2022.
  * Elias et al. (2022) Pierre Elias, Timothy J Poterucha, Vijay Rajaram, Luca Matos Moller, Victor Rodriguez, Shreyas Bhave, Rebecca T Hahn, Geoffrey Tison, Sean A Abreau, Joshua Barrios, et al.  Deep learning electrocardiographic analysis for detection of left-sided valvular heart disease.  _Journal of the American College of Cardiology_ , 80(6):613–626, 2022.
  * Han et al. (2021) Hyeongrok Han, Seongjae Park, Seonwoo Min, Hyun-Soo Choi, Eunji Kim, Hyunki Kim, Sangha Park, Jinkook Kim, Junsang Park, Junho An, et al.  Towards high generalization performance on electrocardiogram classification.  In _2021 Computing in Cardiology (CinC)_ , volume 48, pages 1–4. IEEE, 2021.
  * Hannun et al. (2019) Awni Y Hannun, Pranav Rajpurkar, Masoumeh Haghpanahi, Geoffrey H Tison, Codie Bourn, Mintu P Turakhia, and Andrew Y Ng.  Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network.  _Nature medicine_ , 25(1):65–69, 2019.
  * He et al. (2016) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Deep residual learning for image recognition.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 770–778, 2016.
  * Hsieh et al. (2020) Chaur-Heh Hsieh, Yan-Shuo Li, Bor-Jiunn Hwang, and Ching-Hua Hsiao.  Detection of atrial fibrillation using 1d convolutional neural network.  _Sensors_ , 20(7):2136, 2020.
  * Jaderberg et al. (2017) Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M. Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, Chrisantha Fernando, and Koray Kavukcuoglu.  Population based training of neural networks.  _ArXiv_ , abs/1711.09846, 2017.
  * Kingma and Ba (2014) Diederik P Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  _arXiv preprint arXiv:1412.6980_ , 2014.
  * Koutini et al. (2021) Khaled Koutini, Hamid Eghbal-zadeh, and Gerhard Widmer.  Receptive field regularization techniques for audio classification and tagging with deep convolutional neural networks.  _IEEE/ACM Transactions on Audio, Speech, and Language Processing_ , 29:1987–2000, 2021.
  * Lee et al. (2022) Byeong Tak Lee, Yong-Yeon Jo, Seon-Yu Lim, Youngjae Song, and Joon-myoung Kwon.  Efficient data augmentation policy for electrocardiograms.  In _Proceedings of the 31st ACM International Conference on Information & Knowledge Management_, pages 4153–4157, 2022.
  * Li et al. (2018) Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar.  Massively parallel hyperparameter tuning.  _arXiv preprint arXiv:1810.05934_ , 5, 2018.
  * Liu et al. (2018) Feifei Liu, Chengyu Liu, Lina Zhao, Xiangyu Zhang, Xiaoling Wu, Xiaoyan Xu, Yulin Liu, Caiyun Ma, Shoushui Wei, Zhiqiang He, et al.  An open access database for evaluating the algorithms of electrocardiogram rhythm and morphology abnormality detection.  _Journal of Medical Imaging and Health Informatics_ , 8(7):1368–1373, 2018.
  * Mirvis and Goldberger (2001) David M Mirvis and Ary L Goldberger.  Electrocardiography.  _Heart disease_ , 1:82–128, 2001.
  * Moritz et al. (2018) Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard Liaw, Eric Liang, Melih Elibol, Zongheng Yang, William Paul, Michael I Jordan, et al.  Ray: A distributed framework for emerging ai applications.  In _13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18)_ , pages 561–577, 2018.
  * Nonaka and Seita (2021) Naoki Nonaka and Jun Seita.  In-depth benchmarking of deep neural network architectures for ecg diagnosis.  In _Machine Learning for Healthcare Conference_ , pages 414–439. PMLR, 2021.
  * Park et al. (2022) Junsang Park, Junho An, Jinkook Kim, Sunghoon Jung, Yeongjoon Gil, Yoojin Jang, Kwanglo Lee, and Il-young Oh.  Study on the use of standard 12-lead ecg data for rhythm-type ecg classification problems.  _Computer Methods and Programs in Biomedicine_ , 214:106521, 2022.
  * Peng et al. (2017) Chao Peng, Xiangyu Zhang, Gang Yu, Guiming Luo, and Jian Sun.  Large kernel matters–improve semantic segmentation by global convolutional network.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 4353–4361, 2017.
  * Pourbabaee et al. (2017) Bahareh Pourbabaee, Mehrsan Javan Roshtkhari, and Khashayar Khorasani.  Deep convolutional neural networks and learning ecg features for screening paroxysmal atrial fibrillation patients.  _IEEE Transactions on Systems, Man, and Cybernetics: Systems_ , 48(12):2095–2104, 2017.
  * Rajpurkar et al. (2017) Pranav Rajpurkar, Awni Y Hannun, Masoumeh Haghpanahi, Codie Bourn, and Andrew Y Ng.  Cardiologist-level arrhythmia detection with convolutional neural networks.  _arXiv preprint arXiv:1707.01836_ , 2017.
  * Reyna et al. (2021) Matthew A Reyna, Nadi Sadr, Erick A Perez Alday, Annie Gu, Amit J Shah, Chad Robichaux, Ali Bahrami Rad, Andoni Elola, Salman Seyedi, Sardar Ansari, et al.  Will two do? varying dimensions in electrocardiography: the physionet/computing in cardiology challenge 2021.  In _2021 Computing in Cardiology (CinC)_ , volume 48, pages 1–4. IEEE, 2021.
  * Ribeiro et al. (2020) Antônio H Ribeiro, Manoel Horta Ribeiro, Gabriela MM Paixão, Derick M Oliveira, Paulo R Gomes, Jéssica A Canazart, Milton PS Ferreira, Carl R Andersson, Peter W Macfarlane, Wagner Meira Jr, et al.  Automatic diagnosis of the 12-lead ecg using a deep neural network.  _Nature communications_ , 11(1):1760, 2020.
  * Sakli et al. (2022) Nizar Sakli, Haifa Ghabri, Ben Othman Soufiene, Faris Almalki, Hedi Sakli, Obaid Ali, Mustapha Najjari, et al.  Resnet-50 for 12-lead electrocardiogram automated diagnosis.  _Computational Intelligence and Neuroscience_ , 2022, 2022.
  * Sevilmiş et al. (2017) Aslı Sevilmiş, Hüseyin Polat, and Uğur Ergün.  Classification of electrocardiogram signals with stacked sparse autoencoders and long short-term memory.  _Journal of Medical Systems_ , 41(10):156, 2017.
  * Smith and Topin (2019) Leslie N Smith and Nicholay Topin.  Super-convergence: Very fast training of neural networks using large learning rates.  In _Artificial intelligence and machine learning for multi-domain operations applications_ , volume 11006, pages 369–386. SPIE, 2019.
  * Strodthoff et al. (2020) Nils Strodthoff, Patrick Wagner, Tobias Schaeffter, and Wojciech Samek.  Deep learning for ecg analysis: Benchmarks and insights from ptb-xl.  _IEEE Journal of Biomedical and Health Informatics_ , 25(5):1519–1528, 2020.
  * Sun et al. (2023) Weijie Sun, Sunil Vasu Kalmady, Nariman Sepehrvand, Amir Salimi, Yousef Nademi, Kevin Bainey, Justin A Ezekowitz, Russell Greiner, Abram Hindle, Finlay A McAlister, et al.  Towards artificial intelligence-based learning health system for population-level mortality prediction using electrocardiograms.  _NPJ Digital Medicine_ , 6(1):21, 2023.
  * Tai et al. (2017) Ying Tai, Jian Yang, and Xiaoming Liu.  Image super-resolution via deep recursive residual network.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pages 3147–3155, 2017.
  * Tan and Le (2019) Mingxing Tan and Quoc Le.  Efficientnet: Rethinking model scaling for convolutional neural networks.  In _International conference on machine learning_ , pages 6105–6114. PMLR, 2019.
  * Tianchi (2020) Alibaba Cloud Tianchi.  Tianchi—hefei hi-tech cup ecg intelligent competition 2020.  https://tianchi.aliyun.com/competition/entrance/231754/introduction, 2020.
  * Vaid et al. (2023) Akhil Vaid, Edgar Argulian, Stamatios Lerakis, Brett K Beaulieu-Jones, Chayakrit Krittanawong, Eyal Klang, Joshua Lampert, Vivek Y Reddy, Jagat Narula, Girish N Nadkarni, et al.  Multi-center retrospective cohort study applying deep learning to electrocardiograms to identify left heart valvular dysfunction.  _Communications Medicine_ , 3(1):24, 2023.
  * Vázquez et al. (2021) Cristina Gallego Vázquez, Alexander Breuss, Oriella Gnarra, Julian Portmann, and Giulia Da Poian.  Two will do: Cnn with asymmetric loss, self-learning label correction, and hand-crafted features for imbalanced multi-label ecg data classification.  In _2021 Computing in Cardiology (CinC)_ , volume 48, pages 1–4. IEEE, 2021.
  * Wagner et al. (2020) Patrick Wagner, Nils Strodthoff, Ralf-Dieter Bousseljot, Dieter Kreiseler, Fatima I Lunze, Wojciech Samek, and Tobias Schaeffter.  Ptb-xl, a large publicly available electrocardiography dataset.  _Scientific data_ , 7(1):1–15, 2020.
  * Yan et al. (2020) Zixuan Yan, Xiaochen Yang, Yuhao Cheng, Yingchun Zhang, and Yuhao Liu.  Ecg arrhythmia classification using a 2-d convolutional neural network and transformer.  In _2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC)_, pages 4294–4297. IEEE, 2020.
  * Zagoruyko and Komodakis (2016) Sergey Zagoruyko and Nikos Komodakis.  Wide residual networks.  _arXiv preprint arXiv:1605.07146_ , 2016.
  * Zhang et al. (2020) Chao Zhang, Jianrui Feng, Chenxi Hu, Zhenbao Liu, Liye Cheng, and Yong Zhou.  An intelligent fault diagnosis method of rolling bearing under variable working loads using 1-d stacked dilated convolutional neural network.  _IEEE Access_ , 8:63027–63042, 2020.
  * Zhang et al. (2017) Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz.  Mixup: Beyond empirical risk minimization.  _arXiv preprint arXiv:1710.09412_ , 2017.
  * Zheng et al. (2020a) Jianwei Zheng, Huimin Chu, Daniele Struppa, Jianming Zhang, Sir Magdi Yacoub, Hesham El-Askary, Anthony Chang, Louis Ehwerhemuepha, Islam Abudayyeh, Alexander Barrett, et al.  Optimal multi-stage arrhythmia classification approach.  _Scientific reports_ , 10(1):1–17, 2020a.
  * Zheng et al. (2020b) Jianwei Zheng, Jianming Zhang, Sidy Danioko, Hai Yao, Hangyuan Guo, and Cyril Rakovski.  A 12-lead electrocardiogram database for arrhythmia research covering more than 10,000 patients.  _Scientific data_ , 7(1):1–8, 2020b.

##  Appendix A Architecture of Deep learning models on ECG classification

The following table shows the scaling parameters of the models that were
developed in the previous studies. The papers in the table solely used ResNet
for ECG classification, along with different parameters such as the depth of
the layers, the number of channels, and the dimensions of the kernel. We
noticed a lack of consensus on the ideal strategy for optimizing the scale of
these networks. Even though the studies by Vázquez et al. (2021); Han et al.
(2021) and Sakli et al. (2022) used the same datasets, their network
architectures were different.

Table A.1: Comparison of Scality of ResNet for ECG Classification | Year | Layer Depth | Number of channels | Kernel size
---|---|---|---|---
Pourbabaee et al. (2017) | 2017 | 5 | 64 | 32
Hannun et al. (2019) | 2019 | 34 | 512 | 16
Hsieh et al. (2020) | 2020 | 13 | 512 | 5
Ribeiro et al. (2020) | 2020 | 10 | 320 | 16
Vázquez et al. (2021) | 2021 | 7 | 256 | 5
Han et al. (2021) | 2021 | 14 | 128 | 15
Park et al. (2022) | 2022 | 152 | 2048 | 3
Sakli et al. (2022) | 2022 | 50 | 512 | 3

##  Appendix B Details of datasets

Both Physionet2021 and Tinachi datasets contains more than 20 label classes.
We categorize the labels into six category based on their condition:
Arrhythmia, conduction disorder, axis deviation, prolonged intervals, wave
abnormalities, and the others. Each category represents the following
conditions:

  * •

Arrhythmia is an irregularity in the heart’s rhythm due to problems in the
heart’s electrical conduction system. They can be classified into several
types, from atrial fibrillation, atrial flutter, ventricular tachycardia, and
ventricular fibrillation to sinus premature atrial contraction and premature
ventricular contracction.

  * •

Conduction disorder occurs when the heart’s electrical signals are delayed or
blocked. Examples include atrioventricular (AV) block, and various bundle
branch block, such as Left Bundle Branch Block, Right Bundle Branch Block, and
1st Degree AV Block.

  * •

Axis deviation refers to an abnormal orientation of the heart’s electrical
axis, which can be assessed by analyzing the QRS complex on an
electrocardiogram (ECG). Axis deviation can be categorized as left, right, or
indeterminate. Also, we include ECG with lead displacement in this category.

  * •

Prolonged intervals are abnormalities in the duration of specific ECG segments
or intervals, such as the PR, QRS, or QT intervals. Both short and long
intervals are included in this category.

  * •

Wave involves changes in the size, shape, or polarity of ECG waves, such as
the P wave, QRS complex, or T wave. Interval abnormalities with respect to
magnitude is also included in this category, such as ST segment abnormalities.

  * •

The other category contains condition that is not included any category
described above. This represent a normal or near-normal cardiac electrical
activity or the presence of an artificial pacemaker generating the heart’s
rhythm.

As shown in Table A.2 and Table A.3, both datasets are highly skewed.
Specifically, the average prevalence of labels in Physionet 2021 is 0., and
the prevalence of labels in Alibaba is only 0.042. Further, in the case of
Physionet 2021, the imbalance of distribution between sub-datasets is
significant. For example, more than half of CPSC dataset has fewer than five
labels for each class, whereas G12EC, Ningbo, and PTBXL contain relatively
balanced number of classes.

Table A.2: The number of labels in Physionet2021 dataset. Category | Label | Ningbo | PTBXL | G12EC | Shaoxing | CPSC | Total
---|---|---|---|---|---|---|---
Arrhythmia | AF | 1514 | 570 | 0 | 1780 | 1374 | 5238
| AFL | 73 | 186 | 7615 | 445 | 54 | 8373
| SA | 772 | 455 | 2550 | 0 | 11 | 3788
| SB | 637 | 1677 | 12670 | 3889 | 45 | 18918
| STach | 826 | 1261 | 5687 | 1568 | 303 | 9645
| PAC | 1063 | 555 | 640 | 258 | 740 | 3256
| PVC | 0 | 357 | 1091 | 294 | 194 | 1936
Conduction disorder | BBB | 0 | 116 | 385 | 0 | 0 | 501
| LBBB | 536 | 231 | 248 | 205 | 274 | 1494
| RBBB | 542 | 556 | 1291 | 454 | 1971 | 4814
| 1AVB | 797 | 769 | 893 | 247 | 828 | 3534
| IRBBB | 1118 | 407 | 246 | 0 | 86 | 1857
| NSIVCB | 789 | 203 | 536 | 235 | 4 | 1767
| LAnFB | 1626 | 180 | 380 | 0 | 0 | 2186
Axis deviation | LAD | 5146 | 940 | 1163 | 382 | 0 | 7631
| RAD | 343 | 83 | 638 | 215 | 1 | 1280
Prolonged interval | LPR | 340 | 0 | 40 | 12 | 0 | 392
| LQT | 118 | 1391 | 334 | 57 | 4 | 1904
Wave abnormality | LQRSV | 182 | 374 | 794 | 249 | 0 | 1599
| PRWP | 0 | 0 | 638 | 0 | 0 | 638
| QAb | 548 | 464 | 828 | 235 | 1 | 2076
| TAb | 2345 | 2306 | 4831 | 1876 | 22 | 11380
| TInv | 294 | 812 | 2720 | 157 | 5 | 3988
Others | NSR | 18092 | 1752 | 6299 | 1826 | 922 | 28891
| Brady | 0 | 6 | 7 | 0 | 271 | 284
| PR | 296 | 0 | 1182 | 0 | 3 | 1481
Table A.3: The number of labels in Alibaba dataset. Category | Label | Total
---|---|---
Arrhythmia | AF | 120
| SA | 901
| STach | 5264
| PAC | 314
| PVC | 543
Conduction disorder | RBBB | 551
| CRBBB | 418
| 1AVB | 142
| IRBBB | 126
Axis deviation | LAD | 1124
| RAD | 1124
Wave abnormality | TWC | 3479
| STC | 286
| NSTAb | 64
| STTC | 299
| HLVV | 414
Others | NSR | 9501

##  Appendix C Selected Hyperparameters for All Available Scaling Parameter
Combinations

The table LABEL:hpo:physionet and table LABEL:hpo:Alibaba show the performance
depending on the hyperparameter optimization. F1 means the F-1 score, $K$ the
kernel size, $C$ the number of channels, $D$ the depth of layers, LR a
learning rate, WD a weight decay, Dropout the rate of dropout, N (Aug) the
selected number of data augmentation method, M (Aug) the intensive of data
augmentation methods, and Beta distribution of MixUP. The table is sorted in
descending order by F1-score. The search space can be found in Table 2.

Table A.4: Selected hyperparameters of the model in Physionet 2021 dataset. |  |  |  |  |  |  |  |  |
---|---|---|---|---|---|---|---|---|---
F1 |  K |  C |  D |  LR |  WD |  Dropout |  N(Aug) |  M(Aug) |  Beta
0.6688 |  3 |  128 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6646 |  3 |  64 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6642 |  5 |  128 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6630 |  9 |  128 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6625 |  3 |  64 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6622 |  3 |  128 |  2 |  0.000468866 |  4.48496E-06 |  0.25 |  1 |  7 |  0.2
0.6613 |  3 |  128 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6597 |  5 |  64 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6595 |  3 |  64 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6585 |  5 |  128 |  2 |  0.00258996 |  1.19374E-05 |  0.15 |  0 |  7 |  0.1
0.6584 |  5 |  64 |  2 |  0.00946404 |  1.74804E-06 |  0.1 |  1 |  5 |  0
0.6583 |  3 |  128 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6566 |  5 |  128 |  8 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6547 |  3 |  32 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6540 |  5 |  32 |  2 |  0.00946404 |  1.74804E-06 |  0.1 |  1 |  5 |  0
0.6537 |  9 |  64 |  2 |  0.00953107 |  2.05523E-06 |  0.05 |  0 |  8 |  0.2
0.6526 |  5 |  128 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6523 |  3 |  64 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6497 |  9 |  128 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6490 |  5 |  64 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6489 |  9 |  32 |  2 |  0.00953107 |  2.05523E-06 |  0.05 |  0 |  8 |  0.2
0.6482 |  9 |  64 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6470 |  5 |  32 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6469 |  9 |  128 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6459 |  15 |  128 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6450 |  9 |  128 |  4 |  0.00351696 |  1.17341E-06 |  0.05 |  2 |  3 |  0
0.6420 |  5 |  64 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6396 |  3 |  32 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6379 |  15 |  32 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6376 |  15 |  64 |  2 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6365 |  3 |  32 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6360 |  9 |  32 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6358 |  15 |  128 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6348 |  9 |  64 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6342 |  5 |  32 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6336 |  15 |  64 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6320 |  3 |  32 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6302 |  9 |  32 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6298 |  15 |  64 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6287 |  15 |  32 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
0.6278 |  15 |  128 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6265 |  9 |  64 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6261 |  5 |  32 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6250 |  15 |  32 |  8 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6240 |  9 |  32 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6232 |  15 |  64 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6220 |  15 |  128 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
0.6205 |  15 |  32 |  16 |  0.00117048 |  1.99539E-05 |  0 |  1 |  8 |  0.1
Table A.5: Selected hyperparameters of the model in Alibaba dataset. |  |  |  |  |  |  |  |  |
---|---|---|---|---|---|---|---|---|---
F1 |  K |  C |  D |  LR |  WD |  Dropout |  N(Aug) |  M(Aug) |  Beta
0.5455 |  3 |  128 |  4 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.5397 |  5 |  128 |  4 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5366 |  3 |  128 |  8 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5345 |  3 |  16 |  4 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.533 |  9 |  128 |  4 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5247 |  5 |  128 |  2 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5241 |  5 |  32 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5236 |  5 |  64 |  2 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5227 |  3 |  64 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5219 |  3 |  32 |  4 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5204 |  3 |  32 |  8 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.5201 |  9 |  32 |  2 |  0.00932976 |  3.59464e-06 |  0.1 |  2 |  3 |  0.0
0.52 |  3 |  64 |  4 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5186 |  3 |  64 |  8 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.5181 |  5 |  64 |  4 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5178 |  3 |  128 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.5166 |  5 |  128 |  16 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.5164 |  3 |  128 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5164 |  3 |  16 |  8 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.5153 |  3 |  32 |  2 |  0.000806845 |  6.48126e-06 |  0.2 |  0 |  10 |  0.2
0.5147 |  15 |  128 |  4 |  0.000979419 |  8.11599e-06 |  0.1 |  0 |  5 |  0.2
0.5132 |  9 |  128 |  8 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.513 |  5 |  64 |  8 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.5098 |  5 |  128 |  8 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5096 |  9 |  64 |  8 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5089 |  9 |  64 |  4 |  0.000490151 |  2.57339e-06 |  0.2 |  0 |  7 |  0.2
0.5076 |  3 |  32 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.5027 |  3 |  16 |  2 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.5023 |  9 |  128 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.5021 |  15 |  16 |  2 |  0.00697859 |  1.78065e-05 |  0.0 |  1 |  4 |  0.1
0.5003 |  9 |  64 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.4993 |  9 |  32 |  8 |  0.0078945 |  1.10935e-05 |  0.0 |  1 |  7 |  0.1
0.4992 |  5 |  32 |  16 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4987 |  5 |  32 |  8 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4979 |  15 |  128 |  2 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.4968 |  5 |  32 |  4 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.494 |  5 |  16 |  8 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4936 |  5 |  64 |  16 |  0.00541542 |  6.89599e-06 |  0.0 |  0 |  4 |  0.0
0.4925 |  3 |  64 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4924 |  15 |  64 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4917 |  3 |  16 |  16 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4863 |  9 |  64 |  16 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4858 |  9 |  16 |  2 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4847 |  15 |  64 |  8 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4835 |  15 |  32 |  2 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4828 |  15 |  128 |  8 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4816 |  15 |  32 |  4 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4809 |  5 |  16 |  2 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4808 |  15 |  64 |  2 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4797 |  9 |  128 |  16 |  0.000105932 |  7.98499e-05 |  0.0 |  1 |  2 |  0.1
0.479 |  9 |  32 |  4 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1
0.4747 |  15 |  128 |  16 |  0.00697859 |  1.78065e-05 |  0.0 |  1 |  4 |  0.1
0.4709 |  9 |  32 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4702 |  5 |  16 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4698 |  5 |  16 |  4 |  0.00697859 |  1.78065e-05 |  0.0 |  1 |  4 |  0.1
0.4691 |  15 |  16 |  8 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4688 |  15 |  32 |  8 |  0.00697859 |  1.78065e-05 |  0.0 |  1 |  4 |  0.1
0.4682 |  9 |  16 |  4 |  0.000979419 |  8.11599e-06 |  0.1 |  0 |  5 |  0.2
0.4681 |  15 |  32 |  16 |  0.00161031 |  1.39832e-05 |  0.0 |  0 |  6 |  0.2
0.4633 |  9 |  16 |  16 |  0.000597472 |  7.41711e-06 |  0.0 |  2 |  7 |  0.1
0.4561 |  9 |  16 |  8 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4511 |  15 |  64 |  4 |  0.000297885 |  2.00125e-06 |  0.1 |  1 |  6 |  0.0
0.4505 |  15 |  16 |  16 |  0.00677992 |  3.99025e-06 |  0.0 |  2 |  3 |  0.0
0.4462 |  15 |  16 |  4 |  0.00107348 |  1.17844e-06 |  0.1 |  2 |  1 |  0.1

##  Appendix D Selected Hyperparameters Depending on the Range of the Search
Space

The table LABEL:hpo:physionet2021-optimal and LABEL:hpo:Alibaba-optimal show
the hyperparameters of the selected model provided in Table 3. It is important
to note that suboptimal scaling factors are selected when the search space is
broad.

Table A.6: Selected hyperparameters of the model in Physionet 2021 dataset.  |  |  |  |  |  |  |  |  |
---|---|---|---|---|---|---|---|---|---
|  K |  C |  D |  LR |  WD |  Dropout |  N(Aug) |  M(Aug) |  Mixup
Large |  9 |  128 |  4 |  0.000458882 |  4.99297E-06 |  0.2 |  2 |  9 |  0.0
Medium |  5 |  128 |  2 |  0.00339825 |  6.13601E-06 |  0.1 |  2 |  1 |  0.1
Optimal |  3 |  128 |  4 |  0.00260079 |  8.9745E-06 |  0.1 |  1 |  1 |  0.1
Table A.7: Selected hyperparameters of the model in Alibaba dataset.  |  |  |  |  |  |  |  |  |
---|---|---|---|---|---|---|---|---|---
|  K |  C |  D |  LR |  WD |  Dropout |  N(Aug) |  M(Aug) |  Mixup
Large |  0 |  0 |  0 |  0.0 |  0.0E-06 |  0.0 |  0 |  0 |  0.0
Medium |  0 |  0 |  0 |  0.0 |  0.0E-06 |  0.0 |  0 |  0 |  0.0
Optimal |  0 |  0 |  0 |  0.0 |  0.0E-06 |  0.0 |  0 |  0 |  0.0

##  Appendix E Classification Performance on Labels

Figure A.1, A.3, A.4, A.5, A.6 illustrate the classification performance
across 26 distinct labels of Physionet 2021 dataset, and Figure A.7, A.9,
A.10, A.11 are the classification performance from 17 labels of Alibaba
dataset. A majority of the classes display a comparable pattern to the macro-
average F1 score. However, the optimal performance for each class is different
from the average performance. Certain labels, such as SA and PAC of Physionet
2021 dataset, STach and STTC of Alibaba dataset exhibit different performance
trend. This suggest that the globally optimal performance is not universally
effective for all individual labels.

Figure A.1: The classification performance of networks with different layer
depth, number of channels, and kernel size on arrhythmia labels in Physionet
2021 dataset.

Figure A.2: The classification performance of networks with different layer
depth, number of channels, and kernel size on conduction disorder labels in
Physionet 2021 dataset.

Figure A.3: The classification performance of networks with different layer
depth, number of channels, and kernel size on axis deviations labels in
Physionet 2021 dataset.

Figure A.4: The classification performance of networks with different layer
depth, number of channels, and kernel size on prolonged intervals labels in
Physionet 2021 dataset.

Figure A.5: The classification performance of networks with different layer
depth ($D$), number of channels ($C$), and kernel size ($K$) on wave
abnormalities labels in Physionet 2021 dataset.

Figure A.6: The classification performance of networks with different layer
depth, number of channels, and kernel size on others labels in Physionet 2021
dataset.

Figure A.7: The classification performance of networks with different layer
depth, number of channels, and kernel size on arrhythmia labels in Alibaba
dataset.

Figure A.8: The classification performance of networks with different layer
depth, number of channels, and kernel size on conduction disorder labels in
Alibaba dataset.

Figure A.9: The classification performance of networks with different layer
depth, number of channels, and kernel size on axis deviations labels in
Alibaba dataset.

Figure A.10: The classification performance of networks with different layer
depth ($D$), number of channels ($C$), and kernel size ($K$) on wave
abnormalities labels in Alibaba dataset. Figure A.11: The classification
performance of networks with different layer depth, number of channels, and
kernel size on others labels in Alibaba dataset.

##  Appendix F Receptive Field and Global Average Pooling

The receptive field refers the region of input space that a particular neuron
is connected. Generally, networks with fewer layer and small kernel size have
a narrower receptive field than that with deeper layer and large kernel size.
In our experiment, a network with small number of layer (i.e. $D$=2) and
kernel size (i.e. $K$=3) spans only a few cycles. Conversely, deeper networks
of those with larger kernel expand their receptive fields to cover the entire
10-second signal. The optimal size of receptive field is different by data. A
large receptive fields has benefit in extracting long-term dependencies while
small receptive fields benefit the local details. In the case of ECG
classification, small receptive field already include sufficient information
for feature extraction. In fact, the use of a large receptive field in the ECG
signals could result in the generation of redundant information, and this
redundancy could introduce the challenges in the optimization process and
potentially degrade the performance of the model [Zhang et al. (2020)].

Global Average Pooling is technique used in convolutional neural network for
reducing spatial dimension in image or temporal dimension in time series data.
If the receptive field is small or local, GAP serves to average the features
extracted from this local patch of the input. Consequently, it generates an
average representation of the small part of the input. This can be compared to
an ensemble of different view of the signal, which usually yield a generalized
and robust representation. In contrast, with a larger receptive field, the
benefit of having this ensemble of varied perspectives diminishes. This is
because each receptive field perceives a identical region, which can
potentially reduce the advantage of ensemble of representation.