ECG classification system based on deep residual shrinkage network and LSTM
The ECG classification system using a deep residual shrinkage network and LSTM enhances the accuracy of ECG signal classification by denoising, segmenting, and utilizing RR interval information, addressing the inefficiencies of traditional methods and improving classification accuracy to 99%.
Patent Information
- Application Number
- CN202411113128.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional cardiovascular disease detection methods, such as manual ECG diagnosis and existing ECG classifiers, are time-consuming, laborious, and prone to errors, especially in classifying premature heartbeats due to the lack of effective feature extraction and consideration of heartbeat relationships.
An ECG classification system utilizing a deep residual shrinkage network and LSTM, which includes an acquisition unit, preprocessing unit, segmentation unit, and classification unit, to denoise, segment, and classify ECG signals using RR interval information and a combination of convolutional neural networks, deep residual networks, and long short-term memory artificial neural networks.
Improves the accuracy of ECG signal classification, particularly in distinguishing between normal and abnormal heartbeats, by effectively extracting spatial and temporal features and reducing noise, achieving up to 99% accuracy.
Smart Images

Figure CN119184710A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of biomedical technology, and in particular relates to an ECG classification system based on a deep residual shrinkage network and LSTM. Background Art
[0002] Cardiovascular disease has become a major global disease. Traditional cardiovascular disease detection methods are mainly: medical staff diagnose the health of the human heart by observing the electrocardiogram (ECG). ECG is a method of measuring and recording the electrical activity of the heart. When the ECG shape changes abnormally or the beat rhythm is abnormal, it indicates arrhythmia. However, traditional methods rely on manual diagnosis, which is time-consuming and laborious.
[0003] In order to overcome the defects of traditional manual diagnosis, methods for detecting cardiovascular diseases by classifying ECG signals have emerged. Currently, most ECG classifiers are built using traditional machine learning methods or deep learning methods. For example, traditional machine learning methods such as SVM require manual extraction of morphological features or time-frequency features, which is a lot of work. Deep learning methods are mainly based on ECG limb lead II (MLII) processing, which easily ignores the relationship between each heartbeat, resulting in errors when the ECG signal features are not obvious, especially in the classification accuracy of premature heartbeats and other problems. Summary of the invention
[0004] In view of the defects in the prior art, the present invention provides an ECG classification system based on a deep residual shrinkage network and LSTM, which improves the accuracy of ECG signal classification.
[0005] An ECG classification system based on deep residual shrinkage network and LSTM, comprising:
[0006] Acquisition unit: used to collect ECG raw signals;
[0007] Preprocessing unit: used for denoising the ECG original signal to obtain an ECG denoised signal;
[0008] Segmentation unit: used to segment the ECG noise reduction signal into heart beats to obtain multiple heart beats; calculate the RR interval information according to the R wave of the heart beat;
[0009] Classification unit: used to create and train a classifier based on the deep residual shrinkage network and LSTM; input the ECG denoised signal and RR interval information into the classifier to classify the ECG original signal.
[0010] Furthermore, the RR interval information specifically includes:
[0011] The length of the preceding RR interval is equal to the R wave interval distance between the current heart beat and the previous heart beat;
[0012] The length of the post-RR interval is equal to the R wave interval distance between the current heart beat and the next heart beat;
[0013] The length of the ten RR intervals before and after is equal to the average of the lengths of the first five RR intervals and the lengths of the last five RR intervals, wherein the lengths of the first five RR intervals are the average of the R wave interval distances of the five heart beats before the current heart beat, and the lengths of the last five RR intervals are the average of the R wave interval distances of the five heart beats after the current heart beat;
[0014] The length of the entire RR interval is equal to the average value of the R wave interval distances of all heart beats within the set time period.
[0015] Furthermore, the R-wave interval distance is calculated by using the R-wave localization index method in the MIT BIH database.
[0016] Furthermore, the classifier includes, from top to bottom:
[0017] 3 convolutional layers;
[0018] Deep residual shrinkage network: used to extract spatial features of ECG denoised signals;
[0019] Long short-term memory artificial neural network: used to extract the temporal features of ECG noise reduction signals;
[0020] 3 fully connected layers; the RR interval information is input to the second fully connected layer.
[0021] Furthermore, the number of channels of the feature map in the deep residual shrinkage network is set to the R-wave interval distance, the width of the feature map is set to 1, and the Relu activation function uses the LeakRelu activation function with a slope of 0.2.
[0022] Furthermore, the deep residual shrinkage network consists of two residual shrinkage modules with different thresholds per channel.
[0023] Furthermore, when the classifier is trained, the method for determining the learning rate includes:
[0024] Set the initial value of the learning rate to 0.1;
[0025] After N consecutive rounds of iterative training, the accuracy of the classifier has not improved, and the new learning rate is equal to the learning rate multiplied by 0.5.
[0026] Furthermore, the categories of the ECG raw signal include: normal, supraventricular ectopic beat, ventricular ectopic beat, fusion, and unknown.
[0027] It can be seen from the above technical scheme that the ECG classification system based on deep residual shrinkage network and LSTM provided by the present invention adopts a combination of convolutional neural network, deep residual network, and long short-term memory artificial neural network to create a classifier, and uses a combination of ECG denoised signal and RR interval information to train the classifier, thereby improving the accuracy of ECG signal classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0029] Figure 1 A flow chart of a method implemented by an ECG classification system provided in an embodiment.
[0030] Figure 2 RR interval box plots of different categories of ECG signals provided for the embodiment.
[0031] Figure 3 A schematic diagram of the RSBU-CW structure provided in an embodiment.
[0032] Figure 4 A schematic diagram of a DRSN-CW structure provided in an embodiment.
[0033] Figure 5 A schematic diagram of an LSTM structure provided for an embodiment.
[0034] Figure 6 A schematic diagram of the structure of a classifier provided in an embodiment. DETAILED DESCRIPTION
[0035] The embodiments of the technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and the protection scope of the present invention cannot be limited thereto. It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should be the common meanings understood by those skilled in the art to which the present invention belongs.
[0036] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0037] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0038] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0039] Example:
[0040] An ECG classification system based on deep residual shrinkage network and LSTM, see Figure 1 ,include:
[0041] Acquisition unit: used to collect ECG raw signals;
[0042] Preprocessing unit: used for denoising the ECG original signal to obtain an ECG denoised signal;
[0043] Segmentation unit: used to segment the ECG noise reduction signal into heart beats to obtain multiple heart beats; calculate the RR interval information according to the R wave of the heart beat;
[0044] Classification unit: used to create and train a classifier based on the deep residual shrinkage network and LSTM; input the ECG denoised signal and RR interval information into the classifier to classify the ECG original signal.
[0045] In this embodiment, the ECG classification system consists of four parts: an acquisition unit, a preprocessing unit, a segmentation unit and a classification unit. When the system classifies the ECG raw signal, first, the acquisition unit acquires the patient's ECG raw signal. Then, the preprocessing unit performs noise reduction on the ECG raw signal acquired by the acquisition unit, such as DWT noise reduction (Discrete Wavelet Transform Denoising), to obtain an ECG noise reduction signal. Secondly, the segmentation unit performs heart beat segmentation on the ECG noise reduction signal obtained by the preprocessing unit to obtain multiple heart beats, and calculates the RR interval information based on the R wave of the heart beat. The RR interval information refers to the spacing of ventricular beats, and the ventricular rate can be calculated. Under normal conditions, the RR interval information of the human body is 0.6 to 1 second, and the corresponding ventricular rate is 60 to 100 times per minute. If the RR interval information is abnormal, it indicates that the patient may be at risk of arrhythmia or ventricular premature beats. Finally, the classification unit inputs the ECG noise reduction signal and the RR interval information into the classifier to classify the ECG raw signal.
[0046] The ECG classification system based on deep residual shrinkage network and LSTM uses a combination of convolutional neural network, deep residual network and long short-term memory artificial neural network to create a classifier, and uses a combination of ECG denoised signal and RR interval information to train the classifier, thereby improving the accuracy of ECG signal classification.
[0047] Further, in some embodiments, the RR interval information specifically includes:
[0048] The length of the preceding RR interval is equal to the R wave interval distance between the current heart beat and the previous heart beat;
[0049] The length of the post-RR interval is equal to the R wave interval distance between the current heart beat and the next heart beat;
[0050] The length of the ten RR intervals before and after is equal to the average of the lengths of the first five RR intervals and the lengths of the last five RR intervals, wherein the lengths of the first five RR intervals are the average of the R wave interval distances of the five heart beats before the current heart beat, and the lengths of the last five RR intervals are the average of the R wave interval distances of the five heart beats after the current heart beat;
[0051] The length of the entire RR interval is equal to the average value of the R wave interval distances of all heart beats within the set time period.
[0052] In this embodiment, the method can calculate the RR interval information according to the R wave positioning of the ECG noise reduction signal, and the RR interval information includes the pre-RR interval length Pre-RR, the post-RR interval length Post-RR, the lengths of the ten RR intervals before and after Local-RR, and the length of the entire RR interval Record-RR. For example, assuming that the current heartbeat is the 10th heartbeat, the pre-RR interval length is the R wave interval distance between the 10th heartbeat and the 9th heartbeat. The post-RR interval length is the R wave interval distance between the 10th heartbeat and the 11th heartbeat. The first five RR interval lengths and the last five RR interval lengths use 5 heartbeat intervals as the intervals between consecutive heartbeat reference points, and based on the QRS wave peak point, there are 4 R wave interval distances. The first five RR interval lengths are the average of the R wave interval distances between the 6th heartbeat and the 10th heartbeat, that is, the R wave interval distances between the 6th heartbeat and the 7th heartbeat, ..., the R wave interval distances between the 9th heartbeat and the 10th heartbeat are added and averaged. The length of the last five RR intervals is the average of the R wave interval distances between the 10th and 14th heart beats, that is, the R wave interval distances between the 10th and 11th heart beats, ..., the R wave interval distances between the 13th and 14th heart beats are added and averaged. The length of the first and last ten RR intervals is equal to the average of the first five RR interval lengths and the last five RR interval lengths. The length of the entire RR interval is equal to the average of the R wave interval distances of all heart beats within the set time period, for example, the length of the entire RR interval is equal to the average of the R wave interval distances of all heart beats within 30 seconds.
[0053] Figure 2 It is the RR interval box plot of different categories of ECG original signal. Figure 2 In the figure, (a) shows that the Pre-RR interval of class V and class F is short, (b) shows that the Post-RR interval of class F is short, (b), (c) and (d) show that the Post-RR, Local-RR and Record-RR intervals of class F are short, and (d) shows that the Record-RR duration of class S is long. Overall, the duration of each RR interval information in class Q is relatively concentrated, and the duration of each RR interval information in class F is short and concentrated.
[0054] Further, in some embodiments, the R-wave interval distance is calculated by using the R-wave positioning index method in the MIT BIH database.
[0055] In this embodiment, when the segmentation unit calculates the R wave interval distance, it can be obtained based on the R wave positioning index method in the MIT BIH database. For example, the first 100 points and the last 200 points of the R wave are selected, and the R wave interval distance is obtained according to the selected points. For example, the MIT-BIH data set used by the system contains records of 47 patients, and the duration of each record is 30 minutes. This data set uses a dual-channel dynamic system to analyze and classify the MLII leads in the data set. The ratio of the training set to the test set is 7:3. Table 1 lists the small and medium category information of the five categories and the number of each category after removing the unstable signal of each record.
[0056] Table 1 Different types of heartbeats and their numbers in MIT-BIH
[0057]
[0058]
[0059] Further, in some embodiments, the classifier includes, from top to bottom:
[0060] 3 convolutional layers;
[0061] Deep residual shrinkage network: used to extract spatial features of ECG denoised signals;
[0062] Long short-term memory artificial neural network: used to extract the temporal features of ECG noise reduction signals;
[0063] 3 fully connected layers; the RR interval information is input to the second fully connected layer.
[0064] In this embodiment, since the accuracy of deep learning will be affected in the presence of noise, the system uses deep residual shrinkage networks with channel-wise thresholds (DRSN-CW). This structure is characterized by using a separate threshold for soft thresholding for each channel of the feature map. The structure learns discriminative features through various nonlinear transformations and combines with deep learning to reduce the impact of noise.
[0065] The structure of the residual shrinkage building unit with channel-wise (RSBU-CW) is as follows Figure 3As shown, C represents the number of channels of the feature map, W represents the width of the feature map, and K represents the number of convolution kernels of the convolution layer. For the ECG denoised signal, the number of channels C of the feature map is set to the R wave interval distance, and the width W of the feature map is set to 1. Because there are many spatial features in the ECG denoised signal, the Relu activation function in this system uses the LeakRelu activation function with a slope of 0.2. This activation function can extract more features from the ECG denoised signal. x, z, and α are feature map indicators used when determining the threshold. In RSBU-CW, each channel has its own independent threshold. The feature x is reduced to a one-dimensional vector through GAP. The purpose of using GAP is to reduce the number of weights used in the FC layer and reduce the risk of overfitting. It then enters two fully connected layers. The number of neurons output by the second fully connected layer is the number of input feature channels. Formula (1) is used to output the FC layer so that the output range of the FC layer is scaled to between 0 and 1, where α c represents the cth scale parameter, z c represents the characteristics of the cth neuron. The threshold calculation is shown in formula (2), where τ c represents the threshold of the cth channel, i, j, c are the width, height and number of channels of the feature map respectively. Finally, each neuron is sigmoid normalized, and the scale value of the specific channel is multiplied by the specific channel average of the input feature to obtain the threshold of each channel.
[0066]
[0067] The structure of DRSN-CW is mainly composed of multiple residual shrinkage building units with channel-wise thresholds (RSBU-CW). Figure 4 The deep residual shrinkage network consists of two residual shrinkage modules with different thresholds for each channel. Based on the one-dimensional characteristics of the ECG noise reduction signal, the system sets the output dimension of the convolution layer to 64*1 and the Relu activation function to the LeakRelu activation function with a slope of 0.2.
[0068] In this embodiment, the Long Short-Term Memory (LSTM) artificial neural network is a variant of the Recurrent Neural Network (RNN) and is used for the output of the module DRSN-CW to obtain the temporal characteristics of the ECG noise reduction signal. In order to avoid the overfitting problem during classifier training caused by the introduction of the LSTM module, the output of the LSTM is subjected to Dropout processing to alleviate the overfitting problem. The LSTM structure is as follows: Figure 5As shown, there are three inputs to LSTM, which are the network output value x at the current moment. t , the output value h of LSTM at the previous moment t-1 And the cell state C at the previous moment t-1 LSTM has two outputs, namely the current LSTM output value h t And the current cell state C t LSTM introduces a forget gate, an input gate, and an output gate. The function of the forget gate is to retain the information with a large weight and remove the information with a small weight through the activation function. The purpose is to determine how much of the cell state at the previous moment to retain to the cell state at the current moment. As shown in formula (3), the forget gate input x t and h t-1 , where σ is the Sigmoid function. After passing through the Sigmoid layer, the output is a number f between 0 and 1 t To each unit state C t-1 The dot product of the numbers in, if f t If it is 0, it is discarded, and if it is 1, it is retained. The input gate is responsible for deciding how much of the current input to the current cell state to retain. Formulas (4) and (5) are shown below. They consist of two parts. The first part is the Sigmoid layer, which determines the value to be updated. The second part is the tanh layer, which updates the information to be updated into the cell state and creates a new cell state value vector. And add it to the state. The unit state is updated as shown in the following formula (6): first, C t-1 Updated to C t , and then C t-1 With f t Multiply, discard the information that needs to be discarded, and add The unit state is updated. Finally, the output gate determines how many outputs the unit state has at the current moment, as shown in the following formulas (7) and (8). A Sigmoid layer is used to determine the output part of the unit state, and then the unit state is processed by a tanh layer to output the determined output part.
[0069] f t =σ(W f ·[h t-1 ,x t ]+b f ) (3)
[0070] i t =σ(W i ·[h t-1 ,x t ]+b i ) (4)
[0071]
[0072] o t =σ(W o [h t-1 ,x t ]+b o ) (7)
[0073] h t =o t *tanh(C t ) (8)
[0074] In this embodiment, the classifier is mainly used to extract features from the ECG noise reduction signal, such as Figure 6 As shown in the figure, the classifier can input the MLII data of the current heartbeat containing 300 sample points and the RR interval information of the current heartbeat at one time. The input signal passes through three convolutional layers, each of which uses a batch normalization layer, a Relu activation function, and a maximum pooling layer, and then inputs it to the DRSN-CW structure composed of two layers of RSBU-CW to extract the spatial features in the ECG. Then the LSTM network is used to extract the temporal features in the ECG. After the LSTM network, there are three fully connected layers, in which the RR interval information is input to the second fully connected layer after the LSTM. Dropout regularization is used after the second connection layer to improve the accuracy of the classifier. The detailed structure is shown in Table 2.
[0075] Table 2 Detailed structure of the classifier
[0076]
[0077]
[0078] This classifier is trained for 100 epochs with a batch size of 32. The optimizer uses SGD and the learning rate uses a dynamic learning rate. The initial learning rate is 0.1. When the accuracy of the validation set does not improve after 5 consecutive rounds of iterative training, the learning rate is multiplied by 0.5 as the learning rate for subsequent rounds. Due to the imbalance of the number of samples, the loss function uses Focal loss to calculate the loss. The Focal formula is shown in formula (9), where p t is the predicted probability of the true category of the sample, γ To adjust the hyperparameters of the weight factor, set the Focal loss γ A value of 2 penalizes errors in the minority class more strongly, thereby improving the classifier's ability to classify the minority class.
[0079] FL=-(1-p t ) γ log(p t ) (9)
[0080] Further, in some embodiments, the categories of the ECG raw signal include: normal, supraventricular ectopic beat, ventricular ectopic beat, fusion, and unknown.
[0081] In this embodiment, the system classifies the ECG raw signals into five categories: normal N, supraventricular ectopic beat S, ventricular ectopic beat V, fusion F, and unknown Q.
[0082] In order to further illustrate the accuracy of the classification of the system, the same classifier was trained with and without RR interval information as a feature. The results show that the accuracy of the classifier trained with RR interval information reached 99%, which is higher than the accuracy of the classifier trained without RR interval information. In particular, in the classification of S and F, the accuracy of the classifier trained with RR interval information increased by 1%.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. An ECG classification system based on deep residual shrinkage network and LSTM, characterized in that: include: Acquisition unit: used to collect ECG raw signals; Preprocessing unit: used for performing noise reduction on the ECG original signal to obtain an ECG noise reduction signal; A segmentation unit: used for performing heart beat segmentation on the ECG noise reduction signal to obtain multiple heart beats; and calculating RR interval information according to the R wave of the heart beat; Classification unit: used to create and train a classifier based on a deep residual shrinkage network and LSTM; input the ECG denoised signal and the RR interval information into the classifier to classify the ECG original signal.
2. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 1, characterized in that: The RR interval information specifically includes: The length of the preceding RR interval is equal to the R wave interval distance between the current heart beat and the previous heart beat; The length of the post-RR interval is equal to the R wave interval distance between the current heart beat and the next heart beat; The length of the ten RR intervals before and after is equal to the average of the lengths of the first five RR intervals and the lengths of the last five RR intervals, wherein the lengths of the first five RR intervals are the average of the R wave interval distances of the five heart beats before the current heart beat, and the lengths of the last five RR intervals are the average of the R wave interval distances of the five heart beats after the current heart beat; The length of the entire RR interval is equal to the average value of the R wave interval distances of all heart beats within the set time period.
3. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 2, characterized in that: The R wave interval distance is calculated by using the R wave positioning index method in the MIT BIH database.
4. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 1, characterized in that: The classifier includes, from top to bottom: 3 convolutional layers; Deep residual shrinkage network: used to extract the spatial features of the ECG denoised signal; Long short-term memory artificial neural network: used to extract the time characteristics of the ECG noise reduction signal; 3 fully connected layers; wherein the RR interval information is input to the second fully connected layer.
5. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 4, characterized in that: The number of channels of the feature map in the deep residual shrinkage network is set to the R-wave interval distance, the width of the feature map is set to 1, and the Relu activation function uses the LeakRelu activation function with a slope of 0.
2.
6. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 4, characterized in that: The deep residual shrinkage network consists of two residual shrinkage modules - different thresholds for each channel.
7. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 4, characterized in that: When the classifier is trained, the method for determining the learning rate includes: Set the initial value of the learning rate to 0.1; After N consecutive rounds of iterative training, the accuracy of the classifier has not improved, and the new learning rate is equal to the learning rate multiplied by 0.
5.
8. The ECG classification system of the deep residual shrinkage network and LSTM according to claim 1, characterized in that: The categories of the ECG original signal include: normal, supraventricular ectopic beat, ventricular ectopic beat, fusion, and unknown.
Citation Information
Cited By
Weak supervision robust multi-label identification method for multi-source twelve-lead electrocardiogram
CN122531769A
