# A novel method to correct repolarization time estimation from unipolar electrograms distorted by standard filtering

Peter Langfield, Yingjing Feng, Laura R. Bear, Josselin Duchateau, Rafael Sebastian, Emma Abell, Remi Dubois, Louis Labrousse, Julien Rogier, Meleze Hocini, et al.

<figure><img src="image_1.png" /></figure>

To cite this version:

Peter Langfield, Yingjing Feng, Laura R. Bear, Josselin Duchateau, Rafael Sebastian, et al.. A novel method to correct repolarization time estimation from unipolar electrograms distorted by standard filtering. Medical Image Analysis, 2021, 72, 10.1016/j.media.2021.102075. hal-03811712

HAL Id: hal-03811712

https://hal.science/hal-03811712

Submitted on 12 Oct 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A novel method to correct repolarization time estimation from unipolar electrograms distorted by standard filtering

<figure><img src="image_3.png" /></figure>

Peter Langfield<sup>a,c,1,*</sup>, Yingjing Feng<sup>a,c,1,*</sup>, Laura R. Bear<sup>a</sup>, Josselin Duchateau<sup>a,b</sup>, Rafael Sebastian<sup>d</sup>, Emma Abell<sup>a</sup>, Remi Dubois<sup>a</sup>, Louis Labrousse<sup>b</sup>, Julien Rogier<sup>b</sup>, Meleze Hocini<sup>a,b</sup>, Michel Haissaguerre<sup>a,b</sup>, Edward Vigmond<sup>a,c</sup>

## ARTICLE INFO

**Article history:**

Received 21 May 2020

Revised 30 March 2021

Accepted 2 April 2021

Available online 18 April 2021

**2020 MSC:**

92C55

92B20

68T07

94A12

**Keywords:**

Repolarization

CARTO

Unipolar electrogram

Filtering

Neural network

## ABSTRACT

Reliable patient-specific ventricular repolarization times (RTs) can identify regions of functional block or afterdepolarizations, indicating arrhythmogenic cardiac tissue and the risk of sudden cardiac death. Unipolar electrograms (UEs) record electric potentials, and the Wyatt method has been shown to be accurate for estimating RT from a UE. High-pass filtering is an important step in processing UEs, however, it is known to distort the T-wave phase of the UE, which may compromise the accuracy of the Wyatt method. The aim of this study was to examine the effects of high-pass filtering, and improve RT estimates derived from filtered UEs. We first generated a comprehensive set of UEs, corresponding to early and late activation and repolarization, that were then high-pass filtered with settings that mimicked the CARTO filter. We trained a deep neural network (DNN) to output a probabilistic estimation of RT and a measure of confidence, using the filtered synthetic UEs and their true RTs. Unfiltered ex-vivo human UEs were also filtered and the trained DNN used to estimate RT. Even a modest 2 Hz high-pass filter imposes a significant error on RT estimation using the Wyatt method. The DNN outperformed the Wyatt method in 62.75% of cases, and produced a significantly lower absolute error (p = 8.99E-13), with a median of 16.91 ms, on 102 ex-vivo UEs. We also applied the DNN to patient UEs from CARTO, from which an RT map was computed. In conclusion, DNNs trained on synthetic UEs improve the RT estimation from filtered UEs, which leads to more reliable repolarization maps that help to identify patient-specific repolarization abnormalities.

© 2021 The Authors. Published by Elsevier B.V.

This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/)

## 1. Introduction

Accurate mapping of ventricular activation and repolarization time (RT) can help identify arrhythmogenic regions of the heart, regions that are more prone to afterdepolarizations or susceptible to conduction block (Verduyn et al., 1997; Wang et al., 2016). Han and Moe showed that factors supporting ventricular fibrillation increased the dispersion of RT, regardless of whether the av-

erage RT increased or decreased (Han and Moe, 1964; Han et al., 1964). Coronel et al. (2009) showed that one of the main factors governing the occurrence of reentry is the restitution characteristics of the tissue. Later, by considering the intervals between local RT and activation time (AT), Child et al. (2015) were able to identify tissue vulnerable to reentry without the need to induce the arrhythmia, a metric which was referred to as the reentry vulnerability index (RVI). Although the RVI metric has been shown to be reliable (Martin et al., 2018), its accuracy is limited by the quality of the underlying RT maps. Furthermore, through modeling patient-specific pathologies, a “digital twin” of the patient heart is created, which can be used to explore pathological mechanisms, as well as to suggest and test optimized treatments (Arevalo et al., 2016; Corral-Acero et al., 2020). The repolarization abnormalities

<footnote><sup>a</sup> IHU Liryc, Electrophysiology and Heart Modeling Institute, Fondation Bordeaux Université, Pessac-Bordeaux, France</footnote>

<footnote><sup>b</sup> Bordeaux University Hospital (CHU), Cardiac Electrophysiology and Cardiac Stimulation Team, Pessac, France</footnote>

<footnote><sup>c</sup> Univ. Bordeaux, IMB UMR 5251, Talence F-33400, France</footnote>

<footnote><sup>d</sup> CoMMLab, Dept. Computer Sciences, Universitat de Valencia, Valencia, Spain</footnote>

<footnote>* Corresponding authors at: IHU Liryc, Electrophysiology and Heart Modeling Institute, fondation Bordeaux Université, F-33600 Pessac- Bordeaux, France.</footnote>

<footnote>E-mail addresses: Peter.Langfield@u-bordeaux.fr (P. Langfield), Yingjing.Feng@ubordeaux.fr (Y. Feng).</footnote>

<footnote n="1">¹ These authors contributed equally.</footnote>
suggested by the RT map, together with the structural abnormalities accessible by imaging technologies, can be used for creating such “digital twin”, with which functional pathologies could be identified and treated.

Electro-anatomical mapping systems (EAMs) are a common clinical tool to record unipolar and bipolar electrograms from sites on the surfaces of the ventricles in vivo, the endocardium via a femoral catheter insertion, and the epicardium via a percutaneous subxiphoid puncture (Sacher et al., 2010). The EAM's localization provides the position of the electrode in order to direct it through the vascular system and to specific sites in the ventricles. Unipolar electrograms (UEs) measure extracellular potentials which are composed of the inverse distance weighted potentials produced by the cells comprising the tissue. Transmembrane action potential timings can be estimated from a UE via the Wyatt method (Wyatt et al., 1981) where AT is the instant of steepest negative slope during the QRS phase, and RT is the moment of steepest positive slope during the T-wave. The Wyatt method for estimating RT has been validated in several studies (Coronel et al., 2006; Franzone et al., 2007; Orini et al., 2018; Potse et al., 2009), and, hence, can be considered as a reliable method for estimating RT from UEs. Electrode localization and reliable UEs offer a method for imaging ventricular RT maps.

However, for several EAMs currently used in clinics, acquired UEs are subject to filtering by default. In the case of the CARTO® EAM (Biosense-Webster, Diamond Bar, CA) that is considered in this article, a band-pass filter is built into the acquisition system. This filtering is necessary in order to remove high-frequency noise, correct for baseline wander, reduce powerline interference, and minimize far field components (Stevenson and Soejima, 2005). The lowest frequency for the high-pass component of the CARTO filter is 0.05 Hz, but this has little effect on baseline wander caused by factors such as respiration (typically 0.2–0.5 Hz in patients aged ≥ 65 Rodríguez-Molinero et al., 2013). Such low frequency deviations in the signal can lead to errors in measurements from the isoelectric line and gradients, and large deviations in the signal can lead to amplifier saturation (Kugelstadt, 2005), hence, a higher-frequency high-pass filter is typically applied. Although these deviations can be filtered by post-processing, real-time signals with minimal noise are important during procedures, which means that the signals are generally filtered at acquisition. High-pass filtering is known to distort the T-wave morphology of a UE (Stevenson and Soejima, 2005), yet to the best of our knowledge, there is still a lack of detailed study on its effects on RT estimation.

Activation mapping procedures are a source of electrograms, which are regularly performed with EAMs due to their clinical importance (Bhakta and Miller, 2008). Although the acquisition procedure is not primarily intended for research studies, it gives rise to a large set of simultaneously recorded bipolar and unipolar electrograms from across the ventricles that could be used for further studies, such as constructing patient RT maps. Ethically, existing data should be reused if results can be obtained suitably without subjecting patients to further inconvenience and risk. The reuse of clinical data for different studies and multi-center collaboration is beneficial for research, with reduced time and cost for data collection and more widely available data. This is particularly important in the case of the epicardial data acquired via a percutaneous subxiphoid puncture procedure, which is not commonly preformed. However, although activation mapping relies mainly on bipolar electrograms, high-pass filtered UEs (default 2 Hz) assist in the annotation, for example by improving the detection of lower-amplitude local signals, where a high-pass filter with a frequency ≫ 2 Hz is sometimes used (Stevenson and Soejima, 2005). While such a filter may improve the activation map quality, it can introduce aforementioned unintended effects for RT estimation. Using

inverse filtering to obtain the original signal is not an option given the acquisition noise, especially for recursive filters.

A deep neural network (DNN) can learn a complex non-linear mapping between input and output data, and in our case, to predict the true RT from filtered signals. However, DNNs usually require a large amount of training examples with known labels. The lack of known RT labels makes applying DNN on clinical applications particularly challenging, but this can be resolved by using synthetic data from physiologically-informed mathematical models (Corral-Acero et al., 2020), as well as from data augmentation techniques for machine learning (Bizopoulos and Koutsouris, 2019).

In this article, we first study and highlight the error in estimating RT from a filtered UE using synthetic UEs filtered with the default CARTO high-pass filter. As the main focus of the article, we present our method to recover the RT from filtered UEs using a DNN trained with synthetic UEs based on a comprehensive range of AT, RT and patient variability. We show that our trained DNN performs better with ex-vivo human UEs compared to the Wyatt method. Finally, the trained DNN is applied to clinically recorded UEs, from which an RT map is computed.

# 2. Materials and methods

## 2.1. Clinical and ex-vivo UEs

### 2.1.1. Clinical patient UEs acquired by CARTO

We obtained 18 CARTO datasets with UEs recorded from both the ventricular endocardium and epicardium. The patients were 17 male and 1 female with age 40.5 ± 15.29 (mean ± standard deviation (s.d.)), all without structural heart disease. Their pathologies were 11 idiopathic ventricular fibrillation, 4 Brugada syndrome, 1 hypertrophic cardiomyopathy, 1 laminopathy and 1 arrhythmogenic right ventricular cardiomyopathy. UEs were 2500 ms in duration, and recorded at a sampling frequency of 1 kHz, with resolution of 0.003 mV. The mapping protocol was approved by the institutional review board, and all patients gave written informed consent before the EP procedures.

UEs were selected for analysis if the signal-to-noise ratio was > 10 dB, where the signal and noise power spectral densities were computed over the frequency intervals 1–40 Hz and 40–100 Hz, respectively. We also required that the cross-correlation between successive beats was > 0.9, and that the variation of cycle length between successive beats was no more than 20 ms. This procedure permitted 14.6% of the UEs, providing 7764 UEs in total. The three electrogram beats of each electrogram were then averaged to dampen any acquisition fluctuations.

The UEs showed variation in amplitudes, likely caused by differing contact during sequential acquisition. We normalized the amplitude by first shifting the UE such that its minimum point following the AT was at 0 mV, and the UE was then scaled such that the magnitude of the activation slope, the portion of the signal from the maximum before the AT to the minimum after, was set to 1mV. We also shifted all UEs to start at their AT, and clipped the UEs after 600 ms. The UEs were known to be filtered, even though the filter settings were not available to us. Numerical testing led us to assume that the high-pass filtering frequency was 2 Hz, the default configuration of the system; for more details see Appendix A.

### 2.1.2. Ex-vivo patient UEs

Experimental UEs were obtained from three explanted human hearts, one diagnosed as hypertrophic, another with prior myocardial infarction, and one healthy. Procurement and use of human donor hearts with informed consent from family members were approved by the National Biomedical Agency and in a manner conforming to the declaration of Helsinki. Donor hearts were procured
at the Bordeaux University Hospital and transported in ice cold cardioplegia to the laboratory.

The aorta was cannulated and the heart perfused in Langendorff mode with Tyrode's solution containing (mM) NaCl, 128; NaHCO₃, 28; NaH₂PO₄, 0.5; MgCl₂, 0.7; glucose, 11; KCl, 4.7; CaCl₂, 1.5. The solution was oxygenated with 95%/5% O₂/CO₂ and kept at pH 7.4, temperature 37°C. An epicardial electrode sock (108 electrodes) was attached to the heart and UEs recorded during sinus rhythm at 2 kHz (BioSemi, the Netherlands), referenced to an electrode in the aortic root. Sock channels in which electrodes were in good contact with minimal noise were immediately evident on visual inspection and used in this study.

## 2.2. Synthetic patient UEs

Since we did not have a set of ground-truth measurements of RTs for the CARTO-acquired UEs, we needed to generate a large set of synthetic data. For this, we constructed a comprehensive set of UE morphologies, corresponding to early and late, activation and repolarization.

First, patient-specific reference signals which formed the basis of the UE models, were computed using the data from each of the 18 patients (2.2.1). Then, in order to create a patient population from our cohort of only 18 patients, we used a data augmentation technique to generate new reference signals, each corresponding to a new patient physiology (2.2.2); this has the effect of interpolating between the patient's physiologies. From these reference signals, a wide range of UEs were computed (2.2.3), which were used to train a DNN.

### 2.2.1. UE model

Our method for generating patient-specific UE morphologies was based on the UE model described in Potse et al. (2009) and validated in Orini et al. (2018). This model creates an UE as the difference between a local action potential with known AT and RT, and a global reference signal characterized by global conduction properties. The model first fit action potential templates with ATs and RTs estimated from the CARTO UEs at sites across the ventricles. We used the sigmoid-based function and parameters published in Orini et al. (2018), given by the following:

$$AP_i(t) = A \frac{1}{1 + e^{-\beta_{AT}(t - \tau_{AT_i})}} \cdot \left( 1 - \frac{1}{1 + e^{-\beta_{RT}(t - \tau_{RT_i})}} \right) - V_{rest}, \quad (1)$$

where $\tau_{AT_i}$ and $\tau_{RT_i}$ are the AT and RT, respectively, and the parameters $\beta_{AT} = 0.25$ and $\beta_{RT} = 0.02$ control the slope of the activation and repolarization of the action potential. We fixed the parameters $A = 1$ and $V_{rest} = 0$ since our UEs were normalized.

A reference signal was calculated for the patient as the average of the set of action potentials. That is,

$$\mathrm{Ref}(t) = \frac{1}{N} \sum_{i=0}^{N} AP_{i}(t). \qquad (2)$$

Finally, a UE signal with a given AT and RT was computed by the following, omitting the scaling terms used in Orini et al. (2018):

$$UE_i = \mathrm{Ref}(t) - AP_i(t), \qquad (3)$$

### 2.2.2. Augmented reference signals

To model a population of patients rather than a few specific patients, we performed data augmentation to increase the number of reference signals with Principal Component Analysis (PCA) (Bishop, 2006). PCA finds a linear projection to a low-dimensional subspace of the reference signals such that the variances of datapoints are maximized on the preserved axes. Particularly, the explained variance ratio, defined by the percentage of preserved summed variances over the total summed variances, shows how

<figure><img src="image_4.png" /><figcaption>Fig. 1. Panel (a): The reference signals of our 18 patients characterized by two (arbitrary units (a.u.)) parameters, form an envelope (blue shade) as well as a hull (enclosed by blue lines). Sub-panels: analysis of the PCA-reduced subspace of the reference signals, with the two-dimensional PCA coordinates indicated in the legend. (b) Sample signals showing that changing the x-axis of the reduced space corresponds to a change of downward slope of the reference signal. (c) Sample signals showing that changing the y-axis of the reduced space corresponds to a change in the duration of the reference signal. (d) Sample signals from within the envelope. (e) Sample signals from the hull but not in the envelope. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

much information of the datapoints have been preserved using the low-dimensional representation. By sampling new datapoints from the subspace and inverting the projection, new reference signals could then be generated.

Since the explained variance ratios for preserving one and two dimensions with the largest variances were 98% and 99%, respectively, we projected the 600-dimensional reference signals to only two dimensions. The two-dimensional representation of our 18 patients points formed an enclosed envelope-shaped boundary (blue shaded region in Fig. 1(a)), defining a particular region to sample valid synthetic reference signals from.

The two dimensions of the PCA-reduced subspace, as shown in Fig. 1, correspond to the duration and the downward slope of the reference signals, respectively. We also noticed that signals sampled from the hull, but not in the envelope (the purple dots in panel (a) of Fig. 1 and the signals in panel (e)), showed a morphological feature not present in our data. Therefore, we chose to draw 32 samples uniformly from the enveloped region (black dots in panel (a)), and inversely transformed these samples to the 600-dimensional original space, to form an augmented set of reference signals so that our PCA-augmented patient cohort had a
uniform distribution in the durations and the downward slopes of the reference signals. This data augmentation technique improved the generality of the training data and made training a DNN possible.

### 2.2.3. Computing UEs from the augmented reference signals

For each of the 32 augmented reference signals, we then computed 625 UEs over a range of 25 ATs and 25 RTs using the model described in Section 2.2.1, yielding 20,000 UEs for the training dataset. For very extreme RTs, the morphologies of the UEs changed very little. Hence, to avoid any redundancy in the morphologies, the range of RT was restricted such that the absolute amplitude of the T-wave was within 50% of the amplitude of the reference signal. Similarly, the AT range was a non-linear distribution centered at the mid-point of the upstroke of the reference signal with a width of 60 ms, where fewer points occurred near the edges of the distribution. The RT of each UE was estimated via the Wyatt method, which was considered to be the true RT. Each set of computed UEs was then filtered, where the details of the filter are described in Appendix A.

We normalized the training UEs in the same way as the CARTO UEs. The UEs were then also clipped such that each started at the AT and had a duration of 600 ms. Note that given the normalized convention of our DNN, we estimated RT relative to AT, and hence, more accurately, the time associated with RT should be referred to as activation recovery interval (ARI), i.e. the interval between AT and RT. However, we are interested in the location of the point of repolarization within the signal rather than the particular timing, and so, we refer to the point as RT (local RT).

### 2.2.4. Synthetic patient UEs validation

The morphologies of the training UEs are assumed to be physiologically realistic. Although the reference signals described above were based on CARTO patient datasets, having only filtered CARTO datasets available for constructing the reference signals meant we could only approximate the input AT and RT distributions. Comparing the morphologies of the training UEs with the CARTO UEs used to construct the UE model would therefore indicate whether each of the CARTO UEs was well represented in the training set, and that the model is able to produce physiologically-reasonable morphologies. In our case, the UE model requires only a general distribution of AT and RT, but not necessarily accurate estimations.

### 2.3. A DNN to estimate RT distribution

After examining the morphologies of synthetic raw and filtered UEs, we noticed a consistent deformation of the morphology, and thus decided to use a DNN to estimate the RTs from filtered UEs.

Performing a regression task that maps a 600 ms signal to a single point value (RT) would unavoidably provide undesirable results that fall out of the range of 0 to 600 ms. Instead, we formulated our problem as a classification task, where the prediction target was the $t^{th}$ class among 500 classes corresponding to $RT = 50, 51, ..., 549$ ms. This way, the DNN was not only guaranteed to predict RT in a valid range, but also produced a probabilistic prediction representing the uncertainty of the prediction.

Our architecture for the DNN was a multi-layer perception classification network which followed recommendations of Goodfellow et al. (2016), and is illustrated in Fig. 2. We started with a simple fully-connected layer that took an input of size 600 and produced a hidden layer of size $n_h$, where $n_h$ was a parameter to be determined. To help generalize the DNN, we introduced a dropout layer that randomly switched off nodes with a probability of 50% to prevent over-fitting, where 50% is a simple choice recommended by Srivastava et al. (2014). The next layer was a Rectified Linear Unit (ReLU), which provided a necessary nonlinearity to the

network, and has been successfully applied in many modern DNNs (Goodfellow et al., 2016). This was then followed by another fully-connected linear unit with input size $n_h$ from the activation layer. To allow for more complexity in the network, this middle section consisting of a dropout, a ReLU and a fully-connected layer, formed a repeated section. The output of the final fully-connected layer was fed back to the dropout layer at the start, where the parameter $cp$ determined the number of these repeated components, and the output size of the final fully-connected layer in the repeated section was 500. Finally, a softmax layer was added to produce a 500-dimensional vector as the DNN output. This output acted as the probability distribution for our RT estimation, representing the probabilities of RT falling between 50 to 549 ms after AT.

To establish the hyper-parameters $n_h$ and $cp$, we trained the DNN using a 10-fold cross-validation on our synthetic data, which meant for each of the 10 splits, 9 folds of data were used as the training set, while the remaining fold was used as the validation set. We ensured that the training and validation sets in each split did not share signals coming from the same patient. The optimum $n_h$ and $cp$ were then used to train the DNN on the full training set. We used a one-hot encoding to transform the ground-truth RT into a 500-dimensional vector with the corresponding entry being 1 and others being 0. We computed cross entropy between the ground-truth RT and the DNN output as the loss. An AdaMax optimizer (Kingma and Ba, 2014) with a learning rate of 0.001 was used to update the weights of the DNN layers.

The DNN was implemented in Python using the PyTorch package (version 1.2.0) (Paszke et al., 2019), and configured to run on a graphical processing unit (GPU) via CUDA (version 10.2). It took around 2h for each split to train on the Nvidia Quadro M4000 GPU.

### 2.4. RT and confidence estimation from DNN output

After having obtained the probability distribution from the output of the DNN, additional steps were needed for the final RT estimation since the probability distribution contained one or more peaks. An additional problem was the occurrence of singular spikes with large probability but narrow distribution. These likely resulted from over-fitting the DNN, where the corresponding RT prediction was supported by only a few training examples. We overcame this with the assumption that our probability distribution could be approximated by a Gaussian Mixture Model (GMM) (Bishop, 2006), in which data samples were assumed to be drawn from $N_{GMM}$ weighted Gaussian distributions. The mean and the variance of each Gaussian represents an estimated RT and the estimation uncertainty. Weights of $N_{GMM}$ Gaussians represent votes by the GMM, all of which sum up to 1. Selecting the mean of the Gaussian with the highest weight amounts to selecting the most likely RT estimation suggested by the probability distribution outputted from the DNN, therefore moderating the impact of the spikes appropriately.

Specifically, we drew 1000 samples from each probability distribution using a Monte Carlo approach, and used a GMM to fit drawn samples. The choice of $N_{GMM}$ was made by using the algorithm in Appendix B, and the mean, variance, and weight of each Gaussian distribution in the GMM were optimized to maximize the likelihood of these samples using the expectation-maximization method. The estimated RT was chosen as the mean of the Gaussian distribution with the maximal weight, and the s.d. of the probability distribution provided a confidence interval (CI) for the estimation. The PCA and GMM were implemented by the scikit-learn package (version 0.22) (Pedregosa et al., 2011).
<figure><img src="image_5.png" /><figcaption>**Fig. 2.** The architecture of the DNN. The input is a UE of duration $n_{in} = 600$ ms, and the output is a $n_{out} = 500$-dimension probabilistic distribution (Prob.).</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Fig. 3.** Standard UE morphologies for given ATs and RTs, where the raw signals are shown in orange and the filtered signals in blue. AT increases from left to right, and RT increases from top to bottom. The corresponding RTs estimated using the Wyatt method (WM) are shown as vertical bars for each signal. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

# 3. Results

## 3.1. Filtering impact on RT estimation using the Wyatt method

We start by demonstrating the qualitative effects of filtering to RT estimation with respect to different UE morphologies.

Nine different synthetic UE<sub>Raw</sub> and UE<sub>Filtered</sub> UE morphologies with different combinations of AT and RT are shown in Fig. 3. The UE<sub>Raw</sub> were high-pass filtered giving UE<sub>Filtered</sub> (in blue) (see Appendix A for filtering details).

In each case, for the UE<sub>raw</sub> (in orange), the peak and area of the QRS interval of the UE is correlated with AT, and the peak and area of the T-wave are inversely correlated with the RT, which is consistent with Orini et al. (2018) and Potse et al. (2009). The ST segment of UE<sub>filtered</sub> following the activation is elevated for the early AT and depressed for the late AT. The filtering tends to attenuate the amplitude of the T-waves, but the QRS phase of the UE is generally unaffected. In several cases, the T-wave becomes biphasic, except for panel (f), where the biphasic T-wave becomes positive. For this

case, the true RT prediction lies on the upstroke of the T-wave in UE<sub>Raw</sub>, yet the peak in UE<sub>Filtered</sub>.

The UE<sub>Filtered</sub> with early RTs all show new positive deflections near the end of the signal that are not present in the UE<sub>Raw</sub>. For the case of early AT in panel (a), this leads to a spurious RT prediction, and the largest RT error of the set. Panels (b) and (c) show that as AT increases, the predictions are unaffected by the filtering. However, in the presence of noise, the deflection could also be misinterpreted as the RT.

In Fig. 4 we show a comprehensive overview of RT estimation error by the Wyatt method for the high-pass filters of frequencies 0.5 Hz, 1 Hz, 2 Hz and 4 Hz, which are the four lowest frequency settings available for the CARTO high-pass filter after 0.05 Hz. The error was defined as the RT estimated from UE<sub>Filtered</sub> minus the RT estimated from UE<sub>Raw</sub>. The mean of the set of 18 patient error maps is shown for each UE<sub>Filtered</sub> arranged according to its AT and RT. The distribution of errors can be seen in the box plot below it.

For all four of the frequencies that we studied, the errors were mostly negative. The frequency 0.5 Hz was the smallest that we
<figure><img src="image_7.png" /><figcaption>**Fig. 4.** Effects of filtering on RT estimation errors for the four lowest CARTO high-pass filter frequencies after 0.05 Hz: 0.5 Hz, 1 Hz, 2 Hz (default) and 4 Hz. **Top:** Over- (red) and under- (blue) estimation of RT (ms) from filtered UEs with the Wyatt method. **Bottom:** Box plots showing the error distribution (Error dist.) of RT estimated from filtered UEs for each high-pass filter frequency. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

studied, which yielded errors with median -6.25 ms and interquartile range (IQR) 3.06 ms. In the case of the 1 Hz frequency filter, the errors were again mostly negative with median -11.5 ms and IQR 7.75 ms, but exhibited outliers up to 108 ms. The 2 Hz frequency is the default CARTO frequency and is the focus of this study. The median error was -29.5 ms with IQR 33.34 ms. The magnitude of RT estimation errors ranged up to 212 ms, for example for early AT and early RT, and for late AT and mid RT, which correspond to panels (a) and (f) of Fig. 3, respectively. The 4 Hz frequency was the largest that we studied, yet the CARTO system has the option of high-pass frequencies up to 30 Hz. For 4 Hz, the median and IQR were -29.38 ms and 71.58 ms, with errors ranging up to a magnitude of 248 ms.

## 3.2. UE model validation

We measured the ability of the UE model to reproduce the CARTO training UEs that were used to build the model. A measure was calculated for each CARTO UE as the maximum correlation coefficient between the CARTO UE and each training UE. The mean of these correlation coefficients across the 7764 UEs was 0.911 with s.d. 0.069. This generally high correlation shows that the training UEs were able to represent physiological UEs.

## 3.3. DNN validation performance

To decide the architecture of the DNN, we trained DNNs with hidden layers $n_h = \{50, \dots, 150, 160\}$ and for components $cp =$

<caption>**Table 1**</caption>

Absolute ms error in RT prediction across all 10-fold splits on synthetic UEs for parameters $n_h$ and $cp$. The minimum error in bold is our architecture choice.

<table><thead><tr><th rowspan="2"></th><th rowspan="2"></th><th colspan="3">n<sub>h</sub></th></tr><tr><th>140</th><th>150</th><th>160</th></tr></thead><tbody><tr><td rowspan="3">cp</td><td>1</td><td>3.182 ± 3.103</td><td><strong>2.733 ± 2.701</strong></td><td>2.913 ± 2.861</td></tr><tr><td>2</td><td>2.999 ± 3.028</td><td>2.865 ± 3.518</td><td>2.749 ± 3.731</td></tr><tr><td>3</td><td>3.593 ± 4.918</td><td>2.946 ± 4.102</td><td>3.072 ± 4.444</td></tr></tbody></table>

<figure><img src="image_8.png" /><figcaption>**Fig. 5.** The distributions of RT estimation errors for the testing ex-vivo UEs when computed using our DNN (absolute error mean= 31.47 ms, median= 16.91 ms, s.d.= 44.59 ms) and the Wyatt method (WM) (absolute error mean= 143.05 ms, median= 182.0 ms, s.d.= 120.25 ms).</figcaption></figure>

$\{1, 2, 3\}$. In the setting of 10-fold cross-validation as described in the method, we took the mean of the absolute validation errors from all 10 splits, and the epoch corresponding to the minimum of these averaged errors was considered the optimum epoch. The DNN was then trained with the full training set for this optimum number of epochs. The validation error for the particular architecture was then calculated as the absolute error between the true RT and the DNN-predicted RT. Table 1 shows the mean absolute error and s.d. for network architectures applied to the validation set across all 10-fold splits. The architecture with the minimum error (in bold) from our experiments, which corresponds to $n_h = 150$ and $cp = 1$, was used for our DNN, for which the optimum number of epochs was 4900.

## 3.4. DNN testing performance and its applications

### 3.4.1. Ex-vivo UEs

The performance of the DNN was evaluated on the ex-vivo human UEs described in Section 2.1.2. As we had the unfiltered UEs, true RTs were computed using the Wyatt method, and the filter in Appendix A was applied to the ex-vivo UEs to form the testing set. We then applied our DNN-based method to the 102 filtered testing UEs to obtain the RT and CI estimation, and also the Wyatt method for comparison.

Our DNN-based method outperformed the Wyatt method in 62.75% of cases, and had significantly lower absolute errors than the Wyatt method (with $31.47 \pm 44.59$ ms compared to $143.05 \pm 120.25$ ms, t-test reporting $p = 8.99E-13$), with the distribution of errors for both methods shown in Fig. 5. Using the Wyatt method, RT was overestimated in three-quarters of the ex-vivo
<figure><img src="image_9.png" /><figcaption>**Fig. 6.** Four examples of raw ex-vivo testing UEs (orange), that were filtered (blue), and their corresponding RT predictions using the Wyatt method (WM, diamonds), the DNN probability distribution (red solid line), the predicted RT (dashed red line) and the CI (red shaded area). (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

UEs, whereas using our method, there was no systematic bias towards over- or under-estimation of RT.

The RT predictions of the ex-vivo UEs had relatively small CIs, with mean 12.49 ms and s.d. 21.34 ms. Among all the RT predictions, 21.57% were within 1 CI and 37.25% were within 2 CIs of the true RT.

Examples of the DNN applied to four UEs with different AT and RT combinations are shown in Fig. 6. In each case, the filtered signal $UE_{Filtered}$ that formed the DNN input, and the probability distribution $DNN_{Prob}$, produced by the DNN, are shown, alongside the RT estimation $RT_{DNN}$ and its CI. Fig. 6 also displays the corresponding raw signal $UE_{Raw}$, and the true RT, $RT_{WM(true)}$. For direct comparison, the Wyatt method prediction $RT_{WM}$ from $UE_{Filtered}$ is also shown. Compare these examples with panels (a), (g), (e) and (f) in Fig. 3. The DNN prediction $RT_{DNN}$ outperformed $RT_{WM}$ from the filtered UE in all cases. In the cases of panels (a) and (d), $RT_{WM}$ was a particularly poor estimation with errors of ≈ 180 ms, which is consistent with the regions of largest error in the 2 Hz panel in Fig. 4.

### 3.4.2. Clinical CARTO UEs

We applied the trained DNN to epicardial CARTO UEs of a patient (male, 51, idiopathic ventricular fibrillation). The mean RT of the 1572 UEs that we tested was 310.45 ms with s.d. 94.47 ms. These UEs exhibited far more noise and variability than the ex-vivo UEs. Consequently, the DNN predictions had a larger CI, with mean 44.83 ms and s.d. 51.29 ms. Additionally, the probability distributions showed alternative predictions with less confidence.

Although the true RT is not known for these UEs, we were able to recognize examples of UEs that exhibit the morphologies shown in the catalog summarized in Fig. 3, and saw that the predicted value was in agreement with the region of the predictions in the catalog. Fig. 7 shows four examples of CARTO UEs normalized as described in Section 2; compare these morphologies with panels (a), (c) (d) and (e) of Fig. 3. The panels in the top row of Fig. 7 both

<figure><img src="image_10.png" /><figcaption>**Fig. 7.** CARTO filtered UEs (blue) and the corresponding RT prediction using Wyatt method (WM, diamond), the DNN probability distribution (red solid line), the predicted RT (dashed red line) and the CI (red shaded area). (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

predict RT ≈ 200 ms but also an alternative lower-probability prediction around 400 ms. These alternatives reduce the certainty of the prediction and cause the CI to become wider. The GMM correctly selected the highest peak as the RT estimation when the distribution contained multiple peaks as in these panels.

To show the potentials of our methods, we generated a ventricular ARI map, by projecting the RT estimated using the DNN to the CARTO epicardial mesh and interpolating using Gaussian kernel smoothing. The anterior and posterior views are shown in Fig. 8. The electrode locations are indicated in the maps as points, which show a reasonable distribution, where the mean closest-nearest-neighbor distance was 1.86 mm. The corresponding CI was also mapped to the epicardial mesh, and is shown beneath the ARI map. From this map, clinically relevant features can be analyzed directly, for example, the magnitudes of the spatial repolarization gradients of this map were distributed with median 2.79 ms mm⁻¹ and IQR 4.89 ms mm⁻¹.

## 4. Discussion

### 4.1. The impacts of filtering on UEs

We highlighted the consequence of erroneously applying the Wyatt method to estimate RT from filtered UEs. We showed that even a modest cut-off frequency can have significant adverse effects on RT as computed by the Wyatt method. The filtering tends to have little effect on the QRS phase of the UE that is typically composed of higher frequencies, but the T-wave phase, composed of lower frequencies, becomes distorted. We showed that a UE filtered by a high-pass filter can lead to a noticeable error when estimating RT with the Wyatt method, depending on both the AT and RT of the UE.

Choosing a less impacting lower high-pass filter frequency is an option for the CARTO acquisition system. However, when using a high-pass filter frequency of 0.05 Hz, baseline wander still
<figure><img src="image_11.png" /><figcaption>**Fig. 8.** Ventricular epicardial ARI map (top row), and corresponding CI map (bottom row). The marked points indicate the electrode positions. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

persists due to effects such as respiration (0.2–0.5 Hz in patients aged ≥ 65 Rodríguez-Molinero et al., 2013). Without imposing a higher-frequency filter, the resulting large deviations in amplitude can lead to measurement error and amplifier saturation.

Although high-pass filtering is known to distort the T-wave, during activation mapping procedures, a high frequency (>> 2 Hz) high-pass filter can be used to eliminate far-field components of UEs that can obscure low-amplitude recordings from abnormal regions (Stevenson and Soejima, 2005). Such procedures provide a reliable and extensive source of retrospective UEs, which would be appropriate for reuse in further RT studies if the filtering was minimal (given that the data was acquired reliably and it is suitable for the intended study). However, CARTO's highly-distorting, yet seemingly low default filter frequency of 2 Hz led us to believe that the effects of filtering could be overlooked. In addition, the datasets appeared to give no details of the filter setting used at acquisition, hence, without direct confirmation from the acquisition team, these settings could not be known.

We have seen several studies that consider UEs that appear to exhibit distortions similar to the filtered UEs in our catalog, suggesting that the effects of filtering are under-acknowledged in the field. For example, Yang et al. (2018) used CARTO UEs in their study, where they presented an example UE with an ST elevation, which could be exaggerated by filtering. Although this may not be the case, the article provides no information about the filter settings that were used. In another example, Potse et al. (2014) constructed detailed models that were tuned to recreate recorded UEs. They were able to capture the activation phase of the signal, but their recorded UEs exhibited features characteristic of filtered UEs, such as an ST elevation, that their recreated UEs were not able to capture. In several cases, their recorded and recreated UE comparisons resembled examples from our catalog in Fig. 3.

The authors recognized the consistent ST-segment mismatch, but suggested that this difference was due to underestimation of the wall thickness. If filtering was an issue, repeating the study with minimally-filtered UEs should produce a better match of the repolarization phase of the UEs.

Even if filter settings are known, trying to reverse the filter relies on amplifying low-amplitude components of the signal, which could also amplify signal noise. Mizuhiki et al. (2020) overcame this issue by first averaging signals with their close neighbors to attenuate any noise before reverse-filtering, but given the sparsity of the CARTO data, the spatial morphological variation was too large for this to be an option. For some patients, the option of re-performing a clinical procedure with broader filter settings for future studies exists. Endocardial recordings are frequently performed and new minimally-filtered data could be analyzed. However, the percutaneous subxiphoid puncture that yields the epicardium data (Sacher et al., 2010) is an invasive procedure and is not routine. This makes the epicardial data uncommon and hard to obtain, and hence, any existing epicardial data is very valuable.

## 4.2. A DNN approach to estimate the RT distribution from filtered UEs

We adopted a DNN to learn the mapping from different combinations of AT and RT to the resulting filtered UE morphology. By matching the morphology of the signal, the DNN was able to capture ground-truth RT, which, in our training set, was calculated by the Wyatt method. However, the labeling of RT is independent of the DNN architecture, thus, other RT estimation methods can also be applied.

The key to applying the DNN successfully was to perform supervised learning over a large variety of training data. However, we had access to only a small number of CARTO datasets to use as training examples, and of these their true RTs were not known. Modeling tools allowed us to generate a virtual patient cohort of synthetic yet physiologically-realistic UEs, across a range of clinically observed AT and RT. The DNN was, thus, trained with the synthetic UEs.

The ATs and RTs from each of the CARTO UE datasets were used to model the patient, from which a set of synthetic UEs could be computed. Although not in exact accordance with the model in Potse et al. (2009), our validation step showed that the UEs nevertheless proved sufficiently physiological to form the training dataset. These UEs depended on the model's reference signal that characterizes patient-specific electrophysiology. To ensure a reasonable electrophysiological variability in the training set from only 18 patients, we generated a larger set of synthetic reference signals sampled uniformly from a two-dimensional PCA-reduced subspace of the reference signals, which we constrained to lie within the envelope of the measured points representative of our patient characteristics. In this way, we generated an augmented set of synthetic data representative of a larger patient group, consequently improving the generality of our training data. The training example UEs were generated for each reference signal, where the “true” RTs were first calculated from these raw UEs using the Wyatt method before the UEs were filtered. Since each synthetic UE was computed from an associated action potential template, it would be straightforward to annotate RT directly from the action potential, rather than from the UE with the Wyatt method. However, we chose to estimate RT with the Wyatt method since this allowed us to apply the exact same setting in the ex-vivo testing UEs for evaluation.

We treated the RT estimation problem as a multi-class classification problem, which produces a probabilistic estimation of RT from the morphology of the UE, rather than just a single value prediction. From this, we could ensure that the RT estimations fell
within the time range of the UEs, and we could also obtain a measure of confidence in our prediction.

We chose to create synthetic UEs to mimic the 1 kHz sampling frequency of the CARTO UEs. Hence, the true RT was approximated to the nearest millisecond, and the distribution output from the DNN had the same resolution. This works well as a proof of concept, but our method can accommodate UEs with a higher sampling frequency. The dimension of output distribution can be increased, and a more refined true RT can be calculated from higher-resolution synthetic UEs. But in order to make the DNN applicable to CARTO UEs, these higher-resolution UEs would need to be downsampled as inputs to the DNN to match the CARTO sampling frequency.

### 4.3. Performance of the DNN approach

The testing performance on the ex-vivo UEs (3.4.1) showed that the DNN was clearly able to outperform the Wyatt method in 62.75% of the 102 filtered UEs, giving an absolute error with mean 16.91 ms and s.d. 44.59 ms. In the case of CARTO UEs, the true RT was not known as only filtered UEs were available. However, our CI map provides an indication of the DNN's ability to interpret the signal, based on whether the input morphology is well represented in the training data. The generally low values of the CI map indicates that the morphologies interpreted are fairly typical and that the DNN is certain of its RT predictions. The DNN can still be improved by more rigorously optimizing the DNN architecture choices, and implementing the true details of the CARTO filter. Furthermore, given that CARTO has a discrete set of 8 possible high-pass frequencies, a natural extension of this tool is to build a more comprehensive DNN using UEs filtered by the entire spectrum of 8 discrete CARTO high-pass frequencies. In this way, the exact frequency of the filter used in the acquisition would not be needed. In addition, the DNN could be trained with more diverse CARTO UEs, pathologies and noise settings in order to make the predictions more robust. A more extensive set of training UEs would also reduce the CI. As a future development, uncertainty measures which correlate with the regression error will be better CI candidates.

As seen in the raw UEs in the catalog (Fig. 4), the morphologies of the UEs were regular, and could be categorized according to their ATs and RTs. In addition, we were able to mimic the effects of the filtering (Appendix A), which were consistent and predictable. The DNN considers the morphology of the entire signal, and uses this extra regular information to make an informed RT estimation. Regardless of the filtering, this is a major benefit over the Wyatt method, since the estimation does not depend on a local feature that can be easily influenced by artifacts. For the DNN, the error induced by such artifacts is dampened by the morphology of the rest of the signal. If the rest of the signal is also distorted, this is reflected by a wide CI.

Although the purpose of the DNN was to overcome the distortion in CARTO UE morphologies by filtering, we emphasize that the method is not restricted to CARTO-acquired UEs, and that the same methodology can also be applied to other signal interpretation problems. In the simplest case, by re-annotating the training data, the method can be used to identify features other than RT, for example the peak or end of the T-wave. Furthermore, some acquisition-related issues other than filtering can also be modeled, learned and then corrected for as we have done here. For example, loss of contact between the electrode and the ventricle during acquisition results in a signal with a diminished amplitude, but it can be learned if this feature is consistent. Similarly, abnormal physiological conditions naturally lead to abnormal UEs. For example, ST elevation is commonly seen in UEs in particular regions in patients with Brugada syndrome (Mizusawa and Wilde, 2012), and record-

ings in or near regions of scar are atypical, yet, to some extent, these effects are consistent and predictable.

### 4.4. The computation of RT maps

We presented an example of an RT (ARI) map in Fig. 8 that was computed from CARTO UEs using the DNN. These UEs were acquired originally for AT map construction, hence, this example demonstrates how the CARTO acquisition system can be extended to generate both AT and RT maps from the same data without compromising the quality of the AT map. Since the UE recordings were acquired sequentially, the recordings did not always correspond to the same beat. Variability in the cycle length could lead to spurious variations in the RT estimations. Although this is not an issue for individual RT estimations, our UE selection process mitigated this factor in order to compare local estimations in the map. The quality of an interpolated map from UE features relies heavily on the spatial density of the recording sites and the quality of the local UEs. The recording sites are typically focused on regions of interest to reduce the procedure time, rather than dense uniform sampling. Although we had a reasonable spread of electrode sites, larger interpolation error is expected in regions of sparser electrodes. It is likely that the uninteresting regions are well behaved, and such behavior is captured sufficiently by the sparser sampling.

A major obstacle to reliable RT maps is the lack of a simple method to validate the RT map spatially. Although a detailed overview of expected ventricular activation patterns is available (Durrer et al., 1970), the activation pattern can vary significantly between individuals, and the equivalent for repolarization is still under debate and much less understood (Chauhan et al., 2006; Cowan et al., 1988; Franz et al., 1987; Opthof et al., 2014, 2016, 2017; Yuan et al., 2001). The CI map is representative of the quality of the UE; a low CI shows certainty to the estimations at the individual electrode sites, which are independent of the mapping techniques. Since minimizing the uncertainty has been part of the intuition behind the mapping procedure, the CI map could also be used to improve the efficiency in the catheter mapping process for constructing high-quality maps (Feng et al., 2017). Additionally, by combing interpolation error with the CI, although not a validation, an assurance of the quality of the RT map can be established.

The RT maps themselves can then be used to investigate ventricular electrophysiological abnormalities, in particular, via effective refractory period (ERP), which is a phase where a new action potential cannot be initiated in a previously excited cell. This can lead to regions of block, which play an important role in the onset of pro-arrhythmic re-entrant circuits (Mines, 1913). Clinically, ERP testing is time-consuming and highly impractical for generating maps. As the procedure duration is statistically correlated with the procedural complication rate (Cheng et al., 2018), such lengthy invasive testing with uncertain clinical impact would be ethically unacceptable. In general, RT has been shown to approximate ERP well (Chinushi et al., 2001; Lee et al., 1992). Although, there are scenarios where RT may lead to unreliable ERP estimations, for example where post-repolarization refractoriness occurs, for pathologies where this is uncommon, RT maps provide the most practical way of approximating ERP maps.

## 5. Limitations

Unfortunately, the full details of the CARTO filter were not available to us, and hence, throughout the article we used the filter described in Appendix A. Furthermore, the only obtainable filter details were the high- and low-pass frequencies of the filter used during acquisition, but the details of the filtering were not disclosed in the CARTO datasets.
## 6. Conclusions

Filtering of UEs is often necessary, but the distortion of the T-wave caused by the filter is significant even with light filtering. Although the reliability of the Wyatt method in estimating RT has been shown by previous studies, the presence of filtering can lead to errors larger than 210 ms for a high-pass frequency of just 2 Hz. This margin of error should be considered when estimating RT with the Wyatt method from UEs that are known to be filtered. But despite the UE filtering, the RT can still be accessed via our DNN-based method that estimates RT with a significantly lower error than the Wyatt method. By considering the morphology of the entire UE, our DNN approach is more robust than the Wyatt method, and can also provide a measure of estimation uncertainty. This leads to more reliable RT estimations and more accurate patient-specific RT maps.

## Declaration of Competing Interest

JD received modest consulting fees from Biosense Webster independently of this article.

## CRediT authorship contribution statement

**Peter Langfield:** Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Data curation, Writing - original draft, Writing - review & editing, Visualization, Project administration. **Yingjing Feng:** Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Data curation, Writing - original draft, Writing - review & editing, Visualization. **Laura R. Bear:** Data curation, Resources, Writing - original draft. **Josselin Duchateau:** Data curation, Resources, Writing - original draft, Writing - review & editing. **Emma Abell:** Resources. **Remi Dubois:** Resources. **Louis Labrousse:** Resources. **Julien Rogier:** Resources. **Meleze Hocini:** Resources. **Michel Haissaguerre:** Resources. **Edward Vigmond:** Funding acquisition, Conceptualization, Resources, Writing - original draft, Writing - review & editing.

## Acknowledgments

PL would like to thank Veronique Meijborg and Ruben Coronel for the discussions about the filtering of CARTO electrograms. This project was supported by the Leducq Foundation and GENCI computing resources, allocation A0080310517. This project has received funding from the European Union Horizon 2020 Research and Innovation programme "Personalised In-silico Cardiology (PIC)" under the Marie Skłodowska-Curie grant agreement no. 764738, and from the French Government as part of the "Investments of the Future" program managed by the National Research Agency (ANR), Grant reference ANR-10-IAHU-04.

## Appendix A

We studied a range of filter settings by considering the effects of the filter on synthetic UE morphologies that were constructed using the model in Section 2.2.1. The reference signal was based on the data from one particular patient, and the AT and RT ranges were chosen to display morphologically different features. These signals were then filtered, producing a catalog of UE morphologies. Specifically, we tested high-pass Butterworth, Chebychev I and II, elliptical (Cauer) and Bessel filters, with orders in the range [1,8], and the set of possible CARTO high-pass frequency options: 0.05, 0.5, 1, 2, 4, 8, 16, 30 Hz; the filter was then implemented using the Scipy function *lfilter* (Virtanen et al., 2020).

We found that the set of morphologies that most closely resembled the CARTO morphologies was a 2 Hz order-2 Chebychev II filter. The synthetic electrograms were generally minimally affected by a lowpass filter even at frequencies much lower than the CARTO choices, hence we opted to apply only a high-pass filter at 2 Hz. The minimum attenuation in the stopband was 5 dB.

## Appendix B

**Algorithm 1:** Pick the best $N_{GMM}$ for the given samples.

**Data:** Samples

**Result:** The best choice of $N_{GMM}$

$N_{GMM} := 1$;

Fit the samples with GMM with $N_{GMM}$ components;

**while True do**

Fit the samples with GMM with $N_{GMM} + 1$ components;

**Criterion**₁ := Bayesian Criterion Information of the GMM with $N_{GMM} + 1$ components is less than that of the GMM with $N_{GMM}$ components;

**Criterion**₂ := No CI of any two components in GMM with $N_{GMM} + 1$ components is overlap;

**if Criterion**₁ and **Criterion**₂ are both True then**

$N_{GMM} := N_{GMM} + 1$;

**else**

Return $N_{GMM}$;

**end**

**end**

Return $N_{GMM}$;

## References

Arevalo, H.J., Vadakkumpadan, F., Guallar, E., Jebb, A., Malamas, P., Wu, K.C., Trayanova, N.A., 2016. Arrhythmia risk stratification of patients after myocardial infarction using personalized heart models. Nat. Commun. 7, 11437.

Bhakta, D., Miller, J.M., 2008. Principles of electroanatomic mapping. Indian Pacing Electrophysiol. J. 8, 32.

Bishop, C.M., 2006. Pattern Recognition and Machine Learning. Springer.

Bizopoulos, P., Koutsouris, D., 2019. Deep learning in cardiology. IEEE Rev. Biomed. Eng. 12, 168–193.

Chauhan, V.S., Downar, E., Nanthakumar, K., Parker, J.D., Ross, H.J., Chan, W., Picton, P., 2006. Increased ventricular repolarization heterogeneity in patients with ventricular arrhythmia vulnerability and cardiomyopathy: a human in vivo study. Am. J. Physiology-Heart Circ. Physiol. 290, H79–H86.

Cheng, H., Clymer, J.W., Chen, B.P.H., Sadeghirad, B., Ferko, N.C., Cameron, C.G., Hinooul, P., 2018. Prolonged operative duration is associated with complications: a systematic review and meta-analysis. J. Surg. Res. 229, 134–144.

Child, N., Bishop, M.J., Hanson, B., Coronel, R., Opthof, T., Boukens, B.J., Walton, R.D., Efimov, I.R., Bostock, J., Hill, Y., et al., 2015. An activation-repolarization time metric to predict localized regions of high susceptibility to reentry. Heart Rhythm. 12, 1644–1653.

Chinushi, M., Tagawa, M., Kasai, H., Washizuka, T., Abe, A., Furushima, H., Aizawa, Y., 2001. Correlation between the effective refractory period and activation-recovery interval calculated from the intracardiac unipolar electrogram of humans with and without dl-sotalol treatment. Jpn. Circ. J. 65, 702–706.

Coronel, R., de Bakker, J.M., Wilms-Schopman, F.J., Opthof, T., Linnenbank, A.C., Belterman, C.N., Janse, M.J., 2006. Monophasic action potentials and activation recovery intervals as measures of ventricular action potential duration: experimental evidence to resolve some controversies. Heart Rhythm. 3, 1043–1050.

Coronel, R., Wilms-Schopman, F.J., Opthof, T., Janse, M.J., 2009. Dispersion of repolarization and arrhythmogenesis. Heart Rhythm. 6, 537–543.

Corral-Acero, J., Margara, F., Marciniak, M., Rodero, C., Loncaric, F., Feng, Y., Gilbert, A., Fernandes, J.F., Bukhari, H.A., Wajdan, A., Martinez, M.V., Santos, M.S., Shamohammdi, M., Luo, H., Westphal, P., Leeson, P., DiAchille, P., Gurev, V., Mayr, M., Geris, L., Pathmanathan, P., Morrison, T., Cornelussen, R., Prinzen, F., Delhaas, T., Doltra, A., Sitges, M., Vigmond, E.J., Zacur, E., Grau, V., Rodriguez, B., Remme, E.W., Niederer, S., Mortier, P., McLeod, K., Potse, M., Pueyo, E., Bueno-Orovio, A., Lamata, P., 2020. The 'digital twin' to enable the vision of precision cardiology. Eur. Heart J. 41, 4556–4564.

Cowan, J.C., Hilton, C.J., Griffiths, C.J., Tansuphaswadikul, S., Bourke, J.P., Murray, A., Campbell, R., 1988. Sequence of epicardial repolarisation and configuration of the t wave. Heart 60, 424–433.

Durrer, D., Van Dam, R.T., Freud, G., Janse, M., Meijler, F., Arzbaecher, R., 1970. Total excitation of the isolated human heart. Circulation 41, 899–912.
Feng, Y., Guo, Z., Dong, Z., Zhou, X.Y., Kwok, K.W., Ernst, S., Lee, S.L., 2017. An efficient cardiac mapping strategy for radiofrequency catheter ablation with active learning. Int. J. Comput. Assist. Radiol. Surg. 12, 1199-1207.

Franzone, P. C., Pavarino, L. F., Scacchi, S., Taccardi, B., 2007. Determining recovery times from transmembrane action potentials and unipolar electrograms in normal heart tissue. International Conference on Functional Imaging and Modeling of the Heart, Springer, 139-149.

Franz, M.R., Bargheer, K., Raffenbeul, W., Haverich, A., Lichtlen, P.R., 1987. Monophasic action potential mapping in human subjects with normal electrocardiograms: direct evidence for the genesis of the T wave. Circulation 75, 379-386.

Goodfellow, I., Bengio, Y., Courville, A., Bengio, Y., 2016. Deep Learning. 1. MIT Press Cambridge.

Han, J., de Jalon, P.G., MOE, G.K., 1964. Adrenergic effects on ventricular vulnerability. Circ. Res. 14, 516-524.

Han, J., Moe, G.K., 1964. Nonuniform recovery of excitability in ventricular muscle. Circ. Res. 14, 44-60.

Kingma, D. P., Ba, J., 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.

Kugelstadt, T., 2005. Getting the most out of your instrumentation amplifier design. Analog Appl. J. Q4, 25-30.

Lee, R.J., Liem, L.B., Cohen, T.J., Franz, M.R., 1992. Relation between repolarization and refractoriness in the human ventricle: cycle length dependence and effect of procainamide. J. Am. Coll. Cardiol. 19, 614-618.

Martin, C., Orini, M., Srinivasan, N., Bhar-Amato, J., Honarbakhsh, S., Chow, A., Lowe, M., Ben-Simon, R., Elliott, P., Taggart, P., et al., 2018. Assessment of a conduction-repolarisation metric to predict arrhythmogenesis in right ventricular disorders. Int. J. Cardiol. 271, 75-80.

Mines, G.R., 1913. On dynamic equilibrium in the heart. J. Physiol. 46, 349.

Mizuhiki, T., Setogawa, T., Shidara, M., 2020. Reverse-filtering on extracellular action potential for waveform analysis. Neurosci. Res. 160, 1-10.

Mizusawa, Y., Wilde, A.A., 2012. Brugada syndrome. Circ. Arrhythm. Electrophysiol. 5, 606-616.

Ophof, T., Janse, M.J., Meijborg, V.M., Cinca, J., Rosen, M.R., Coronel, R., 2016. Dispersión in ventricular repolarization in the human, canine and porcine heart. Prog. Biophys. Mol. Biol. 120, 222-235.

Ophof, T., Remme, C.A., Jorge, E., Noriega, F., Wiegerinck, R.F., Tasiam, A., Alvarez, J., Munoz, C., Cinca, J., Coronel, R., 2014. Repolarization in the isolated normal human heart. Heart Rhythm. 11 (May suppl), 11.

Ophof, T., Remme, C.A., Jorge, E., Noriega, F., Wiegerinck, R.F., Tasiam, A., Beekman, L., Alvarez-Garcia, J., Munoz-Guijosa, C., Coronel, R., et al., 2017. Cardiac activation-repolarization patterns and ion channel expression mapping in intact isolated normal human hearts. Heart Rhythm. 14, 265-272.

Orini, M., Taggart, P., Lambiase, P.D., 2018. In vivo human sock-mapping validation of a simple model that explains unipolar electrogram morphology in relation to conduction-repolarization dynamics. J. Cardiovasc. Electrophysiol. 29, 990-997.

Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., Chintala, S., 2019. Pytorch: an imperative style, high-performance deep learning library. In: Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., Garnett, R. (Eds.), Advances in Neural Information Processing Systems, 32. Curran Associates, Inc., pp. 8024-8035.

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Courneaupeau, D., Brucher, M., Perrot, M., Duchesnay, E., 2011. Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825-2830.

Potse, M., Krause, D., Kroon, W., Murzilli, R., Muzzarelli, S., Regoli, F., Caiani, E., Prinzen, F.W., Krause, R., Auricchio, A., 2014. Patient-specific modelling of cardiac electrophysiology in heart-failure patients. Europace 16, iv56-iv61.

Potse, M., Vinet, A., Ophof, T., Coronel, R., 2009. Validation of a simple model for the morphology of the T-wave in unipolar electrograms. Am. J. Physiology-Heart Circ. Physiol. 297, H792-H801.

Rodríguez-Molinero, A., Narvaiza, L., Ruiz, J., Gálvez-Barrón, C., 2013. Normal respiratory rate and peripheral blood oxygen saturation in the elderly population. J. Am. Geriatr. Soc. 61, 2238-2240.

Sacher, F., Roberts-Thomson, K., Maury, P., Tedrow, U., Nault, I., Steven, D., Hocini, M., Koplan, B., Leroux, L., Derval, N., et al., 2010. Epicardial ventricular tachycardia ablation: a multicenter safety study. J. Am. Coll. Cardiol. 55, 2366-2372.

Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., Salakhutdinov, R., 2014. Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 15, 1929-1958.

Stevenson, W.G., Soejima, K., 2005. Recording techniques for clinical electrophysiology. J. Cardiovasc. Electrophysiol. 16, 1017-1022.

Verduyn, S.C., Vos, M.A., van der Zande, J., Kulcsár, A., Wellens, H.J., 1997. Further observations to elucidate the role of interventricular dispersion of repolarization and early afterdepolarizations in the genesis of acquired torsade de pointes arrhythmias: a comparison between almakalant and d-sotalol using the dog as its own control. J. Am. Coll. Cardiol. 30, 1575-1584.

Virtanen, P., Gommers, R., Oliphant, T.E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S.J., Brett, M., Wilson, J., Jarrod Millman, K., Mayorov, N., Nelson, A.R.J., Jones, E., Kern, R., Larson, E., Carey, C., Polat, I., Feng, Y., Moore, E.W., Vand erPlas, J., Laxalde, D., Perk told, J., Cimrman, R., Henriksen, I., Quintero, E.A., Harris, C.R., Archibald, A.M., Ribeiro, A.H., Pedregosa, F., van Mulbregt, P., ContributorsS., 2020. Scipy 1.0: fundamental algorithms for scientific computing in python. Nat. Methods 17, 261-272.

Wang, C., Wang, L.I., Zhang, C., Cao, Z.Z., Luo, A.t., Zhang, P.h., Fan, X.r., Ma, J.h., 2016. Tolterodine reduces veratridine-augmented late INa, reverse-INCX and early afterdepolarizations in isolated rabbit ventricular myocytes. Acta Pharmacol. Sin. 37, 1432-1441.

Wyatt, R., Burgess, M., Evans, A., Lux, R., Abildskov, J., Tsutsumi, T., 1981. Estimation of ventricular transmembrane action potential durations and repolarization times from unipolar electrograms. Am. J. Cardiol. 47, 488.

Yang, T., Yu, L., Jin, Q., Wu, L., He, B., 2018. Activation recovery interval imaging of premature ventricular contraction. PLoS One 13 (6), e0196916.

Yuan, S., Kongstad, O., Hertervig, E., Holm, M., Grins, E., Olsson, B., 2001. Global repolarization sequence of the ventricular endocardium: monophasic action potential mapping in swine and humans. Pacing Clin. Electrophysiol. 24, 1479-1488.