Abstract
The anomaly detection of electrocardiogram (ECG) data is crucial for identifying deviations from normal heart rhythm patterns and providing timely interventions for high-risk patients. Various autoencoder (AE) models within machine learning (ML) have been proposed for this task. However, these models often do not explicitly consider the specific patterns in ECG time series, thereby impacting their learning efficiency. In contrast, we adopt a method based on prior knowledge of ECG time series shapes, employing multi-stage preprocessing, adaptive convolution kernels, and Toeplitz matrices to replace the encoding part of the AE. This approach combines inherent ECG features with the symmetry of Toeplitz matrices, effectively extracting features from ECG signals and reducing dimensionality. Our model consistently outperforms state-of-the-art models in anomaly detection, achieving an overall accuracy exceeding 99.6%, with Precision and Area Under the Receiver Operating Characteristic Curve (AUC) reaching 99.8%, and Recall peaking at 99.9%. Moreover, the runtime is significantly reduced. These results demonstrate that our technique effectively detects anomalies through automatic feature extraction and enhances detection performance on the ECG5000 dataset, a benchmark collection of heartbeat signals.