## 1 Introduction
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.