AUTHOR=Ge Zhaoyang , Cheng Huiqing , Tong Zhuang , Yang Lihong , Zhou Bing , Wang Zongmin TITLE=Pacing Electrocardiogram Detection With Memory-Based Autoencoder and Metric Learning JOURNAL=Frontiers in Physiology VOLUME=Volume 12 - 2021 YEAR=2021 URL=https://www.frontiersin.org/journals/physiology/articles/10.3389/fphys.2021.727210 DOI=10.3389/fphys.2021.727210 ISSN=1664-042X ABSTRACT=Background and Objective: Remote ECG diagnosis has been widely used in the clinical ECG workflow. However, the existing commercial ECG diagnosis algorithms still show substantial rates of misdiagnosis, especially the pacing ECG with other abnormalities. Some of the works to employ autoencoder toward diagnosing ECG abnormalities focus on minimizing the reconstruction error on the training data and then uses the reconstruction error as an indicator of detection. It has been proved that sometimes the traditional autoencoder “generalizes” so well that it may compress and reconstruct a specific type of anomaly to a different kind of anomaly. Therefore, this may lead to false detections when using hidden features for diagnosing ECG abnormalities. Methods: In this paper, we propose a novel autoencoder network with a memory module, which can classify the pacing ECG and other abnormalities of routine ECG very well. First, we designed an automatic encoder with a memory module. Given an input of pacing ECG, the memory module can obtain and memorize latent features from the encoder and then use them to retrieve the most relevant memory items for reconstructing input data. In the training phase, the memory items are updated to represent the latent features of the input pacing ECG. In the testing phase, the reconstructed data is obtained from combined features of input data from the encoder and the features in the memory module. Therefore, the class of reconstructed data will be close to the class of training data. Then, we design a new objective function based on the idea of metric learning. According to the objective function, the distance can be calculated among the samples for clustering each class. Results and Conclusion: The proposed method achieves an average F1-score of 0.918 on the pacing ECG database and performs an average F1-score of 0.949 on the MIT-BIH arrhythmia database. Our experiments on various databases prove the proposed Memory-based automatic encoder model (MAE) has excellent generality and high effectiveness.