Please wait a minute...
浙江大学学报(工学版)  2022, Vol. 56 Issue (10): 1912-1923    DOI: 10.3785/j.issn.1008-973X.2022.10.003
自动化技术、信息工程     
基于并行架构和时空注意力机制的心电分类方法
彭向东(),潘从成(),柯泽浚,朱华强,周肖
江西财经大学 软件与物联网工程学院,江西 南昌 330032
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
 全文: PDF(3015 KB)   HTML
摘要:

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

关键词: 心电分类数据不平衡深度学习并行架构时空注意力机制    
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 words: electrocardiograph classification    data imbalanced    deep learning    parallel architecture    spatiotemporal attention mechanism
收稿日期: 2022-03-06 出版日期: 2022-10-25
CLC:  TP 183  
基金资助: 江西省自然科学基金资助项目(20192BAB207003);江西省教育厅科学技术研究资助项目(GJJ180263)
作者简介: 彭向东(1975—),男,讲师,硕导,从事机器学习、体域网和生物医学信号处理的研究. orcid.org/0000-0001-9929-6830. E-mail: pengxiangdong@jxufe.edu.cn
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
彭向东
潘从成
柯泽浚
朱华强
周肖

引用本文:

彭向东,潘从成,柯泽浚,朱华强,周肖. 基于并行架构和时空注意力机制的心电分类方法[J]. 浙江大学学报(工学版), 2022, 56(10): 1912-1923.

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.

链接本文:

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

图 1  小波方法的去噪对比图
图 2  5种类型心拍的形态图
图 3  ECG数据集划分的比例
心律类型 Nb
训练集 测试集 总计
N 72379 18140 90519
S 2206 551 2757
V 5762 1378 7140
F 629 171 800
Q 6424 1610 8034
表 1  数据增强前训练集和测试集的心拍数量对比
心律类型 Nb
数据增强前 数据增强后
N 72379 72379
S 2206 3152
V 5762 7365
F 629 2617
Q 6424 8593
表 2  数据增强后训练集的心拍数量对比
图 4  并行架构模型
类型 网络层 激活函数 卷积核数 神经元数 步长
输入 输入层 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
表 3  并行架构模型的参数
图 5  Bi-LSTM的整体结构
图 6  GCA Block的具体结构
图 7  GTSA Block的具体结构
图 8  在训练过程和测试验证过程中心拍分类的准确率和损失值曲线
图 9  心拍分类的混淆矩阵
心律类型 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
表 4  不同评价指标下的分类结果
图 10  数据增强对心电信号分类效果的影响
方法 类别 方法 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
表 5  本文方法与其他方法的分类效果对比
图 11  5种类型心电信号的热度图
心律类型 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
表 6  小尺度方法的心拍分类结果
心律类型 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
表 7  大尺度下的心拍分类效果
心律类型 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
表 8  多尺度下的心拍分类效果
心律类型 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
表 9  基于5折交叉验证的模型分类性能波动范围
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] 刘近贞,陈飞,熊慧. 多尺度残差网络模型的开放式电阻抗成像算法[J]. 浙江大学学报(工学版), 2022, 56(9): 1789-1795.
[2] 王万良,王铁军,陈嘉诚,尤文波. 融合多尺度和多头注意力的医疗图像分割方法[J]. 浙江大学学报(工学版), 2022, 56(9): 1796-1805.
[3] 郝琨,王阔,王贝贝. 基于改进Mobilenet-YOLOv3的轻量级水下生物检测算法[J]. 浙江大学学报(工学版), 2022, 56(8): 1622-1632.
[4] 夏杰锋,唐武勤,杨强. 光伏航拍红外图像的热斑自动检测方法[J]. 浙江大学学报(工学版), 2022, 56(8): 1640-1647.
[5] 赵永胜,李瑞祥,牛娜娜,赵志勇. 数字孪生驱动的机身形状控制方法[J]. 浙江大学学报(工学版), 2022, 56(7): 1457-1463.
[6] 何立,庞善民. 结合年龄监督和人脸先验的语音-人脸图像重建[J]. 浙江大学学报(工学版), 2022, 56(5): 1006-1016.
[7] 张雪芹,李天任. 基于Cycle-GAN和改进DPN网络的乳腺癌病理图像分类[J]. 浙江大学学报(工学版), 2022, 56(4): 727-735.
[8] 褚晶辉,史李栋,井佩光,吕卫. 适用于目标检测的上下文感知知识蒸馏网络[J]. 浙江大学学报(工学版), 2022, 56(3): 503-509.
[9] 程若然,赵晓丽,周浩军,叶翰辰. 基于深度学习的中文字体风格转换研究综述[J]. 浙江大学学报(工学版), 2022, 56(3): 510-519, 530.
[10] 陈彤,郭剑锋,韩心中,谢学立,席建祥. 基于生成对抗模型的可见光-红外图像匹配方法[J]. 浙江大学学报(工学版), 2022, 56(1): 63-74.
[11] 任松,朱倩雯,涂歆玥,邓超,王小书. 基于深度学习的公路隧道衬砌病害识别方法[J]. 浙江大学学报(工学版), 2022, 56(1): 92-99.
[12] 刘兴,余建波. 注意力卷积GRU自编码器及其在工业过程监控的应用[J]. 浙江大学学报(工学版), 2021, 55(9): 1643-1651.
[13] 陈雪云,黄小巧,谢丽. 基于多尺度条件生成对抗网络血细胞图像分类检测方法[J]. 浙江大学学报(工学版), 2021, 55(9): 1772-1781.
[14] 刘嘉诚,冀俊忠. 基于宽度学习系统的fMRI数据分类方法[J]. 浙江大学学报(工学版), 2021, 55(7): 1270-1278.
[15] 金立生,华强,郭柏苍,谢宪毅,闫福刚,武波涛. 基于优化DeepSort的前方车辆多目标跟踪[J]. 浙江大学学报(工学版), 2021, 55(6): 1056-1064.