TranECG:Transformer based Multi-lead ECG Anomaly Detection
-
Graphical Abstract
-
Abstract
Electrocardiogram (ECG) is one of the most used tools for detecting cardiovascular diseases. However, ECG analysis heavily relies on the experience of medical experts, leading to low analysis efficiency. To address this, we propose an anomaly detection method called TranECG, which integrates the ideas of Transformer and Generative Adversarial Network (GAN). First, the long-sequence ECG data is segmented into several equidistant heartbeat segments. Then, a reconstruction model based on GAN is employed to learn the normal patterns of the heartbeat segments and generate the corresponding reconstructed sequences. Finally, the anomaly detection module analyzes the residual matrix between the reconstructed sequences and the original sequences to determine whether anomalies exist in the ECG. Additionally, to explicitly locate anomalies, a heatmap is constructed based on the attention coefficient matrix of the anomaly detection module, visualizing the positions of anomalies in the ECG. Experimental results on the two ECG datasets from CPSC and AIWIN demonstrate that the accuracy of TranECG is improved by 4.7% on average, and the area under the curve (AUC) is enhanced by 1.4% on average compared to competitive methods in the paper.
-
-