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.
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.
Fig.1ECG signal comparison with noise reduction using wavelet method
Fig.2Five types of heart beat morphology
Fig.3Proportion 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.1Comparison 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.2Comparison of number of heartbeats in training set after data augment
Fig.4Structure 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.3Parameters of parallel architecture model
Fig.5Overall structure of Bi-LSTM
Fig.6Structure of GCA Block
Fig.7Structure of GTSA Block
Fig.8Accuracy and loss curves of heartbeat classification during training and test validation
Fig.9Confusion 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.4Classification results over different evaluation metrics
Fig.10Effect 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.5Comparison of classification performance by proposed network and other methods
Fig.11Heat-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.6Beat 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.7Beat 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.8Beat 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.9Model 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