Uncertainty-Inspired Multi-Task Learning in
Uncertainty-Inspired Multi-Task Learning in
6, JUNE 2025
Abstract—As the scenarios for electrocardiogram (ECG) database) and achieving a significant performance im-
monitoring become increasingly diverse, particularly with provement in heartbeat classification through uncertainty-
the development of wearable ECG, the influence of am- based cross-lead fusion compared to single-lead prediction
biguous factors in diagnosis has been amplified. Reliable and other state-of-the-art methods (an average improve-
ECG information must be extracted from abundant noises ment of 14.28% for detecting heartbeats of S and 3.37% for
and confusing artifacts. To address this issue, we suggest detecting heartbeats of V). Considering the characteristic of
an uncertainty-inspired model for beat-level diagnosis (UI- one-stage ECG analysis within one model, it is suggested
Beat). The base architecture of UI-Beat separates heart- that the proposed UI-Beat has the potential to be employed
beat localization and event diagnosis in two branches to as a general model for arbitrary scenarios of ECG monitor-
address the problem of heterogeneous data sources. To ing, with the capacity to remove unusable episodes, and
disentangle the epistemic and aleatoric uncertainty within realize heartbeat-level diagnosis with confidence provided.
one stage in a deterministic neural network, we propose
a new method derived from uncertainty formulation and Index Terms—ECG diagnosis, uncertainty disentangle-
realize it by introducing the class-biased transformation. ment, signal quality, ambiguous data, heartbeat localiza-
Then the disentangled uncertainty can be utilized to screen tion, heartbeat classification.
out noise and identify ambiguous heartbeat synchronously.
The results indicate that UI-Beat can significantly improve
the performance of noise detection (from 91.60% to 97.50%
for real-world noise detection and from 61.40% to 82.41% I. INTRODUCTION
for real-world artifact detection). For multi-lead ECG analy- EARTBEAT identification is the first and the most critical
sis, UI-Beat is approaching the performance upper bound
in heartbeat localization (only 15 false positives and 9 false
negatives out of the 175,907 heartbeats in the INCART
H stages for automatic electrocardiograph (ECG) analysis.
Unfortunately, the performance for automatic diagnosis of wear-
able ECGs has reached a bottleneck that the error accumulation
of heartbeat analysis will disturb the downstream tasks and is
not easily corrected. The recent researches have shown that the
Received 12 May 2024; revised 1 November 2024; accepted 17 classic methods, such as Pan-Tompkins and its variations [1],
February 2025. Date of publication 26 February 2025; date of current are no longer suitable for complex situations, while the deep
version 6 June 2025. This work was supported in part by the National learning (DL) approaches have brought significant improve-
Natural Science Foundation of China under Grant 62171123 and Grant
62211530112, in part by the National Key Research and Development ment in wearable ECG analysis [2], [3]. Despite improving the
Program of China under Grant 2023YFC3603600, in part by the Natural accuracy, the DL-based methods tend to make over-confident
Science Foundation of Jiangsu Province under Grant BK20241304, in predictions and not provide measures of confidence in their
part by the Jiangsu Funding Program for Excellent Postdoctoral Talent
2024ZB701, and in part by China Postdoctoral Science Foundation inference. Sufficient evidence is needed to help cardiologists
under Grant 2024M750444. (Xingyao Wang and Hongxiang Gao con- identify ambiguous signals and beats, especially for wearable
tributed equally to this work.) (Corresponding author: Chengyu Liu.) ECGs with limited lead(s) and noise contamination. As shown
Xingyao Wang is with the Institute of High Performance Comput-
ing (IHPC), Agency for Science, Technology and Research (A∗STAR),, in Fig. 1, the anomaly in long-term single-lead ECG is not only
Singapore 138632, and also with the School of Instrument Sci- caused by cardiac arrhythmia, but also misdirected by ambigu-
ence and Engineering and State Key Laboratory of Digital Medi- ous heartbeats and unusable episodes contaminated by random
cal Engineering, Southeast University, Nanjing 210096, China (e-mail:
wang_xingyao@[Link]). noise. Here, an ‘unusable’ ECG segment refers to a segment
Hongxiang Gao, Caiyun Ma, and Chengyu Liu are with the School of collected ECG data where no discernible ECG features are
of Instrument Science and Engineering and State Key Laboratory of detected, and no continuous three or more identifiable R-waves
Digital Medical Engineering, Southeast University, Nanjing 210096,
China (e-mail: hongxiang_seu@[Link]; caiyun@[Link]; is found. Such segments are deemed unusable due to insufficient
chengyu@[Link]). information for reliable analysis.
Tingting Zhu is with the Department of Engineering Science, The ambiguous heartbeats in ECG can be due to several
University of Oxford, OX1 3PJ Oxford, U.K. (e-mail: tingt-
[Link]@[Link]). reasons, including the poor quality in ECG, interference of al-
Feng Yang and Huazhu Fu are with the Institute of High Performance ternating current voltage, muscle tremor, baseline drift and even
Computing (IHPC), Agency for Science, Technology and Research pathological factors. They generally share similar morphology
(A∗STAR), Singapore 138632 (e-mail: yangf@[Link];
hzfu@[Link]). with QRS-complex so far as to confuse the cardiologists [4].
Digital Object Identifier 10.1109/JBHI.2025.3545927 In practice, the so-call artifacts in wearable ECGs with
2168-2194 © 2025 IEEE. All rights reserved, including rights for text and data mining, and training of artificial intelligence and similar technologies.
Personal use is permitted, but republication/redistribution requires IEEE permission. See [Link]
for more information.
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4047
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4048 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
physiological indicators for long-term ECG analysis. Current C. Uncertainty in Deterministic Models
research on ECG classification mainly focuses on end-to-end
The majority of uncertainty estimation approaches in deep
supervised learning [14], including the design of NNs tailored
learning are under Bayesian framework, that is to assume
for the extraction of pseudo-periodic features in ECGs [15], and
the posterior distribution of model parameters given training
studies on label distribution learning for multi-label issues for
data [7], [8], [9]. However, these methods are either unable to
ECG classification [16], [17]. Considering the variance in dif-
scale to large databases and model architectures, suffer from
ferent ECG collection approaches, self-supervised learning has
low-quality uncertainty measurement, or require expensive en-
been explored through pretraining on integrated ECG databases.
semble. Quantifying uncertainty in deterministic neural net-
Experiments have shown that pretrained AI models can enhance
works is more applicable since they own the lowest compu-
classification performance for downstream tasks, especially for
tational cost and not modify the inference procedure. Entropy
rare anomalies [18], [19]. Due to the inconsistent distribution of
measurement of predictive results is first attempted to estimate
annotations for ECG segmentation and diagnosis, most studies
uncertainty in deterministic models [33]. Unfortunately, entropy
still approach ECG analysis as a multi-step problem [20], [21].
measurement is often not indicative of OoD data [34]. Feature
However, ECG semantic delineation and diagnosis should be
space modeling offers a different approach [35]. The essence
interdependent. Recently, some research has considered how to
is to establish a constraint in the latent distribution induced by
integrate ECG segmentation and classification tasks within a sin-
iD and OoD data, so that once a previously unseen point with
gle model. For instance, Gao et al. adopted continual learning to
high distance (low density) added to the training data, the feature
implement ECG segmentation and abnormality detection within
space should be revealed with low distance (high density) [36].
a backbone network [22]. Moreover, a significant bottleneck in
Several related studies have already existed, like Kong et al. [37]
ECG analysis is to establish trustworthy AI models for clinic.
explicitly confuses the feature space referring to Brownian mo-
In fact, for diagnosis of 12-lead resting ECGs, there has been
tion using two independent Encoders, and Amersfoort et al. [35]
exploratory research on the impact of uncertainty estimation in
utilizes Radial Basis Function (RBF) network to exclude OoD
AI while deploying AI in clinic [23]. For fine-grained beat-level
data straying in feature-space.
ECG analysis, the uncertainty inherent in heartbeat variants
will cause the unstable diagnostic results, and contribute to
inconsistent data distributions and annotations. III. METHODS
A. ECG Analysis Framework
B. Multi-Source Multi-Task Learning The proposed model for ECG heartbeat analysis encompasses
Multi-task learning aims to learn multiple tasks simultane- two distinct tasks: heartbeat localization (R-peak localization)
ously through the interdependence between different tasks [24]. and heartbeat diagnosis. For heartbeat localization, the proposed
In multi-task learning, a prevalent approach involves utilizing method will first detects the coarse QRS-complex interval for
shared hidden layers within a single model to address various each heartbeat, then identifies the R-peak within that interval.
tasks, known as “hard-sharing”. Despite its popularity, this The nature of these two tasks is distinct: localization is to detect
technique often leads to diminished performance, especially in QRS-complex in ECG, while diagnosis requires an integrated
multi-source scenario [25], [26]. The key issue in multi-source decision considering the contextual information. Moreover, due
learning is the deficiency of shared samples among tasks induced to the difference in annotation difficulty, any publicly available
by data heterogeneity. For multi-task learning, the approach to ECG database that contains annotations for R-peaks can be
address multi-source problems can be summarized as establish- utilized for training in heartbeat localization task, and such
ing mechanisms for cross-task information transfer [24], and databases tend to own a more comprehensive ECG distribution.
evaluating the relationships among tasks is the most direct strat- In contrast, ECG databases with annotations for abnormal heart-
egy. For example, operating under the premise that tasks facing beats are rarer and mostly constructed by clean ECGs.
the same sample are not mutually independent, [27] proposes Consequently, as illustrated in Fig. 2, in order to achieve
a method to enhance the learning of cross-task consistency. the beat-level diagnosis, the proposed UI-Beat model employs
Zhou et al. [28] measures the similarity between tasks based structurally identical yet independent encoders and decoders for
on adversarial learning and utilize the information from similar the tasks of heartbeat and event detection, respectively. In ECG,
tasks to improve the performance of independent tasks. Beyond an event such as sinus rhythm (SR) and ventricular arrhythmia
directly measuring inter-task correlations, knowledge distilla- (VA) in Fig. 2, or atrial arrhythmia (AA), may contain multiple
tion and transfer are also employed to align representations of heartbeats. Ultimately, heartbeat diagnosis integrates the predi-
single-tasks with those of multi-task models, thereby mitigating cated probability sequence for heartbeat localization and event
training imbalances caused by task heterogeneity [29], [30]. detection, that is, assigning a diagnostic type to each localized
In recent years, researchers have also explored modeling the heartbeat within an event interval. Another aim of this design
inter-task correlations based on the theory of multivariate Gaus- is to do cross learning for the two tasks asynchronously owing
sian process, which has led to the design of training procedure to the heterogeneous data distribution in heartbeat localization
for neural networks (NNs) [31], [32]. In the context of ECG and classification. The details will be demonstrated in the next
diagnostics, tasks with simpler annotations typically have a more section.
comprehensive distribution, yet there is a lack of annotations for While synchronously localizing and diagnosing each heart-
more challenging tasks. beat, frame-level uncertainty estimation is conducted based on
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4049
Fig. 2. Overall ECG analysis pipeline based on the proposed UI-Beat model. An arbitrary ECG with any number of leads is segmented into
fragments for input to the UI-Beat model at first. (a) illustrates the basic architecture of UI-Beat model designed for the multi-task and multi-source
scenario in this work. The results of heartbeat classification are obtained by merging the outputs of heartbeat localization and event detection. In
(b), based on the proposed uncertainty disentanglement method, UI-Beat provides frame-level outputs including UE and UA . The outputs from the
lead with the highest confidence at each frame is selected as the ultimate output for that frame of the ECG. Meanwhile, UE and UA are respectively
responsible for detecting noise and ambiguous heartbeat.
a new proposed uncertainty disentanglement formulation. Here tasks are defined as fl and fe , gl and ge , respectively. Thus,
we utilize U represents the predictive uncertainty, and UE and UA for heartbeat localization task, we have zl = fl (xl ); ŷl = gl (zl ),
the epistemic and aleatoric uncertainty, respectively. In UI-Beat, and for event detection task, ze = fe (xe ); ŷe = ge (ze ). Before
the decoupled UE and UA respectively provide the capabilities entering the encoders, we uniformly performed embedding on
for noise filtration and the detection of ambiguous heartbeats. the input ECG episode. The reason for employing event detec-
Meanwhile, through uncertainty-based cross-lead fusion, the tion as a precursor task to heartbeat classification lies in the
output from the lead with the highest confidence is adopted as further compression of input ECG signals in latent space. Since
the final prediction, and UI-Beat will ultimately realize noise ECGs are non-stationary signals prone to noise interference,
detection, ambiguous beat identification, heartbeat localization more compression can mitigate the impact of noise on the output.
and diagnosis within one stage. In order to induce the utilization of contextual information
in heartbeat localization within this multi-task, multi-source
learning framework, and to introduce a broader data distribution
B. Cross-Source Learning of heartbeat for event detection, we design and implement the
As aforementioned, since the heartbeat localization task and inter-task interaction. This interaction is realized by transform-
heartbeat classification task are heterogeneous, we consider the ing and aligning fe (xl ) with zl and then adding them when input
heartbeat localization database as Dl = {Xl , Yl }, the heartbeat xl is provided. A similar approach is conducted with input xe .
classification database as Dc = {Xc , Yc }, and the event database While training, the supervision from Dl is exclusively linked to
De = {Xe , Ye }. The event database is constructed from Dc as the parameters updates for fl and gl , and the supervision from De
De = {Xe , Ye }, where Xe contains intervals, and Ye denotes is solely associated with the parameters of fe and ge . However,
labels associated with these intervals. While De was derived for the heartbeat classification task with database Dc , since
from Dc by grouping sequences of abnormal beats, it is also it is an intersection between heartbeat localization and event
possible to derive Dc from De . In this alternative process, each detection, we merge gl (fl (xc )) with ge (fe (xc )). Given that the
heartbeat within an abnormal interval in De would be assigned output for heartbeat localization is a probability sequence for
a label reflecting the specific abnormal rhythm type, thereby binary states (QRS-complex and non-QRS interval), we treat it
creating a heartbeat-level classification dataset. Accordingly, we as an attention tensor and utilize a channel-wise multiplication
have revised the description to accurately reflect the relationship method to integrate it with the output from event detection.
between Dc and De . The encoders and decoders of the two The formulas for cross-task information interaction and the
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4050 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
ŷc = gl (fl (xc )) · ge (fe (xc )). (3) where T is the total number of the frames.
As Eqn.6 shows, UE can be deemed as the sum of the KL
To clarify cross-source learning in our proposed method, we divergence between the two distributions of zτ , the class-biased
have provided the data flow of the model’s forward propagation distribution and the ground truth distribution, which is learned
in the flowchart (Fig. 3). from the training set. We expect a feasible solution to estimate
For convenience, the parameters for fl and fe are defined as P (zτ | ŷτ , D) by producing discrepancy for the posterior dis-
θl and θe , while for decoders are ωl and ωe . In the following tribution belonging to a certain class c ∈ [1, K], p(zτ | ŷτc , D).
sections, the parameters of the combined encoder and decoder Thus we introduce φ to transform zτ into the class-biased
will be indicated as θ and ω. During training, the optimization representation:
objective function in our scenario can be defined as:
min L(θ, ω, D) = loc (θl , ωl , (Xl , Yl )) P (zτ | ŷτ , D) = P (zτ , φc | ŷτc , D)
θ,ω c
+ evn (θe , ωe , (Xe , Ye )) (4) = P (zτ | ŷτc , φc , D)P (φc | ŷτc , D) (7)
c
+ cls (θ, ω, (Xc , Yc )),
1
where loc , evn , and cls are the loss functions for heartbeat local- = P (zτ | ŷτc , φc , D),
K c
ization, event detection, and heartbeat classification respectively.
For UI-Beat training, we simply utilize cross entropy for the loss Here the φc is responsible for finding the evidence of the target
function of each task. class as far as possible, and the prior distribution, p(φc | ŷτc , D)
is set as the constant 1/K, which is under the assumption that
C. Frame-Wise Uncertainty Disentanglement the evidence distribution of the target class c is well determined
According to [38], given a data point {x, y} ∈ D and the by the model after learning from D.
prediction ŷ for x, the predictive uncertainty H[EP (θ|D) [p(Y | Recall and update the aforementioned Markov chain, and we
fθ φ gω
x, θ)]] upper-bounds the epistemic uncertainty, where epistemic can have x −→ z − → zτ −→ ŷτ . In a general sense, this Markov
uncertainty is quantified as the mutual information I[Y ; θ | x, D] chain can be utilized for image under pixel-level modeling, and
brought by θ on ŷ. The formulation is defined as follows: time series data under frame-level modeling. Thus we have
I [Y, θ | x, D] = H [Y | x, D]] − EP (θ|D) [H [Y | x, θ]] . (5) P (zτ | ŷτ , φc , D) = P (zτ | ŷτc , φc (z)). (8)
epistemic predictive aleatoric (for iD x)
In our thoughts, the transformation φc should be class-biased
The UE = I[Y ; θ | x, D] can be isolated from UA by sampling and preferentially capture features for the target class on each
θ from P (θ | D). This approach estimates UA as the expected frame. For iD data, φc (z) should be consistent with z since
entropy EP (θ|D) [H[Y | x, θ]], allowing UE to capture the un- the evidence distribution is well-determined, so that UE will be
certainty due to variability in θ itself. Therefore, the way is minimal. Conversely, we expect φc (z) to be inconsistent with
infeasible for a deterministic network with a solely-determined z when facing OoD data, inducing an increasing UE . Defining
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4051
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4052 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
A. Noise and Ambiguous Beat Detection ambiguous beats outside the morphology and rhythm patterns of
normal beats (N), atrial (A), and ventricular (V) premature beats.
1) Database: For noise screening, 3,000 unusable 10-
Two physiologists then checked and annotated the candidate
second episodes (without any distinguishable heartbeat) were ambiguous heartbeats. In the end, we left the ambiguous beats on
extracted from a real-world wearable ECG database [39]. In which the two physiologists provided inconsistent annotations.
addition, to comprehensively illustrate the advantage of the Besides the annotations of ambiguous beats, we also annotated
proposed uncertainty estimation method for noise detection, we certain heartbeats to evaluate the specificity of UI-Beat recog-
also included two external test sets using different types of non- nizing ambiguous heartbeats. Fig. 7(a) and (b) list the classic
ECG signals, which are heart sounds and photoplethysmography instances of the simulated and manually annotated ambiguous
(PPG) signals, and utilized CPSC2019 database (10-second heartbeats. For convenience, we name the simulated and real-
ECG episodes with QRS-complex annotated) [40] as the iD world databases for ambiguous heartbeats as SIM-AM-ECG and
effective ECG set. RW-AM-ECG, respectively.
For identifying ambiguous heartbeats, two data sets are con- 2) Experimental Setup: For the evaluation of detecting am-
structed, including 2,000 ECG episodes with a simulated am- biguous heartbeats, the positive predictive value (P P V ), sensi-
biguous heartbeat, which is a randomly-inserted QRS-complex tivity (Se), and F1 score are computed over the cumulated true
from different patients and a real-world data set containing positive (T P ), false positive (F P ) and false negative (F N ). And
960 samples with 1,018 manually annotated QRS-like artifact for noise screening, accuracy (Acc) is utilized as an evaluation
heartbeats. To ensure the correctness of recognizing heartbeats index for classifying effective ECG and non-ECG episodes. True
in ECGs, we often need to refer to contextual information since negative (T N ) is additionally utilized in the Acc calculation.
the absolute morphology of the artifacts (derived from noise) These metrics are defined as follows:
is close to or even equal to the QRS-complex in most cases.
Therefore, the simulation will ensure a portion of ECG episodes TP
contain an ambiguous heartbeat that has general morphological Se = × 100%, (14)
TP + FN
characteristics while not conforming to the contextual pattern.
The visual description of generating the simulated ambiguous TP
PPV = × 100%, (15)
heartbeats is shown in Fig. 5. TP + FP
To capture the ambiguous heartbeats among real-world wear- 2 × Se × P+
F1 = × 100%, (16)
able ECGs, we first looked through the records for the candidate Se + P+
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4053
Fig. 7. Statistical histograms of UE and UA . (a) ∼ (d): Comparison of the distribution of UE for UI-Beat in the presence of effective ECG and
non-ECG episodes (real-world noise, Gaussian noise, PPG, and heart sound). (e) ∼ (f): Comparison of the distribution of UA for UI-Beat in the
presence of simulated and real-world ambiguous beats.
TABLE I
THE PERFORMANCE COMPARISON BETWEEN THE PROPOSED UI-BEAT AND THE TWO REPRESENTATIVE SQA METHODS FOR SCREENING NON-ECG
SIGNALS BASED ON EPISTEMIC UNCERTAINTY
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4054 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
TABLE II
THE PERFORMANCE OF DETECTING QRS-LIKE ARTIFACTS BASED ON ALEATORIC UNCERTAINTY
TABLE III
COMPARISON OF QRS-COMPLEX DETECTION PERFORMANCE ON MULTI-LEAD ECGS
at annotated artifacts according to ŷ. According to Table II, the and several classic uncertainty-aware methods, including MC-
results of Se on SIM-AM-QRS (75.36%) and on RW-AM-QRS Dropout [8] and Deep Ensemble [9], which we use an ensemble
(88.01%) for recognizing ambiguous heartbeats indicate that UA of five networks. To ensure an objective evaluation, we conduct
can be utilized as an auxiliary confidence for the outputs from the SQA method, GbSQI [41], as the preprocession for P&T in
UI-Beat. However, there is an obvious overlap between the am- a multi-lead setting. All the methods that take uncertainty into
biguous and certain beats, and such confusion brings down P P V account are trained with a multi-branch convolutional neural net-
for ambiguous beats. The confounding distributions are either work (MBCNN) [48], which is one of the optimal methods so far
embodied in the contextual disturbance or the noisy annotations. in R-peak detection. For each frame, the estimated uncertainty
is given, and the output sequence is made up of the frame-level
B. Heartbeat Localization for Multi-Lead ECGs likelihood that belongs to the lead with the most confidence.
Besides the general evaluation indicators (Se, PPV and F1 )
1) Database: So far, the key element for heartbeat local-
mentioned above, we complement the performance loss (%) in
ization in multi-lead ECGs lies in how to integrate cross-lead
FN and FP of a method M compared with the method with the
information well. In this experiment, we use the CPSC2019-
minimum FN and FP for a more direct display of performance
Train database [40] for training and five other independent
discrepancy, which is defined as follows:
databases with annotations of R-peaks, including CPSC2019-
Test for testing the baseline performance on the single-lead FN(M) − FNmin
FNLOSS (M) = × 100%, (18)
heartbeat localization, and four other databases to evaluate the FN(M)
performance of heartbeat localization on multi-lead ECGs, in-
FP(M) − FPmin
cluding MIT-BIH Arrhythmia Database (MIT-BIH) [43], QT FPLOSS (M) = × 100%. (19)
Database (QTDB) [44], INCART 12-lead Arrhythmia Database FP(M)
(INCART) [45] and LUDB 12-lead Database [46]. 3) Results: Table III gives a quantitative evaluation of heart-
2) Experimental Setup: The specific implementation is beat localization in multi-lead ECGs with uncertainty-based de-
shown in Algorithm 1 and a 2-second overlap is adopted cision. The results over CPSC2019-TEST indicate that the base-
for long-term ECGs. Also, we compare UI-Beat against the line performance of the three uncertainty-aware QRS-complex
rule-based R-peak detection method, Pan-Tompkins (P&T) [47], detection methods is equivalent and far superior than P&T,
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4055
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4056 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
TABLE V
COMPARISON OF HEARTBEAT CLASSIFICATION PERFORMANCE ON DS2 DERIVED FROM MIT-BIH AND INCART
Fig. 8. Visualization of heartbeat localization and diagnosis on a wearable single-lead ECG using UI-Beat. In addition to displaying the results of
heartbeat localization and classification, the figure also presents the judgement of noise and confidence level based on the disentangled UE and
UA . The gray line indicates the noise interval, and according to Algorithm 2, all diagnostic results within this interval are rejected. The frame-level
confidence is calculated by 1 − UA and transformed into heat maps to intuitively showcase the correspondence among ECG signals, diagnostic
outcomes, confidence levels. It is observable that when encountering noise interference or ambiguous heartbeats, the confidence is generally low,
whereas for clean heartbeats with distinct features, the confidence is notably high.
(Conf.) is represented by 1 − UA , and the noise is screened disentangle the epistemic and aleatoric uncertainty without
out based on UE . According to Fig. 8, UI-Beat is capable of ensemble learning. The proposed method is named as UI-Beat.
effectively eliminating noise while making reliable heartbeat According to the definition of uncertainty, the epistemic and
localization and diagnosis, and it offers confidence levels for aleatoric uncertainty can be utilized to identify OoD data
heartbeats with ambiguous characteristics among different cat- (non-ECG noise) and iD ambiguous data (ambiguous heart-
egories. beats).The experimental results suggest that UI-Beat possesses
the capability of realizing noises screening, artifactambiguous
heartbeat identification, high-precision heartbeat localization
V. DISCUSSION and heartbeat diagnosis within one-stage inference. Moreover,
For the first time we introduce uncertainty-inspired learning the proposed class-biased transformation for uncertainty disen-
into heartbeat-level ECG analysis with a deterministic neural tanglement in UI-Beat is easily implemented and plug-and-play
network. We develop the uncertainty paradigm into distance for arbitrary Encoders, which is consistent with a rapid and
measurement between class-biased representations and lightweight deployment for the initial stage of ECG analysis.
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
WANG et al.: UNCERTAINTY-INSPIRED MULTI-TASK LEARNING IN ARBITRARY SCENARIOS OF ECG MONITORING 4057
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.
4058 IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. 29, NO. 6, JUNE 2025
[7] A. Kendall and Y. Gal, “What uncertainties do we need in Bayesian deep [31] V. Aglietti, T. Damoulas, M. Álvarez, and J. González, “Multi-task causal
learning for computer vision,” in Proc. Neural Inf. Process. Syst., 2017, learning with Gaussian processes,” Adv. Neural Inf. Process. Syst., vol. 33,
pp. 5580–5590. pp. 6293–6304, 2020.
[8] Y. Gal and Z. Ghahramani, “Dropout as a Bayesian approximation: Rep- [32] J. Futoma, S. Hariharan, and K. Heller, “Learning to detect Sepsis with
resenting model uncertainty in deep learning,” in Proc. Int. Conf. Mach. a multitask Gaussian process RNN classifier,” in Proc. Int. Conf. Mach.
Learn., 2016, pp. 1050–1059. Learn., 2017, pp. 1174–1182.
[9] R. Rahaman and A. H. Thiery, “Uncertainty quantification and deep [33] J. Liu, Z. Lin, S. Padhy, D. Tran, T. Bedrax Weiss, and B. Lakshmi-
ensembles,” in Proc. Adv. Neural Inf. Process. Syst., 2021, vol. 34, narayanan, “Simple and principled uncertainty estimation with determin-
pp. 20063–20075. istic deep learning via distance awareness,” Adv. Neural Inf. Process. Syst.,
[10] T. Zhu, A. E. Johnson, J. Behar, and G. D. Clifford, “Crowd-sourced vol. 33, pp. 7498–7512, 2020.
annotation of ECG signals using contextual information,” Ann. Biomed. [34] L. Smith and Y. Gal, “Understanding measures of uncertainty for ad-
Eng., vol. 42, pp. 871–884, 2014. versarial example detection,” in Proc. Uncertainty Artif. Intell., 2018,
[11] R. He et al., “Automatic detection of QRS complexes using dual channels pp. 560–569.
based on U-Net and bidirectional long short-term memory,” IEEE J. [35] J. Van Amersfoort, L. Smith, Y. W. Teh, and Y. Gal, “Uncertainty estima-
Biomed. Health Inform., vol. 25, no. 4, pp. 1052–1061, Apr. 2020. tion using a single deep deterministic neural network,” in Proc. Int. Conf.
[12] R. V. Andreao, B. Dorizzi, and J. Boudy, “ECG signal analysis through Mach. Learn., 2020, pp. 9690–9700.
hidden Markov models,” IEEE Trans. Biomed. Eng., vol. 53, no. 8, [36] J. Mukhoti, A. Kirsch, J. van Amersfoort, P. H. Torr, and Y. Gal, “Determin-
pp. 1541–1549, Aug. 2006. istic neural networks with appropriate inductive biases capture epistemic
[13] K. Wang, G. Yang, Y. Huang, and Y. Yin, “Multi-scale differential feature and aleatoric uncertainty,” in Proc. ICML Workshop Uncertain. Robust.
for ECG biometrics with collective matrix factorization,” Pattern Recog- Deep Learn., 2021.
nit., vol. 102, 2020, Art. no. 107211. [37] L. Kong, J. Sun, and C. Zhang, “SDE-Net: Equipping deep neural net-
[14] A. Y. Hannun et al., “Cardiologist-level arrhythmia detection and classi- works with uncertainty estimates,” in Proc. Int. Conf. Mach. Learn., 2020,
fication in ambulatory electrocardiograms using a deep neural network,” pp. 5405–5415.
Nature Med., vol. 25, no. 1, pp. 65–69, 2019. [38] J. Mukhoti, A. Kirsch, J. van Amersfoort, P. H. Torr, and Y. Gal, “Deep
[15] J. Malik, O. C. Devecioglu, S. Kiranyaz, T. Ince, and M. Gabbouj, “Real- deterministic uncertainty: A new simple baseline,” in Proc. IEEE/CVF
time patient-specific ECG classification by 1 D self-operational neural Conf. Comput. Vis. Pattern Recognit., 2023, pp. 24384–24394.
networks,” IEEE Trans. Biomed. Eng., vol. 69, no. 5, pp. 1788–1801, [39] Z. Cai et al., “An open-access long-term wearable ECG database for
May 2021. premature ventricular contractions and supraventricular premature beat
[16] L. Sun, C. Li, Y. Ren, and Y. Zhang, “A multitask dynamic graph at- detection,” J. Med. Imag. Health Inform., vol. 10, no. 11, pp. 2663–2667,
tention autoencoder for imbalanced multilabel time series classification,” 2020.
IEEE Trans. Neural Netw. Learn. Syst., vol. 35, no. 9, pp. 11829–11842, [40] H. Gao et al., “An open-access ECG database for algorithm evaluation of
Sep. 2024. QRS detection and heart rate estimation,” J. Med. Imag. Health Inform.,
[17] S. Zhang, Y. Li, X. Wang, H. Gao, J. Li, and C. Liu, “Label decoupling vol. 9, no. 9, pp. 1853–1858, 2019.
strategy for 12-lead ECG classification,” Knowl.-Based Syst., vol. 263, [41] F. Liu et al., “Dynamic ECG signal quality evaluation based on the
2023, Art. no. 110298. generalized bSQI index,” IEEE Access, vol. 6, pp. 41892–41902, 2018.
[18] N. Wang, P. Feng, Z. Ge, Y. Zhou, B. Zhou, and Z. Wang, “Adversarial [42] Q. Li, R. G. Mark, and G. D. Clifford, “Robust heart rate estimation from
spatiotemporal contrastive learning for electrocardiogram signals,” IEEE multiple asynchronous noisy sources using signal quality indices and a
Trans. Neural Netw. Learn. Syst., vol. 35, no. 10, pp. 13845–13859, Kalman filter,” Physiol. Meas., vol. 29, no. 1, pp. 15–32, 2007.
Oct. 2024. [43] G. B. Moody and R. G. Mark, “The impact of the MIT-BIH arrhythmia
[19] W. Zhang, L. Yang, S. Geng, and S. Hong, “Self-supervised time se- database,” IEEE Eng. Med. Biol. Mag., vol. 20, no. 3, pp. 45–50, Mar. 2001.
ries representation learning via cross reconstruction transformer,” IEEE [44] P. Laguna, R. G. Mark, A. Goldberg, and G. B. Moody, “A database
Trans. Neural Netw. Learn. Syst., vol. 35, no. 11, pp. 16129–16138, for evaluation of algorithms for measurement of QT and other waveform
Nov. 2024. intervals in the ECG,” in Proc. Comput. Cardiol., 1997, pp. 673–676.
[20] Z. Zhao, X. Wang, Z. Cai, J. Li, and C. Liu, “PVC recognition for wearable [45] A. Taddei et al., “The European ST-T database: Standard for evaluating
ECGs using modified frequency slice wavelet transform and convolutional systems for the analysis of ST-T changes in ambulatory electrocardiogra-
neural network,” in Proc. Comput. in Cardiol. (CinC), 2019, pp. 1–4. phy,” Eur. Heart J., vol. 13, no. 9, pp. 1164–1172, 1992.
[21] J. Niu, Y. Tang, Z. Sun, and W. Zhang, “Inter-patient ECG classification [46] A. I. Kalyakulina et al., “LUDB: A new open-access validation tool
with symbolic representations and multi-perspective convolutional neural for electrocardiogram delineation algorithms,” IEEE Access, vol. 8,
networks,” IEEE J. Biomed. health Inform., vol. 24, no. 5, pp. 1321–1332, pp. 186181–186190, 2020.
May 2019. [47] J. Pan and W. J. Tompkins, “A real-time QRS detection algorithm,” IEEE
[22] H. Gao, X. Wang, Z. Chen, M. Wu, J. Li, and C. Liu, “ECG-CL: A com- Trans. Biomed. Eng., vol. 32, no. 3, pp. 230–236, Mar. 1985.
prehensive electrocardiogram interpretation method based on continual [48] W. Cai and D. Hu, “QRS complex detection using novel deep learning
learning,” IEEE J. Biomed. Health Inform., vol. 27, no. 11, pp. 5225–5236, neural networks,” IEEE Access, vol. 8, pp. 97082–97089, 2020.
Nov. 2023. [49] V. Kalidas and L. Tamil, “Real-time QRS detector using stationary wavelet
[23] J. F. Vranken et al., “Uncertainty estimation for deep learning-based transform for automated ECG analysis,” in Proc. IEEE 17th Int. Conf.
automated analysis of 12-lead electrocardiograms,” Eur. Heart J.- Digit. Bioinf. Bioeng. (BIBE), 2017, pp. 457–461.
Health, vol. 2, no. 3, pp. 401–415, 2021. [50] M. U. Zahid et al., “Robust R-Peak detection in low-quality holter ECG
[24] Y. Zhang and Q. Yang, “A survey on multi-task learning,” IEEE Trans. using 1 D convolutional neural network,” IEEE Trans. Biomed. Eng.,
Knowl. Data Eng., vol. 34, no. 12, pp. 5586–5609, Dec. 2021. vol. 69, no. 1, pp. 119–128, Jan. 2021.
[25] Y. Zhu et al., “Heterogeneous transfer learning for image classification,” [51] Association for the Advancement of Medical Instrumentation & American
in Proc. AAAI Conf. Artif. Intell., no. 1, 2011, pp. 1304–1309. National Standards Institute, Testing and reporting performance results of
[26] Y. Li, X. Tian, T. Liu, and D. Tao, “On better exploring and exploiting cardiac rhythm and ST segment measurement algorithms,” ANSI/AAMI
task relationships in multitask learning: Joint model and feature learning,” EC57:2012/(R)2020, 2012.
IEEE Trans. Neural Netw. Learn. Syst., vol. 29, no. 5, pp. 1975–1985, [52] P. De Chazal, M. O’Dwyer, and R. B. Reilly, “Automatic classification of
May 2017. heartbeats using ECG morphology and heartbeat interval features,” IEEE
[27] A. R. Zamir et al., “Robust learning through cross-task consistency,” in Trans. Biomed. Eng., vol. 51, no. 7, pp. 1196–1206, Jul. 2004.
Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit., 2020, pp. 11197– [53] J. He, L. Sun, J. Rong, H. Wang, and Y. Zhang, “A pyramid-like model for
11206. heartbeat classification from ECG recordings,” PLoS one, vol. 13, no. 11,
[28] F. Zhou, C. Shui, M. Abbasi, L.-É. Robitaille, B. Wang, and C. Gagné, 2018, Art. no. e0206593.
“Task similarity estimation through adversarial multitask neural network,” [54] G. Wang, M. Chen, Z. Ding, J. Li, H. Yang, and P. Zhang, “Inter-patient
IEEE Trans. Neural Netw. Learn. Syst., vol. 32, no. 2, pp. 466–480, ECG arrhythmia heartbeat classification based on unsupervised domain
Feb. 2020. adaptation,” Neurocomputing, vol. 454, pp. 339–349, 2021.
[29] W.-H. Li and H. Bilen, “Knowledge distillation for multi-task learning,” in [55] J. Yang, W. Cai, and M. Wang, “Premature beats detection based on a
Proc. Comput. Vision–ECCV Workshops Glasgow, U.K., 2020, pp. 163– novel convolutional neural network,” Physiol. Meas., vol. 42, no. 7, 2021,
176. Art. no. 0 75003.
[30] K. Li, J. Lu, H. Zuo, and G. Zhang, “Multi-source contribution learning [56] S. M. Mathews, C. Kambhamettu, and K. E. Barner, “A novel application
for domain adaptation,” IEEE Trans. Neural Netw. Learn. Syst., vol. 33, of deep learning for single-lead ECG classification,” Comput. Biol. Med.,
no. 10, pp. 5293–5307, Oct. 2021. vol. 99, pp. 53–62, 2018.
Authorized licensed use limited to: Universitatsbibliothek Erlangen Nurnberg. Downloaded on March 05,2026 at 11:02:17 UTC from IEEE Xplore. Restrictions apply.