Next Article in Journal
ML-Based Maintenance and Control Process Analysis, Simulation, and Automation—A Review
Previous Article in Journal
A Space of Apt Product Designs Based on Market Information
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Comparative Evaluation of Neural Network Models for Optimizing ECG Signal in Non-Uniform Sampling Domain

by
Pratixita Bhattacharjee
and
Piotr Augustyniak
*
Faculty of Electrical Engineering, Automatics, Computer Science and Biomedical Engineering, AGH University of Krakow, 30-059 Kraków, Poland
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(19), 8772; https://doi.org/10.3390/app14198772 (registering DOI)
Submission received: 1 August 2024 / Revised: 17 September 2024 / Accepted: 24 September 2024 / Published: 28 September 2024

Abstract

:
Electrocardiographic signals (ECG) are ubiquitous, which justifies the research of their optimal storage and transmission. However, proposals for non-uniform signal sampling must take into account the priority of diagnostic data accuracy and record integrity, as well as robustness to noise and interference. In this study, two novel methods are introduced, each utilizing a distinct neural network architecture for optimizing non-uniform sampling of ECG signal. A transformer model refines each time point selection through an iterative process using gradient descent optimization, with the goal of minimizing the mean squared error between the original and resampled signals. It adaptively modifies time points, which improves the alignment between both signals. In contrast, the Temporal Convolutional Network model trains on the original signal, and gradient descent optimization is utilized to improve the selection of time points. Evaluation of both strategies’ efficacy is performed by calculating signal distances at lower and higher sampling rates. First, a collection of synthetic data points that resembled the P-QRS-T wave was used to train the model. Then, the ECG-ID database for real data analysis was used. Filtering to remove baseline wander followed by evaluation and testing were carried out in the real patient data. The results, in particular MSE = 0.0005, RMSE = 0.0216, and Pearson’s CC = 0.9904 for 120 sps in the case of the transformer patient data model, provide viable paths for maintaining the precision and dependability of ECG-based diagnostic systems at much lower sampling rate. Outcomes indicate that both techniques are effective at improving the fidelity between the original and modified ECG signals.

1. Introduction

Electrocardiographs, or ECGs, are crucial diagnostic and monitoring devices for diseases of the heart. ECGs provide important information related to the electrical activity of the heart. The reliability of ECG signals is vital in gauging patient results and the dependability of diagnostic equipment. Data from an ECG are usually sampled with uniform sampling techniques, which are used to collect the data points at constant intervals. It is simple and intuitive. However, this approach might compress the most diagnostically significant differences embedded within the ECG signal, particularly in the presence of noise and interference. Therefore, the increasing interest in studying non-uniform sampling lies in its priority given to the integrity of records and diagnostic efficiency. The potential application of non-uniform sampling directly reduces the space the electrocardiogram occupies in the storage or transmission bandwidth and, at the same time, enables a more thorough representation of vulnerable details in signals. Additionally, the technique is of interest to the economy and quality of diagnostics.
Recent developments in neural network topology have realized practicable methods to improve the non-uniform sampling of ECG signals. The methods try to adapt themselves to time point selection to improve the similarity between the original signal and the resampled signal. One of the methods to optimize the resemblance, for instance, the ECG signal, is to choose time points at which the most prominent characteristics of the waveform are captured. Neural networks have shown the ability to capture the critical points that optimally retained the underlying diagnostic information through the use of time series models [1]. However, careful attention should be paid to the selection of such a point in time since too much change will create an automatic loss of critical diagnostic information.
The non-uniform sampling of the ECG signals substantially has the edge overuniform sampling because these techniques do not include the limitations implicit in uniform sampling, particularly when handling complex biomedical data, noise, etc.
Key features prioritization: Uniform sampling entails data points at evenly spaced-out intervals, which is a simple method. However, this method does not take into account the variable importance of different sections of the ECG waveform. Since ECG signals have stages of swift change (e.g., during the QRS complex) and stages of relative stability (e.g., during the T-wave or P-wave), uniform sampling might either oversample less critical areas or undersample the more critical ones. In the case of non-uniform sampling, the selection of sampling points itself is adaptive and depends on the importance of the different parts of the signal. More attention is given to those areas where the ECG signal changes abruptly, thus identifying and preserving critical features.
Noise resilience: In the presence of noise and interference, uniform sampling might involuntarily capture and accentuate these distortions, possibly concealing the critical features of the ECG signal. The non-uniform sampling assists in nullifying the effect of noise at the sampling points and thus cancels out the extraneous data that otherwise would have been captured. The quality of the heart’s electrical activity is enhanced by the extraction of clearer and more accurate patterns.
Better reconstruction: Concentrating on more informative ECG sections, non-uniform sampling leads to a better reconstruction of the original signal from the sampled data. The ECG is still preserved with its essential fragments after compression or down-sampling.
Two major challenges in the design of efficient non-uniform sampling methods for ECG signals are choosing the best time points at which the signal has to be sampled and ensuring the resampled signal reliably carries the original waveform [1,2].
Improved signal reconstruction in ECG analysis has some dynamic benefits associated with diagnostic precision and patient outcomes. In assessment with elementary methods, advanced reconstruction techniques reserve the essential features of the original ECG signal well, ensuring that fine diagnostically relevant distinctions in the heart’s electrical activity are precisely apprehended and characterized, making the detection of arrhythmias, ischemias, and other cardiac abnormalities more consistent, which otherwise might have been misinterpreted by less accurate reconstructions [3,4]. Furthermore, noise and artifacts—which are distinctive problems for ECG signals—are placated by the improved reconstruction.
The paper presents two new neural network-based techniques: a temporal convolutional network model and a transformer model.
The TCN model uses convolutional layers to represent temporal dependencies of the ECG signal and has been designed specifically for sequence modeling. Thus, it is very well-suited, and its architecture is optimized for long-range interactions. On the other hand, this TCN model refines time points into rigid alignment with the original signal through the use of gradient descent optimization and training on the original ECG signal. This approach ensures that even in the case of noise, the important features of the ECG signal are captured accurately [5,6,7].
Contrarily, the transformer model has already revealed huge potential in time-series analysis and is very famous due to its efficacy in natural language processing tasks. The transformer can enhance the signal alignment by adaptively adjusting time points and modeling the dependencies among various signal components [8]. Other than reducing errors, this iterative approach ensures that key components of the ECG signal will be preserved. The model provides flexibility and intrinsic long-term reliability during adjustments to signal characteristics, thereby making it a robust tool for the optimization of ECG signal sampling [9].
Some metrics, like Pearson’s correlation coefficient, mean squared error, and root mean square error, are being used to evaluate the similarity of original and resampled (i.e., restored from non-uniform) signals and, thus, the performance of neural network models. These measurements can thus provide the overall assessment of the capability of a model to retain integrity in ECG signals [10]. The models are developed and tested against the ECG-ID database, which is a large collection of annotated ECG records. Notable gains in terms of alignment of the signals have been made. The results show how neural network models may be used to increase the accuracy and dependability of ECG-based diagnostic systems.
The core idea realized in these models is gradient descent, iteratively improving the selection of time points. What it aims at during the process is to increase the alignment between the original and resampled signals. The transformer model, through adaptive changes to these time points, reduces mean squared error, ensuring that the resampled signal approaches very close to the original one. On the contrary, while using gradient descent optimization, the TCN model focuses on how to directly derive the optimum time point selection from the original signal. The new approach aims to improve the fidelity of the resampled signal by reducing the mean square error between the original and resampled signals. The TCN model assumes temporal dependencies in the ECG data through its convolutional layers, hence helping in the determination of those time points relevant for non-uniform sampling.
The paper is organized as follows: Section 2 reviews the relevant literature on the processing of ECG signals and neural network applications in non-uniform sampling; Section 3 describes the materials and methodology, including the architecture and the training process of transformer and TCN models; Section 4 describes the experimental setup and results, showing the comparison and the performance of these models. Finally, Section 5 discusses the implications of the findings and suggests directions for future research.
The study shows that neural networks can optimize non-uniform sampling and further improve state-of-the-art performance in the processing of ECG signals. These results offer critical information in an attempt to design better and more homogeneous ECG-based diagnostic technology in anticipation that this will result in improved care in medical practice. The developed approaches open new opportunities not only for the improvement of ECG signal quality but also for the application of neural networks in biomedical signal processing, opening new vistas for health technology development.

2. Related Work

In recent studies, researchers investigated ways to improve ECG classification using deep learning models, most of which were focused on morphological features of the ECG signals. For example, Potes et al. [11] developed a convolutional neural network-based feature extraction method to obtain morphological features from the ECG waveforms for their classification. These CNN-based techniques have shown better performance than classical machine-based learning methods, such as support vector machines. These approaches have been discredited, however, since they fail to capture the latent temporal features of ECGs [1].
Consequently, researchers have tried to bypass this limitation by investigating the use of sequence-based models such as transformer architectures and recurrent neural networks. These have proved much better in regard to data classification by performing better at using the temporal dependencies inherent in ECG signals [12]. Of these, the transformer architecture has lately been found very efficient in the analysis of ECG due to the attention mechanism and the ability to describe long-range dependencies [13].
For instance, Guan et al. [13] proposed a low-dimensional denoising embedding transformer model for the classification of ECGs. In this approach, they leveraged the self-attention mechanism of the transformer, which enables the model to focus on parts of the signal that are relevant. On the other hand, Mondéjar-Guerra et al. combined rule-based features with neural network methodology for ECG abnormality detection and demonstrated how domain knowledge can be combined with deep learning models to great advantage [14].
Deep learning has further been explored in other applications related to ECG, such as for classification tasks, including representation learning and chronic disease prediction. For example, Gao et al. provides a new deep learning architecture that leverages deep CNNs with advanced mechanisms, such as residual learning and temporal attention, to enhance the detection performance of AF by leaps and bounds [15].
Particularly, there are considerable limitations to the existing methods for deep learning-based ECG classification and non-uniform sampling that put forward a number of motives for developing more advanced neural network-based approaches [16]. Specifically, such methods do not completely help the traditional techniques in capturing the complex temporal dependencies inherent in an ECG signal, which is very important in making correct diagnoses or classifications.
Such restrictions of the existing ECG classification and non-uniform sampling techniques in capturing and employing temporal dependencies in ECG lead to the necessity of more sophisticated methods. In this paper, neural network-based models for the optimal selection and reconstruction of ECG signals are projected, overtly modeling the temporal features with motivation through these encounters. This may, in turn, vastly increase the accuracy and consistency of ECG-diagnosis systems, improving patient outcomes in medical situations.
Lately, transformers and temporal convolutional neural networks have subjugated the huge potential of optimizing the non-uniform sampling of ECG signals. These models are competent at learning complex representations and relations within the ECG data, which can advance expressive features extracted under different conditions of sampling rates and henceforth be used to significantly improve diagnostic performance and reliability in clinical applications.
Although there are still a number of challenges to be surmounted, the integration of deep learning with domain expertise in ECG analysis has returned encouraging outcomes. In particular, the identification and description of ECG waveforms with high precision are crucial in the diagnosis and treatment of cardiovascular disorders. Further research in deep learning models can help realize their full potential in improving ECG-based diagnosis systems.
The main goal of this paper is to provide and evaluate neural network models for non-uniform ECG signal sampling and reconstruction: a TCN model and a transformer model. Specifically, the proposed methods are designed to optimize the choice of time points of an ECG signal at which the signal samples should be selected to retain the main characteristics and fidelity of the original signal. The paper presents research aimed at delivering improvements in the accuracy and reliability of ECG-based diagnostic systems using neural network topologies that capture temporal dependencies.

3. Materials and Method

3.1. Preliminaries

ECG time series data: A sequence of data points taken in successive points of time by a time order is known as a time series. The most common form of time series is a sequence taken in successive, consistently spaced moments of time. In this paper, we follow the method proposed in signals with random sampling intervals [17]. The method is based on the concept that, in continuous domain discrete value, a function defines sampling interval. It is a technique where the algorithm tries to optimize the representation of the signal by changing the sampling intervals of a signal, also called time points. It is followed by gradient descent, which iteratively updates the initial time points created with a linear space to much more closely match the original signal [18,19].
Non-uniform sampling: Since the ECG signals are non-uniformly sampled, the time interval left between any two successive measurements is no longer constant. It may be due to level-crossing sampling, compression, or limitations of the hardware used for data capture. For example, non-uniform sampling presents many issues: special signal processing techniques have to be used; there is a possibility of losing diagnostic information; and lastly, many of the standard methods used for signal analysis are aimed at uniformly sampled data [20].
The ECG-ID database and preprocessing of signal: In order to evaluate our proposed models, a synthetic ECG signal and real patient records from the ECG-ID database [21] downloaded from Physionet [22] were used. There are 310 ECG recordings from Lead-I in the ECG-ID database. The digital ECG records were taken in Lead-I for 20 s and digitized at a rate of 500 Hz with 12-bit precision. Lead I represent the possible distinction between the right and left hands (LA–RA). It is selected because it can be measured with ease and is insensitive to small differences in the positions of the electrodes. The records came from 90 volunteers aged 13 to 75 years (44 men and 46 women). This ECG-ID database consists of signals that are baseline drift corrected, frequency-selective filtered, and signal enhanced. Baseline drift correction was implemented using multilevel one-dimensional wavelet analysis (db8, N = 9). Frequency-selective signal filtering was implemented using a set of adaptive band stop (Ws = 50 Hz, dA = 1.5) and lowpass (Butterworth, Wp = 40 Hz, Ws = 60 Hz, Rp = 0.1 dB, Rs = 30 dB) filters followed by smoothing with N = 5 points averaging [21]. An adaptive band stop filter fairly suppresses power-line noise, and a lowpass filter is used to remove the remaining noise components caused by possible high-frequency distortions.
As some baseline wanders were still observed while implementation, to refine further, the band-pass Butterworth filter (filter order of 4, flow = 0.5 Hz, fhigh = 60 Hz, and fs is from the ECG record) was used to remove low- and high-frequency noise components and baseline wander muscle noise and used as input to the models as a modified signal. The frequency range analyzed in the models is set at 0.5–60 Hz for 10 s, as shown in Figure 1 and Figure 2 [23,24].
The modified ECG signal, which has been subjected to preprocessing steps, is utilized as the input to the neural network models. These models then process the modified signal to capture the essential dependencies and features within the data.

3.2. Proposed Neural Network Models

The methodologies utilize neural network models (TCN and transformer) to capture dependencies in the ECG data, followed by a gradient descent optimization to fine-tune the time points for better signal alignment.

3.2.1. Temporal Convolutional Network (TCN) Model

The TCN process begins by building a TCN model designed to handle time-series data effectively. The TCN model is initialized with an input shape that matches the length of the original ECG signal and is compiled using the Adam optimizer [25] and mean squared error (MSE) loss function. The original ECG signal, reshaped to fit the model input, serves as the training data.
Convolutional layers: The TCN uses dilated causal convolutions to handle temporal dependencies. The output of a dilated convolution at time step t with a dilation factor d is given by
y t = i = 0 k 1 w i · x t d · i
where wi are the convolutional filter weights, k is the filter size, and x is the input sequence.
In a causal convolutional model, the output at time step t depends only on the input from time step t and before, which is particularly important in the context of time series prediction or any sequential task in which knowledge of the forthcoming cannot be used to affect the former. Hence, the temporal order of the series is preserved without any leakage from the future.
Dilation refers to the elements of the kernel being spaced in a convolutional operation. In a dilated convolution, the kernel gets ‘stretched out’ with zeros in between such that it can have a wider receptive field without increasing the number of parameters. It permits the network to model dependencies over long time intervals. In the TCN model, the ‘causal’ padding is used to ensure the same along with dilation_rate**i, where i is the layer index, efficiently increasing the dilation rate with each succeeding layer.
Residual connections: To facilitate training deeper networks, the TCN employs residual connections that add the input to the output of each convolutional block. Residual connections refer to shortcuts that connect the input of a layer directly to the output of a later layer, bypassing one or more intermediate layers. It is used for the model to learn the residual mapping, which means the difference between the output and the input rather than the whole transformation. Residual connections make it easier to train deep networks by enabling gradients to flow more directly through the network; that is, their use reduces the risk of vanishing gradients. Residual connections help stabilize the network and prevent overfitting by enabling some of the information from the previous layers to pass unchanged.
y t = x t + F ( x t )
where F(xt) represents the output of the convolutional layers.
Once the model is trained, an initial set of time points, uniformly distributed over the signal length, is generated. The ECG values at these initial time points are calculated for the modified signal and interpolated to match the length of the original signal. The initial distance between the original and modified signals is computed using MSE. The residual layer is added with x = layers.Add()([x, residual]). This line adds the output of the main convolutional layer x to the output of the residual branch. Adding the residual adds information from the input or a transformed version of the input to the output of the convolutional layer. Figure 3 provides a detailed representation of the flow of elements within the TCN model.

3.2.2. Transformer Model

The model is compiled using the Adam optimizer and MSE loss function. The original ECG signal is reshaped for the model input for training purposes. After training, an initial set of time points is generated uniformly over the signal length. The ECG readings at these points are computed using the modified signal and interpolated with Cubic Splines interpolation to match the duration of the original signal. MSE is used to calculate the initial distance between the signals. Instead of processing the full input sequence evenly, the transformer model uses an attention mechanism to selectively focus on key portions of the sequence [26].
The self-attention mechanism is the mechanism that allows the model to weigh different parts of the input sequence differently based on their relevance to one another [27]. The multi-head attention mechanism is followed by residual connection and layer normalization in the proposed model. Finally, the attention mechanism is added after the convolutional layers but before the final output layers. This setup allows the model to use convolutions in capturing local patterns and, at the same time, leverage global dependencies through self-attention. The core of the transformer model is the self-attention mechanism, which computes the attention scores as follows:
A t t e n t i o n ( Q , K , V ) = s o f t m a x ( Q K T d k ) V
where Q (queries), K (keys), and V (values) are projections of the input sequence, and dk is the dimension of the keys.
The position-wise feed-forward networks add positional encoding to the input sequence x. The aim is to ensure that each data point in the sequence is not characterized by itself but includes its position within a given sequence. Adding positional encoding to the model allows it to identify where elements are situated in a sequence, which is relevant for time series analysis, where the order of data points matters. Each position in the sequence passes through a feed-forward neural network:
FFN ( x ) = max ( 0 ,   x W 1 + b 1 ) W 2 + b 2
where W1, W2, b1, and b2 are learnable parameters. Figure 4 provides a detailed representation of the flow of elements within the transformer model.

3.3. Optimization Process for Time Points

Gradient descent optimization: For both models, the optimization process aims to minimize the MSE by adjusting the model parameters and the selected time points iteratively:
θ t + 1 = θ t η · θ M S E
where θ represents the model parameters at time points, η is the learning rate, and ∇θMSE is the gradient of the MSE with respect to θ.
Both models utilize a gradient descent-like approach to optimize the selection of time points, with adjustments made iteratively to minimize the distance between the original and modified signals:
Initial time points: The collection of equidistant points is used to initiate the optimization process by providing a baseline from which the algorithm iteratively refines the time points to capture the essential features of the original signal.
T = { t 1 , t 2 ,     , t n }
where T represents the initial set of uniformly distributed time points.
Interpolated values: The ECG values at these time points are interpolated to match the original signal’s length:
y ^ ( t ) = interp ( T , ECG   values )
The interpolation method used was Cubic Splines interpolation for the proposed models.
Distance calculation: The distance (error) between the original and interpolated signals is calculated using mean square error (MSE):
M S E = 1 N i = 1 N ( y i y i ^ ) 2
Iterative adjustment: For each time point ti, adjust by small increments (δ = −1, 0, 1\delta = −1, 0, 1δ = −1, 0, 1) to find a new set of time points that minimize the MSE:
T = { t 1 , t 2 + δ ,     , t n }
The time points are updated if the new configuration results in a smaller MSE:
If   MSE ( T ) < M S E ( T )   t h e n   T = T
By iterating through these steps, the models refine the time points to achieve better alignment between the original and modified ECG signals, thereby optimizing the non-uniform sampling.

4. Results and Discussion

4.1. Experimental Setup

We examined the effectiveness of a TCN model and a transformer-based model in our experimental setup for time-series signal optimization (Figure 5). The network consists of three 1D convolutional layers. Each layer has 64 filters. The size of the convolutional kernel is 3, and the ReLU activation function is applied to introduce non-linearity ‘same’ padding, which is used to ensure the output length matches the input length. A final 1D convolutional layer with a single filter and a kernel size of 1 is applied to produce the output. The output layer is linearly activated to allow the prediction of continuous values. The model is then trained on the original signal for 25 epochs. However, the loss stabilized at 10 epochs. New ECG values for the modified signal are computed at the initial time points using cubic spline interpolation. The obtained ECG values are interpolated to the length of the original signal so that they can be compared directly. Afterward, the defined architecture is used to build the TCN model, which is then compiled with the Adam optimizer and mean squared error loss function (Figure 6). For each time point, small perturbations (−1, 0, 1) are tested to see which one will go in a direction that conveys a reduction in the distance—the MSE of the original and interpolated signals. If a perturbation returns a smaller distance, the time point is updated. This is repeated for a number of iterations, 100 in this case.
The transformer adds positional information to the input data to help the model understand the position of each element in the sequence; it performs attention operations to focus on different parts of the input sequence [28]. Layer normalization alleviates the output to improve training stability. The feed-forward network consists of Conv1D layers that act as fully connected layers applied to each position of the sequence. Residual connection adds the original input to the output of the feed-forward network, followed by another layer normalization. A Conv1D layer is used to produce the final output with a single value per position.
By testing multiple numbers of samples ranging from low to high, the experiment explores how the quantity of data (in terms of time points) affects the outcomes or results of the study. The inclusive lower range of 18 to 36 samples per second and higher range from 46 to 120 samples per second used denotes a methodical search to determine the ideal time series length that yields dependable or interesting findings without unnecessary complexity or redundancy of data. The samples from 18 to 36 were tested more meticulously to observe the intricacies in lower sampling rates specifically.
All experiments were implemented in Python (v3.10.9) using Tensorflow (v2.15.0) and Keras (v2.15.0) machine learning libraries. All the experiments were run on a Windows 11 Home 64-bit operating system with an AMD Ryzen 7 3750H 4-Core processor 2.3 GHz (Advanced Micro Devices, Inc., St. Clara, CA, USA), NVIDIA GEFORCE GTX 1660 Ti GPU, (NVIDIA Corporation, St. Clara, CA, USA), and 16 GB installed memory.

4.2. Evaluation Matrices

We used the most common distance matrices as follows:
Mean squared error (MSE):
Mean squared error quantifies the average squared difference between predicted values and actual values. It is defined as:
MSE = 1 n i = 1 n ( y i y i ^ ) 2
where:
n is the number of samples or data points;
yi are the actual values;
ŷi are the predicted values.
Root mean squared error (RMSE):
Root mean squared error is the square root of MSE, which gives a measure of the average magnitude of the error. It is calculated as follows:
RMSE = MSE = 1 n i = 1 n ( y i y i ^ ) 2
Pearson’s correlation coefficient:
Pearson’s correlation coefficient measures the linear correlation between two variables. For a sample, it is calculated as:
r = i = 1 n ( x i x ¯ ) ( y i y ¯ ) i = 1 n ( x i x ¯ ) 2 i = 1 n ( y i y ¯ ) 2
where:
n is the number of samples;
x and y are the individual data points;
x ¯ and y ¯ are the average means.
Pearson’s coefficient r ranges from −1 to 1:
r = 1: Perfect positive correlation;
r = −1: Perfect negative correlation;
r = 0: No correlation.

4.3. Synthetic ECG Results

First, the models are tested on synthetic ECG data to check the effectiveness of the approach [29]. Once the models are trained and optimized, as shown, they can be used with real-patient ECG data, showing temporal dynamics captured and reconstruction with adaptive sampling. Figure 7 presents the performance of the TCN model on synthetic data. The original data are 30 sample points roughly defining the ECG signal. The modified signal is the interpolated one. Optimally chosen time points give a close interpolation of the original signal, proving the efficiency of our model to a great extent, as depicted in the graph. Figure 8 displays the performance of the transformer model on synthetic data. Similar to the TCN model, the transformer model also performs quite well in reconstructing the original ECG signal with given sample points. A non-uniform sample series approximates an irregular synthetic ECG signal, which in turn represents the modified signal.
The operator argmin refers to the argument (input value) of a function that minimizes the function’s value. For a function f(x), argminx f(x) is the value of x that minimizes f(x). For both our models, the argmin time points or the optimal sampling that leads to the lowest error is approximately averaged around 9.67 s in the sequence.
The evaluation matrices in Table 1 show the performance as well as the comparison between both models for synthetic data. Based on the measurements, it is possible to draw conclusions about the TCN and transformer models’ respective performances. The root mean squared error (RMSE) of 0.0573 and the mean squared error (MSE) of 0.0032 were attained by the TCN model. These error metrics show that there is not much of a difference between the real and predicted values, indicating that the TCN model can accurately mimic the original signal. In addition, the TCN model’s high Pearson’s correlation coefficient (0.9766) indicates a linear link between the anticipated and actual values.
It is in the error metrics, however, that the transformer model performs better than the TCN model, with an MSE of 0.0026 and an RMSE of 0.0510. The smaller these numbers are, the closer a model’s predictions are to the actual values, thus indicating greater accuracy. The Pearson’s correlation coefficient was marginally lower for the transformer model at 0.9612, compared to that of the TCN model. Nevertheless, this denotes a strong linear relationship between the predicted and true values.

4.4. ECG-ID Dataset Results

The proposed model was trained on this varied dataset to determine the optimum number of samples to be chosen. The model’s performance in reconstructing ECG signals was evaluated across a range of sampling rates from 18 to 120 samples per second (sps), which provides interesting patterns in the Pearson’s correlation coefficient (r), mean squared error (MSE), and root mean squared error (RMSE). These metrics offer a thorough assessment of the degree to which the reconstructed signal closely resembles the original ECG signal.
Figure 9, Figure 10, Figure 11 and Figure 12 illustrate the optimal time points selected for resampling the ECG signal of Person_30 in the database at two extremely different sampling rates: 18 sps and 120 sps. Figure 9 and Figure 11 demonstrate the distribution of optimal time points when the signal is reduced to 18 sps for both TCN and transformer models, while Figure 10 and Figure 12 present the optimal time points for a higher rate of 120 sps for both models, respectively. These figures highlight how the sampling density affects the selection of time points to ensure the reconstructed signal maintains high fidelity to the original.

4.4.1. TCN Model Results

These results show a clear trend with regard to the performance of the temporal convolutional network model with respect to MSE, RMSE, and r, as the number of samples per second varies from 18 to 120. There is a monotonic decrease in MSE and RMSE, thus proving that the accuracy in reconstructing signals improves when the number of samples increases from 18 to 120. In particular, from 0.0214 to 0.0161, MSE is decreasing, and RMSE from 0.1463 to 0.1267, thereby improving the fidelity of the reconstructed ECG signal. Another measure of interest is Pearson’s r, which quantifies the linear correlation between the original and reconstructed signals. This measure shows an upward trend from 0.6976 to 0.7866, indicating that with more samples used, the reconstructed signal goes increasingly in line with the original one. This result could, therefore, imply that the TCN model benefits to a large extent from a higher number of samples, which helps in capturing fine details and temporal dependencies within the ECG data. The model converges at about 120 samples, reflecting the optimal balance between sample size and reconstruction accuracy, hence applicable in the effective processing of ECG signals. In Table 2, performance is registered for the TCN model from different lower to higher sampling rates. Figure 13 presents the scatter plot for TCN model results.

4.4.2. Transformer Model Results

These results for the transformer model demonstrate quite good efficiency in the task of non-uniform sampling optimization for the reconstruction of ECG signals. There is a clear improvement in the performance metrics as the number of samples increases from 18 to 120, hence depicting more accuracy and fidelity in the reconstructed signal. The mean squared error reduces drastically from 0.0031 to 0.0005, and the root mean squared error also declines significantly from 0.0554 to 0.0216, thus giving a far more accurate representation of the actual signal. Also, Pearson’s correlation coefficient, r, climbs from 0.9355 to as high as 0.9904; thus, it is also shown that the linear relationship between the original and reconstructed signals is much stronger. These data show that the transformer model can still maintain high accuracy even with a smaller number of samples. In this case, all values for the Pearson r are always above 0.9, meaning that this model is likely to effectively give the essential features of the ECG signal, and hence, it could rebuild the signal with accuracy and reliability. The optimal performance of the model occurs at 120 samples. This is, therefore, a clear indication of the capacity of the model to efficiently make use of an increased number of samples in improving the quality of ECG signal representation. In Table 3, evaluations are performed for a transformer model for different lower to higher sampling rates. Figure 14 presents the scatter plot for transformer model results.

4.4.3. Comparative Analysis of TCN and Transformer Model Performance against State-of-the-Art (SOTA) Methods

1.
Performance at Lower Sampling Rates
Convolutional neural networks: Traditional CNNs mainly extract the morphological features from ECG signals and usually suffer from low sampling rates since they are unable to capture the temporal dependencies. It was proved that although CNNs were effective in spatial feature extraction, missing some important temporal patterns with low sampling rates significantly affected reconstruction quality [16]. The case of the TCN model shows much better consistency in improving Pearson’s CC, hence having a better capacity to retain temporal information, which is essential for rebuilding ECG signals.
The transformer model, on the other hand, uses self-attention mechanisms, which allows it to maintain high fidelity to the original signal even at low sampling rates, even better than TCN, as observed in the results.
Recurrent neural networks (RNNs) and LSTMs: While RNNs are commonly applied for the reconstruction of the ECG signal, methods using them, such as long short-term memory networks, can have the issues of vanishing gradient, mostly at lower sampling rates. This might cause the learning of long-term dependencies to be less effective [30]. On the other hand, the MSE and Pearson’s r obtained by the TCN model show a stable improvement with the increment in sampling rates. Therefore, it is more stable and efficient in capturing these long-term dependencies compared to traditional RNNs.
However, the Transformer model outdoes these models by attaining lower MSE and higher Pearson’s r, representing a better arrangement with the original signal.
2.
Performance at Higher Sampling Rates
Hybrid models: Methods that have combined CNN with RNN or attention mechanisms, such as CNN-LSTM with attention, display well-acceptable results in dealing with ECG signals by leveraging both spatial and temporal features [14]. Such models might attain similar or slightly improved MSE and RMSE values but often at an amplified computational cost. The stable performance of the TCN model at varying rates specifies that it offers a good trade-off between precision and computational efficiency, thus making this model a reasonable alternative to the other more intricate models.
The current transformer model not only matches but, in some cases, even outperforms these hybrids with a much simpler and more efficient architecture.
3.
Quantitative comparison of methods
Since the key emphasis of the proposed models lies in enhancing the accuracy of ECG signals using non-uniform sampling and deep learning-based models, compressive sensing is an essential baseline for efficiency evaluation. The comparison performance of existing CS-based methods with the proposed Transformer and TCN models (Table 4) is used to show how modern neural networks can further improve signal fidelity while maintaining or even exceeding efficacy and accuracy achieved by the traditional techniques. The accuracy results, in particular of the transformer model, show values on par with or exceeding Lee et al.’s outcomes [31].
Computational efficiency is emphasized using neural networks. Though direct execution times are not compared, emphasis on iterative gradient descent optimization suggests a balance in computational complexity and accuracy.
The TCN model’s performance metrics clearly improve with the number of samples, demonstrating the need for more samples in order to fully capture the temporal dependencies and intricate details present in the ECG signal. The model’s capacity to improve the fidelity of the reconstructed signal with additional samples is demonstrated by the steady decline in mean squared error (MSE) and root mean square error (RMSE), as well as the rising trend in Pearson’s correlation coefficient (r). The performance levels out at about 120 samples, indicating that this quantity offers the best balance for precise signal reconstruction. This suggests that although the TCN model gains a lot from larger sample sizes, it needs a large number of samples to function at its best, which may be taken into account in situations where sampling resources are limited.
Conversely, the transformer model exhibits a noteworthy ability to attain elevated precision in ECG signal reconstruction with a reduced amount of data. It continues to retain high standards of accuracy and fidelity at lower sample counts, but its performance metrics show noticeable gains with rising sample counts. The effectiveness of the transformer model in capturing the key characteristics of the ECG signal is demonstrated by its ability to consistently attain Pearson’s r values above 0.9, even with fewer samples. This implies that the transformer model is more effective at delivering precise signal reconstruction by making better use of the samples that are available, which makes it especially appropriate for applications where sampling rate limits are prevalent. Its performance reaches its highest point at 120 samples, with a unique 0.0005 MSE and 0.9904 Pearson’s r, demonstrating its robustness and reliability for medical diagnostics and monitoring applications.

5. Conclusions and Limitations

Conclusion: A potent approach for the reconstruction of ECG signals with TCN and the transformer model has been proposed. The models demonstrate non-uniform sampling situations of ECG signals, reducing reconstruction errors while retaining vital diagnostic information. Due to its convolutional layers, the TCN model is able to process long-range temporal dependencies and optimize the selection of time points for sampling. Contrarily, the transformer model uses an attention mechanism to capture complex temporal patterns, increasing orientation with the original ECG signals. Experimental results of different sampling rates demonstrate that the TCN model performed better at higher sampling rates—for instance, producing an MSE of 0.0174 and a Pearson’s r of 0.7661 at optimum settings. However, the transformer model proved to be efficient in keeping high accuracy, specifically at low sampling rates. It kept the MSE as low as 0.0005, with a Pearson’s r value of up to 0.9805, thereby keeping the integrity of the signal intact.
Comparative analysis of the state-of-the-art models proves that the methods proposed in this paper outperform existing techniques both in accuracy and reliability. At optimal lower sampling rates, the transformer model achieved an accuracy of 98.05% with a very high Pearson’s r of 0.9805 and 0.9904 at optimal higher sampling rates. The TCN model also showed significant improvements in the alignment and fidelity of the signal, which would particularly be useful in applications supporting higher sampling rates.
These results further confirm that both TCN and transformer models provide substantial improvement in ECG signal reconstruction; each has different advantages depending on the sampling rate and the application requirements. In the near future, efforts will be focused on investigating the potential of these models and extending applications to arrhythmia detection techniques.
Proposed models hold supreme clinical relevance for better precision and dependability in the processing of ECG signals. This degree of accuracy is vital in detecting slight changes in heart rhythms that otherwise might go undetected by traditional methods of diagnosis, as in cases of arrhythmia or myocardial infarction. Additionally, these models overcome the limitations of uniform sampling and conventional CNNs, which could have missed certain temporal patterns, thereby assuring the integrity of the ECG signal even in the presence of noise. The robustness of the proposed models to such instabilities makes them suitable for ICU continuous monitoring or outpatient ambulatory monitoring.
This also significantly impacts telemedicine, whereby reconstruction of ECG signals from models at different sampling rates allows high-fidelity ECG data to be transmitted across limited bandwidths without loss of diagnostic quality, simplifying remote patient monitoring. Such a capacity could be enormously helpful in managing chronic cardiovascular diseases in underserved or rural areas where convenience to specialized care is not to the mark. Furthermore, the model’s capability to adaptively sample and reconstruct ECG signals could be connected to develop personalized diagnostic tools. Patients with identified cardiac conditions could have their ECG data managed with models optimized for noticing specific incongruities, thereby refining continuing care. Similarly, wearables prepared with TCN or transformer models could deliver consistent data for long-term health monitoring, notifying both patients and healthcare providers of probable issues prior to them becoming perilous. Reduction in diagnostic errors allows the models to not only advance patient outcomes but also facilitate the proficiency of healthcare delivery. Their successful application thus opens the way for further studying of non-uniform sampling methods and ways of integrating them into other diagnostic modalities. Indeed, principles used here may be generalized to process other physiological signals, like electroencephalograms (EEGs), much better and provide enhanced diagnostic capabilities in many fields of medicine.
Limitations: Future research can mitigate the drawbacks of the proposed method. The models are sensitive to the initialization of time points [17]. The optimization using gradients could become trapped in the local minima. Since the models are only tested on ECG data, it is possible that they will not translate well to other time-series statistics [34,35,36]. Note that this optimization method can be computationally demanding and has an extensive time series [37]. Future research should focus on more solid methods of optimization, such as reinforcement learning or genetic algorithms, to find the optimal time points to answer these research questions, such as model extension to multivariate time-series data and multiple data set performance evaluations.

Author Contributions

Conceptualization, P.B. and P.A.; methodology, P.B.; software, P.B.; validation, P.B. and P.A.; formal analysis, P.B.; investigation, P.B.; resources, P.B.; data curation, P.B.; writing—original draft preparation, P.B.; writing—review and editing, P.B. and P.A.; visualization, P.B.; supervision, P.A.; project administration, P.A.; funding acquisition, P.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by AGH University of Krakow in the year 2024 as research project No. 16.16.120.773.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are available on demand form the corresponding author: [email protected].

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Bian, Y.; Chen, J.; Chen, X.; Yang, X.; Chen, D.Z.; Wu, J. Identifying Electrocardiogram Abnormalities Using a Handcrafted-Rule-Enhanced Neural Network. IEEE/ACM Trans. Comput. Biol. Bioinform. 2023, 20, 2434–2444. [Google Scholar] [CrossRef] [PubMed]
  2. Chen, H.; Wibowo, S.; Rajput, K.S. Compressive Sampling Based Multi-Spectrum Deep Learning for Sub-Nyquist Pacemaker ECG Analysis. In Proceedings of the 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Montreal, QC, Canada, 20–24 July 2020. [Google Scholar] [CrossRef]
  3. Jin, S.-C.; Hsieh, C.-J.; Chen, J.-C.; Tu, S.-H.; Chen, Y.-C.; Hsiao, T.-C.; Liu, A.; Chou, W.-H.; Chu, W.; Kuo, C.W. Development of Limited-Angle Iterative Reconstruction Algorithms with Context Encoder-Based Sinogram Completion for Micro-CT Applications. Sensors 2018, 18, 4458. [Google Scholar] [CrossRef] [PubMed]
  4. Saulnier, E.G.; Castro, J.C.; Cook, C.B. Impact of measurement error on predicting population-based inpatient glucose control. Future Sci. OA 2019, 5, FSO388. [Google Scholar] [CrossRef] [PubMed]
  5. Che, C.; Zhang, P.; Zhu, M.-S.; Qu, Y.; Jin, B. Constrained transformer network for ECG signal processing and arrhythmia classification. BMC Med. Inform. Decis. Mak. 2021, 21, 184. [Google Scholar] [CrossRef]
  6. Wang, B.; Ma, Z.; Lai, S.; Zhao, L. Neural Moving Horizon Estimation for Robust Flight Control. IEEE Trans. Robot. 2024, 40, 639–659. [Google Scholar] [CrossRef]
  7. Wang, X.; Liu, C.; Li, Y.; Cheng, X.; Li, J.; Clifford, G.D. Temporal-Framing Adaptive Network for Heart Sound Segmentation Without Prior Knowledge of State Duration. IEEE Trans. Biomed. Eng. 2021, 68, 650–663. [Google Scholar] [CrossRef]
  8. Alamr, A.; Artoli, A. Unsupervised Transformer-Based Anomaly Detection in ECG Signals. Algorithms 2023, 16, 152. [Google Scholar] [CrossRef]
  9. Zhao, Z. Transforming ECG Diagnosis: An In-depth Review of Transformer-based Deep Learning Models in Cardiovascular Disease Detection. arXiv 2023, arXiv:2306.01249. [Google Scholar]
  10. Naser, M.Z.; Alavi, A.H. Insights into Performance Fitness and Error Metrics for Machine Learning. arXiv 2020, arXiv:2006.00887. [Google Scholar]
  11. Potes, C.; Parvaneh, S.; Rahman, A.; Conroy, B. Ensemble of Feature:Based and Deep Learning:Based Classifiers for Detection of Abnormal Heart Sounds. In Proceedings of the 2016 Computing in Cardiology Conference (CinC), Vancouver, BC, Canada, 11–14 September 2016. [Google Scholar] [CrossRef]
  12. Saeedi, A.; Maghsoudi, A.; Rahatabad, F.N. Depression Diagnosis and Drug Response Prediction via Recurrent Neural Networks and Transformers Utilizing EEG Signals. arXiv 2023, arXiv:2303.06033. [Google Scholar] [CrossRef]
  13. Guan, J.; Wang, W.; Feng, P.; Wang, X.; Wang, W. Low-Dimensional Denoising Embedding Transformer for ECG Classification. In Proceedings of the ICASSP 2021—2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Toronto, ON, Canada, 6–11 June 2021. [Google Scholar] [CrossRef]
  14. Mondéjar-Guerra, V.; Novo, J.; Rouco, J.; Penedo, M.G.; Ortega, M. Heartbeat classification fusing temporal and morphological information of ECGs via ensemble of classifiers. Biomed. Signal Process. Control 2019, 47, 41–48. [Google Scholar] [CrossRef]
  15. Gao, Y.; Wang, H.; Liu, Z. An end-to-end atrial fibrillation detection by a novel residual-based temporal attention convolutional neural network with exponential nonlinearity loss. Knowl.-Based Syst. 2021, 212, 106589. [Google Scholar] [CrossRef]
  16. Hong, S.; Zhou, Y.; Shang, J.; Xiao, C.; Sun, J. Opportunities and Challenges of Deep Learning Methods for Electrocardiogram Data: A Systematic Review. Comput. Biol. Med. 2020, 122, 103801. [Google Scholar] [CrossRef] [PubMed]
  17. Augustyniak, P. Diagnostic Interpretation of Non-Uniformly Sampled Electrocardiogram. Sensors 2021, 21, 2969. [Google Scholar] [CrossRef]
  18. Gao, H.; Wang, X.; Chen, Z.; Wu, M.; Li, J.; Liu, C. ECG-CL: A Comprehensive Electrocardiogram Interpretation Method Based on Continual Learning. IEEE J. Biomed. Health Inform. 2023, 27, 5225–5236. [Google Scholar] [CrossRef]
  19. Oppenheim, V.A. Discrete-Time Signal Processing, 3rd ed.; Prentice-Hall Signal Processing Series; Pearson Education India: Noida, India, 2009. [Google Scholar]
  20. Serhani, A.M.; El Kassabi, H.T.; Ismail, H.; Navaz, A.N. ECG Monitoring Systems: Review, Architecture, Processes, and Key Challenges. Sensors 2020, 20, 1796. [Google Scholar] [CrossRef]
  21. Lugovaya, T.S. Biometric Human Identification Based on Electrocardiogram. Master’s Thesis, Faculty of Computing Technologies and Informatics, Electrotechnical University LETI, Saint Petersburg, Russia, 2005. [Google Scholar]
  22. Goldberger, A.L.; Amaral, L.A.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 2000, 101, e215–e220. [Google Scholar] [CrossRef]
  23. Kher, R.; Patel, G. Signal Processing Techniques for Removing Noise from ECG Signals. J. Biomed. Eng. Res. 2019, 3, 1–9. [Google Scholar] [CrossRef]
  24. Zhu, J.; Rao, N.; Liang, D.; Chen, W. Design of Pre-processing Circuit for Wireless ECG Monitoring System. In Proceedings of the 2008 International Conference on BioMedical Engineering and Informatics, Sanya, China, 27–30 May 2008. [Google Scholar] [CrossRef]
  25. Rajpurkar, P.; Hannun, A.; Haghpanahi, M.; Bourn, C.; Ng, A.Y. Cardiologist-Level Arrhythmia Detection with Convolutional Neural Networks. arXiv 2017, arXiv:1707.01836. [Google Scholar] [CrossRef]
  26. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. arXiv 2017, arXiv:1706.03762. [Google Scholar] [CrossRef]
  27. Geng, Q.; Liu, H.; Gao, T.; Liu, R.; Chen, C.; Zhu, Q.; Shu, M. An ECG Classification Method Based on Multi-Task Learning and CoT Attention Mechanism. Healthcare 2023, 11, 1000. [Google Scholar] [CrossRef] [PubMed]
  28. Islam, S.; Elmekki, H.; Elsebai, A.; Bentahar, J.; Drawel, N.; Rjoub, G.; Pedrycz, W. A comprehensive survey on applications of transformers for deep learning tasks. Expert Syst. Appl. 2024, 241, 122666. [Google Scholar] [CrossRef]
  29. Adam, A.; Farouk, R.M.; El-Desouky, B.S. Generalized gamma distribution for biomedical signals denoising. Signal Image Video Process. 2022, 17, 695–704. [Google Scholar] [CrossRef]
  30. Abdullah, L.A.; Al-Ani, M.S. CNN-LSTM based model for ECG arrhythmias and myocardial infarction classification. Adv. Sci. Technol. Eng. Syst. 2020, 5, 601–606. [Google Scholar] [CrossRef]
  31. Lee, J.; Kim, K.; Choi, J.-W. Pruning-Based Sparse Recovery for Electrocardiogram Reconstruction from Compressed Measurements. Sensors 2017, 17, 105. [Google Scholar] [CrossRef]
  32. Pant, J.K.; Krishnan, S. Compressive Sensing of Electrocardiogram Signals by Promoting Sparsity on the Second-Order Difference and by Using Dictionary Learning. IEEE Trans. Biomed. Circuits Syst. 2014, 8, 293–302. [Google Scholar] [CrossRef]
  33. Polania, L.F.; Sato, T.; Carrillo, R.; Nguyen, K.D. Exploiting Prior Knowledge in Compressed Sensing Wireless ECG Systems. IEEE Trans. Biomed. Eng. 2015, 62, 353–362. [Google Scholar] [CrossRef] [PubMed]
  34. Al-Zaiti, S.S.; Martin-Gill, C.; Zègre-Hemsey, J.K.; Bouzid, Z.; Faramand, Z.; Alrawashdeh, M.O.; Gregg, R.E.; Helman, S.; Riek, N.T.; Kraevsky-Phillips, K.; et al. Machine learning for ECG diagnosis and risk stratification of occlusion myocardial infarction. Nat. Med. 2023, 29, 1804–1813. [Google Scholar] [CrossRef]
  35. Deasy, J.; Ercole, A.; Lió, P. Adaptive Prediction Timing for Electronic Health Records. arXiv 2020, arXiv:2003.02554. [Google Scholar] [CrossRef]
  36. Jhin, Y.S.; Lee, J.-H.; Jo, M.; Kook, S.; Jeon, J.; Hyeong, J.; Kim, J.; Park, N. EXIT: Extrapolation and Interpolation-based Neural Controlled Differential Equations for Time-series Classification and Forecasting. In Proceedings of the ACM Web Conference 2022, Virtual Event, Lyon, France, 25–29 April 2022. [Google Scholar] [CrossRef]
  37. Rajpal, N.; Singh, R.; Mehta, R. Wavelet and KICA based ECG Beat Classification for Cardiac Health Care. In Proceedings of the 2018 4th International Conference for Convergence in Technology (I2CT), Mangalore, India, 27–28 October 2018. [Google Scholar] [CrossRef]
Figure 1. Raw ECG signal from the database (original signal).
Figure 1. Raw ECG signal from the database (original signal).
Applsci 14 08772 g001
Figure 2. Filtered ECG signal (modified signal).
Figure 2. Filtered ECG signal (modified signal).
Applsci 14 08772 g002
Figure 3. Architectural diagram of TCN model.
Figure 3. Architectural diagram of TCN model.
Applsci 14 08772 g003
Figure 4. Architectural diagram of transformer model.
Figure 4. Architectural diagram of transformer model.
Applsci 14 08772 g004
Figure 5. Block diagram of the proposed sampling and validation process.
Figure 5. Block diagram of the proposed sampling and validation process.
Applsci 14 08772 g005
Figure 6. Workflow of the proposed models—a programming viewpoint.
Figure 6. Workflow of the proposed models—a programming viewpoint.
Applsci 14 08772 g006
Figure 7. Synthetic signal output for TCN model.
Figure 7. Synthetic signal output for TCN model.
Applsci 14 08772 g007
Figure 8. Synthetic signal output for transformer model.
Figure 8. Synthetic signal output for transformer model.
Applsci 14 08772 g008
Figure 9. ECG optimization using TCN Model at 18 sps for Person_30 in the database.
Figure 9. ECG optimization using TCN Model at 18 sps for Person_30 in the database.
Applsci 14 08772 g009
Figure 10. ECG optimization using TCN Model at 120 sps for Person_30 in the database.
Figure 10. ECG optimization using TCN Model at 120 sps for Person_30 in the database.
Applsci 14 08772 g010
Figure 11. ECG optimization using the transformer model at 18 sps for Person_30 in the database.
Figure 11. ECG optimization using the transformer model at 18 sps for Person_30 in the database.
Applsci 14 08772 g011
Figure 12. ECG optimization using the transformer model at 120 sps for Person_30 in the database.
Figure 12. ECG optimization using the transformer model at 120 sps for Person_30 in the database.
Applsci 14 08772 g012
Figure 13. Scatter plot for TCN model showing actual outcome: (a) MSE vs. number of samples; (b) RMSE vs. number of samples; (c) Pearson’s r vs. number of samples.
Figure 13. Scatter plot for TCN model showing actual outcome: (a) MSE vs. number of samples; (b) RMSE vs. number of samples; (c) Pearson’s r vs. number of samples.
Applsci 14 08772 g013
Figure 14. Scatter plot for transformer model showing actual outcome: (a) MSE vs. number of samples; (b) RMSE vs. number of samples; (c) Pearson’s r vs. number of samples.
Figure 14. Scatter plot for transformer model showing actual outcome: (a) MSE vs. number of samples; (b) RMSE vs. number of samples; (c) Pearson’s r vs. number of samples.
Applsci 14 08772 g014
Table 1. Evaluation metrics for TCN and transformer.
Table 1. Evaluation metrics for TCN and transformer.
Models MSE RMSE Pearson’s Coefficient
TCN Model 0.0032 0.0573 0.9766
Transformer Model 0.0026 0.0510 0.9612
Table 2. Average evaluation metrics for TCN model.
Table 2. Average evaluation metrics for TCN model.
For Lower Sampling Rates
Samples per Second MSE RMSE Pearson’s r
18 0.0214 0.1463 0.6976
19 0.0215 0.1469 0.6942
20 0.0216 0.1472 0.6940
21 0.0194 0.1393 0.7322
22 0.0180 0.1341 0.7559
23 0.0185 0.1361 0.7471
24 0.0180 0.1340 0.7566
25 0.0180 0.1340 0.7568
26 0.0179 0.1339 0.7574
27 0.0179 0.1339 0.7574
28 0.0179 0.1338 0.7579
29 0.0179 0.1339 0.7574
30 0.0179 0.1338 0.7576
31 0.0179 0.1337 0.7581
32 0.0178 0.1336 0.7587
33 0.0178 0.1334 0.7594
34 0.0178 0.1334 0.7595
35 0.0177 0.1332 0.7605
36 0.0174 0.1318 0.7661
For Higher Sampling Rates
Samples per Second MSE RMSE Pearson’s r
46 0.0171 0.1307 0.7704
56 0.0169 0.1299 0.7739
66 0.0169 0.1299 0.7739
76 0.0166 0.1290 0.7777
86 0.0164 0.1281 0.7806
96 0.0163 0.1277 0.7823
106 0.0162 0.1273 0.7840
120 0.0161 0.1267 0.7866
Table 3. Average evaluation metrics for transformer model.
Table 3. Average evaluation metrics for transformer model.
For Lower Sampling Rates
Samples per Second MSE RMSE Pearson’s r
18 0.0031 0.0554 0.9355
19 0.0040 0.0635 0.9129
20 0.0048 0.0695 0.8946
21 0.0030 0.0544 0.9371
22 0.0013 0.0366 0.9718
23 0.0013 0.0367 0.9716
24 0.0013 0.0367 0.9717
25 0.0013 0.0363 0.9724
26 0.0013 0.0367 0.9717
27 0.0013 0.0359 0.9729
28 0.0013 0.0363 0.9723
29 0.0010 0.0313 0.9797
30 0.0009 0.0307 0.9805
31 0.0009 0.0308 0.9804
32 0.0010 0.0313 0.9798
33 0.0012 0.0351 0.9741
34 0.0010 0.0315 0.9793
35 0.0012 0.0342 0.9756
36 0.0009 0.0307 0.9805
For Higher Sampling Rates
Samples per Second MSE RMSE Pearson’s r
46 0.0008 0.0289 0.9826
56 0.0009 0.0299 0.9813
66 0.0007 0.0263 0.9856
76 0.0008 0.0279 0.9839
86 0.0006 0.0251 0.9870
96 0.0005 0.0221 0.9899
106 0.0006 0.0238 0.9883
120 0.0005 0.0216 0.9904
Table 4. Performance comparison of proposed methods against state-of-the-art non uniform ECG representations.
Table 4. Performance comparison of proposed methods against state-of-the-art non uniform ECG representations.
PapersAlgorithmsSignal-to-Noise RatioPercentage Root-Mean-Square DifferenceCompression Ratio
Pant et al. [32]RLS and RLS-DL39 dBNot explicitly provided86%
i.e., CR = 7.14
Polania et al. [33]MMB-IHT and MMD-CoSaMP25–28 dB2.98–25.58%CR up to 8.0
Lee et al. [31]TPMPLow PRD indicates high-quality signal reconstruction.0.72–0.86%CR between 3.5 and 8.0
Proposed methodsTCN ModelSignal quality improved by low MSE.1.61% at CR = 4.16 (120 sps);
2.14% at CR = 27.8 (18 sps)
CR between
4.16 and 27.8
Does not focus on compression, instead minimizing data points without affecting quality
Transformer Model0.05% at CR = 4.16 (120 sps);
0.31% at CR = 27.8 (18 sps)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Bhattacharjee, P.; Augustyniak, P. Comparative Evaluation of Neural Network Models for Optimizing ECG Signal in Non-Uniform Sampling Domain. Appl. Sci. 2024, 14, 8772. https://doi.org/10.3390/app14198772

AMA Style

Bhattacharjee P, Augustyniak P. Comparative Evaluation of Neural Network Models for Optimizing ECG Signal in Non-Uniform Sampling Domain. Applied Sciences. 2024; 14(19):8772. https://doi.org/10.3390/app14198772

Chicago/Turabian Style

Bhattacharjee, Pratixita, and Piotr Augustyniak. 2024. "Comparative Evaluation of Neural Network Models for Optimizing ECG Signal in Non-Uniform Sampling Domain" Applied Sciences 14, no. 19: 8772. https://doi.org/10.3390/app14198772

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop