0% found this document useful (0 votes)
19 views14 pages

VAE-BiLSTM-MHA for ECG Anomaly Detection

Uploaded by

Eshan C
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views14 pages

VAE-BiLSTM-MHA for ECG Anomaly Detection

Uploaded by

Eshan C
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

An Attention-Augmented VAE-BiLSTM Framework for

Anomaly Detection in 12-Lead ECG Signals


Marc Garreta Basora1* and Mehmet Oguz Mulayim2,1
1
Universitat Autònoma de Barcelona (UAB), Cerdanyola del Vallès, Spain
2
Artificial Intelligence Research Institute (IIIA-CSIC), Cerdanyola del Vallès, Spain

Abstract
arXiv:2510.05919v1 [[Link]] 7 Oct 2025

Anomaly detection in 12-lead electrocardiograms (ECGs) is critical for identifying deviations associated with car-
diovascular disease. This work presents a comparative analysis of three autoencoder-based architectures: con-
volutional autoencoder (CAE), variational autoencoder with bidirectional long short-term memory (VAE-BiLSTM),
and VAE-BiLSTM with multi-head attention (VAE-BiLSTM-MHA), for unsupervised anomaly detection in ECGs.
To the best of our knowledge, this study reports the first application of a VAE-BiLSTM-MHA architecture to ECG
anomaly detection. All models are trained on normal ECG samples to reconstruct non-anomalous cardiac mor-
phology and detect deviations indicative of disease. Using a unified preprocessing and evaluation pipeline on
the public China Physiological Signal Challenge (CPSC) dataset, the attention-augmented VAE achieves the
best performance, with an AUPRC of 0.81 and a recall of 0.85 on the held-out test set, outperforming the other
architectures. To support clinical triage, this model is further integrated into an interactive dashboard that visu-
alizes anomaly localization. In addition, a performance comparison with baseline models from the literature is
provided.

Keywords: Anomaly Detection, ECG, Autoencoder, Variational Autoencoder, Attention Mechanism, Unsuper-
vised Learning, Visualization Dashboard

This time-series signal captures the electrical activity


of the heart, reflecting how electrical impulses propagate
through cardiac tissues and can be detected via electrodes
1 I NTRODUCTION placed on the skin [7]. In this work, we will focus on the 12-
lead ECG, which provides different information from vari-
Anomaly detection (AD) refers to the process of identifying ous parts of a patient’s body.
patterns that deviate from an expected or normal behavior in Regardless of its diagnostic importance, interpreting
the data [1]. The importance of this data identification lies multi-lead ECG samples is time-consuming, making even
in the fact that these variations, known as anomalies, may trained physicians misclassify subtle variations that can
lead to critical actionable information [2]. For instance, lead to health diseases [5, 8]. This limitation motivates the
AD plays a crucial role in the healthcare domain, as they development of an automated approach that can assist med-
can, when properly processed, indicate potential diseases ical professionals by reducing the time of detection, as well
or critical health events in patients. More specifically, car- as possibly enhancing the accuracy of identifying cardiac
diovascular diseases (CVDs) are the leading cause of death anomalous patterns from ECG data.
globally [3], accounting for over one third of all deaths ev-
To understand these anomalies, it is important to under-
ery year [4]. Early detection of cardiac issues is therefore
stand the fundamental ECG waveform components. As
essential, as it improves patients’ quality of life by provid-
shown in Figure 1, a normal ECG consists of different
ing early warning of upcoming health events, reduces the
intervals and waves that represent the electrical activity of
economic burden on healthcare systems, and even saves
the heart. First, there is the P-wave, continued by the QRS
lives [5]. Among various diagnostic tools, the electrocar-
complex, which reflects the contraction of the ventricles
diogram (ECG) is one of the most common, non-invasive
when the heart pumps. After that, the T-wave indicates the
methods that is used as a diagnostic tool. Because it records
heart recovery. There are also intervals such as PR, QT or
key information such as heart rhythm, heart rate and car-
TP, which provide information about the electrical signals
diac axis information [6], the ECG is an important data for
flow.
early recognition of various cardiac conditions such as coro-
nary artery disease (CAD), heart failure (HF), arrhythmia
(ARR), and other heart diseases. In recent research, machine learning (ML) has been ap-
plied to anomaly detection across various domains. In
∗ Corresponding author: [Link]@[Link] the healthcare context, ML models show strong capabili-

1
Section 4.1, the applied evaluation metrics in Section 4.2,
the results in Section 4.3, and the interactive dashboard in
Section 4.4. Finally, Section 5 summarizes the conclusions
and outlines future work.

Fig. 1: ECG morphology of two normal beats. Reproduced 2 S TATE OF THE A RT


from Zhang et al. [9] with permission.

CNN 1D-CNN [21]


ties in processing large volumes of physiological multivari-
ate time-series data, enabling those architectures to learn VAE [10, 11, 20]
complex patterns that may be difficult to detect and time-
LSTM AE [19]
consuming through manual professional inspection. In par- Autoencoder (AE)
ticular, unsupervised and self-supervised approaches are AD Approaches CAE [18]
gaining prominence due to the scarcity of labeled data in
DAE [17]
this domain.
Among the proposed ML architectures, variational au- RNN LSTM [15, 16]
toencoder (VAE)-based architectures are one of those that
Transformer [13, 14]
have proved effective in distinguishing between normal and
abnormal 12-lead ECG recordings [10, 11]. Additionally, Fig. 2: Approaches for Anomaly Detection (AD) in ECGs
adding attention mechanisms into these architectures has
also demonstrated significant benefits in other anomaly de-
The field of anomaly detection in healthcare has evolved
tection application domains [12].
over time. Early methods relied on rule-based systems [22]
Particularly, this work focuses on autoencoder-based ar-
and small-scale medical corpora, which were limited when
chitectures to detect anomalies in multivariate ECG time-
handling the complexity of multivariate time-series data
series data. Specifically, three models are implemented
such as ECG or electroencephalogram (EEG) signals. With
and compared for the task: the Convolutional Autoen-
the increase in data from electronic health records (EHRs)
coder (CAE), the Variational Autoencoder with Bidirec-
[23] and advances in deep learning techniques, these latest
tional Long Short-Term Memory (VAE-BiLSTM), and the
approaches have overcome the previous ones.
VAE-BiLSTM with Multi-Head Attention (VAE-BiLSTM-
This literature review focuses mostly on unsupervised
MHA).
and self-supervised learning as these methods are consid-
ered to tackle the lack of labeled anomalous data in ECG
Contributions
databases [24, 25].
This paper, to the best of our knowledge, proposes the first Figure 2 illustrates the anomaly detection approaches
application of an architecture that integrates Multi-Head At- that used ECGs as data. Gu et al. [21] design a CNN
tention into a VAE-BiLSTM framework for 12-lead ECG with depthwise convolutions and 8-bit quantization, specif-
anomaly detection. The contributions of this work are as ically adapted for Field-Programmable Gate Array (FPGA)
follows: deployment in wearable devices. Their implementation
processes 4-second ECG windows in real time, achiev-
• We present a novel approach to 12-lead ECG anomaly ing 97.69 % accuracy on the MIT-BIH [26] arrhythmia
detection by using a VAE-BiLSTM-MHA framework, dataset and demonstrating that high-fidelity anomaly detec-
which integrates multi-head attention into a variational tion pipelines can be applied under power and area con-
autoencoder model. straints.
• We conduct a comparative analysis with custom im- Recurrent architectures have also been widely explored
plementations of two other autoencoder-based archi- for ECG anomaly detection. Chauhan and Vig [15] apply a
tectures: CAE and VAE-BiLSTM. deep Long Short-Term Memory (LSTM) to raw ECG time
signals, learning temporal representations that identify ir-
• We develop an interactive dashboard that provides vi- regular beats with high detection accuracy. Additionally,
sually interpretable results based on model decisions. Thill et al. [16] propose a stacked LSTM approach that
• We provide all code publicly for further research. models the multivariate prediction-error distribution across
the ECG leads via a Gaussian model, achieving high re-
call with low false-alarm rates on the MIT-BIH arrhythmia
Document Structure
dataset.
The remainder of this paper is structured as follows: Sec- Autoencoder (AE)–based approaches have shown
tion 2 briefly surveys classical and deep learning tech- promising results regarding the reconstruction of normal
niques for ECG anomaly detection. Section 3 describes the ECG morphology and detection of anomalies through
methodology followed, including the problem formulation reconstruction errors. Particularly, variational autoen-
in Section 3.1, the preprocessing pipeline in Section 3.2, coders (VAEs) have demonstrated to be effective for ECG
the model architectures in Section 3.3 and the anomaly de- anomaly detection [10, 11, 20]. Liu et al. [10] used a
tection strategy in Section 3.4. Section 4 presents the ex- vector quantized VAE (VQ-VAE) to perform synthetic data
perimental setup and results, covering the used datasets in augmentation in order to classify between several cardiac

2
anomalies. Jang et al. [11] applied a convolutional autoen- detection.
coder trained with unlabeled data to extract ECG features.
Atamny et al. [20] employed a variational autoencoder, Motivated by the high performance of autoencoder-based
which outperformed the other unsupervised models they ECG anomaly detection systems, as explained above, the
evaluated. However, the integration of multi-head attention absence of any study implementing multi-head attention in
mechanisms within VAE-based models remains unexplored VAE architectures for ECG data emphasizes the novelty of
in the context of ECG data. This apparent gap is one of this work and encourages its comparative evaluation against
the motivations of this study to explore this autoencoder similar models.
variant within other architectures, providing a comparative
analysis of its performance against similar approaches.
3 M ETHODOLOGY
Among other autoencoder approaches, several studies
are relevant. Lomoio et al. [18] propose a 1D convolu- This section describes the main steps taken to design and
tional autoencoder trained on synthetic ECG segments to implement the anomaly detection systems for 12-lead ECG
learn “normal” patterns, reporting AUROC (Area Under the signals, including the formulation of the problem, data pre-
ROC Curve) of 97.82 % on simulated data and a AUROC processing, model development, and the anomaly detection
of 0.80% on the CPSC-2018 12-lead ECG test set [27]. process.
They also provide reconstruction-error heatmaps over input
data for explainability, validated against cardiologist anno-
tations. Choi et al. [19] introduce a segment-wise LSTM 3.1 Problem Formulation
autoencoder that processes PreQ, QRS, and PostS intervals A multivariate time series is a sequence of data points along
separately—corresponding to atrial conduction, ventricular m dimensions. In the context of ECG signals, each di-
depolarization, and ventricular repolarization phases of the mension corresponds to one of the 12 leads, resulting in
heart’s cycle, respectively—achieving AUROCs up to 0.96 m = 12. Therefore, a 12-lead ECG dataset can be repre-
per segment and an overall Atrial Fibrillation (AF) detec- sented as a multivariate time series:
tion AUROC of 0.98 when the three anomaly scores are
fused via an XGBoost classifier, and report a AUROC of T = {x1 , x2 , . . . , xT }, xt ∈ Rm [30] (1)
0.74% on the CPSC-2018 12-lead ECG test set. Hribar and
Torkar [17] develop a denoising autoencoder for 12-lead where each observation xt ∈ R12 is composed by all 12
ECG that removes the need for band-pass filters—which leads at time t.
limit the frequency of the ECG signal— and notch filters— In this unsupervised learning setting, the autoencoder-based
which remove narrow-band interference—, attaining 0.81 models are trained exclusively on normal samples T to ba-
accuracy and 0.74 recall on the PhysioNet/CinC 2021 chal- sically learn a compact representation of the healthy signal
lenge dataset [28], with saliency overlays pinpointing the manifold and to overcome the imbalance between normal
temporal origins of anomalies. In a comprehensive com- and anomalous ECG samples in clinical corpora [24, 25].
parative study, Atamny et al. [20] benchmark standard AEs, During inference or testing, given an unseen sample x̂t , the
VAEs, diffusion models, normalizing flows, and Gaussian task is to compute how much a 12-lead ECG test sample
mixture models on the CPSC-2018 12-lead ECG challenge, deviates from the learned representation to decide whether
finding the VAE as the best performant with AUROC = 0.83 that sample diverges from the normal-signal manifold or
while even the simplest AE achieves AUROC = 0.76. not. That is, if the unseen sample lies too far from the nor-
Regarding the utilization of VAE-based models in other mal representation, it could be considered an anomaly.
domains , Fu et al. [29] proposed OmniAnomaly, a VAE- To measure this difference, an anomaly score St is defined,
based architecture enhanced with adversarial training and which is compared against a threshold τ to assign a binary
probability reconstruction generation in industrial sensor anomaly label yt :
streams. Correia et al. [12] introduced MA-VAE, which (
integrates multi-head attention into the VAE framework, 1, if St > τ,
yt = [15] (2)
showing promising results results in complex temporal 0, otherwise,
datasets in Automotive Endurance Powertrain Testing.
The value of St is computed per each window along each
Transformer-based architectures are also used in the task of the 12th leads, so at the end, you end up with several
of anomaly detection and, this variety of models excel scores per lead that are averaged to obtain a single score per
at modeling multivariate time-series data-ECG data-by sample (See 3.2.2 for more details regarding the Windowing
capturing both temporal and spatial dependencies between process).
multiple leads and its duration-timesteps. For instance, Hu
The value of τ is not fixed but estimated on the validation
et al. [13] presents a hybrid CNN-Transformer network
split that contains only normal ECG recordings. Four strate-
that achieves state-of-the-art arrhythmia classification on
gies for deciding the adequate threshold between a normal
single-lead data by combining local feature extraction
representation and an anomalous sample are explored:
with global self-attention. Similarly, Kim et al. [14]
introduces S-transform–augmented CNN–Transformer that 1. 95th percentile. It is an unsupervised rule that its
preprocesses the input into a time–frequency representation threshold is fixed at the 95th percentile of the valida-
before attention pooling, producing an improvement when tion scores from normal samples.
detecting subtle waveform anomalies. In parallel, Tuli et
al. [30] proposes TranAD, a Transformer-based model 2. F1 -optimisation. This approach keeps the value τ that
that captures long-term dependencies for robust anomaly maximises the F1 score during validation.

3
3. Youden’s J statistic [31]. This technique opti-
mizes the Receiver Operating Characteristic (ROC)
curve during validation, selecting the threshold
that maximizes J = TPR(TruePositiveRate) −
FPR(FalsePositiveRate).

4. Peaks-Over-Threshold (POT) [29, 32]. It uses one of


the above techniques to choose a baseline threshold u.
Then, a Generalised Pareto Distribution [33] is fit to
the extreme tail of the validation scores to set τ .

In this study, the above procedure is repeated for ev-


ery architecture (i.e., CAE, VAE-BiLSTM, VAE-BiLSTM-
MHA), obtaining a model-specific threshold that is used
during testing with the goal of minimizing the “false alarm”
[34] principle, a concept used in the medical domain that
occurs when a system erroneously classifies a normal sam-
ple as anomalous.

3.2 Data Preprocessing


3.2.1 Input Data
Two ECG databases are used to train and validate each of
the proposed models. Data curation was performed over all
recordings labeled as Sinus Rhythm—normal heartbeats—
from both datasets to ensure a refined and combined dataset
containing only normal samples. The first dataset, PTB- Fig. 3: Example of a raw 12-lead ECG sample from the
XL [35], comprises twelve-lead recordings from PhysioNet MIMIC-IV ECG dataset. The red and black boxes show
[36], from which it was either cropped or padded to have consecutive windows extracted for training.
an input data of ten-seconds segments to guarantee consis-
tency within the second dataset. Each ECG sample is re-
sampled at 500 Hz, providing 5,000 data points per lead, windows W , where each window represents a fixed-length
and a total of 8,900 normal samples were used with a 80/20 segment of the ECG signal:
training and validation split (See Table 1). The second
dataset, MIMIC-IV ECG [37], was introduced to perform W = {w1 , w2 , . . . , wn }, wi ∈ RL×m (3)
real-world data augmentation after observing that the used
where L is the number of ECG leads and each window
architectures would perform better given a high-quality and
wi is an L × m matrix containing a fixed-length segment
high-quantity of ECG normal samples. After resampling
from all leads. The total number of windows per sample n is
all recordings to ten-second segments and filtering for valid
normal rhythms, over 92,000 samples—labeled as Sinus 
T −m

Rhythm—were selected from more than 800,000 total sam- n= + 1, s < m (4)
s
ples available to include only those ECGs labeled uniquely
as non-anomalous, excluding other data with additional di- In this case, T is the total length of the recording, m the
agnoses or ambiguous labeling systems. As shown in Fig- window length (e.g., 500 samples), and s the hop size (e.g.,
ure 3, each sample consists of twelve-leads—each capturing 250 samples for 50 % overlap). As shown in Figure 3, the
ten seconds of the heart’s electrical activity. black and red-bordered rectangles over the first two seconds
of an ECG recording illustrate how two windows are cre-
Characteristic PTB-XL MIMIC-IV ECG ated and how the window segmentation is applied.
Total ECGs 21, 799 > 800, 000
Sinus rhythm ECGs ≈ 8, 900 ≈ 92, 000 3.2.3 Filtering and Normalization
Number of patients 18, 869 > 160, 000
Access Public Restricted After reviewing the literature and experimenting with dif-
ferent filtering and normalization configurations, the fol-
TABLE 1: Input datasets overview lowing techniques were chosen as optimal:

1. ECG signals are cleaned using a combination of band-


pass and notch filters [38, 39, 40]. Specifically, a 3rd-
3.2.2 Window Segmentation
order Butterworth bandpass filter with cutoff frequen-
Window segmentation is used during the experiments pro- cies of 0.5 Hz and 100 Hz is applied to remove baseline
posed in Section 4. This sample partition technique serves wander. Then, a notch filter centered at 60 Hz removes
as a way to capture localized patterns within large ECG sig- power-line interference. These filters are applied lo-
nals [15]. The training data set is matched by overlapping cally to each ECG lead to preserve signal quality and

4
Fig. 4: Comparison of non-processed and preprocessed ECG signals

process them in a personalized way so that each lead where B is the batch size, 12 is the number of ECG leads
is treated accordingly to its frequency distribution. per sample, and T is the window length.
The model consists of two main blocks: an encoder that
2. After filtering, the signals are normalized using z-score maps data x into a latent representation z, and a decoder that
normalization [41] in order to have a mean of 0 and a maps this compressed space z back into the original data
standard variation of 1 on a per-lead basis to ensure representation x′ to perform a reconstruction of the origi-
consistent amplitude scaling across the dataset, which nal signal. The encoder compresses and reduces the tempo-
facilitates effective training of machine learning mod- ral information using convolutional layers, while increasing
els. channel depth. Afterwards, the decoder produces the in-
(z) xt,i − µi
xt,i = (5) verse of this action, reconstructing x′ to match the original
σi + ε
input shape.
where i is the lead index, and the constant vector ϵ is During training, the model minimizes the Mean-Squared
introduced to the denominator to prevent division by Error (MSE) loss between each input sample and its re-
zero when the lead has zero variance. constructed version. This loss function penalizes high-
amplitude reconstruction deviations more heavily. In a 12-
In Figure 4, the effects of filtering and normalization (in lead ECG, the largest per-sample amplitudes occur within
blue) are observable compared to the raw signals (in red). the QRS complex, particularly at the R-peaks, where the
This preprocessing step reduces baseline drift and power- signal changes sharply. Consequently, the autoencoder is
line interference. However, for anomalous samples, the driven to reproduce these segments with high fidelity, while
same operations can also mask subtle deviations, conse- small deviations in flatter regions (e.g., PR or ST segments)
quently increasing the risk of false negatives. For example, have a minor effect on the total loss.
in the raw versus preprocessed comparison of the second
sample, the low-amplitude ST-segment deviations visible in
the raw signals are attenuated by the previously explained Variational Autoencoder Bidirectional Long
processing techniques. Consequently, there is a ”trade- Short-Term Memory (VAE-BiLSTM)
off between noise suppression and anomaly/morphology
The proposed VAE-BiLSTM model, illustrated in Figure 6,
preservation” [42], as processing is an essential step be-
encodes each twelve-lead ECG window of shape [B, 12, T ]
fore training a model to input non-noisy data, but it can
(batch size B, leads 12, timesteps T )—with a permuta-
also delete subtle anomalous patterns, thereby increasing
tion to convert it to the required shape [B, T, 12]— with
the risk of false negatives.
a bidirectional LSTM encoder block that generates a la-
tent mean vector µz ∈ RB×d and a log-variance vector
3.3 Model Architectures log σ 2z ∈ RB×d , where d is the latent dimension. Af-
terwards, the reparameterization trick 1 is used to convert
Convolutional Autoencoder (CAE) a latent sample z from a non-differentiable sampling step
The proposed Convolutional Autoencoder, illustrated in to a differentiable one. Then, z is then repeated T times
Figure 5, is used as the baseline model in our comparative 1 The reparameterization trick is used in VAE models to enable gradient
analysis and was adapted from open-source code [18]. It propagation with a differentiable transformation expressing a deterministic
processes twelve-lead ECG windows of shape [B, 12, T ], transformation (see Eq. 6).

5
Fig. 5: CAE architecture

Fig. 6: VAE-BiLSTM architecture

in a loop process and it is used as input to a unidirec- Each 12-lead window x ∈ RB×T ×12 is encoded by two
tional LSTM decoder, which outputs per-lead reconstruc- bidirectional BiLSTM layers, producing hidden states h ∈
tion means x bt and log-variances log σ b 2t , with tensors of RB×T ×2h , where h is the second LSTM’s hidden size. A
shape [B, 12, T ]. fully connected layer (MLP) maps h to per-timestep latent
mean and log-variance µz , log σ 2z ∈ RB×T ×2d , with la-

During training, the model minimizes the negative log-
likelihood (NLL) of the output plus a Kullback-Leibler tent dimension d. Latent samples are then generated using
(KL) divergence multiplied by an annealed coefficient β. the reparameterization trick [43]:
The architecture is inspired by the original VAE formula-
tion of Kingma and Welling [43] and by the OmniAnomaly
z = µz + exp 0.5 log σ 2z ⊙ ϵ,

ϵ ∼ N (0, I) (6)
framework for time-series anomaly detection [29].
This stochastic approach introduces variability in the la-
tent representation, rather than relying on a point-wise re-
To add inter-lead correlations, a lead-wise attention block
construction error—MSE—used in the previous determin-
embeds every (B, T ) slice of the input leads and applies a
istic model.
4-head self-attention layer, resulting in lead context vectors
h̃ ∈ RB×T ×d . At the end, an enriched representation is
VAE-BiLSTM with Multi-Head Attention obtained given the combination of the lead-wise attention
(VAE-BiLSTM-MHA) with the latent space z⋆ = z + h̃.

Inspired by the original VAE architecture of Kingma and Then, the latent z⋆ is used as values in a 8-head attention
Welling [43], the OmniAnomaly time–series architecture layer whose queries and keys are linear projections of the
[29], and the MA-VAE design [12], an extension of the pre- raw input window. This produces a context-aware sequence
vious model, VAE-BiLSTM, is presented in order to incor- representation A ∈ RB×T ×d that now encodes both global
porate two attention mechanisms: a lead-wise attention to latent information and lead-specific saliency.
capture inter-lead dependencies and a multi-head attention Finally, A is passed through two bidirectional LSTMs
to enhance the latent sequence representation as illustrated and an output MLP, providing per-sample reconstruction
in Figure 7. mean and logvar statistics.

6
Fig. 7: VAE-BiLSTM with Multi-Head Attention architecture

3.4 Anomaly Detection Task where the first section measures the MSE reconstruc-
tion error and the second section is the KL divergence
Given an unseen multi-lead ECG sample of length T , the
between the approximate posterior qϕ (z | wi ) and the
overlapping window segmentation is applied to obtain n
prior p(z), enforcing a regularized latent space. Con-
windows per sample (See Section 3.2.2 for the window pro-
sequently, a window’s high score can lead to an un-
cess):
likely latent representation and a poor reconstructed
sample.

Wx = w1 , w2 , . . . , wn , (7)
• For the VAE-BiLSTM-MHA model, we define the
anomaly score as an attention-weighted ELBO:
 
T −m
n= + 1, s < m. (8)
s
where m
X 2
sVAE-BiLSTM-MHA
i = αi,t wi,t − ŵi,t
• T is the total length of the ECG recording in samples, 2
t=1
| {z }
• m is the length of each window in samples, Attention-weighted reconstruction

• s is the stride between successive windows, + KL qϕ (z | wi ) ∥ p(z)



| {z }
• n is the total number of windows Latent regularization
(12)
Each window wi is then passed through the trained
anomaly detector model, which produces a per-window where αi,1 , . . . , αi,m considers normalized attention
anomaly score weights produced per each window, the ∥wi,t − ŵi,t ∥22
determines the MSE reconstruction error and the other
si = S (wi ) (9) section regularizes the latent space against the prior as
where the scoring function S depends on the model archi- in the case of VAE-BiLSTM above.
tecture: The attention-weighted reconstruction term is based
on the assumption that the self-attention block inside
• For the CAE model, the anomaly score for each win-
the model “attends” to those time steps where there
dow is computed as the mean-squared reconstruction
are relevant variations. Consequently, low-information
error:
segments contribute less than in salient zones regard-
sCAE
i = ∥wi − ŵi ∥22 (10)
ing the MSE. The correlation between high-attention
where the MSE measures point-wise differences be- regions and high reconstruction error will be illustrated
tween the input and its reconstruction [44]. Conse- in the visualizations presented in Section 4.3.
quently, windows with large reconstruction errors are
considered as anomalous signals. Decision Rule Once each window wi has been assigned
• For the VAE-BiLSTM model, each window’s anomaly a score si , a single score is obtained for the entire recording
score is computed by the negative evidence lower by taking the mean:
bound (ELBO [43]), where the MSE is used as the n
reconstruction term, which can be derived from maxi- 1X
S= si (13)
mizing the Gaussian log-likelihood: n i=1

sVAE-BiLSTM
i = ∥wi − ŵi ∥22 As explained in Section 3.1, a threshold τ is established
 (11)
+ KL qϕ (z | wi ) ∥ p(z) during validation. Then, the final anomaly decision is given

7
by TABLE 4: VAE–BiLSTM-MHA Hyperparameters (exclud-
( ing β)
anomalous, S > τ,
ŷ = Parameter Value
normal, S ≤ τ.
Window size 500
If the average score S exceeds τ , the signal is labeled as Stride 0.5× window size (250)
anomalous; otherwise, it is labeled as normal. This sim- Learning rate 1 × 10−4
ple rule leverages the validation-tuned threshold to balance Number of epochs 100
sensitivity and specificity. Latent dimension 64
Hidden dimension 128
Number of attention heads 8
Dropout (encoder) 0.1
4 E XPERIMENTS Gaussian noise (input) σ = 0.01
Criterion Attn. + Recon. + KL
Optimizer Adam
The three proposed autoencoder-based models (CAE, VAE-
BiLSTM, and VAE-BiLSTM-MHA) are evaluated against
four literature baselines listed below, which also report re-
sults on the same dataset. The comparison is made under TABLE 5: β-Annealing Schedule for VAE–BiLSTM
the closest possible conditions:
Epoch (t) βt
• ConvAE [18] t
t ≤ 10 βt =
10
t > 10 βt = 1.0
• VAE–AE Hybrid [20]

TABLE 6: β-Scheduling for VAE-BiLSTM–MHA (cycli-


• AE + Peak Detection [19] cal ramp from 10−8 to 10−2 over epochs [11–100])

Epoch (t) βt
• MSGformer [45]
t ≤ 10 βt = 10−8
t − 10
Below, Tables 2–6 summarize the hyperparameter con- 10 < t ≤ 100 βt = 10−8 + [10−8 , 10−2 ]
90
figurations for each of our proposed models. All parameters
were selected manually, aided by visual analysis.
4.1 Datasets
TABLE 2: CAE Hyperparameters The primary evaluation dataset is the publicly available
CPSC 2018 challenge corpus [27], which comprises 12-
Parameter Value lead ECG recordings acquired at 500 Hz for a nominal du-
ration of 10 s per patient. The dataset is balanced in terms
Window size 500
of gender (approximately 50 % female, 50 % male). For the
Stride 0.5× window size (250)
binary anomaly detection task, each recording has been re-
Learning rate 1 × 10−3
labeled as either Sinus Rhythm (i.e., normal) or Anomalous,
Number of epochs 100
obtaining over 2,000 ECG samples—each recording from a
Criterion MSE loss
unique patient—resulting to over 2,000 patients [46].
Optimizer Adam
The preprocessing pipeline remained identical to that
used for the MIMIC-IV ECG data, except for the notch
filter, whose center frequency was lowered from 60 Hz to
50 Hz to match the mains frequency of the region in which
TABLE 3: VAE–BiLSTM Hyperparameters (excluding β) the new dataset was recorded.
To ensure consistency with the training preprocessing
Parameter Value and windowing (Section 3.2.3), the testing set passed
through identical preprocessing steps—bandpass filtering to
Window size 500
remove baseline wander and power-line interference, fol-
Stride 0.5× window size (250)
lowed by z-score normalization per lead— except for the
Learning rate 5 × 10−3
notch filter, in which case its maximum frequency was low-
Number of epochs 100
ered from 60 Hz to 50 Hz to match the main frequency of
Latent dimension 64
the region in which the CSPC dataset was recorded. Ad-
Hidden dimension 128
ditionally, a selection of 10 s duration segments at 500 Hz
Criterion Recon. + KL
was performed. This curation and preprocessing pipeline
Optimizer Adam
ensures that both training and test sets follow a standard

8
TABLE 7: Performance Comparison of the Proposed and (cited) Baseline Models on the CPSC Dataset

Model Prec. Rec. F1 AUROC AUPRC


CAE 0.64 0.82 0.72 0.77 0.80
VAE-BiLSTM 0.70 0.76 0.73 0.78 0.81
VAE-BiLSTM-MHA 0.75 0.85 0.80 0.80 0.81
ConvAE [18] – – 0.79 0.80 –
VAE–AE Hybrid [20] – – – 0.65 –
AE + Peak Detection [19] – 0.56 0.56 0.74 –
MSGformer [45] – – 0.847 0.88 –

preprocessing approach, as used in several research articles through the saliency map2 using the model’s MSE recon-
[38, 39]. struction error.
Figure 8 illustrates an original normal ECG signal (black)
and its reconstruction (orange) per each lead, with three ex-
4.2 Evaluation Metrics tra information: the per-window anomaly score (“A”), the
To evaluate the performance of the proposed anomaly de- saliency heat-map, and the MSE reconstruction error val-
tection model, a set of standard metrics commonly used in ues. As observed in the figure, the highest MSE values
anomaly detection literature was selected, including preci- and the darkest saliency are located in every QRS. It means
sion, recall, F1 score, AUPRC, and AUROC. that the model has learned to focus on these rapid and large
changes in the signals. More importantly, even though these
spikes obtain the highest MSE error, the global anomaly
Precision, Recall, and F1 Score: The primary evaluation score remains below the defined threshold, meaning that
metrics are precision (P ), recall (R), and F1 score (F1 ): the CAE model interprets the spikes within the normal mor-
phology.
TP TP PR
P = , R= , F1 = 2 (14)
TP + FP TP + FN P +R
Variational Autoencoder BiLSTM (VAE-BiLSTM)
where T P , F P , and F N are the number of True Pos-
Compared with the CAE model, the VAE–BiLSTM
itives (correctly detected anomalies), False Positives (nor-
achieves higher F1, AUROC, and AUPRC, since its
mal samples incorrectly labeled as anomalies), and False
stochastic latent variables force the model to learn repre-
Negatives (missed anomalies), respectively.
sentations that generalize from normal-only training data.
However, in early experiments the model suffered from pos-
AUPRC: The Area Under the Precision-Recall Curve de- terior collapse, where the approximate posterior collapsed
termines the model’s ability to correctly detect anomalies onto the prior as formulated in Equation 15:
(T P ) while avoiding false alarms (F P ).
qϕ (z | x) ≈ p(z) (15)
AUROC: The Area Under the Receiver Operating Char-
acteristic Curve evaluates the trade-off between the true At collapse, the KL divergence term fell to nearly zero,
positive rate (T P R = T PT+F
P the encoder outputs µz ≈ 0 and log σ 2z ≈ 0, and the
N ) and the false positive rate
FP decoder didn’t receive information about the latent space
(F P R = F P +T N ) across different thresholds. That is to
z, converting it into a deterministic auto-encoder (since
say, a higher AUROC value shows a stronger discriminative
β KL ≈ 0).
ability between healthy and anomalous ECG samples.
To solve this problem, a technique called cyclical KL an-
nealing [12] was applied (see Table 6), increasing β over
4.3 Results time starting at epoch 11—letting the model also learn
a well-reconstructed normal manifold—over a 10-epoch
Table 7 summarizes the anomaly detection performance of schedule and then repeating the cycle. This technique al-
all models evaluated on the CPSC 2018 test set. The re- lowed the model to distribute importance between recon-
sults of the proposed models are obtained under a unified struction and regularization phases—MSE and KL diver-
evaluation process, whereas the baseline scores are directly gence accordingly. A dropout was also added for further
extracted from the respective original publications and re- regularization.
flect their reported evaluation conditions. Below we detail
Overall, this combined strategy prevented posterior col-
the findings of the experiments with each model.
lapse as each latent dimension maintained a minimum of in-
formation flow, and the posterior parameters µz and log σz2
Convolutional Autoencoder (CAE) stayed separated from the prior values, thus, the encoder did
not collapse to µz = 0 and log σz2 = 0.
The convolutional autoencoder achieves a solid perfor-
mance on the quantitative anomaly detection task. Ad- 2 A saliency map is a visualization that shows which parts of an input

ditionally, the interpretability of this model is obtained the model considers most important.

9
Fig. 8: CAE interpretability of a normal ECG sample

Fig. 9: VAE-BiLSTM-MHA interpretability of an anomalous ECG sample

VAE-BiLSTM with Multi-Head Attention tention weights in the same section. This correlation indi-
(VAE-BiLSTM-MHA) cates that the model not only struggles to reconstruct the
signal in that specific region, but also assigns more impor-
tance to that region through its attention mechanism. The
The last model achieves improved performance on the
combination of reconstruction error and attention probably
quantitative task, showing higher Precision, Recall, F1-
means that the model is highlighting a segment it both finds
score, and AUROC compared to the previous models. Ad-
difficult to reproduce and finds it relevant for the overall re-
ditionally, its interpretability is enhanced through the at-
sult.
tention mechanisms. Figure 9 shows a 12-lead anomalous
ECG sample (black original vs. red reconstruction), to- Figure 10 focuses on a 500 timestep window of the previ-
gether with the per-window anomaly score in yellow and ous anomalous ECG sample, showing the original vs recon-
the attention weights in purple. It illustrates that between structed signal, the anomaly score and the attention weights
time steps 3,500 and 4,000 the model produces higher re- within a heatmap. The peaks in reconstruction error and
construction error, higher anomaly scores, and increased at- anomaly score are strongly correlated and they are located

10
Fig. 10: VAE-BiLSTM-MHA interpretability of Figure 9, focused on a window size of 500 samples

in QRS peaks. Interestingly, the heatmap shows that the 5 C ONCLUSIONS


model does not focus exactly on the sharp error peaks, but
rather on the segments before and after them. This indi- In this work, a comparative analysis was conducted among
cates that the model considers the surrounding waveform three autoencoder-based architectures for anomaly de-
morphology, rather than focusing only on the sharp peaks. tection in multivariate 12-lead electrocardiogram (ECG)
Such behavior leads to a more informative explanation, as time-series data. Specifically, a convolutional autoen-
subtle variations before and after the QRS complex can in- coder (CAE), a variational autoencoder with bidirec-
dicate anomalous patterns. tional long short-term memory (VAE-BiLSTM), and a
VAE-BiLSTM augmented with multi-head attention (VAE-
BiLSTM-MHA) architectures were evaluated on the CPSC
4.4 Dashboard 2018 dataset. The results demonstrated that the pro-
posed novel approach VAE-BiLSTM-MHA outperformed
A local web application is implemented as the last objective the other models, achieving an AUPRC of 0.81 and a recall
of this work, it uses the Dash framework within Plotly in- of 0.85. Beyond quantitative performance, this model also
tegration to create visualizations of these last interpretable exhibited qualitative strengths regarding the interpretabil-
models—both CAE and VAE-BiLSTM-MHA. As it is ob- ity of anomaly diagnosis. An additional contribution of
served in Figure 11, the user interface offers a simple and this work was the development of a user-friendly interactive
personalized framework where you can upload an ECG sig- web application that provides a simple way to observe ECG
nal in standard formats—.npy or .dat/.hea. After- signals and indicate possible anomaly deviations with in-
wards, clicking on “Analyze ECG Sample”, the interface terpretable graphics, helping users identify and understand
will render the 12-lead ECG signal, predict an anomaly de- cardiac anomalies.
cision, and provide as well as a detailed plot to interpret Despite these advances, limitations are present in this
model’s reasoning. study. First, the evaluation on a single benchmark dataset
The dashboard also offers configuration possibilities such with customized configurations defined within this work
as choosing the leads that you wanna visualize, choosing may limit the generalizability of the results. Second, the
between a CAE and a VAE-BiLSTM-MHA models, and models were trained and evaluated in an offline setting,
deciding the anomaly threshold—though it is not recom- without facing real-time ECG monitoring challenges. Fi-
mend to alter the default threshold value as it is computed nally, the absence of medical professionals in the process
on the validation set (Section 3.1). In the main plot section, of model creation and its evaluation restricted the ability to
there are several displays per each lead. The original signal fully assess the clinical interpretability of the models’ out-
(black) and the reconstructed signal (red) are found in the puts.
first graphic of each lead. Then, there is another graphic that Future research directions include extending the cur-
shows the anomaly score (orange) in each timestep. More- rent VAE-BiLSTM-MHA framework for real-time, online
over, there are two horizontal heat-map bars that compute anomaly detection in collaboration with medical profes-
the lead-wise attention weights and the point-wise MSE per sionals, to facilitate deeper clinical insights into ECG data
leads along time steps. and its anomalies. Such partnerships would foster inno-

11
Fig. 11: Interactive Dashboard

vation by combining technical expertise with the domain caregiving for cardiovascular disease: 2015 to 2035:
knowledge of healthcare practitioners. Additionally, ex- A policy statement from the american heart associa-
ploring advanced architectures such as Transformer-based tion,” Circulation, vol. 137, no. 19, pp. e558–e577,
models and integrating additional patient-related data with 2018.
ECG signals may improve both the accuracy of anomaly
detection and the interpretability of diagnostic outcomes. [6] Y. Sattar and L. Chhabra, “Electrocardiogram,” in
StatPearls [Internet]. Treasure Island (FL): Stat-
Pearls Publishing, 2023.
S OFTWARE AVAILABILITY
[7] E. A. Ashley and J. Niebauer, Cardiology Explained.
The source code has been made publicly available at: Remedica, 2004, chapter 3, pp. 15–34.
[Link]
[8] D. A. Cook, S.-Y. Oh, and M. V. Pusic, “Accuracy
ACKNOWLEDGMENTS of physicians’ electrocardiogram interpretations: A
systematic review and meta-analysis,” JAMA Internal
The authors would like to extend their special thanks to Medicine, vol. 180, no. 11, pp. 1461–1471, 2020.
Universitat Autònoma de Barcelona for providing the com-
putational resources that supported this research. [9] Y. Zhang, I. Silva, G. B. Moody, L. A. Celi, D. J.
Stone, and G. D. Clifford, “Robust and accurate
anomaly detection in ecg artifacts using time series
R EFERENCES motif discovery,” Journal of Healthcare Engineering,
vol. 6, no. 1, pp. 1–22, 2015.
[1] G. Pang, C. Shen, L. Cao, and A. V. D. Hengel, “Deep
learning for anomaly detection: A review,” ACM Com- [10] F. Liu, H. Deng, Y. Wang, and Z. Wang, “Using the
put. Surv., vol. 54, no. 2, Mar. 2022. vq-vae to improve the recognition of abnormalities
in short-duration 12-lead electrocardiogram records,”
[2] F. T. Liu, K. M. Ting, and Z.-H. Zhou, “Isolation for-
Computer Methods and Programs in Biomedicine,
est,” in Proceedings of the 2008 Eighth IEEE Inter-
vol. 200, p. 105906, 2021.
national Conference on Data Mining, 2008, pp. 413–
422. [11] J.-H. Jang, T. Y. Kim, H.-S. Lim, and D. Yoon,
[3] E. G. Nabel, “Cardiovascular disease,” The New Eng- “Unsupervised feature learning for electrocardiogram
land Journal of Medicine, vol. 349, no. 1, pp. 60–72, data using the convolutional variational autoencoder,”
2003. PLoS ONE, vol. 16, no. 12, p. e0260612, 2021.

[4] W. H. Organization. (2025) Cardiovascular diseases. [12] L. Correia, J.-C. Goos, P. Klein, T. Bäck, and A. V.
Kononova, “Ma-vae: Multi-head attention-based vari-
[5] S. B. Dunbar, O. A. Khavjou, T. Bakas, G. Hunt, R. A. ational autoencoder for anomaly detection in multi-
Kirch, A. R. Leib, R. S. Morrison, D. C. Poehler, V. L. variate time series,” arXiv preprint arXiv:2309.02253,
Roger, and L. P. Whitsel, “Projected costs of informal 2023.

12
[13] R. Hu, J. Chen, and L. Zhou, “A transformer-based [25] J. Qin, F. Gao, Z. Wang, D. C. Wong, Z. Zhao, S. D.
deep neural network for arrhythmia detection using Relton, and H. Fang, “A novel temporal generative
continuous ecg signals,” Computers in Biology and adversarial network for electrocardiography anomaly
Medicine, vol. 144, p. 105325, 2022. detection,” Artificial Intelligence in Medicine, vol.
136, p. 102489, 2023.
[14] D. Kim, K. R. Lee, D. S. Lim, K. H. Lee, J. S. Lee,
D.-Y. Kim, and C.-B. Sohn, “A novel hybrid cnn- [26] G. B. Moody and R. G. Mark, “The mit-bih arrhyth-
transformer model for arrhythmia detection without mia database,” 1988, physioNet Digital Library.
r-peak identification using stockwell transform,” Sci- [27] F. Liu, C. Liu, L. Zhao, X. Zhang, X. Wu, X. Xu,
entific Reports, vol. 15, no. 1, p. 7817, 2025. Y. Liu, C. Ma, S. Wei, Z. He, J. Li, and E. N. Y.
Kwee, “An open access database for evaluating the al-
[15] S. Chauhan and L. Vig, “Anomaly detection in ecg
gorithms of electrocardiogram rhythm and morphol-
time signals via deep long short-term memory net-
ogy abnormality detection,” Journal of Medical Imag-
works,” in Proceedings of the 2015 IEEE Interna-
ing and Health Informatics, vol. 8, no. 7, pp. 1368–
tional Conference on Data Science and Advanced An-
1373, 2018.
alytics (DSAA). IEEE, Oct. 2015, pp. 1–7.
[28] M. A. Reyna, N. Sadr, E. A. Perez Alday, A. Gu, A. J.
[16] M. Thill, S. Däubener, W. Konen, and T. Bäck, Shah, C. Robichaux, A. B. Rad, A. Elola, S. Seyedi,
“Anomaly detection in electrocardiogram readings S. Ansari, H. Ghanbari, Q. Li, A. Sharma, and G. D.
with stacked lstm networks,” in CEUR Workshop Pro- Clifford, “Will two do? varying dimensions in elec-
ceedings, vol. 2473, 2019, pp. 1–9. trocardiography: The physionet/computing in cardiol-
ogy challenge 2021,” in 2021 Computing in Cardiol-
[17] R. Hribar and D. Torkar, “Explainable anomaly de- ogy (CinC). IEEE, 2021, pp. 1–4.
tection of 12-lead ecg signals using denoising autoen-
coder,” in Intelligent Secure Trustable Things, ser. [29] C. Fu, D. Zhang, P. Huang, S. Liu, Y. Qiao, and H. Xu,
Studies in Computational Intelligence, M. Karner, Ed. “Robust anomaly detection for multivariate time series
Springer Nature, 2024, vol. 1147, pp. 127–140. via generative adversarial networks,” in Proceedings
of the 25th ACM SIGKDD International Conference
[18] U. Lomoio, P. Vizza, R. Giancotti, S. Petrolo, on Knowledge Discovery & Data Mining (KDD ’19),
S. Flesca, F. Boccuto, P. H. Guzzi, P. Veltri, and 2019, pp. 2828–2837.
G. Tradigo, “A convolutional autoencoder framework
for ecg signal analysis,” Heliyon, vol. 11, p. e41517, [30] S. Tuli, G. Casale, and N. R. Jennings, “Tranad:
2025. Deep transformer networks for anomaly detection
in multivariate time series data,” arXiv preprint
[19] S. Choi, K. Choi, H. K. Yun, S. H. Kim, H.-H. Choi, arXiv:2201.07284, 2022.
Y.-S. Park, and S. Joo, “Diagnosis of atrial fibrillation [31] E. M. M. López and E. L. Molina, “Inference of the
based on ai-detected anomalies of ecg segments,” He- Youden index and associated threshold using empir-
liyon, vol. 10, no. 1, p. e23597, 2023. ical likelihood for quantiles,” Statistics in Medicine,
vol. 30, no. 19, pp. 2467–2480, 2011.
[20] O. Atamny, A. Saguner, R. Abaecherli, and
E. Konukoglu, “Outlier detection in ecg,” in Proceed- [32] A. Siffer, P. Fouque, A. Termier, and C. Largouët,
ings of Computing in Cardiology, vol. 50, 2023, pp. “Anomaly detection in streams with extreme value
1–4. theory,” in Proceedings of the 23rd ACM SIGKDD In-
ternational Conference on Knowledge Discovery and
[21] M. Gu, Y. Zhang, Y. Wen, G. Ai, H. Zhang, P. Wang, Data Mining (KDD ’17), 2017, pp. 1067–1075.
and G. Wang, “A lightweight convolutional neural
network hardware implementation for wearable heart [33] MathWorks. (2025) Generalized pareto distribution.
rate anomaly detection,” Computers in Biology and MATLAB Documentation.
Medicine, vol. 155, p. 106623, 2023. [34] W. A. Gacek and W. Pedrycz, “Ecg signal process-
ing, classification and interpretation: A comprehen-
[22] M. N. Imtiaz and N. Khan, “Pan-tompkins++: A ro-
sive framework of computer-aided diagnosis,” Inter-
bust approach to detect r-peaks in ecg signals,” arXiv
national Journal of Bioelectromagnetism, vol. 17,
preprint arXiv:2211.03171v3, 2022.
no. 1, pp. 1–28, 2015.
[23] B. Theodorou, C. Xiao, and J. Sun, “Synthesize high- [35] A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M.
dimensional longitudinal electronic health records via Hausdorff, P. C. Ivanov, R. G. Mark, and H. E. Stanley,
hierarchical autoregressive language model,” Nature “Physiobank, physiotoolkit, and physionet: Compo-
Communications, vol. 14, no. 1, p. 5305, 2023. nents of a new research resource for complex physio-
logic signals,” Circulation, vol. 101, no. 23, pp. e215–
[24] A. Jiang, C. Huang, Q. Cao, Y. Xu, Z. Zeng,
e220, 2000, rRID:SCR 007345.
K. Chen, Y. Zhang, and Y. Wang, “Anomaly detection
in electrocardiograms: Advancing clinical diagno- [36] PhysioNet, “Physionet: An archive for physiologic
sis through self-supervised learning,” arXiv preprint signals,” [Link] accessed: 2025-06-
arXiv:2404.04935v1, Apr. 2024. 23.

13
[37] PhysioNet. (2025) Mimic-iv ecg (version 1.0). Phys-
ioNet Dataset.
[38] L. Koch, B. Shickel, M. Harer, J. Ma, M. Ahmad,
M. Aslam, J. Seeliger, A. Wood, A. Goyal, P. Ra-
jpurkar, L. Zimmer, U. J. Muehlematter, M. Jermyn,
E. Michailidis, R. Arnold, A. V. Dalca, J. M. Kwon,
S. R. Steinhubl, W. T. O’Neal, Z. I. Attia, M. M.
Churpek, and M. P. Lungren, “A foundational vi-
sion transformer improves diagnostic performance for
electrocardiograms,” npj Digital Medicine, vol. 6, p.
147, 2023.
[39] O. Linschmann, M. Rohr, K. Leonhardt, and
C. Antink, “Multi-label classification of cardiac ab-
normalities for multi-lead ecg recordings based on
auto-encoder features and a neural network classifier,”
in Proceedings of the Computing in Cardiology Con-
ference, vol. 48, 2021, pp. 1–4.
[40] S. H. El-Khafif and M. A. El-Brawany, “Artificial neu-
ral network-based automated ecg signal classifier,” In-
ternational Scholarly Research Notices, vol. 2013, pp.
1–6, 2013.
[41] S. Zhang, Y. Fang, and Y. Ren, “Ecg autoen-
coder based on low-rank attention,” Scientific Reports,
vol. 14, p. 12823, 2024.
[42] J. Ródenas, M. Garcı́a, J. J. Rieta, and R. Alcaraz,
“An efficient algorithm based on wavelet transform
to reduce powerline noise from electrocardiograms,”
in Computing in Cardiology (CinC), Maastricht, The
Netherlands, 2018, p. 200.
[43] D. P. Kingma and M. Welling, “Auto-encoding varia-
tional bayes,” arXiv preprint arXiv:1312.6114, 2013.
[44] T. Zhang, Y. Zhang, B. Zhang, H. Zhou, Q. Xu,
Y. Zhang, and C. Xu, “Unsupervised deep anomaly
detection for multi-sensor time-series signals,” arXiv
preprint arXiv:2107.12626, 2021.

[45] C. Ji, L. Wang, J. Qin, and Z. Wang, “Msgformer: A


multi-scale grid transformer network for 12-lead ecg
arrhythmia detection,” Biomedical Signal Processing
and Control, vol. 87, p. 105499, 2024, online ahead of
print.

[46] Z. Li and H. Zhang, “Automatic detection for multi-


labeled cardiac arrhythmia based on frame blocking
preprocessing and residual networks,” Frontiers in
Cardiovascular Medicine, vol. 8, p. 616585, 2021.

14

You might also like