# Nonlinear T-Wave Time Warping-Based Sensing Model for Non-Invasive Personalised Blood Potassium Monitoring in Hemodialysis Patients: A Pilot Study

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{*}

Next Article in Journal

Next Article in Special Issue

Next Article in Special Issue

Previous Article in Journal

Previous Article in Special Issue

Previous Article in Special Issue

Centre de Recerca en Enginyeria Biomèdica, Universitat Politècnica de Catalunya, 08028 Barcelona, Spain

CIBER en Bioingeniería, Biomateriales y Nanomedicina (CIBER-BBN), 50018 Zaragoza, Spain

Laboratorios Rubió, Castellbisbal, 08755 Barcelona, Spain

Escuela Superior de Ingeniería, Ciencia y Tecnología, Universidad Internacional de Valencia, 46002 Valencia, Spain

Nephrology Ward, Hospital Clínico Universitario Lozano Blesa, 50009 Zaragoza, Spain

BSICoS Group, I3A, IIS Aragón, Universidad de Zaragoza, 50018 Zaragoza, Spain

William Harvey Research Institute, Queen Mary University of London, London E1 4NS, UK

Author to whom correspondence should be addressed.

Academic Editor: Piotr Augustyniak

Received: 25 January 2021 / Revised: 16 March 2021 / Accepted: 30 March 2021 / Published: 12 April 2021

(This article belongs to the Special Issue Advances in ECG Sensing and Monitoring)

Background: End-stage renal disease patients undergoing hemodialysis (ESRD-HD) therapy are highly susceptible to malignant ventricular arrhythmias caused by undetected potassium concentration ([${K}^{+}$ ]) variations ($\mathsf{\Delta}\left[{K}^{+}\right]$ ) out of normal ranges. Therefore, a reliable method for continuous, noninvasive monitoring of [${K}^{+}$ ] is crucial. The morphology of the T-wave in the electrocardiogram (ECG) reflects $\mathsf{\Delta}\left[{K}^{+}\right]$ and two time-warping-based T-wave morphological parameters, ${d}_{w}$ and its heart-rate corrected version ${d}_{w,c}$ , have been shown to reliably track $\mathsf{\Delta}\left[{K}^{+}\right]$ from the ECG. The aim of this study is to derive polynomial models relating ${d}_{w}$ and ${d}_{w,c}$ with $\mathsf{\Delta}\left[{K}^{+}\right]$ , and to test their ability to reliably sense and quantify $\mathsf{\Delta}\left[{K}^{+}\right]$ values. Methods: 48-hour Holter ECGs and [${K}^{+}$ ] values from six blood samples were collected from 29 ESRD-HD patients. For every patient, ${d}_{w}$ and ${d}_{w,c}$ were computed, and linear, quadratic, and cubic fitting models were derived from them. Then, Spearman’s ($\rho $ ) and Pearson’s (r) correlation coefficients, and the estimation error (${e}_{d}$ ) between $\mathsf{\Delta}\left[{K}^{+}\right]$ and the corresponding model-estimated values ($\widehat{\mathsf{\Delta}}\left[{K}^{+}\right]$ ) were calculated. Results and Discussions: Nonlinear models were the most suitable for $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation, rendering higher Pearson’s correlation (median 0.77 $\le r\le $ 0.92) and smaller estimation error (median 0.20 $\le {e}_{d}\le $ 0.43) than the linear model (median 0.76 $\le r\le $ 0.86 and 0.30 $\le {e}_{d}\le $ 0.40), even if similar Spearman’s $\rho $ were found across models (median 0.77 $\le \rho \le $ 0.83). Conclusion: Results support the use of nonlinear T-wave-based models as $\mathsf{\Delta}\left[{K}^{+}\right]$ sensors in ESRD-HD patients.

Heart failure is among the most common cardiovascular complications in end-stage renal disease (ESRD) patients [1,2]. In hemodialysis (HD)-dependent ESRD (ESRD-HD) patients, the risk of cardiovascular mortality caused by electrical instability is 10- to 20-fold higher than in age- and gender-matched healthy subjects [3,4]. This remarkable association can be explained by the extreme fluctuations in blood potassium concentration ([${K}^{+}$]) occurring in between HD sessions [5,6]. These changes in [${K}^{+}$] are usually clinically silent and occur without warning to the patient or to the doctor in the absence of blood tests [7]. Therefore, continuous noninvasive monitoring of [${K}^{+}$] variations ($\mathsf{\Delta}\left[{K}^{+}\right]$) is of great importance [8] as it would provide risk warnings, improving an ever-growing clinical need.

The electrocardiogram (ECG) reflects the electrical activity of the heart in a non-invasive and inexpensive way. Electrocardiographic consequences of $\mathsf{\Delta}\left[{K}^{+}\right]$ are well known [9,10,11]: The earliest effects appear as narrowed and peaked T waves [12], followed by changes in the QT interval duration (or its corrected version, QTc) [13] and in repolarisation complexity [14]. Several studies in the literature have attempted to estimate [${K}^{+}$] through the analysis of T-wave morphology changes, quantified by features representative of the T-wave shapes, [15,16,17]. In previous studies [18,19,20,21,22], we proposed and investigated six T-wave morphological parameters quantifying T-wave morphology changes by means of time warping analysis [23] for continuous non-invasive $\mathsf{\Delta}\left[{K}^{+}\right]$ monitoring. These six T-wave morphology parameters included ${d}_{w}^{u}$, ${d}_{w}$, and ${\widehat{d}}_{w,c}$ (unsigned, signed, and heart rate corrected T-wave morphology variations in time, respectively), ${d}_{a}$ (T-wave morphology variations in amplitude), and their non-linear components (${d}_{w}^{\mathrm{NL}}$ and ${d}_{a}^{\mathrm{NL}}$) as described in [21,23]. In addition, we tested two lead space reduction techniques [20], principal component analysis (PCA) and periodic component analysis ($\pi $CA) [24], this later implemented in two different versions: By exploiting the complete QRST complex periodicity, $\pi {C}^{\mathrm{B}}$, or just restricting to the T-wave, $\pi {C}^{\mathrm{T}}$ [20]. This work [20] showed that ${d}_{w}$ and ${\widehat{d}}_{w,c}$ had the highest correlation with $\mathsf{\Delta}\left[{K}^{+}\right]$. They also showed that $\pi {C}^{\mathrm{T}}$ presented higher robustness against noise than PCA or $\pi {C}^{\mathrm{B}}$, making it the most suitable lead space reduction technique for $\mathsf{\Delta}\left[{K}^{+}\right]$ tracking during the HD session, as well as in the post therapy monitoring before the next HD session. Nevertheless, a quantitative relation between these T-wave morphological parameters derived from ECG analysis and $\mathsf{\Delta}\left[{K}^{+}\right]$ has not yet been established for clinical use, which would allow a non invasive measurement of $\mathsf{\Delta}\left[{K}^{+}\right]$ value.

The direct assessment of a marker as $\left[{K}^{+}\right]$ surrogate by Pearson correlation analysis implies the assumption of a linear relation between them. However, previous works have reported that the reconstruction of [${K}^{+}$] from the ECG significantly improves by employing a quadratic regression [16]. This result is compatible with the findings we reported in [20,21] where the same study population described in Section 2 was investigated according to the protocol in Figure 1. In Palmieri et al. [21], we observed a non-linear correspondence between $\mathsf{\Delta}\left[{K}^{+}\right]$ and the T-wave time warping biomarkers ${d}_{w}$ and ${\widehat{d}}_{w,c}$ (purple and green boxplots, respectively, in Figure 2 of the present study). Therefore, we hypothesised that using patient-specific nonlinear models based on T-wave time warping-derived markers can provide better quantitative assessment of $\mathsf{\Delta}\left[{K}^{+}\right]$. The aim of this study is to derive and to evaluate nonlinear polynomial sensing models to estimate $\mathsf{\Delta}\left[{K}^{+}\right]$ by using $\pi {C}^{\mathrm{T}}$-based markers, ${d}_{w}$ and ${\widehat{d}}_{w,c}$. As a reference, a patient-specific linear model is also estimated for each marker.

This paper is organised as follows. First, we describe the study population, a database recorded during the interdialytic interval between two HD sessions. We next expand on the methodology to calculate the T-wave morphology parameters, as well as the proposed models to monitor [${K}^{+}$] fluctuations from the ECG. Finally, we present and discuss the results, ending with conclusions and considerations for future research.

The ESRD-HD study population included 29 patients from the Nephrology ward at Hospital Clínico Universitario Lozano Blesa (Zaragoza, Spain). Inclusion criteria were (i) 18-year-old or older patients, (ii) being diagnosed with ESRD, and (iii) undergoing HD at least three times per week, with venous or cannula access. The study protocol was approved by the Aragon’s ethics committee (CEICA, ref. PI18/003) and all patients signed informed consent. All procedures and methods were performed in accordance with the Helsinki Declaration. Further details concerning the study protocol and clinical features of the study population can be found in [20,21]. A 48-h, standard 12-lead ECG Holter recording (H12+, Mortara Instruments, Milwaukee, WI, USA, sampling frequency of 1 kHz, amplitude resolution of 3.75 μV) was collected for each enrolled patient, with the acquisition starting 5 min before the HD onset and lasting until the next HD session, programmed 48 h later. Simultaneously, to determine [${K}^{+}$], a total of 6 blood samples were collected just before starting the HD and every hour during the HD session (5 in total), with a last extraction immediately before the next HD session (Figure 1). The current number of patients included in the database is still limited, hence this work should be interpreted as an exploratory pilot study.

In this section, the different steps required for the processing of the ECG signals are described and summarised in the block diagram presented in Figure 3.

Baseline wander was removed with a 0.5-Hz cut-off high-pass filter, implemented with a forward-backward 6-th order Butterworth filter [25]. Residual noise out of the T-wave band was removed with a 40 Hz cut-off frequency forward-backward 3-th order low-pass Butterworth filter. QRS complexes were detected and T-waves delineated using a wavelet-based single-lead delineation method applied to each of the 12 leads [26].

Periodic component analysis is a lead space reduction technique aiming to emphasise the periodic structure of a signal [24,27]. In this work, $\pi $CA was applied with a one-beat periodicity to maximise the T-wave beat-to-beat periodic components on the transformed signal, as explained in [20]. For each ECG recording, a transformation matrix ${\mathsf{\Psi}}_{\pi \mathrm{CA}}$ was estimated as detailed in [20], and applied to the 8 independent standard leads, obtaining a new set of 8 transformed leads, named periodic components. In this way and by ordering the transformed leads inversely to their associated eigenvalue, the most beat-to-beat periodic components appear projected onto the first component, $\pi C$1, which was selected for subsequent analysis and T waves were again delineated by using the above-mentioned delineator [26].

All T-waves from $\pi C$1 were further low-pass filtered at 20 Hz using a forward-backward 6-th Butterworth filter to remove remaining out-of-band frequency components. T-waves in 2-min wide windows centered around the 5-th minute and 35-th minute of each available hour were selected, from which a mean warped T-wave (MWTW) was computed from all T-waves in each window [21,23]. Finally, the two T-wave morphology parameters, ${d}_{w}$ and ${d}_{w,c}$, were computed by comparing each MWTW with respect to a reference MWTW, selected at the end of the HD session, resulting in relative markers to the reference point at the end of HD (${h}_{4}$ in Figure 1). A detailed description of the computation of the warping markers here analysed can be found in [21,23], describing how ${d}_{w}$ represents a relative measure of morphological changes between two T-waves. Likewise, ${\widehat{d}}_{w,c}$ is obtained from ${d}_{w}$ marker after being compensated for T-wave morphological changes not attributable to $\mathsf{\Delta}\left[{K}^{+}\right]$ but to heart rate changes occurring between the reference and analysis points [20,21].

The two proposed biomarkers, measured along time, have been associated with the corresponding relative variations in [${K}^{+}$] with respect to the [${K}^{+}$] at the reference point (${h}_{4}$), where a blood sample was taken:
being ${\left[{K}^{+}\right]}_{{h}_{i}}$ the concentration at the ${h}_{i}$-th time point (see Figure 1) and ${\left[{K}^{+}\right]}_{{h}_{4}}$ the reference concentration at the end of the HD treatment. The $\mathsf{\Delta}\left[{K}^{+}\right]$ distribution across patients for each hour is presented in Figure 2.

$$\mathsf{\Delta}\left[{K}^{+}\right]\left({h}_{i}\right)={\left[{K}^{+}\right]}_{{h}_{i}}-{\left[{K}^{+}\right]}_{{h}_{4}}$$

For a given patient p, the relationship between the marker $d\in \{{d}_{w},{d}_{w,c}\}$ and $\mathsf{\Delta}\left[{K}^{+}\right]$ measured along time was modelled by means of a linear (l), quadratic (q), and cubic (c) regression models for each patient to noninvasively calculate $\mathsf{\Delta}\left[{K}^{+}\right]$ values, according to the following models:
respectively. The coefficients ${\alpha}_{l}$, ${\alpha}_{q}$, ${\beta}_{q}$, ${\alpha}_{c}$, ${\beta}_{c}$, and ${\gamma}_{c}$ were estimated for each patient p and marker d by using a least square regression analysis between $\widehat{\mathsf{\Delta}}\left[{K}^{+}\right]$ and $\mathsf{\Delta}\left[{K}^{+}\right]$ values. For each patient and marker, the parameters of the three models were estimated with two different approaches: (i) By using all the available $\mathsf{\Delta}\left[{K}^{+}\right]$ values (“m = a”) and (ii) by adopting a leave-one-out cross validation (“m = o”) by excluding the ${h}_{i}$-th $\mathsf{\Delta}\left[{K}^{+}\right]\left({h}_{i}\right)$ value from the training-set and evaluating the prediction error at this ${h}_{i}$-th point, repeating this for all possible ${h}_{i}$ exclusions.

$${\widehat{\mathsf{\Delta}}}_{d}^{l}\left[{K}^{+}\right]\left({h}_{i}\right)={\alpha}_{l}\phantom{\rule{0.166667em}{0ex}}d\left({h}_{i}\right),$$

$${\widehat{\mathsf{\Delta}}}_{d}^{q}\left[{K}^{+}\right]\left({h}_{i}\right)={\alpha}_{q}\phantom{\rule{0.166667em}{0ex}}d\left({h}_{i}\right)+{\beta}_{q}\phantom{\rule{0.166667em}{0ex}}{d}^{2}\left({h}_{i}\right),$$

$${\widehat{\mathsf{\Delta}}}_{d}^{c}\left[{K}^{+}\right]\left({h}_{i}\right)={\alpha}_{c}\phantom{\rule{4pt}{0ex}}d\left({h}_{i}\right)+{\beta}_{c}\phantom{\rule{4pt}{0ex}}{d}^{2}\left({h}_{i}\right)+{\gamma}_{c}\phantom{\rule{4pt}{0ex}}{d}^{3}\left({h}_{i}\right),$$

Finally, to avoid physiologically meaningless ${\widehat{\mathsf{\Delta}}}_{d}\left[{K}^{+}\right]$ trends, the three models in Equations (2)–(4) were computed with a constrained parameter estimation in order to guarantee a monotonically increasing relationship between $\widehat{\mathsf{\Delta}}\left[{K}^{+}\right]$ and d, as physiologically expected and corroborated by the marker trend evolution in Figure 2 in this paper and in Corsi et al. [16] in Figure 2 and Figure 4. That was implemented by imposing:
which for positive values of the marker, $d>0$, implies ${\alpha}_{l}\ge 0$, ${\alpha}_{q}\ge 0$, ${\beta}_{q}\ge 0$, ${\alpha}_{c}\ge 0$, ${\beta}_{c}\ge 0$, and ${\gamma}_{c}\ge 0$. The case with $d<0$ is anecdotal, see Figure 2, and most likely is due to outliers, since they do not follow physiological interpretations of T-wave narrowing with increased potassium.

$$\frac{\partial {\widehat{\mathsf{\Delta}}}_{d}\left[{K}^{+}\right]}{\partial d}\ge 0,$$

Spearman’s rank and Pearson’s correlation coefficients ($\rho $ and r, respectively) were used for correlation analyses between $\mathsf{\Delta}\left[{K}^{+}\right]$ and ${\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]$, where $f\in \{l,q,c\}$ denotes the fitting model, $d\in \{{d}_{w},{\widehat{d}}_{w,c}\}$ the T-wave morphology parameter and $m\in \{a,o\}$ the estimation method. This analysis gives information about both the monotonic relation and the strength of the association between each modelled T-wave morphology parameter and $\mathsf{\Delta}\left[{K}^{+}\right]$, thus providing a more complete characterisation. In addition, for each patient p and hour ${h}_{i}$, an estimation error ${e}_{d,m}^{f}({h}_{i},p)$ was computed as:
where $i\in \{0,1,2,3,5\}$ is the set of hours where the computation of the estimation error is meaningful. Note that ${h}_{4}$ is the reference point where both $\mathsf{\Delta}\left[{K}^{+}\right]$ and ${\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]$ are equal to zero and therefore it is excluded from error computation to avoid a biased error evaluation. The value ${\widehat{\mathsf{\Delta}}}_{d,a}^{f}\left[{K}^{+}\right](p,{h}_{i})$ represents the estimation at time ${h}_{i}$ when training is done including all available ${h}_{i}$ hours values from the corresponding patient, while ${\widehat{\mathsf{\Delta}}}_{d,o}^{f}\left[{K}^{+}\right](p,{h}_{i})$ represents the estimate at hour ${h}_{i}$ when all but the ${h}_{i}$-th point of the patient are used in the training.

$${e}_{d,m}^{f}({h}_{i},p)=\left|{\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]({h}_{i},p)-\mathsf{\Delta}\left[{K}^{+}\right]({h}_{i},p)\right|$$

All statistical analyses were performed using MATLAB version R2019a and results are given as the median and interquartile range (IQR).

The median and IQR values of intra-patient Spearman’s ($\rho $) and Pearson’s (r) correlation coefficients, computed between $\mathsf{\Delta}\left[{K}^{+}\right]$, and ${\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]$, are given in Table 1. The same table also displays the median and IQR values of the errors ${e}_{d,m}^{f}(p,{h}_{i})$, pooling together all patients and all blood extractions (ALL), and segregated for hour ${h}_{0}$ and ${h}_{5}$.

Boxplots in Figure 4 show the estimation error ${e}_{d,m}^{f}(p,{h}_{i})$ distributions, sorted by hours ${h}_{i}$, using the linear (Figure 4a,d), the quadratic (Figure 4b,e), and the cubic (Figure 4c,f) models. In addition, the aggregated distribution for all hours is presented with the label (ALL). The widest error distributions are obtained for hours ${h}_{0}$ and ${h}_{5}$, whose median and IQR are given in Table 1. These time points are of great interest since: (i) The samples are the furthest from the reference (${h}_{4}$) and (ii) when they are estimated by using the leave-one-out (m = o) approach they do not have any temporarily close samples before (i.e., in case of ${h}_{0}$) and/or after (i.e., in case of ${h}_{5}$) as opposed to ${h}_{1}$, ${h}_{2}$, and ${h}_{3}$; this together with the fact that their associated marker values are also the farthest from the rest, Figure 2. Therefore, it seemed worthy performing a detailed hour-based error analysis.

An example of cubic modeling results for a given patient with and without parameter constriction for monotonic ${\widehat{\mathsf{\Delta}}}_{{d}_{w},o}^{c}\left[{K}^{+}\right]$ behaviour with d is presented in Figure 5. Results are given for no restrictions on $\{{\alpha}_{c},{\beta}_{c},{\gamma}_{c}\}$ (Figure 5a); by just imposing ${\alpha}_{c}\ge 0$ (Figure 5b); and by the full constrained model (${\alpha}_{c}\ge 0$, ${\beta}_{c}\ge 0$, ${\gamma}_{c}\ge 0$) (Figure 5c).

In this study, we analysed ECG signals from 29 ESRD-HD patients. We extracted T-wave morphology parameters, ${d}_{w}$ and ${\widehat{d}}_{w,c}$, previously reported to have a strong correlation with $\mathsf{\Delta}\left[{K}^{+}\right]$ [20,21]. Then, we proposed and compared, the use of linear, quadratic, and cubic regression models for $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation from ${d}_{w}$ and ${\widehat{d}}_{w,c}$ markers. The performance of each model was evaluated through Spearman’s and Pearson’s correlation coefficients of the estimated $\widehat{\mathsf{\Delta}}\left[{K}^{+}\right]$ with respect to actual $\mathsf{\Delta}\left[{K}^{+}\right]$ values and through hourly-based absolute estimation errors. The results on ESRD-HD patients here reported showed that non-linear regression models could be advantageously used to quantitatively estimate $\mathsf{\Delta}\left[{K}^{+}\right]$ and could, therefore, be an effective tool for remote, frequent, and noninvasive monitoring of ESRD-HD patients.

According to Spearman’s correlation coefficient ($\rho $) between measured and estimated variations in [${K}^{+}$], similar $\rho $ median values were found across the three models, with 0.06 being the highest median increment when moving from a linear to a cubic model for $d={d}_{w}$ in m = a and, thus, denoting an analogous monotonic relationship between real $\mathsf{\Delta}\left[{K}^{+}\right]$ and estimated values (${\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]$). On the other hand, an improvement can be appreciated when comparing Pearson’s correlation coefficient (r) evaluated in the three models, being the IQR reduced in $d={d}_{w}$ and m = a by 0.06 and 0.08 when comparing the quadratic and cubic models, respectively, with respect to the linear model. Similar considerations can be made for $d={\widehat{d}}_{w,c}$. This is an expected outcome since the models here proposed were designed to avoid distorting the original monotonic increasing relationship between $\mathsf{\Delta}\left[{K}^{+}\right]$ and the ECG derived markers, but only to adjust for the linear/non-linear relationship between them. However, the overall performance decreases considerably when the leave-one-out method, m = o, was used, being the median r lower and the IQR wider than in m = a. Also, for both ${d}_{w}$ and ${\widehat{d}}_{w,c}$ in m = o, a remarkable increase in the IQR can be observed when comparing linear and cubic models: From 0.47 to 0.61 for the first marker and from 0.34 to 0.45 for the second one. Overall, these findings seem to suggest that the cubic model does not provide any additional advantages to the linear or quadratic models in estimating $\mathsf{\Delta}\left[{K}^{+}\right]$ using the leave-one-out approach. Therefore, the results we observed for m = a could potentially be affected by over-fitting.

Another interesting observation can be made when comparing ${d}_{w}$ with ${\widehat{d}}_{w,c}$ in terms of r: For the linear model and m = a, a small gain is obtained by heart rate correction, which is more significant for m = o. However, this improvement for the heart rate corrected index ${\widehat{d}}_{w,c}$ vanishes in m = a when using the quadratic model or the cubic model getting even worse in m = o. This can also be a result of the over-fitting in these estimates, ${\widehat{d}}_{w,c}$ since it is already subjected to an heart rate correction estimation [21].

A reduction in the median and IQR estimation error for $d={d}_{w}$ in m = a results when hours and patients values are pooled together. The IQR decreases from 0.48 for the linear model to 0.34 for both the quadratic and cubic models. The median error goes from 0.30 in the linear model to 0.22 and 0.21 in the quadratic and the cubic models, respectively. An analogous trend can be found for $d={\widehat{d}}_{w,c}$ in m = a: IQR reduces from 0.50 in $f=l$ to 0.36 in $f=q$ and to 0.39 in $f=c$. However, for both markers, the improvements disappear when the leave-one-out method m = o is used, which would support the previously hypothesised over-fitting for m = a. These outcomes would point at the quadratic model as the most suitable model for $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation in m = a, as well as in m = o, even if in this latter case the advantage is not very remarkable. Moreover, as mentioned above, there is no clear benefit in using a cubic rather than a quadratic model in any of both m = a and m = o cases, probably due to the full constrained parameter estimation rule we imposed which, when applied to the cubic model, we observed it resulted in a very small cubic term, reducing to quadratic model as in Figure 5.

The most distant hours from the reference point (${h}_{0}$ and ${h}_{5}$ in this work) are the most interesting and challenging for $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation. Indeed, these two are the time points where the estimation errors are the highest and the error distributions are the widest, which is particularly true when they are taken out of the training set in the m = o case (red boxplot). That could be considered as an indication of the high uncertainty in predicting such values, especially when the values to be estimated do not have closer samples before and/or after, resulting in the wide IQR values reported for ${e}_{d,m}^{f}$ at ${h}_{0}$ and ${h}_{5}$, Table 1. In general, the IQR value for ${e}_{d,m}^{f}$ at ${h}_{0}$ decreases for ${d}_{w}/{\widehat{d}}_{w,c}$ in m = a from 0.77/1.03 for linear to 0.58/0.73 for quadratic and to 0.37/0.67 for cubic model (similarly for the median), but again these reductions vanish in m = o. Analogous considerations can be made for ${e}_{d,m}^{f}$ at ${h}_{5}$.

The results observed so far may lead to the conclusion that, according to the performance metrics r or ${e}_{d,o}^{f}$ considered, the observed improvement for quadratic model estimation in the case of m = a vanishes, or it is largely attenuated, in m = o. However, when analysing data distributions we realise that values of ${d}_{w}$ and ${\widehat{d}}_{w,c}$ markers are not evenly distributed in all the analysed range (see Figure 2). This fact can imply an overweight of small d values in m = o modelling, penalising the estimates at ${h}_{0}$ and ${h}_{5}$, which present d values that might not be well represented in the training set. This could also mean that the leave-one-out cross-validation needs to be cautiously framed when the value of d to be estimated is far from those used in the training set range, which in our dataset usually happens at ${h}_{0}$ and/or at ${h}_{5}$ as exemplified in Figure 6. In these cases, the estimation error between real $\mathsf{\Delta}\left[{K}^{+}\right]$ and ${\widehat{\mathsf{\Delta}}}_{d,o}^{f}\left[{K}^{+}\right]$ would be larger than the error with respect to ${\widehat{\mathsf{\Delta}}}_{d,a}^{f}\left[{K}^{+}\right]$. This could be due to the fact that when the training set consists of all the available d values (i.e., m = a), thus covering all the whole spanning range for that patient, the estimated coefficients make a proper modeling and $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation possible. However, if that range is not well represented (e.g., in m = o mainly for ${h}_{0}$ and ${h}_{5}$), then the estimated coefficients model well the range of low d values, but do not model well large d values outside that range, thus not being able to provide accurate estimates for high d values, resulting in inconsistent models and then in unreliable $\mathsf{\Delta}\left[{K}^{+}\right]$ estimation. This circumstance is particularly true for the cubic model rather than for the quadratic one, as a consequence of having an extra parameter to fit, then increasing the possibility of overfitting, obtaining divergent values outside the training range.

In the following, some limitations of our study are acknowledged. If blood samples had been collected more frequently during the early stage of the HD treatment when [${K}^{+}$] and, consequently, d more rapidly change—covering a broad range of values—then the model training set in m = o could have better represented all the possible cases of d in the quadratic as well as in the cubic model, and then the results could have been more conclusive for the non-linear modelling improvement in predicting [${K}^{+}$]. If this refined learning would have been done, or is done in future studies, it will, predictably, result in less error at the extreme times ${h}_{0}$ and ${h}_{5}$ of the process, and consequently also in a notably improved performance of the quadratic model both for m = a and for m = o.

Another limitation that should be taken into account when interpreting this work’s results is the lack of perfect time synchronisation between the actual $\mathsf{\Delta}\left[{K}^{+}\right]$ and the evaluated d used for estimation at ${h}_{5}$. As previously reported in [21], 44 h is the average ECG duration in our database—not 48 h, when the last blood sample is takenl—mainly due to electrode detachment or early battery exhaustion. However, in a recent study [20], we observed a low marker dynamics in the late post-HD treatment. Therefore, with some degree of confidence, we have assumed that the estimation error obtained between $\mathsf{\Delta}\left[{K}^{+}\right]$ and ${\widehat{\mathsf{\Delta}}}_{d,m}^{f}\left[{K}^{+}\right]$ at ${h}_{5}$ would be quite similar if the actual value—had the ECG lasted, as planned, for 48 h—had been used for modelling.

Specific aspects of ESRD-HD patients’ clinical status (e.g., possibility of previous infarction not always revealed in clinical history) could have influenced the results, generating the inter-patient variability here observed. In addition, the accuracy of the proposed models in estimating potassium variations for patients other than ESRD-HD remains to be assessed.

Finally, the reduced number of patients and available blood samples for each patient included in this study also represents a limitation to frame the conclusion of the work. Indeed, even if the proposed approach may entail a significant step towards a robust and reliable $\mathsf{\Delta}\left[{K}^{+}\right]$ sensing from time-warping based biomarkers, it needs to be validated in larger cohorts before any translation to clinical practice. However, the available data would suggest that a patient-specific quadratic model could estimate $\mathsf{\Delta}\left[{K}^{+}\right]$ time trends with better accuracy than a linear-model. Also, in real practice, this method implies the collection of several blood samples, which may result in cumbersome procedures. It remains to be studied to what extent the models learned in one session can be extrapolated for sessions in later days/weeks, reducing the learning to just a single session.

Future studies should be conducted in a larger population including not only ESRD-HD patients but also subjects at risk of [${K}^{+}$] imbalance, such as those with diabetes mellitus [28] or severe cardiovascular events like myocardial infarction [29]. In addition, the proposed estimation models should be validated in a follow-up study where the models are learned at the initial HD session and used in later HD sessions to measure $\mathsf{\Delta}\left[{K}^{+}\right]$. In such studies the complete learning with m = a at the initial HD session could be evaluated by its prediction value at subsequent sessions, without any overfitting risk. At this future analysis, we expect that m = a approach will show better performance, in terms of correlation and estimation error, than the one reported here for the m = o case, since the models’ coefficients will be estimated over the six $\mathsf{\Delta}\left[{K}^{+}\right]$ values (and not just over five as in m = o), thus covering the full range of d values for each patient.

The present study showed the advantage in using non-linear models in estimating $\mathsf{\Delta}\left[{K}^{+}\right]$ measurements in ESRD-HD patients based on T-wave-derived markers. These results suggest a new noninvasive strategy for ECG-based [${K}^{+}$] sensing, with large implications for monitoring patients with cardiovascular and renal diseases, providing a meaningful tool for a personalised ambulatory cardiac risk assessment of these patients.

Conceptualisation, P.G., E.P., J.P.M. and P.L.; methodology, P.L.; software, F.P.; validation, F.P., P.G. and P.L.; formal analysis, F.P.; investigation, F.P., P.G. and P.L.; resources, D.F., J.R. and P.L.; data curation, J.E.R., D.F. and P.L.; writing—original draft preparation, F.P.; writing—review and editing, F.P., P.G., A.M.-Y., E.P., J.P.M., J.R. and P.L.; visualisation, F.P.; supervision, P.G., J.R. and P.L.; project administration, J.E.R., D.F. and P.L.; funding acquisition, D.F. and P.L. All authors have read and agreed to the published version of the manuscript.

This work was funded by Products & Technology S.L. (Castellbisbal, Barcelona, Spain), and by AGAUR, Generalitat de Catalunya (Spain) grant DI001-2018 and CIBER-BBN ref: “DEKOALE”. The work was also supported by project PID2019-104881RB-I00, and PID2019-105674RB-I00 funded by the Spanish Ministry of Science and Innovation (MICINN) and FEDER, by Gobierno de Aragón (project LMP124-18 and Reference Group Biomedical Signal Interpretation and Computational Simulation (BSICoS) T39-20R) co-funded by FEDER 2014-2020 ”Building Europe from Aragón” and by the European Research Council (ERC) through project ERC-StG 638284. J. Ramírez would like to thank the support of Marie Sklodowska-Curie grant no. 786833. A. Martín-Yebra is a “Juan de la Cierva” fellow (project FJC2018-037369-I).

The study was conducted according to the guidelines of the Declaration of Helsinki, and approved by the Institutional Review Board (or Ethics Committee) of the Aragon’s Ethics Committee (CEICA, ref. PI18/003, 25/01/2018).

Informed consent was obtained from all subjects involved in the study.

The dataset is still ongoing and it is available upon request to the corresponding author.

The computation was performed at the High Performance computing platform of the NANBIOSIS ICTS.

The authors declare no conflict of interest. The funders had role in the design of the study but they had no role in the collection, analyses, or interpretation of data nor in the writing of the manuscript, or in the decision to publish the results.

The following abbreviations are used in this manuscript:

${\mathsf{\Psi}}_{\pi \mathrm{CA}}$ | Transformation matrix to perform Periodic Component Analysis |

$\left[{K}^{+}\right]$ | Blood potassium concentration |

$\mathsf{\Delta}\left[{K}^{+}\right]$ | Blood potassium concentration variations |

ECG | Electrocardiogram |

ESRD | End Stage Renal Disease |

ESRD-HD patients | End Stage Renal Disease patients undergoing hemodialysis |

HD | Hemodialysis |

IQR | Interquartile range |

MWTW | Mean Warped T-wave |

PCA | Principal Component Analysis |

$\pi $ CA | Periodic Component Analysis |

$\pi {C}^{\mathrm{T}}$ | Periodic Component Analysis evaluated over the T-wave |

$\rho $ | Spearman’s correlation coefficient |

r | Pearson’s correlation coefficient |

- Segall, L.; Nistor, I.; Covic, A. Heart Failure in Patients with Chronic Kidney Disease: A Systematic Integrative Review. BioMed Res. Int.
**2014**, 2014. [Google Scholar] [CrossRef] - Collins, A.J.; Foley, R.N.; Herzog, C.; Chavers, B.; Gilbertson, D.; Ishani, A.; Kasiske, B.; Liu, J.; Mau, L.-W.; McBean, M.; et al. US Renal Data System 2010 Annual Data Report. Am. J. Kidney Dis.
**2011**, 51 (Suppl. 1), e1–e526. [Google Scholar] [CrossRef] [PubMed] - London, G.M. The Clinical Epidemiology of Cardiovascular Diseases in Chronic Kidney Disease: Cardiovascular Disease in Chronic Renal Failure: Pathophysiologic Aspects. Semin. Dial.
**2003**, 16, 85–94. [Google Scholar] [CrossRef] - Johnson, D.W.; Craven, A.M.; Isbel, N.M. Modification of cardiovascular risk in hemodialysis patients: An evidence-based review. Hemodial. Int.
**2007**, 11, 1–14. [Google Scholar] [CrossRef] - Perl, J.; Chan, C. Timing of sudden death relative to the hemodialysis procedure. Nat. Rev. Nephrol.
**2006**, 2, 668–669. [Google Scholar] [CrossRef] [PubMed] - Turakhia, M.P.; Blankestijn, P.J.; Carrero, J.J.; Clase, C.M.; Deo, R.; Herzog, C.A.; Kasner, S.E.; Passman, R.S.; Pecoits-Filho, R.; Reinecke, H.; et al. Chronic kidney disease and arrhythmias: Conclusions from a kidney disease: Improving global outcomes (KDIGO) controversies conference. Eur. Heart J.
**2018**, 39, 2314–2325. [Google Scholar] [CrossRef] [PubMed] - Gumz, M.L.; Rabinowitz, L.; Wingo, C. An Integrated View of Potassium Homeostasis. N. Engl. J. Med.
**2015**, 373, 60–72. [Google Scholar] [CrossRef] [PubMed] - Welch, A.; Maroz, N.; Wingo, C.S. Hyperkalemia: Getting to the heart of the matter. Nephrol. Dial. Transplant.
**2013**, 28, 15–16. [Google Scholar] [CrossRef] - Van Mieghem, C.; Sabbe, M.; Knockaert, D. The clinical value of the ECG in noncardiac conditions. Chest
**2004**, 125, 1561–1576. [Google Scholar] [CrossRef] - Bleyer, A.J.; Hartman, J.; Brannon, P.C.; Reeves-Daniel, A.; Satko, S.G.; Russell, G. Charact. Sudd. Death Hemodial. Patients. Kidney Int.
**2006**, 69, 2268–2273. [Google Scholar] [CrossRef] [PubMed] - Levis, J.T. ECG Diagnosis: Hypokalemia. Perm. J.
**2012**, 16, 57. [Google Scholar] [CrossRef] [PubMed] - Diercks, D.B.; Shumaik, G.M.; Harrigan, R.A.; Brady, W.J.; Chan, T.C. Electrocardiogr. Manifestations: Electrolyte Abnorm. J. Emerg. Med.
**2004**, 27, 153–160. [Google Scholar] [CrossRef] [PubMed] - Severi, S.; Grandi, E.; Pes, C.; Badiali, F.; Grandi, F.; Santoro, A. Calcium Potassium Chang. Haemodial. Alter Ventricular Repolarization Duration: Vivo Silico Analysis. Nephrol. Dial. Transplant.
**2008**, 23, 1378–1386. [Google Scholar] [CrossRef] [PubMed] - Severi, S.; Vecchietti, S.; Cavalcanti, S.; Mancini, E.; Santoro, A. Electrocardiogr. Chang. Hemodiafiltration Differ. Potassium Remov. Rates. Blood Purif.
**2003**, 21, 381–388. [Google Scholar] [CrossRef] - Frohnert, P.P.; Giuliani, E.R.; Friedberg, M.; Johnson, W.J.; Tauxe, W.N. Statistical investigation of correlations between serum potassium levels and electrocardiographic findings in patients on intermittent hemodialysis therapy. Circulation
**1970**, 41, 667–676. [Google Scholar] [CrossRef] - Corsi, C.; Cortesi, M.; Callisesi, G.; De Bie, J.; Napolitano, C.; Santoro, A.; Mortara, D.; Severi, S. Noninvasive Quantif. Blood Potassium Conc. ECG Hemodial. Patients. Sci. Rep.
**2017**, 7, 42492. [Google Scholar] [CrossRef] - Krogager, M.L.; Kragholm, K.; Skals, R.K.; Mortensen, R.N.; Polcwiartek, C.; Graff, C.; Nielsen, J.B.; Kanters, J.K.; Holst, A.G.; Søgaard, P.; et al. Relatsh. Serum Potassium Conc. Electrocardiogr. Charact. 163,547 Individ. Prim. Care. J. Electrocardiol.
**2019**, 57, 104–111. [Google Scholar] [CrossRef] - Palmieri, F.; Gomis, P.; Ferreira, D.; Ruiz, J.E.; Bergasa, B.; Martín-Yebra, A.; Bukhari, H.A.; Pueyo, E.; Martínez, J.P.; Ramírez, J.; et al. T-Wave Morphol. Chang. Surrog. Blood Potassium Conc. Hemodial. Patients. 2019 Comput. Cardiol. (CinC)
**2019**, 46. [Google Scholar] [CrossRef] - Bukhari, H.A.; Palmieri, F.; Ferreira, D.; Potse, M.; Ramírez, J.; Laguna, P.; Sánchez, C.; Pueyo, E. Transmural Ventricular Heterog. Play A Major Role Determ. T-Wave Morphol. Differ. Extracell. Potassium Levels. 2019 Comput. Cardiol. (CinC)
**2019**, 46. [Google Scholar] [CrossRef] - Palmieri, F.; Gomis, P.; Ruiz, J.E.; Ferreira, D.; Martín-Yebra, A.; Pueyo, E.; Laguna, P.; Martínez, J.P.; Ramírez, J. Potassium Monit. Multilead T-Wave Morphol. Chang. Hemodyalisis: Period. Versus Princ. Compon. Analysis. 2020 Comput. Cardiol. (CinC)
**2020**, 47. [Google Scholar] [CrossRef] - Palmieri, F.; Gomis, P.; Ferreira, D.; Ruiz, J.E.; Bergasa, B.; Martín-Yebra, A.; Bukhari, H.A.; Pueyo, E.; Martínez, J.P.; Ramírez, J.; et al. Monitoring Blood Potassium Concentration in Hemodialysis Patients by Quantifying T-waveMorphology Dynamics. Sci. Rep.
**2021**, 11, 1–15. [Google Scholar] [CrossRef] - Bukhari, H.; Palmieri, F.; Ramírez, J.; Laguna, P.; Ruiz, J.E.; Ferreira, D.; Potse, M.; Sanchez, C.; Pueyo, E. Characterization of T Wave Amplitude, Duration and Morphology Changes During Hemodialysis: Relationship with Serum Electrolyte Levels and Heart Rate. IEEE Trans. Biomed. Eng.
**2020**. [Google Scholar] [CrossRef] - Ramírez, J.; Orini, M.; Tucker, J.D.; Pueyo, E.; Laguna, P. Variability of Ventricular Repolarization Dispers. Quantified Time-Warping Morphol. T-Wave. IEEE Trans. Biomed. Eng.
**2017**, 64, 1619–1630. [Google Scholar] [CrossRef] - Monasterio, V.; Clifford, G.D.; Laguna, P.; Martínez, J.P. A Multilead Scheme Based Period. Compon. Anal. T-Wave Alternans Anal. ECG. Ann. Biomed. Eng.
**2010**, 38, 2532–2541. [Google Scholar] [CrossRef] - Sörnmo, L.; Laguna, P. Electrocardiogram (ECG) Signal Processing. In Wiley Encyclopedia of Biomedical Engineering; Akay, M., Ed.; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2006; pp. 1298–1313. ISBN 0-471-24967-X (CL). [Google Scholar] [CrossRef]
- Martínez, J.P.; Almeida, R.; Olmos, S.; Rocha, A.P.; Laguna, P. A Wavelet-Based ECG Delin. Eval. Stand. Databases. IEEE Trans. Biomed. Eng.
**2004**, 51, 570–581. [Google Scholar] [CrossRef] [PubMed] - Sameni, R.; Jutten, C.; Shamsollahi, M.B. Multichannel electrocardiogram decomposition using periodic component analysis. IEEE Trans. Biomed. Eng.
**2008**, 55, 1935–1940. [Google Scholar] [CrossRef] [PubMed] - Liamis, G.; Liberopoulos, E.; Barkas, F.; Elisaf, M. Diabetes Mellit. Electrolyte Disorders. World J. Clin. Cases
**2014**, 2, 488–496. [Google Scholar] [CrossRef] [PubMed] - Jacobsen, M.R.; Reza Jabbari, R.; Glinge, C.; Stampe, N.K.; Butt, J.H.; Blanche, P.; Lønborg, J.; Nielsen, O.W.; Køber, L.; Torp-Pedersen, C.; et al. Potassium Disturbances Risk Ventricular Fibrillation Patients ST-Segment—Elevation Myocard. Infarction. JAHA
**2020**, 4, 488–496. [Google Scholar] [CrossRef]

d | f | m | $\mathit{\rho}$ | r | ${\mathit{e}}_{\mathit{d},\mathit{m}}^{\mathit{f}}$ | ||
---|---|---|---|---|---|---|---|

ALL | ${\mathit{h}}_{0}$ | ${\mathit{h}}_{5}$ | |||||

${d}_{w}$ | l | a | 0.83 (0.33) | 0.86 (0.35) | 0.30 (0.48) | 0.28 (0.77) | 0.29 (0.55) |

o | 0.77 (0.48) | 0.76 (0.47) | 0.38 (0.61) | 0.56 (1.10) | 0.45 (0.66) | ||

q | a | 0.83 (0.36) | 0.91 (0.29) | 0.22 (0.34) | 0.24 (0.58) | 0.27 (0.49) | |

o | 0.83 (0.49) | 0.77 (0.51) | 0.38 (0.59) | 0.64 (1.15) | 0.63 (0.60) | ||

c | a | 0.89 (0.35) | 0.92 (0.27) | 0.21 (0.34) | 0.23 (0.37) | 0.30 (0.54) | |

o | 0.83 (0.49) | 0.79 (0.61) | 0.39 (0.72) | 0.64 (1.24) | 0.69 (0.75) | ||

${\widehat{d}}_{w,c}$ | l | a | 0.83 (0.31) | 0.88 (0.34) | 0.27 (0.50) | 0.26 (1.03) | 0.31 (0.54) |

o | 0.80 (0.44) | 0.81 (0.34) | 0.40 (0.63) | 0.54 (1.11) | 0.50 (0.59) | ||

q | a | 0.83 (0.35) | 0.90 (0.27) | 0.21 (0.36) | 0.25 (0.73) | 0.27 (0.50) | |

o | 0.80 (0.53) | 0.77 (0.39) | 0.41 (0.67) | 0.57 (1.45) | 0.71 (0.61) | ||

c | a | 0.83 (0.31) | 0.90 (0.25) | 0.20 (0.39) | 0.25 (0.67) | 0.23 (0.52) | |

o | 0.80 (0.49) | 0.72 (0.45) | 0.43 (0.81) | 0.77 (1.25) | 0.76 (0.80) |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).