Arrhythmia classification adaptive network based on variable convolution and bidirectional lstm
Patent Information
- Application Number
- CN202210419592.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-21
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-04-21
AI Technical Summary
[0006]本发明的目的在于针对传统的心电信号分类技术存在特征提取繁琐复杂,准确率低以及泛化能力差等缺点,提出一种基于可变卷积和双向LSTM的心律失常分类自适应网络(ADLNet)
[0037]本发明的有益效果在于:(1)降低了解决问题的繁琐复杂过程;(2)有效地提高了心电信号分类准确率。
Smart Images

Figure CN116992922B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine learning and pattern recognition technology. It constructs a robust neural network prediction method using a given 12-lead electrocardiogram (ECG) dataset in order to correctly classify new ECG signals. Technical Background
[0002] With the increasing incidence and mortality rates of heart disease, human health is directly threatened. Electrocardiogram (ECG) recognition is a crucial prerequisite for the clinical diagnosis of heart disease. Due to the ever-increasing demand for ECG diagnosis, manual ECG recognition is slow and lacks real-time performance. Therefore, research on automatic ECG recognition technology has been a focus of attention for scholars from various fields.
[0003] In recent years, deep learning technology has simulated biological neurons to automatically extract and process data through supervised or unsupervised learning, leaving the manual extraction of complex features to be completed automatically by computers, significantly reducing the automation complexity of data processing. Due to its powerful information extraction and model fitting capabilities, deep learning technology has been widely applied in the field of electrocardiogram (ECG) signal diagnosis. Among them, convolutional neural networks (CNNs) are a type of feedforward neural network that includes convolutional computation and has a deep structure. They possess representation learning capabilities, strong ability to extract local small-scale features, and characteristics such as few training parameters, good robustness, and high diagnostic accuracy. Therefore, many ECG signal diagnosis methods based on CNNs are currently available.
[0004] Single-lead ECG signals cannot fully reflect the electrical characteristics of the heart. When processing multi-lead data, it is necessary to consider periodic information and the relationship between leads. Variable convolution can select meaningful features based on the data characteristics of the actual signal, and a larger receptive field can improve accuracy by integrating more information. Dilated convolution can learn features in a broader temporal dimension, thereby solving the above problems.
[0005] This invention proposes an adaptive network for arrhythmia classification—ADLNet—based on variable convolution and bidirectional LSTM. Summary of the Invention
[0006] The purpose of this invention is to address the shortcomings of traditional electrocardiogram (ECG) signal classification techniques, such as cumbersome feature extraction, low accuracy, and poor generalization ability. This invention proposes an adaptive arrhythmia classification network (ADLNet) based on variable convolution and bidirectional LSTM. The invention discloses an ADLNet network for arrhythmia classification. First, outlier data is removed from the original dataset. Second, the data is downsampled to reduce computational load without losing the complete description of the ECG signal. Third, each record is segmented at equal time intervals. The processed ECG data is then input into the designed ADLNet network for classification. The ADLNet network consists of a residual variable convolution module, a bidirectional LSTM module, and an attention module. The attention mechanism adjusts the network's receptive field, and the feature maps output by the residual variable convolution module and the bidirectional LSTM module are fused according to weights. The input to this network is the downsampled and standardized ECG signal, and each output represents the probability of its class. This is an end-to-end ECG signal classification method.
[0007] The overall process of this invention is as follows: Figure 1 The specific steps are as follows:
[0008] S1. Preprocessing of 12-lead ECG signals
[0009] ① Downsampling the ECG recordings in the dataset
[0010] ② For ECG signals with an original length of less than 30 seconds, copy the existing signal segments to make up for the signals with a total length of less than 30 seconds. For ECG signals with an original length of more than 30 seconds, cut 30 seconds of ECG signal from the original ECG signal and normalize it.
[0011] S2. Constructing an ADLNet model for 12-lead ECG signals
[0012] ①ADLNet includes a residual variable convolution module for feature extraction, a bidirectional LSTM module, and a self-attention mechanism for feature fusion.
[0013] ② The ADLNet network input is a preprocessed 12-lead electrocardiogram. First, the data is processed by a residual variable convolution module and a bidirectional LSTM module to extract features. Then, an adaptive fusion module is used to summarize the two sets of features.
[0014] ③ The residual variable convolution module consists of two convolutional layers and one variable convolutional layer. The convolutional layers include a 1×3 convolutional kernel, a ReLU non-linear activation layer, a max pooling layer, and a BatchNorm layer. The variable convolutional layer includes a 3×3 variable convolution, a ReLU non-linear activation layer, and a BatchNorm layer.
[0015] ④ The bidirectional LSTM module has 3 layers and 1024 hidden layer units.
[0016] ⑤ The adaptive fusion module adds the feature maps A1 and A2 of the residual variable convolution module and the residual dilated convolution module to obtain A′=A1+A2, and then converts the feature map into a 1×1×N feature vector through global average pooling.
[0017]
[0018] Where N represents the channels of the feature map, and W and H represent the width and height of the feature matrix A′, respectively.
[0019] Next, the feature vector is compressed and decompressed using a fully connected layer, and activated using the Sigmoid activation function to obtain the weight coefficients s and (1-s).
[0020]
[0021] The weighted sums of the A and A' are then summed to obtain A'. The final output of the Adaptive Fusion module is obtained by adding A and A''.
[0022] A″=sA1+(1-s)A2 (10)
[0023] F out =A″+A (11)
[0024] S3. Optimize and train the model built in S2.
[0025] The loss function used is the cross-entropy loss function:
[0026]
[0027] Where x represents a sample, y represents the actual label, a represents the predicted output, and n represents the total number of samples.
[0028] S4. Predict each 12-lead ECG recording in the test set.
[0029] The specific steps are as follows:
[0030] Step 1: Data Preprocessing
[0031] ① The ECG recordings of the test set were downsampled.
[0032] ② For ECG signals with an original length of less than 30 seconds, copy the existing signal segments to make up for the signals with a total length of less than 30 seconds. For ECG signals with an original length of more than 30 seconds, cut 30 seconds of ECG signal from the original ECG signal and normalize it.
[0033] Step 2 Model Prediction
[0034] ① Take a predicted sample obtained in Step 1, i.e. n H×W×12 matrices, and send it to ADLNet. The model then performs a Softmax mapping to estimate the probability of the predicted sample belonging to each class. The output of the model is an n×c matrix, where c is the number of classes.
[0035] ② Calculate the category corresponding to the maximum probability of each sample, and obtain a sequence of n category labels W = {w1, w2, ... w...} n}, where w i ∈{1, 2, ..., c}, to obtain the final category.
[0036] This invention downsamples, crops, and normalizes the raw 12-lead ECG signal to adapt it to the model's input data. To capture relevant lead information, an Adaptive Arrhythmia Classification Network (ADLNet) based on dilated and variable convolution is proposed. Dilated convolution provides the convolution kernel with a larger receptive field, enabling the acquisition of temporal features. Variable convolution adaptively alters the receptive field of the convolution kernel to obtain inter-lead features. Furthermore, an adaptive fusion method is used to fuse temporal and lead features, enabling the model to make more accurate predictions.
[0037] The beneficial effects of the present invention are: (1) it reduces the tedious and complicated process of solving the problem; (2) it effectively improves the accuracy of electrocardiogram signal classification. Attached Figure Description
[0038] Figure 1 This is the classification process of the method.
[0039] Figure 2 This invention relates to a residual variable convolution module.
[0040] Figure 3 The overall structure of the neural network model designed in this invention is ADLNet. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the following detailed explanations of the various aspects involved in the technical invention are provided:
[0042] This invention proposes a 12-lead ECG signal classification method based on a variable convolutional and bidirectional LSTM adaptive network for arrhythmia classification. The ECG signal data used comes from the 2018 China Physiological Signal Challenge. This data was collected from 11 hospitals, and the officially released training set contains 6877 records, including 3699 males and 3178 females. An additional 2954 records are used as a test set, but are not publicly available. The dataset also provides the age and gender of the individuals. The signal sampling rate was 500Hz, and each record contained a standard 12-lead dataset. The dataset included nine ECG types: eight arrhythmia categories and one normal rhythm category. Specifically, these were: Normal, Atrial fibrillation (AF), Grade I atrioventricular block (I-AVB), Left bundle branch block (LBBB), Right bundle branch block (RBBB), Premature atrial contractions (PAC), Premature ventricular contractions (PVC), ST-segment depression (STD), and ST-segment elevation (STE). Each sample had 1-3 reference labels.
[0043] To verify the effectiveness and feasibility of the present invention, the specific implementation method is as follows:
[0044] Step 1: Data Preprocessing
[0045] ① Downsampling the ECG recordings in the dataset can reduce the computational load during training without losing the complete description of the ECG signal.
[0046] ②Since CNNs cannot accept signals of varying lengths as input, this paper specifies a uniform length for ECG signals. For ECG signals with an original length of less than 30 seconds, existing signal segments are copied to compensate for signals shorter than 30 seconds. For ECG signals with an original length exceeding 30 seconds, 30 seconds of ECG signal are trimmed from the original ECG signal and then normalized.
[0047] Step 2: Construct an ADLNet neural network model for ECG signals
[0048] ①ADLNet includes residual variable convolution modules and residual dilated convolution modules for feature extraction, as well as a self-attention mechanism for feature fusion.
[0049] ② The ADLNet network input is a preprocessed 12-lead electrocardiogram. First, the data is processed by a residual variable convolution module and a residual dilated convolution module to extract features. Then, an adaptive fusion block is used to summarize the two sets of features.
[0050] ③ The residual variable convolution module consists of two convolutional layers and one variable convolutional layer. The convolutional layers include a 1×3 convolutional kernel, a ReLU non-linear activation layer, a max pooling layer, and a BatchNorm layer. The variable convolutional layer includes a 3×3 variable convolution, a ReLU non-linear activation layer, and a BatchNorm layer.
[0051] ④ The bidirectional LSTM module has 3 layers and 1024 hidden layer units.
[0052] ⑤ The adaptive fusion module adds the feature maps A1 and A2 of the residual variable convolution module and the residual dilated convolution module to obtain A′=A1+A2, and then converts the feature map into a 1×1×N feature vector through global average pooling.
[0053]
[0054] Where N represents the channels of the feature map, and W and H represent the width and height of the feature matrix A′, respectively.
[0055] Next, the feature vector is compressed and decompressed using a fully connected layer, and activated using the Sigmoid activation function to obtain the weight coefficients s and (1-s).
[0056]
[0057] The weighted sums of the A and A′ are then summed to obtain A′. The final output of the Adaptive Fusion module is obtained by adding A and A′′.
[0058] A″=sA1+(1-s)A2 (10)
[0059] F out =A″+A (11)
[0060] Step 3. Optimize and train the model built in S2.
[0061] The loss function used is the cross-entropy loss function:
[0062]
[0063] Where x represents a sample, y represents the actual label, a represents the predicted output, and n represents the total number of samples.
[0064] Step 4. Predict each 12-lead ECG recording in the test set.
[0065] The specific steps are as follows:
[0066] Step 1: Data Preprocessing
[0067] ① The ECG recordings of the test set are downsampled. Reducing the sampling frequency can reduce the amount of computation during training without losing the complete description of the ECG signal.
[0068] ②Since CNNs cannot accept signals of varying lengths as input, this paper specifies a uniform length for ECG signals. For ECG signals with an original length of less than 30 seconds, existing signal segments are copied to compensate for signals shorter than 30 seconds. For ECG signals with an original length exceeding 30 seconds, 30 seconds of ECG signal are trimmed from the original ECG signal and then normalized.
[0069] Step 2 Model Prediction
[0070] ① Take a predicted sample obtained in Step 1, i.e. n H×W×12 matrices, and send it to ADLNet. The model then performs a Softmax mapping to estimate the probability of the predicted sample belonging to each class. The output of the model is an n×c matrix, where c is the number of classes.
[0071] ② Calculate the category corresponding to the maximum probability of each sample, and obtain n category label sequences W = {w1, w2, ... w...} n}, where w i ∈{1, 2, ..., c}, to obtain the final category.
[0072] To verify the effectiveness and feasibility of the method of this invention, the proposed network and its components were validated on the 12-lead ECG signal dataset from the CPSC2018 competition. Each network was run 5 times, and the results were averaged and calculated using the standard deviation. The final experimental results on the test set are shown in Table 1.
[0073] Table 1 Comparison of arrhythmia classification results of ECG signals by different network structures
[0074]
Claims
1. An adaptive network for cardiac arrhythmia classification based on dilated convolution and bidirectional LSTM—ADLNet, which includes the following steps: S1. Preprocessing of 12-lead ECG signals ① Downsample the electrocardiogram recordings in the dataset; ② For ECG signals with an original length of less than 30 seconds, copy the existing signal segments to make up for the signals with a total length of less than 30 seconds. For ECG signals with an original length of more than 30 seconds, cut 30 seconds of ECG signal from the original ECG signal and normalize it. S2. Constructing an ADLNet model for 12-lead ECG signals ①ADLNet includes a residual variable convolution module for feature extraction, a bidirectional LSTM module, and a self-attention mechanism for feature fusion; ② The ADLNet network input is a preprocessed 12-lead electrocardiogram. First, the data is processed by the residual variable convolution module and the bidirectional LSTM module to extract features. Then, the adaptive fusion module is used to summarize the two sets of features. ③ The residual variable convolution module consists of two convolutional layers and one variable convolutional layer. The convolutional layers include a 1×3 convolutional kernel, a ReLU non-linear activation layer, a max pooling layer, and a BatchNorm layer. The variable convolutional layer includes a 3×3 variable convolution, a ReLU non-linear activation layer, and a BatchNorm layer. ④ The bidirectional LSTM module has 3 layers and 1024 hidden layer units; ⑤ The adaptive fusion module adds the feature maps A1 and A2 of the residual variable convolution module and the residual dilated convolution module to obtain A′=A1+A2, and then converts the feature map into a 1×1×N feature vector through global average pooling; Where N represents the channels of the feature map, and W and H represent the width and height of the feature matrix A′, respectively; Next, the feature vector is compressed and decompressed using a fully connected layer, and activated using the Sigmoid activation function to obtain the weight coefficients s and (1-s). The weighted sum of the corresponding feature maps is used to obtain A′. The final output of the Adaptive Fusion module is obtained by adding A and A′′. A″=sA1+(1-s)A2 (10) F out =A″+A (11) S3. Optimize and train the model built in S2. The loss function used is the cross-entropy loss function: Where x represents a sample, y represents the actual label, a represents the predicted output, and n represents the total number of samples. S4. Predict each 12-lead ECG recording in the test set. The specific steps are as follows: Step 1: Data Preprocessing ① The ECG recordings of the test set were downsampled; ② For ECG signals with an original length of less than 30 seconds, copy the existing signal segments to make up for the signals with a total length of less than 30 seconds. For ECG signals with an original length of more than 30 seconds, cut 30 seconds of ECG signal from the original ECG signal and normalize it. Step 2 Model Prediction ① The predicted sample obtained in Step 1, i.e., n H×W×12 matrices, is fed into the arrhythmia classification adaptive network. The model is then mapped by Softmax to estimate the probability of the predicted sample belonging to each category. The output of the model is an n×c matrix, where c is the number of categories. ② Calculate the class corresponding to the maximum probability of each sample, and obtain n class label sequences W = {w1, w2, ... w n }, where w i ∈{1, 2, ..., c}, thus obtaining the final category.