Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2022, Vol. 56 Issue (10): 1912-1923    DOI: 10.3785/j.issn.1008-973X.2022.10.003
    
Classification method for electrocardiograph signals based on parallel architecture model and spatial-temporal attention mechanism
Xiang-dong PENG(),Cong-cheng PAN(),Ze-jun KE,Hua-qiang ZHU,Xiao ZHOU
School of Software and Internet of Things Engineering, Jiangxi University of Finance and Economics, Nanchang 330032, China
Download: HTML     PDF(3015KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

A parallel architecture electrocardiograph (ECG) classification model based on deep learning was proposed in order to effectively extract the spatiotemporal characteristics of ECG signals and improve the classification accuracy. A spatiotemporal attention mechanism based on gate channel attention block (GCA block) and gate time step attention (GTSA block) module was adopted in order to achieve multi-channel feature fusion. The bidirectional long-short time memory network and the convolutional neural network were used as the base feature extractor. The before-after dependence of the ECG signal sequence data and the local correlation features at different scales were captured respectively, and the automatic classification of five different types of ECG signals was realized. Results verified on the MIT-BIH dataset showed that the accuracy, specificity, sensitivity, accuracy and Macro-F1 of the total classification of five different ECG signals by the method were 99.50%, 99.61%, 96.20%, 98.02% and 97.08%, respectively. The model can not only effectively shorten the depth of the network model and prevent the model from overfitting, but also more accurately extract the spatiotemporal characteristics of the ECG signal and obtain better classification performance compared with other ECG classification models.



Key wordselectrocardiograph classification      data imbalanced      deep learning      parallel architecture      spatiotemporal attention mechanism     
Received: 06 March 2022      Published: 25 October 2022
CLC:  TP 183  
Fund:  江西省自然科学基金资助项目(20192BAB207003);江西省教育厅科学技术研究资助项目(GJJ180263)
Cite this article:

Xiang-dong PENG,Cong-cheng PAN,Ze-jun KE,Hua-qiang ZHU,Xiao ZHOU. Classification method for electrocardiograph signals based on parallel architecture model and spatial-temporal attention mechanism. Journal of ZheJiang University (Engineering Science), 2022, 56(10): 1912-1923.

URL:

https://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2022.10.003     OR     https://www.zjujournals.com/eng/Y2022/V56/I10/1912


基于并行架构和时空注意力机制的心电分类方法

为了有效提取心电信号 (ECG) 的时空特征和提高分类准确性,提出基于深度学习的并行架构心电分类模型. 该模型采用基于GCA Block和GTSA Block模块实现多路特征融合的时空注意力机制. 使用双向长短时记忆网络和卷积神经网络作为基特征提取器,分别捕捉心电信号序列数据的前后依赖关系和不同尺度上的局部相关特征,实现对5种不同类型的心电信号的自动分类. 在MIT-BIH数据集上验证的结果表明,该方法对5种不同心电信号的总体分类准确率、特异性、敏感度、精确度和Macro-F1分别为99.50%、99.61%、96.20%、98.02%和97.08%. 相较于其他心电分类模型,该模型不仅能够有效地缩短网络模型深度,防止模型过拟合,而且能够更准确地提取心电信号的时空特征,获得更好的分类性能.


关键词: 心电分类,  数据不平衡,  深度学习,  并行架构,  时空注意力机制 
Fig.1 ECG signal comparison with noise reduction using wavelet method
Fig.2 Five types of heart beat morphology
Fig.3 Proportion of ECG dataset split
心律类型 Nb
训练集 测试集 总计
N 72379 18140 90519
S 2206 551 2757
V 5762 1378 7140
F 629 171 800
Q 6424 1610 8034
Tab.1 Comparison of number of heartbeats in training and test sets before data augment
心律类型 Nb
数据增强前 数据增强后
N 72379 72379
S 2206 3152
V 5762 7365
F 629 2617
Q 6424 8593
Tab.2 Comparison of number of heartbeats in training set after data augment
Fig.4 Structure of parallel architecture model
类型 网络层 激活函数 卷积核数 神经元数 步长
输入 输入层 340×1
输入 1D Conv + BN Relu 32 7×1 1
大尺度 最大池化层 3×1 2
大尺度 GCA Block×4
大尺度 1D Conv + BN Relu 32 5×1 1
小尺度 最大池化层 2×1 2
小尺度 GCA Block×3
小尺度 Bi-LSTM+BN Tanh 170×1
Bi-LSTM GTSA Block
Bi-LSTM GAP
特征融合 Concate
特征融合 全连接层 Relu 256×1
特征融合 Dropout
输出 全连接层 Relu 128×1
输出 Addition
输出 全连接层 Softmax 5×1
Tab.3 Parameters of parallel architecture model
Fig.5 Overall structure of Bi-LSTM
Fig.6 Structure of GCA Block
Fig.7 Structure of GTSA Block
Fig.8 Accuracy and loss curves of heartbeat classification during training and test validation
Fig.9 Confusion matrix of heartbeat classification
心律类型 Spe/% Sen/% Pre/% F1/%
N 98.25 99.84 99.64 99.74
S 99.90 94.37 95.94 95.15
V 99.94 98.19 99.12 98.65
F 99.97 88.89 95.60 92.12
Q 99.99 99.81 99.81 99.75
Tab.4 Classification results over different evaluation metrics
Fig.10 Effect of data enhancement on effectiveness of ECG signal classification
方法 类别 方法 OA/% Spe/% Sen/% Macro-F1/%
文献[19]方法 5 CNN-LSTM 98.10 98.70 97.50
文献[30]方法 5 FCMDBN 96.54 98.32
文献[31]方法 8 4-layer LSTM 99.26 99.14 99.26
文献[32]方法 5 CAE + LSTM 99.23
文献[20]方法 5 STFT + 2-DCNN 99.0
文献[18]方法 5 CNN + BLSTM 95.90 95.90 95.92
文献[21]方法 4 CNN + BLSTM 99.56 99.47 95.90 96.40
文献[27]方法 5 HCRNet 98.70 99.28 99.38
本文方法 5 PSTA- Net 99.50 99.61 96.20 97.08
Tab.5 Comparison of classification performance by proposed network and other methods
Fig.11 Heat-map of five types of ECG signals
心律类型 Spe/% Sen/% Pre/% F1/%
N 98.15 98.31 99.43 98.87
S 97.41 92.05 93.14 92.59
V 99.37 97.11 98.13 97.62
F 98.42 85.07 94.39 89.49
Q 99.71 98.27 99.43 98.85
Tab.6 Beat classification results of small-scale methods
心律类型 Spe/% Sen/% Pre/% F1/%
N 99.21 99.12 99.39 99.25
S 98.54 93.29 93.42 93.36
V 99.48 96.75 98.73 97.73
F 98.53 85.36 94.71 89.79
Q 99.69 99.07 99.28 99.17
Tab.7 Beat classification results of large-scale methods
心律类型 Spe/% Sen/% Pre/% F1/%
N 99.34 99.33 99.66 99.49
S 98.29 94.02 94.98 94.50
V 99.53 97.01 99.03 98.01
F 99.66 85.73 95.17 90.20
Q 99.81 99.19 99.31 99.25
Tab.8 Beat classification results of multi-scale methods
心律类型 Sen/% F1/% Spe/%
N ±0.24 ±0.27 ±0.13
S ±0.41 ±0.52 ±0.24
V ±0.39 ±0.57 ±0.19
F ±0.87 ±0.93 ±0.95
Q ±0.23 ±0.21 ±0.15
Tab.9 Model classification performance fluctuation range based on 5-fold cross-validation
[1]   EBRAHIMI Z, LONI M, DANESHTALAB M, et al A review on deep learning methods for ECG arrhythmia classification[J]. Expert Systems with Applications: X, 2020, 7: 100033
doi: 10.1016/j.eswax.2020.100033
[2]   CHOI S, ADNANE M, LEE G J, et al Development of ECG beat segmentation method by combining low-pass filter and irregular R–R interval checkup strategy[J]. Expert Systems with Applications, 2010, 37 (7): 5208- 5218
doi: 10.1016/j.eswa.2009.12.069
[3]   ASL B, SETAREHADN S, MOHEBBI M Support Vector machine-based arrhythmia classification using reduced features of heart rate variability signal[J]. Artificial Intelligence in Medicine, 2008, 44 (1): 51- 64
doi: 10.1016/j.artmed.2008.04.007
[4]   FAN X, YAO Q, CAI Y, et al Multi-scaled fusion of deep convolutional neural networks for screening atrial fibrillation from single lead short ecg recordings[J]. IEEE Journal of Biomedical and Health Informatics, 2018, 22 (6): 1744- 1753
doi: 10.1109/JBHI.2018.2858789
[5]   HANNUN A Y, RAJPURKAR P, HAGHPANAHI M, et al Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network[J]. Nature Medicine, 2019, 25 (1): 65- 69
doi: 10.1038/s41591-018-0268-3
[6]   ZHANG J, LIU A, GAO M, et al ECG-based multi-class arrhythmia detection using spatio-temporal attention based convolutional recurrent neural network[J]. Artificial Intelligence in Medicine, 2020, 106: 101856
doi: 10.1016/j.artmed.2020.101856
[7]   SAADATNEJAD S, OVEISI M, HASHEMI M LST-M based ECG classification for continuous monitoring on personal wearable devices[J]. IEEE Journal of Biomedical and Health Informatics, 2019, 24 (2): 515- 523
[8]   LYNN H M, PAN S B, KIM P A deep bidirectional GRU network model for biometric electrocardiogram classification based on recurrent neural networks[J]. IEEE Access, 2019, 7: 145395- 145405
[9]   YAO Q, FAN X, CAI Y, et al. Time-incremental convolutional neural network for arrhythmia detection in varied-length electrocardiogram [C]// 2018 IEEE 16th International Conference on Dependable, Autonomic and Secure Computing, 16th International Conference on Pervasive Intelligence and Computing, 4th International Conference on Big Data Intelligence and Computing and Cyber Science and Technology Congress. Athens: IEEE, 2018: 754-761.
[10]   HE R, LIU Y, WANG K, et al Automatic cardiac arrhythmia classification using combination of deep residual network and bidirectional LSTM[J]. IEEE Access, 2019, 7: 102119- 102135
doi: 10.1109/ACCESS.2019.2931500
[11]   YAO Q, WANG R, FAN X, et al Multi-class arrhythmia detection from 12-lead varied-length ECG using attention based time-incremental convolutional neural network[J]. Information Fusion, 2020, 53: 174- 182
doi: 10.1016/j.inffus.2019.06.024
[12]   WANG P, HOU B, SHAO S, et al ECG arrhythmiasdetection using auxiliary classifier generative adversarial network and residual network[J]. IEEE Access, 2019, 27 (2): 100910- 100922
[13]   HOU B, YANG J, WANG P, et al LSTM-based auto-encoder model for ECG arrhythmias classification[J]. IEEE Transactions on Instrumentation and Measurement, 2019, 69 (4): 1232- 1240
[14]   MOODY G B, MARK R G The impact of the MIT-BIH arrhythmia database[J]. IEEE Engineering in Medicine and Biology Magazine, 2001, 20 (3): 45- 50
doi: 10.1109/51.932724
[15]   ZHANG M, LU C, LIU C Improved double-threshold denoising method based on the wavelet transform[J]. OSA Continuum, 2019, 2 (8): 2328- 2342
doi: 10.1364/OSAC.2.002328
[16]   ANSI/AAMI. Testing and reporting performance results of cardiac rhythm and ST segment measurement algorithms[S]. Washington: ANSI, 2008.
[17]   HE H, BAI Y, GARCIA E A, et al. ADASYN: adaptive synthetic sampling approach for imbalanced learning [C]// 2008 IEEE International Joint Conference on Neural Networks. Hongkong: IEEE, 2008: 1322-1328.
[18]   XU X, JEONG S, LI J Interpretation of electrocardiogram (ECG) rhythm by combined CNN and BiLSTM[J]. IEEE Access, 2020, 28 (3): 125380- 125388
[19]   OH S L, NG E Y K, SAN T R, et al Automated diagnosis of arrhythmia using combination of CNN and LSTM techniques with variable length heart beats[J]. Computers in Biology and Medicine, 2018, 102: 278- 287
doi: 10.1016/j.compbiomed.2018.06.002
[20]   HUANG J, CHEN B, YAO B, et al ECG arrhythmia classification using STFT-based spectrogram and convolutional neural network[J]. IEEE Access, 2019, 7: 92871- 92880
doi: 10.1109/ACCESS.2019.2928017
[21]   CHEN A, WANG F, LIU W, et al Multi-information fusion neural networks for arrhythmia automatic detection[J]. Computer Methods and Programs in Biomedicine, 2020, 193: 105479
doi: 10.1016/j.cmpb.2020.105479
[22]   RAMARAJ E A novel deep learning based gated recurrent unit with extreme learning machine for electrocardiogram (ECG) signal recognition[J]. Biomedical Signal Processing and Control, 2021, 68: 102779
doi: 10.1016/j.bspc.2021.102779
[23]   JIN Y, QIN C, HUANG Y, et al Multi-domain modeling of atrial fibrillation detection with twin attentional convolutional long short-term memory neural networks[J]. Knowledge-Based Systems, 2020, 193: 105460
doi: 10.1016/j.knosys.2019.105460
[24]   GE R, SHEN T, ZHOU Y, et al Convolutional squeeze-and-excitation network for ECG arrhythmia detection[J]. Artificial Intelligence in Medicine, 2021, 121: 102181
doi: 10.1016/j.artmed.2021.102181
[25]   LU Y, JIANG M, WEI L, et al Automated arrhythmia classification using depth wise separable convolutional neural network with focal loss[J]. Biomedical Signal Processing and Control, 2021, 69: 102843
doi: 10.1016/j.bspc.2021.102843
[26]   ALJOHANI N R, FAYOUMI A, HASSAN S U A novel focal-loss and class-weight-aware convolutional neural network for the classification of in-text citations[J]. Journal of Information Science, 2021, 6 (3): 165- 176
[27]   LUO X, YANG L, CAI H, et al Multi-classification of arrhythmias using a HCR-Net on imbalanced ECG datasets[J]. Computer Methods and Programs in Biomedicine, 2021, 208: 106258
doi: 10.1016/j.cmpb.2021.106258
[28]   LI C, ZHAO H, LU W, et al DeepECG: image-based electrocardiogram interpretation with deep convolutional neural networks[J]. Biomedical Signal Processing and Control, 2021, 69: 102824
doi: 10.1016/j.bspc.2021.102824
[29]   MURAT F, YILDIRIM O, TALO M, et al Application of deep learning techniques for heartbeats detection using ECG signals analysis and review [J]. Computers in Biology and Medicine, 2020, 120: 103726
doi: 10.1016/j.compbiomed.2020.103726
[30]   吴志勇, 丁香乾, 许晓伟, 等 基于深度学习和模糊C均值的心电信号分类方法[J]. 自动化学报, 2018, 44 (1): 1913- 1920
WU Zhi-yong, DING Xiang-qian, XU Xiao-wei, et al A classification method for ECG signals based on deep learning and fuzzy C-means[J]. Journal of Automatica Sinica, 2018, 44 (1): 1913- 1920
doi: 10.16383/j.aas.2018.c170417
[31]   GAO J, ZHANG H, LU P, et al An effective LSTM recurrent network to detect arrhythmia on imbalanced ECG dataset[J]. Journal of Healthcare Engineering, 2019, 12 (3): 1- 10
[1] Jin-zhen LIU,Fei CHEN,Hui XIONG. Open electrical impedance imaging algorithm based on multi-scale residual network model[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(9): 1789-1795.
[2] Wan-liang WANG,Tie-jun WANG,Jia-cheng CHEN,Wen-bo YOU. Medical image segmentation method combining multi-scale and multi-head attention[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(9): 1796-1805.
[3] Kun HAO,Kuo WANG,Bei-bei WANG. Lightweight underwater biological detection algorithm based on improved Mobilenet-YOLOv3[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(8): 1622-1632.
[4] Yong-sheng ZHAO,Rui-xiang LI,Na-na NIU,Zhi-yong ZHAO. Shape control method of fuselage driven by digital twin[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(7): 1457-1463.
[5] Li HE,Shan-min PANG. Face reconstruction from voice based on age-supervised learning and face prior information[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(5): 1006-1016.
[6] Xue-qin ZHANG,Tian-ren LI. Breast cancer pathological image classification based on Cycle-GAN and improved DPN network[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(4): 727-735.
[7] Jing-hui CHU,Li-dong SHI,Pei-guang JING,Wei LV. Context-aware knowledge distillation network for object detection[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(3): 503-509.
[8] Ruo-ran CHENG,Xiao-li ZHAO,Hao-jun ZHOU,Han-chen YE. Review of Chinese font style transfer research based on deep learning[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(3): 510-519, 530.
[9] Tong CHEN,Jian-feng GUO,Xin-zhong HAN,Xue-li XIE,Jian-xiang XI. Visible and infrared image matching method based on generative adversarial model[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(1): 63-74.
[10] Song REN,Qian-wen ZHU,Xin-yue TU,Chao DENG,Xiao-shu WANG. Lining disease identification of highway tunnel based on deep learning[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(1): 92-99.
[11] Xing LIU,Jian-bo YU. Attention convolutional GRU-based autoencoder and its application in industrial process monitoring[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(9): 1643-1651.
[12] Xue-yun CHEN,Xiao-qiao HUANG,Li XIE. Classification and detection method of blood cells images based on multi-scale conditional generative adversarial network[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(9): 1772-1781.
[13] Jia-cheng LIU,Jun-zhong JI. Classification method of fMRI data based on broad learning system[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(7): 1270-1278.
[14] Li-sheng JIN,Qiang HUA,Bai-cang GUO,Xian-yi XIE,Fu-gang YAN,Bo-tao WU. Multi-target tracking of vehicles based on optimized DeepSort[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(6): 1056-1064.
[15] Teng ZHANG,Xin-long JIANG,Yi-qiang CHEN,Qian CHEN,Tao-mian MI,Piu CHAN. Wrist attitude-based Parkinson's disease ON/OFF state assessment after medication[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(4): 639-647.