CNN-GRU ECG signal classification method based on attention mechanism

By introducing the CNN-GRU model of attention mechanism in ECG signal classification, the problems of high misdiagnosis rate and complex feature extraction of electrogram interpretation algorithms in the existing technology are solved, and the ECG signal classification with high accuracy is achieved, which improves the generalization of the model ability and robustness.

CN119014878AActive Publication Date: 2024-11-26DALIAN UNIV OF TECH

Patent Information

Application Number
CN202411124219.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-26
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

The existing electrocardiogram interpretation algorithm has a high misdiagnosis rate, traditional machine learning algorithms require complex manual operations, deep learning is difficult to capture context information in ECG data classification, GRU networks require manual construction of feature relationships, and insufficient ability to mine ECG features.

Method used

The CNN-GRU model based on attention mechanism is adopted to extract features through convolutional neural networks, combine the gating cyclic unit and attention mechanism module to automatically extract high-level features and capture the correlation between signals to classify ECG signals.

Benefits of technology

It improves the accuracy of ECG signal classification, enhances the model's attention to important features, realizes multi-category classification tasks, and ensures the generalization ability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119014878A_ABST
    Figure CN119014878A_ABST
Patent Text Reader

Abstract

The invention discloses an ECG signal classification method of CNN-GRU based on an attention mechanism, and belongs to the field of ECG signal classification. The method comprises the following steps: firstly, completing the collection of ECG signals, carrying out resampling, preprocessing, annotation and other operations on the ECG signals to obtain an ECG signal data set, and dividing the ECG signal data set into a training set and a test set; building an ECG signal feature extraction network by using a CNN network, and building an ECG signal classification network by using a GRU network and an attention mechanism module; inputting the training set data into the CNN-GRU model for training, and storing the model with the highest classification accuracy; and inputting the test set data into the stored model, completing the test, obtaining the final classification accuracy, and realizing the classification of the ECG signals. According to the ECG classification method of the CNN-GRU based on the attention mechanism provided by the invention, the ECG classification accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ECG signal classification, and more particularly to an ECG signal classification method based on a CNN-GRU with an attention mechanism. Background Art

[0002] In recent years, due to the influence of factors such as the aging population, chronic cardiovascular diseases, increasing life pressure and the ever-accelerating pace of life, the incidence of heart disease has been increasing. According to incomplete statistics, about one-third of the world's deaths are due to heart disease, and about 540,000 people die of sudden cardiac death in China each year. It can be seen that heart disease seriously threatens human survival and health. In addition, the incidence of heart disease has a trend of getting younger, and the proportion of young people is increasing. Heart disease has become a major threat to human life. Therefore, in order to effectively prevent the occurrence of heart disease and treat cardiovascular disease in a targeted manner, timely and accurate arrhythmia recognition is very important.

[0003] Electrocardiograms are an important means of diagnosing heart diseases. Since their introduction 50 years ago, computer-assisted interpretation has become increasingly important in the clinical ECG workflow, and has become an important auxiliary means for doctors to interpret in many clinical settings. However, existing commercial ECG interpretation algorithms still have a high misdiagnosis rate. Traditional machine learning algorithms require manual filtering, feature extraction, wavelet transform and other complex operations. These data operations rely heavily on medical industry experience and have a great impact on the final model results. In recent years, people have begun to try to use deep learning to classify raw ECG data, and have made significant progress.

[0004] Convolutional neural networks can extract abstract high-dimensional features, but cannot capture contextual information and achieve better classification. The gated recurrent unit (GRU) is an optimized network based on the long short-term memory (LSTM) network. It simplifies the internal unit structure of the LSTM and can effectively shorten the training time of the model while ensuring high prediction accuracy. Therefore, it is more suitable for the field of arrhythmia detection. However, the GRU network requires artificial construction of feature relationships and needs to be combined with other networks to improve the ability to mine electrocardiogram features. Further optimization is still needed. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an ECG signal classification method based on a CNN-GRU with an attention mechanism in view of the shortcomings of the above-mentioned technology.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a CNN-GRU ECG signal classification method based on the attention mechanism, comprising the following steps:

[0007] S1: Collect ECG signals and perform resampling and preprocessing

[0008] S1.1ECG signal collection: select ECG signal data from the database;

[0009] S1.2 ECG signal resampling: A sliding window is used to cover all segments and segment the original ECG signal data. During the resampling process, the signal is first Fourier transformed to obtain its spectrum representation, and then the spectrum is interpolated to adapt it to the target sampling frequency. Finally, the spectrum is converted back to the time domain signal through inverse Fourier transform.

[0010] S1.3 ECG signal annotation and preprocessing: Use WFDB to read the collected ECG data and annotate the data according to AAMI standards;

[0011] S1.4 Data division: The processed ECG signal dataset is randomly divided into a training set and a test set;

[0012] S2: Building ECG signal feature extraction and classification network

[0013] Build a comprehensive model consisting of a convolutional neural network and a gated recurrent unit; the model uses a convolutional neural network to extract features and a gated recurrent unit for classification;

[0014] S2.1 Feature Extraction Convolutional Neural Network: The feature extraction network consists of a one-dimensional convolutional layer, a batch normalization layer, and a maximum pooling layer. Through local connections and weight sharing mechanisms, the input data is processed step by step to automatically extract high-level features.

[0015] Convolution layer: Using local connections and weight sharing, the input signal is convolved to extract local features. The formula for the convolution operation is as follows:

[0016]

[0017] Among them, x is the input signal, w is the convolution kernel, y is the output signal, k is the convolution kernel size, m is the position index of the output signal in the convolution operation, and n is the position index in the convolution kernel; batch normalization layer: normalize the output of the convolution layer, and the formula for batch normalization is:

[0018]

[0019] in, is the normalized output, μ and σ are the mean and standard deviation of the batch data, respectively, and ∈ is a small constant;

[0020] Maximum pooling layer: pooling operation is performed on the normalized features. The maximum pooling formula is:

[0021] y[i]=max(x[m:m+p])

[0022] Where p is the size of the pooling window;

[0023] S2.2 Arrhythmia classification network: The gated recurrent unit model GRU is used for feature classification, and the attention mechanism module is introduced to capture the correlation between signals, thereby completing the classification of arrhythmia signals;

[0024] The gated recurrent unit model captures long-term dependencies in the time series by updating the gate and resetting the gate. The formula is as follows:

[0025] z t =σ(W (z) x t +U (z) h t-1 )

[0026] r t =σ(W (r) x t +U (r) h t-1 )

[0027]

[0028] Among them, z t is the update gate, r t is the reset gate, h t is the hidden state, is a candidate hidden state, x t is the input at time step t, W is the weight matrix input to the update gate, W (z) is the weight matrix input to the reset gate, W (r) is the weight matrix of the candidate hidden state, U is the weight matrix from the hidden state to the update gate, and U (z) is the weight matrix from the hidden state to the reset gate, U (r) is the weight matrix from hidden state to candidate hidden state, is the point-wise product at the element level, σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function;

[0029] Attention mechanism: The attention mechanism calculates the degree of association between each element in the sequence and the current moment, and weights the sequence elements according to the degree of association;

[0030] Calculate the attention weight: perform weighted summation on the output of the hidden layer of the gated recurrent unit model GRU to calculate the attention score for each time step; the calculation formula is:

[0031] e ij =tanh(W h h i +W s s j )

[0032] Among them, e ij Represents the hidden state h i With the current input s j The correlation score, h i is the output of the GRU hidden layer at time step i, s j is the value of the current input at time step j, W h and W s is the weight matrix used to calculate the attention score;

[0033] Normalized weights: The attention scores are normalized by the softmax function to obtain the attention weight distribution:

[0034]

[0035] Among them, α ij represents the attention weight at time j to time i;

[0036] Calculate the context vector: Apply the attention weights to the hidden layer output of the GRU to get the context vector:

[0037]

[0038] Fully connected layer and output layer: The output of the attention mechanism is classified through the fully connected layer and the output layer; the output layer uses the softmax function to calculate the final classification probability:

[0039] y=softmax(W o c+b o )

[0040] Among them, W o is the weight matrix of the fully connected layer, b o is the bias vector of the fully connected layer;

[0041] Through the above structure, the model extracts and classifies features in ECG signals to identify different types of arrhythmias;

[0042] S3. Training ECG classification model

[0043] The cross entropy loss function is used to measure the difference between the model output and the true label; for a given sample, the cross entropy loss function is defined as:

[0044]

[0045] Among them, q i is the probability of the true label, p i is the probability of the model output;

[0046] The RMSprop optimization algorithm is used to adaptively adjust the learning rate based on the exponentially weighted moving average of the square of the gradient; its parameter update rules are as follows:

[0047]

[0048] Among them, θ t is the parameter of the tth iteration, is the gradient of the loss function with respect to the parameters, η is the learning rate, β is the decay rate, and v t is the exponentially weighted moving average of the square of the gradient, and δ is a small constant used to prevent division by zero;

[0049] By calculating the cross entropy loss function and using the RMSprop optimization algorithm for back propagation to update the model parameters, the training is iterated continuously until the set maximum number of training times is reached; during the training process, the classification model with the highest classification accuracy during the training process is saved as the optimal network model.

[0050] Furthermore, the database in step S1 is the MIT-BIH arrhythmia database, the MIT-BIHST variation database, the EU ST-T ECG database and the sudden cardiac death dynamic ECG database.

[0051] Furthermore, in step S1.2, during resampling, the sliding window is 10 seconds, and the sampling frequency during Fourier transform is set to 360 Hz; after resampling, the ECG signal is standardized into a signal segment with a length of 10 seconds and a sampling frequency of 360 Hz.

[0052] Furthermore, in step S1.3, the classification of data annotation includes N-normal, L-left bundle branch block, R-right bundle branch block, V-ventricular premature beat, A-atrial premature beat.

[0053] The beneficial effects of the present invention are as follows: the method first completes the collection of ECG signals, and resamples, preprocesses, annotates and other operations on the ECG signals to obtain an ECG signal data set, and divides the ECG signal data set into a training set and a test set; uses a CNN network to build an ECG signal feature extraction network, and uses a GRU network and an attention mechanism module to build an ECG signal classification network; inputs the training set data into the CNN-GRU model for training, and saves the model with the highest classification accuracy; inputs the test set data into the saved model, completes the test, obtains the final classification accuracy, and realizes the classification of ECG signals. The ECG classification method of CNN-GRU based on the attention mechanism proposed in the present invention improves the accuracy of ECG classification. Multi-dataset processing: This method uses multiple data sets for training and testing, while other methods usually use a single data set, which ensures that the model has better generalization ability and robustness. Multi-category classification: This method realizes the five-category task of N-normal, L-left bundle branch block, R-right bundle branch block, V-ventricular premature beats, and A-atrial premature beats, while other methods are usually limited to two categories, which increases the complexity and practicality of classification.

[0054] Introducing the attention mechanism: This method introduces the attention mechanism module, which significantly improves the accuracy of ECG signal classification by capturing the correlation between signals. The attention mechanism can dynamically adjust the weight of each time step, enhance the model's attention to important features, and improve classification performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a flow chart of the implementation of the invention.

[0056] Figure 2 This is a schematic diagram of the CNN structure.

[0057] Figure 3 This is a schematic diagram of the attention mechanism.

[0058] Figure 4 This is a schematic diagram of the CNN-GRU model based on the attention mechanism.

[0059] Figure 5 It is the category distribution diagram of ECG signal after processing.

[0060] Figure 6 It is a confusion matrix diagram.

[0061] Figure 7 is the change in loss and accuracy during training. DETAILED DESCRIPTION

[0062] Combination Figures 1 to 5 , an ECG signal classification method based on CNN-GRU of attention mechanism, comprising the following steps:

[0063] Step 1: Collect ECG signals and resample and preprocess them

[0064] 1.1 ECG signal collection: To ensure sufficient data volume and improve the generalization ability of the model, ECG signal data are selected from the following four databases:

[0065] MIT-BIH arrhythmia database, MIT-BIHST change database, EU ST-T ECG database, sudden cardiac death dynamic ECG database.

[0066] 1.2 ECG signal resampling: In order to facilitate subsequent processing and cope with the inconsistency of data length and sampling frequency between different databases, we use a 10-second sliding window to cover all segments and segment the original ECG signal data. During the resampling process, the sampling frequency is set to 360Hz using the Fourier transform method. First, the signal is Fourier transformed to obtain its spectral representation, and then the spectrum is interpolated to adapt it to the target sampling frequency. Finally, the spectrum is converted back to the time domain signal through the inverse Fourier transform. In this way, we can standardize ECG signals of different lengths and sampling frequencies into signal segments with a length of 10 seconds and a sampling frequency of 360Hz, which is convenient for subsequent data processing and analysis.

[0067] 1.3 ECG signal annotation and preprocessing: The collected ECG data were read using WFDB and annotated according to the AAMI standard, with the classifications including N (normal), L (left bundle branch block), R (right bundle branch block), V (ventricular premature beats), and A (atrial premature beats). After deduplication and removal of abnormal labels, an ECG data set containing 53,787 N signals, 1,896 L signals, 1,951 R signals, 27,455 V signals, and 1,079 A signals was obtained.

[0068] 1.4 Data division: The processed ECG signal dataset is randomly divided into training set and test set in a ratio of 9:1.

[0069] Step 2: Build ECG signal feature extraction and classification network

[0070] In order to extract representative features from the input ECG signal data and classify them to identify arrhythmias, we built a comprehensive model consisting of a convolutional neural network (CNN) and a gated recurrent unit (GRU). The model uses a convolutional neural network to extract features and uses a GRU for classification. In order to enhance the classification ability of the model, an attention mechanism is also introduced.

[0071] 2.1 Feature Extraction Convolutional Neural Network

[0072] The feature extraction network consists of a one-dimensional convolutional layer, a batch normalization layer, and a maximum pooling layer. Through local connections and weight sharing mechanisms, it gradually processes the input data and automatically extracts high-level features.

[0073] 2.1.1 Convolution layer: Using local connections and weight sharing, the input signal is convolved to extract local features. The formula for the convolution operation is as follows:

[0074]

[0075] Among them, x is the input signal, w is the convolution kernel, y is the output signal, k is the convolution kernel size, m is the position index of the output signal in the convolution operation, and n is the position index in the convolution kernel;

[0076] 2.1.2 Batch Normalization Layer: Normalize the output of the convolutional layer to speed up the training process and improve model stability.

[0077]

[0078] Where x is the input signal, is the normalized output, μ and σ are the mean and standard deviation of the batch data, respectively, and ∈ is a small constant;

[0079] 2.1.3 Maximum pooling layer: Perform pooling operation on the normalized features to reduce feature dimension and computational complexity while retaining important features. The formula for maximum pooling is:

[0080] y[i]=max(x[m:m+p])

[0081] Where p is the size of the pooling window;

[0082] This internal structure consisting of convolutional layers, pooling layers, and fully connected layers effectively reduces the number of parameters that need to be learned and reduces the complexity of the model. Through convolutional layers and pooling layers, the model can effectively capture important information in the input data and automatically extract feature vectors, thereby simplifying the process of feature extraction and data reconstruction and improving the quality of feature representation.

[0083] 2.2 Arrhythmia Classification Network

[0084] The classification network uses the GRU model for feature classification and introduces an attention mechanism module to capture the correlation between signals, thereby completing the classification of arrhythmia signals.

[0085] 2.2.1GRU (Gated Recurrent Unit): The GRU model captures long-term dependencies in time series through a simplified gate structure (update gate and reset gate), while reducing training parameters and improving training efficiency. The formula of GRU is as follows:

[0086] z t =σ(W (z) x t +U (z) h t-1 )

[0087] r t =σ(W (r) x t +U (r) h t-1 )

[0088]

[0089] Among them, z t is the update gate, r t is the reset gate, h t is the hidden state, is a candidate hidden state, x t is the input at time step t, W, W (z) , W (r) is the weight matrix input to each gate (update gate, reset gate, candidate hidden state), U, U (z) , U (r) is the weight matrix from the hidden state to each gate (update gate, reset gate, candidate hidden state), is the point-wise product (Hadamard product) at the element level, σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function. 2.2.2 Attention mechanism: The attention mechanism calculates the degree of association between each element in the sequence and the current moment, and weights the sequence elements according to these associations, so that the model can focus on the part related to the current task, thereby improving the accuracy of the model.

[0090] In ECG signal classification, the attention mechanism can help the model identify and emphasize key ECG signal segments. For example, when detecting abnormal heart rhythms, the morphology and timing features of certain waveforms (such as P waves, QRS complexes, and T waves) may have particularly important diagnostic significance. By introducing the attention mechanism, the model can dynamically assign higher weights to these key features, thereby more accurately identifying different types of arrhythmias.

[0091] The basic process of the attention mechanism is as follows:

[0092] Calculate attention weights: Perform weighted summation on the outputs of the GRU hidden layer and calculate the attention score for each time step. The calculation formula is:

[0093] e ij =tanh(W h h i +Ws s j )

[0094] Among them, e ij Represents the hidden state h i With the current input s j The correlation score, h i is the output of the GRU hidden layer at time step i, s j is the value of the current input at time step j, W h and W s is the weight matrix used to calculate the attention score;

[0095] Normalized weights: The attention scores are normalized by the softmax function to obtain the attention weight distribution:

[0096]

[0097] Among them, α ij Represents the attention weight at time j to time i.

[0098] Calculate the context vector: Apply the attention weights to the hidden layer output of the GRU to get the context vector:

[0099]

[0100] In this way, the attention mechanism can focus on the most important parts of the ECG signal and improve classification accuracy.

[0101] 2.2.3 Fully connected layer and output layer: The output of the attention mechanism is passed through the fully connected layer and the output layer for classification. The output layer uses the softmax function to calculate the final classification probability:

[0102] y=softmax(W o c+b o )

[0103] Among them, W o is the weight matrix of the fully connected layer, b o is the bias vector of the fully connected layer;

[0104] Through the above structure, the model can effectively extract and classify features in ECG signals, thereby identifying different types of arrhythmias.

[0105] Step 3: Train the ECG classification model

[0106] In the process of training the ECG classification model, we input the ECG signal training set into the ECG classification model composed of feature extraction and classification networks. By comparing with the correct labels, the accuracy of the detection model for arrhythmia classification is calculated.

[0107] We use the cross entropy loss function to measure the difference between the model output and the true label. For a given sample, let the probability distribution of the model output be p and the probability distribution of the true label be q, then the cross entropy loss function is defined as:

[0108]

[0109] Among them, i represents the index of the category, q i is the probability of the true label, p i is the probability of the model output. In the optimization process, we used the RMSprop (Root Mean Square Propagation) optimization algorithm. RMSprop is a variant of the commonly used stochastic gradient descent (SGD) optimization algorithm, which adaptively adjusts the learning rate based on the exponentially weighted moving average of the square of the gradient. Its parameter update rule is as follows:

[0110]

[0111] Among them, θ t is the parameter of the tth iteration, is the gradient of the loss function with respect to the parameters, η is the learning rate, β is the decay rate, and v t is the exponentially weighted moving average of the square of the gradient, and ∈ is a small constant added for numerical stability.

[0112] By calculating the cross entropy loss function and using the RMSprop optimization algorithm for back propagation to update the model parameters, we continuously iterate the training until the maximum number of training times is reached. During the training process, we save the classification model with the highest classification accuracy during the training process as the optimal network model to ensure the good performance of the model on the test set.

[0113] Step 4: Test the ECG Classification Model

[0114] Input the ECG signal test set into the trained optimal network model, classify the test set data, and compare the classification results with the labels corresponding to the test set. Complete the test of the ECG classification model and obtain the final classification accuracy.

Claims

1. A CNN-GRU ECG signal classification method based on attention mechanism, characterized in that: The following steps are involved: S1: Collect ECG signals and perform resampling and preprocessing S1.1ECG signal collection: select ECG signal data from the database; S1.2 ECG signal resampling: A sliding window is used to cover all segments and segment the original ECG signal data. During the resampling process, the signal is first Fourier transformed to obtain its spectrum representation, and then the spectrum is interpolated to adapt it to the target sampling frequency. Finally, the spectrum is converted back to the time domain signal through inverse Fourier transform. S1.3 ECG signal annotation and preprocessing: Use WFDB to read the collected ECG data and annotate the data according to AAMI standards; S1.4 Data division: The processed ECG signal dataset is randomly divided into a training set and a test set; S2: Building ECG signal feature extraction and classification network Build a comprehensive model consisting of a convolutional neural network and a gated recurrent unit; the model uses a convolutional neural network to extract features and a gated recurrent unit for classification; S2.1 Feature Extraction Convolutional Neural Network: The feature extraction network consists of a one-dimensional convolutional layer, a batch normalization layer, and a maximum pooling layer. Through local connections and weight sharing mechanisms, the input data is processed step by step to automatically extract high-level features. Convolution layer: Using local connections and weight sharing, the input signal is convolved to extract local features. The formula for the convolution operation is as follows: Among them, x is the input signal, w is the convolution kernel, y is the output signal, k is the convolution kernel size, m is the position index of the output signal in the convolution operation, and n is the position index in the convolution kernel; batch normalization layer: normalize the output of the convolution layer, and the formula for batch normalization is: in, is the normalized output, μ and σ are the mean and standard deviation of the batch data, respectively, and ∈ is a small constant; Maximum pooling layer: pooling operation is performed on the normalized features. The maximum pooling formula is: y[i]=max(x[m:m+p]) Where p is the size of the pooling window; S2.2 Arrhythmia classification network: Use the gated recurrent unit model for feature classification, and introduce the attention mechanism module to capture the correlation between signals, so as to complete the classification of arrhythmia signals; The gated recurrent unit model captures long-term dependencies in the time series by updating the gate and resetting the gate. The formula is as follows: z t =σ(W (z) x t +U (z) h t-1 ) r t =σ(W (r) x t +U (r) h t-1 ) Among them, z t is the update gate, r t is the reset gate, h t is the hidden state, is a candidate hidden state, x t is the input at time step t, W is the weight matrix input to the update gate, W (z) is the weight matrix input to the reset gate, W ( r ) is the weight matrix of the candidate hidden state, U is the weight matrix from the hidden state to the update gate, and U ( z ) is the weight matrix from the hidden state to the reset gate, U ( r ) is the weight matrix from hidden state to candidate hidden state, ° is the point-by-point product at element level, σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function; Attention mechanism: The attention mechanism calculates the degree of association between each element in the sequence and the current moment, and weights the sequence elements according to the degree of association; Calculate the attention weight: perform weighted summation on the output of the hidden layer of the gated recurrent unit model GRU to calculate the attention score for each time step; the calculation formula is: e ij =tanh(W h h i +W s S j ) Among them, e ij Represents the hidden state h i With the current input s j The correlation score, h i is the output of the GRU hidden layer at time step i, s j is the value of the current input at time step j, W h and W s is the weight matrix used to calculate the attention score; Normalized weights: The attention scores are normalized by the softmax function to obtain the attention weight distribution: Among them, α ij represents the attention weight at time j to time i; Calculate the context vector: Apply the attention weights to the hidden layer output of the GRU to get the context vector: Fully connected layer and output layer: The output of the attention mechanism is classified through the fully connected layer and the output layer; the output layer uses the softmax function to calculate the final classification probability: y =softmax(W o c+b o ) Among them, W o is the weight matrix of the fully connected layer, b o is the bias vector of the fully connected layer; Through the above structure, the model extracts and classifies features in ECG signals to identify different types of arrhythmias; S3. Training ECG classification model The cross entropy loss function is used to measure the difference between the model output and the true label; for a given sample, the cross entropy loss function is defined as: Among them, q i is the probability of the true label, p i is the probability of the model output; The RMSprop optimization algorithm is used to adaptively adjust the learning rate based on the exponentially weighted moving average of the square of the gradient; its parameter update rules are as follows: Among them, θ t is the parameter of the tth iteration, is the gradient of the loss function with respect to the parameters, η is the learning rate, β is the decay rate, and v t is the exponentially weighted moving average of the square of the gradient, and δ is a small constant used to prevent division by zero; By calculating the cross entropy loss function and using the RMSprop optimization algorithm for back propagation to update the model parameters, the training is iterated continuously until the set maximum number of training times is reached; during the training process, the classification model with the highest classification accuracy during the training process is saved as the optimal network model.

2. The ECG signal classification method based on CNN-GRU of the attention mechanism according to claim 1, characterized in that: The databases in step S1 are the MIT-BIH arrhythmia database, the MIT-BIHST variation database, the EU ST-T ECG database and the sudden cardiac death dynamic ECG database.

3. The ECG signal classification method based on CNN-GRU of the attention mechanism according to claim 1, characterized in that: In step S1.2, during resampling, the sliding window is 10 seconds, and the sampling frequency is set to 360 Hz during Fourier transform; after resampling, the ECG signal is standardized into a signal segment with a length of 10 seconds and a sampling frequency of 360 Hz.

4. The ECG signal classification method based on CNN-GRU of the attention mechanism according to claim 1, characterized in that: In step S1.3, the classification of data annotation includes N-normal, L-left bundle branch block, R-right bundle branch block, V-ventricular premature beat, A-atrial premature beat.

Citation Information

Patent Citations

  • Multi-class arrhythmia detection method based on lead attention mechanism

    CN110890155A

  • Multi-feature fusion electrocardiosignal classification model modeling method based on attention mechanism

    CN113288163A

  • Arrhythmia classification method based on convolutional neural network and gating circulation unit

    CN113768514A

  • Generating neural network models, classifying physiological data, and classifying patients into clinical classifications

    GB202103370D0

  • Deep learning algorithms for heartbeats detection

    US20180249964A1

Cited By

  • Electromyographic signal real-time decomposition method based on attention mechanism and convolutional network

    CN119587049A

  • Method and system for constructing small sample electrocardiosignal recognition model based on Shaplet

    CN119700134A

  • Construction method and system of small sample ECG signal recognition model based on Shapelet

    CN119700134B

  • Electrocardiogram data processing model, device and equipment

    CN120022004A

  • Intelligent error detection method and system for measurement while drilling data

    CN120929927A