VAE-BiLSTM-MHA for ECG Anomaly Detection
VAE-BiLSTM-MHA for ECG Anomaly Detection
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
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.
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
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
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
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]
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
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
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
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.
14