Arrhythmia intelligent classification device based on deep learning
By applying wavelet denoising, undersampling and multiple interpretability analysis methods in the intelligent classification model of arrhythmia, the problems of poor generalization and interpretability of existing models are solved, and higher accuracy and credibility are achieved , promoting the application of deep learning technology in the diagnosis of arrhythmia.
Patent Information
- Application Number
- CN202411358122.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing deep learning models have poor generalization and interpretability in the classification of arrhythmia, which leads to doctors and patients’ distrust of the model, limiting the application of deep learning technology in arrhythmia diagnosis.
The data set is expanded by wavelet denoising method, and the undersampling principle is used to randomly sample the heart-beat type data set with a large number of data distributions. The Adam optimizer and learning rate attenuation strategy are used for model training, and various types of them are used for HiResCAM, LIME, SHAP, etc. The method explains the model classification results.
It improves the accuracy and interpretability of the intelligent classification model of arrhythmia, enhances the readability and trust of the model, and promotes the practical application of deep learning technology in arrhythmia diagnosis.
Smart Images

Figure CN119494026A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent arrhythmia classification devices, and specifically relates to an intelligent arrhythmia classification device based on deep learning. Background Art
[0002] Electrocardiograms are an important basis for manual diagnosis of arrhythmias, and manual diagnosis relies heavily on doctors' prior knowledge and subjective intentions. As the prevalence of arrhythmias increases, doctors' diagnostic workload increases, and relying solely on manual diagnosis will affect the real-time and accuracy of detection.
[0003] Deep algorithms have achieved positive results in arrhythmia detection, but existing models used in arrhythmia classification have the problem of high classification accuracy but poor generalization and interpretability, which leads to doctors and patients' distrust of the models, thus limiting the application of deep learning technology in arrhythmia diagnosis. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides an intelligent classification device for arrhythmia based on deep learning. The device uses the wavelet denoising method to expand the data set, uses the undersampling principle to randomly sample the heartbeat type data set with a large data distribution, and uses the Adam optimizer and the learning rate decay strategy to train the model. Finally, the arrhythmia data set is classified through the model, and the model classification results are explained using HiResCAM, LIME, SHAP and other methods to intuitively display the basis for model type judgment. It can quickly analyze the electrocardiogram and output the results with higher accuracy.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: an intelligent arrhythmia classification device based on deep learning, comprising: a data set construction module, a data preprocessing module, an arrhythmia intelligent classification network construction training module, and an analysis module;
[0006] The data set construction module is used to construct a heart rhythm sample data set and is configured to perform the following actions: based on the ECG data sample, for different sampling frequencies, the preset points before and after the R peak are intercepted as a heart beat, a heart beat diagram is drawn, and it is saved as five arrhythmia types according to the AAMI classification standard;
[0007] The data preprocessing module is configured to perform the following actions: denoising the heart rate sample data set using a wavelet threshold denoising method, then expanding the data, and randomly sampling samples of categories with high sample content using a random sampling method;
[0008] The arrhythmia intelligent classification network construction training module is configured to perform the following actions: construct an arrhythmia intelligent classification network based on the DenseNet-201 network, take the heartbeat graph as input and the corresponding arrhythmia type as output, train the classification network, and obtain an arrhythmia intelligent classification model;
[0009] The analysis module is configured to perform the following actions: using an explainable analysis method to analyze the classification results output by the arrhythmia intelligent classification model to obtain analysis results.
[0010] Furthermore, the aforementioned intelligent classification device for arrhythmia based on deep learning is characterized in that, for a sampling frequency of 360 Hz, 150 points before and after the peak are intercepted as a heart beat, and for a sampling frequency of 250 Hz, 100 points before and after the peak are intercepted as a heart beat.
[0011] Furthermore, the aforementioned five arrhythmia types are N: normal or bundle branch block beat, S: supraventricular abnormal beat, V: ventricular abnormal beat, F: fusion beat and Q: unclassified beat.
[0012] Furthermore, the aforementioned wavelet denoising method is specifically: using the dB10 wavelet basis to perform three-layer wavelet decomposition on all heartbeat signals to obtain a number of wavelet coefficients, and then applying a soft threshold function to the high-frequency coefficients of each layer for threshold quantization processing to obtain the quantized wavelet coefficient estimate, and finally using the processed wavelet coefficients to perform an inverse wavelet transform to reconstruct the original signal to obtain a denoised heartbeat graph.
[0013] Furthermore, the aforementioned data expansion specifically includes: merging the heartbeat graph after wavelet threshold denoising with the original heartbeat graph to form a new data set, and the sample size of the new data set is expanded to twice that of the original data set.
[0014] Furthermore, the aforementioned random sampling specifically involves sampling the cardiotocogram data corresponding to the MIT-BIH dataset type N with a coefficient of 0.2, and sampling the cardiotocogram data corresponding to the EU ST-T dataset type N with a coefficient of 0.005.
[0015] Furthermore, the aforementioned intelligent arrhythmia classification network includes four Dense Block stacks, and every two Dense Blocks are connected by a transition layer. The transition layer includes a batch normalization layer, a convolution layer, and an average pooling layer. At the same time, the activation function of the intelligent arrhythmia classification network adopts the order of BN-ReLU-Conv, and finally the fully connected layer outputs five types of arrhythmia.
[0016] Furthermore, the aforementioned analysis module uses four methods: LIME, SHAP, Grad_CAM++ and HiResCAM to perform interpretable analysis on the model classification results.
[0017] Compared with the prior art, the beneficial technical effects of the present invention using the above technical solution are as follows:
[0018] 1. The present invention is a high-end intelligent device with the advantages of short time consumption and high accuracy. It is proposed to draw the ECG signal into a graph and then classify it, which can intuitively display the location of each signal data value. The device of the present invention implements a high-accuracy algorithm through a carefully designed deep neural network to achieve arrhythmia classification, thereby improving the practicality of the model. The present invention does not require operations such as ECG waveform feature extraction, and can directly use deep learning instead, saving time, reducing workload, and does not require manual identification, thereby improving work efficiency. The present invention realizes the first application of Grad_CAM++ and HiResCAM interpretability analysis methods in the field of ECG intelligent classification, improves the interpretability of deep learning models, and promotes the application process of intelligent classification models in practice. The present invention applies a variety of interpretability analysis methods in the field of arrhythmia intelligent classification, intuitively displays the classification basis of the model, and enhances the readability of the model.
[0019] 2. The model algorithm proposed in the present invention can not only judge the type of electrocardiogram arrhythmia, but also explain the basis for the model to make the judgment. The four interpretability analysis methods proposed in the present invention can achieve the interpretability of the test results and are very suitable for auxiliary diagnosis. The model proposed in the present invention has high generalization and the accuracy reduction is small in the classification of other data sets.
[0020] 3. The arrhythmia intelligent classification network proposed in the present invention constructs a training module. The model not only provides classification results of arrhythmia types, but also provides explainable results. This means that doctors or researchers can understand why the model makes a specific judgment, which improves the credibility and acceptability of the results. The model has high computational efficiency: The DenseNet-201 network structure adopted in this model uses a novel inter-layer connection method, so that information can be more fully transmitted between layers, thereby better improving the efficiency of information flow. Visual abnormality display: The explainable results are superimposed on the template electrocardiogram, so that the model classification basis can be displayed intuitively, which helps doctors or researchers to quickly understand and diagnose. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a heartbeat sample graph of a certain MIT-BIH arrhythmia data set after processing provided by an embodiment of the present invention.
[0022] Figure 2It is a schematic diagram of the architecture of DenseNet provided in an embodiment of the present invention.
[0023] Figure 3 This is an example diagram of a DenseNet structure containing 3 Dense Blocks provided in an embodiment of the present invention.
[0024] Figure 4 This is an example diagram of the effect of explaining the model classification results using the SHAP method provided in an embodiment of the present invention.
[0025] Figure 5 This is an example diagram of the effect of explaining the model classification results using the LIME method provided in an embodiment of the present invention.
[0026] Figure 6 This is an example diagram of the effect of explaining the model classification results using the Grad_CAM++ method provided in an embodiment of the present invention.
[0027] Figure 7 This is an example diagram of the effect of explaining the model classification results by the HiResCAM method provided in an embodiment of the present invention.
[0028] Figure 8 It is a framework diagram of the device of the present invention. DETAILED DESCRIPTION
[0029] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0030] Various aspects of the invention are described herein with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the invention are not limited to those described in the accompanying drawings. It should be understood that the invention is implemented by any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed in the invention are not limited to any implementation. In addition, some aspects disclosed in the invention may be used alone or in any appropriate combination with other aspects disclosed in the invention.
[0031] refer to Figure 8 , the present invention provides an arrhythmia intelligent classification device based on deep learning, including: a data set construction module, a data preprocessing module, an arrhythmia intelligent classification network construction training module, and an analysis module;
[0032] The data set construction module is used to construct a heart rhythm sample data set and is configured to perform the following actions: based on the electrocardiogram sample, for different sampling frequencies, the preset points before and after the R peak are intercepted as a heart beat, a heart beat graph is drawn, and it is saved as five arrhythmia types according to the AAMI classification standard;
[0033] The data preprocessing module is configured to perform the following actions: denoising the heart rate sample data set using a wavelet threshold denoising method, then expanding the data, and randomly sampling samples of categories with high sample content using a random sampling method;
[0034] The arrhythmia intelligent classification network construction training module is configured to perform the following actions: construct an arrhythmia intelligent classification network based on the DenseNet-201 network, take the heartbeat graph as input and the corresponding species arrhythmia type as output, train the classification network, and obtain an arrhythmia intelligent classification model;
[0035] The analysis module is configured to perform the following actions: using an explainable analysis method to analyze the classification results output by the arrhythmia intelligent classification model to obtain analysis results.
[0036] As a preferred embodiment, the dataset construction module uses the public datasets MIT-BIH Arrhythmia Database and European ST-T Database, and reads the V1 channel data and labels of the two datasets respectively, and intercepts 150 points before and after the R peak of the labeled ECG data (for the dataset with a sampling frequency of 360 Hz) or 100 points (for the dataset with a sampling frequency of 250 Hz) as a heartbeat, and draws it as follows Figure 1 The image samples shown are 640×480 in size and are saved as F, N, Q, S, and V according to the AAMI classification standard. The N category includes the following labels: "L", "R", "e", "j", "f", " / ", "n", "B", and "N". The S category includes: "A", "a", "J", and "S". The V category includes: "V", "E", and "r". The F category includes: "F". The Q category includes: "Q" and "?". The five types of arrhythmias are N: normal or bundle branch block beats, S: supraventricular abnormal beats, V: ventricular abnormal beats, F: fusion beats, and Q: unclassified beats.
[0037] As a preferred embodiment, the data preprocessing module processes the serious problem of sample category imbalance in the drawn picture data set. The data preprocessing module uses the wavelet threshold denoising method to expand the samples of the two data sets, and uses the random sampling method to randomly sample the sample of the category with more sample content. First, the three-layer wavelet decomposition of all heartbeat signals is performed using the dB10 wavelet basis to obtain a series of wavelet coefficients. Then, the soft threshold function is applied to the high-frequency coefficients of each layer for threshold quantization processing to obtain the quantized wavelet coefficient estimation value, and the processed wavelet coefficients are used to perform inverse wavelet transform to reconstruct the original signal and obtain the denoised signal. After the image processed by wavelet threshold denoising is merged with the original image, a new data set is formed. Compared with the original data set, the sample size is expanded to twice the original. The N-type samples in the MIT-BIH arrhythmia data set are sampled (undersampled) with a coefficient of 0.2, and the samples of the EU ST-T data set are sampled (undersampled) with a coefficient of 0.005, and finally the data sets named MIT_data and ST_data are formed.
[0038] The present invention has produced two experimental data sets. The first experimental data set MIT_dataset divides MIT_data into a training set and a test set at a ratio of 0.1, which is used for model training and testing in a single data set. The second experimental data set dataset uses the MIT_data data set as a training set and the ST_data data set as a test set, which is used for model training and testing in a cross-dataset situation, thereby testing the generalization ability of the model.
[0039] As a preferred embodiment, the arrhythmia intelligent classification network construction training module constructs an arrhythmia intelligent classification network based on the DenseNet-201 network. Figure 2 As shown in Figure 2, DenseNet divides the entire network into multiple densely connected modules, called Dense Blocks, such as Figure 3As shown. The connection between Dense Blocks is completed by a series of transition layers (TransitionLayers), which are usually composed of a batch normalization layer (Batch Normalization Layer), a convolutional layer (Convolutional Layer), and an average pooling layer (Average Pooling Layer). The model of the present invention uses the DenseNet-201 network, and the input image is binarized and input into the network model. The main body of the model is composed of 4 DenseBlocks stacked, and each two Dense Blocks are connected by a Transition Layer. The activation function combination follows the order of BN-ReLU-Conv, that is, the input is first normalized by batch normalization (Batch Normalization, BN), and then the ReLU activation function is used for nonlinear transformation, and finally the convolution operation is performed. The input channel of the model input layer is set to 1, the output channel is 64, the convolution kernel is (7, 7), the activation function is ReLU, and the output layer outputs 5 arrhythmia categories, namely N (normal or bundle branch block beats), S (supraventricular abnormal beats), V (ventricular abnormal beats), F (fusion beats) and Q (unclassified beats).
[0040] The present invention is first trained and tested on the MIT_dataset dataset, and then trained and tested on the dataset dataset. The model training uses the Adam optimizer, and the StepLR strategy is used to reduce the model learning rate. The epoch is set to 30.
[0041] As a preferred embodiment, the analysis module extracts images (344 in total) from the test dataset of MIT_dataset as the sample dataset for interpretability analysis. The trained DenseNet201 model is analyzed and compared using four interpretable analysis methods: SHAP, LIME, Grad_CAM++, and HiResCAM. The advantages and disadvantages of the interpretability methods are evaluated by observing whether the features that affect the results obtained by each method for each sample of the sample dataset are effective (the features are on the ECG signal). The explanation effect of SHAP is shown in Figure 1. Figure 4 As shown in the figure, the blue part represents the features that have a negative impact on the results, and the red part represents the features that have a positive impact on the results. The colors from light to dark represent the impact from small to large. The explanation effect of LIME is as follows: Figure 5 As shown in the figure, the red ECG waveform area represents the feature that has the greatest impact on the result; the interpretation effect of Grad_CAM++ is as follows Figure 6As shown in Figure 1, the influence of the regional features covered by the highlighted color on the results gradually decreases with the color changes of red, orange, yellow, green, cyan, blue and purple. The interpretation effect of HiResCAM is shown in Figure 1. Figure 7 As shown, its feature representation method is consistent with the Grad_CAM++ method.
[0042] The present invention compares four interpretability analysis methods. The SHAP method is better in calculating all valid features, but it has the problem that the number of calculated valid features is large and dense, making it difficult to concretize; the effective features obtained by the Grad_CAM++ method can be concentrated in one or two areas, but there are cases where valid features cannot be obtained for most N types of samples; the LIME method has problems such as the overlap of the effective feature edge line and the ECG signal and the dispersion of effective features; HiResCAM is more suitable for this research field both in terms of calculation speed and interpretation effect.
[0043] Example 1: Implementation in hospital environment
[0044] 1. Dataset creation: In a hospital environment, a large number of static ECGs (sampling frequency is recommended to be 360Hz) can be collected and labeled. 150 points before and after the R peak (for a data set with a sampling frequency of 360Hz) or 100 points (for a data set with a sampling frequency of 250Hz) are intercepted as a heartbeat. After drawing the picture, it is saved as five categories: F, N, Q, S, and V according to the AAMI classification standard.
[0045] 2. Data preprocessing: To address the problem of imbalanced number of sample categories, the wavelet threshold denoising method is used to expand the samples of the two data sets, and the random sampling method is used to randomly sample samples of categories with high sample content.
[0046] 3. Experimental data set preparation: The data set is divided into training set and test set in a ratio of 9:1.
[0047] 4. Network construction: The model adopts the DenseNet-201 network structure, the input channel of the model input layer is set to 1, the activation function is ReLU, and the output layer outputs 5 arrhythmia categories.
[0048] 5. Model training: Use the Adam optimizer, the initial learning rate is 0.01, the StepLR strategy is used to reduce the learning rate, the decay coefficient is set to 0.5, and the training rounds are 30 times.
[0049] 6. Explain the model classification results: Input the samples into the model for classification, and use the HiResCAM interpretability analysis method for visual interpretation.
[0050] Example 2: Research environment implementation
[0051] 1. Dataset preparation: In a research environment, you can use a public ECG dataset for experiments, and read the V1 channel data and labels of the dataset. For the labeled ECG data, extract 150 points before and after the R peak (for a dataset with a sampling frequency of 360 Hz) or 100 points (for a dataset with a sampling frequency of 250 Hz) as a heartbeat. After drawing the picture, save it as five categories: F, N, Q, S, and V according to the AAMI classification standard.
[0052] 2. Data preprocessing: To address the problem of imbalanced number of sample categories, the wavelet threshold denoising method is used to expand the samples of the two data sets, and the random sampling method is used to randomly sample samples of categories with high sample content.
[0053] 3. Experimental data set preparation: The data set is divided into training set and test set in a ratio of 9:1.
[0054] 4. Network construction: The model adopts the DenseNet-201 network structure, the input channel of the model input layer is set to 1, the activation function is ReLU, and the output layer outputs 5 arrhythmia categories.
[0055] 5. Model training: Use the Adam optimizer, the initial learning rate is 0.01, the StepLR strategy is used to reduce the learning rate, the decay coefficient is set to 0.5, and the training rounds are 30 times.
[0056] 6. Explain the model classification results: Input the samples into the model for classification, and use the HiResCAM interpretability analysis method for visual interpretation.
[0057] Although the present invention has been described above with preferred embodiments, it is not intended to limit the present invention. A person skilled in the art of the present invention may make various modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the definition of the claims.
Claims
1. A device for intelligent classification of arrhythmias based on deep learning, characterized in that: include: Data set construction module, data preprocessing module, arrhythmia intelligent classification network construction training module, and analysis module; The data set construction module is used to construct a heart rhythm sample data set and is configured to perform the following actions: based on the ECG data sample, for different sampling frequencies, the preset points before and after the R peak are intercepted as a heart beat, a heart beat diagram is drawn, and it is saved as five arrhythmia types according to the AAMI classification standard; The data preprocessing module is configured to perform the following actions: denoising the heart rate sample data set using a wavelet threshold denoising method, then expanding the data, and randomly sampling samples of categories with high sample content using a random sampling method; The arrhythmia intelligent classification network construction training module is configured to perform the following actions: construct an arrhythmia intelligent classification network based on the DenseNet-201 network, take the heartbeat graph as input and the corresponding arrhythmia type as output, train the classification network, and obtain an arrhythmia intelligent classification model; The analysis module is configured to perform the following actions: using an explainable analysis method to analyze the classification results output by the arrhythmia intelligent classification model to obtain analysis results.
2. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: For a sampling frequency of 360 Hz, 150 points before and after the peak are intercepted as a heart beat, and for a sampling frequency of 250 Hz, 100 points before and after the peak are intercepted as a heart beat.
3. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: The five arrhythmia types are N: normal or bundle branch block beat, S: supraventricular abnormal beat, V: ventricular abnormal beat, F: fusion beat and Q: unclassified beat.
4. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: The specific wavelet denoising method is as follows: a three-layer wavelet decomposition of all heartbeat signals is performed using the dB10 wavelet basis to obtain a number of wavelet coefficients, and then a soft threshold function is applied to the high-frequency coefficients of each layer for threshold quantization to obtain the quantized wavelet coefficient estimate. Finally, the processed wavelet coefficients are used to perform an inverse wavelet transform to reconstruct the original signal and obtain a denoised heartbeat graph.
5. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: The data expansion specifically includes: merging the heartbeat graph after wavelet threshold denoising with the original heartbeat graph to form a new data set, and the sample size of the new data set is expanded to twice that of the original data set.
6. The device for intelligently classifying arrhythmias based on deep learning according to claim 3, characterized in that: The random sampling specifically involves sampling the cardiotach data corresponding to the MIT-BIH dataset type N with a coefficient of 0.2, and sampling the cardiotach data corresponding to the EU ST-T dataset type N with a coefficient of 0.
005.
7. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: The intelligent arrhythmia classification network includes four Dense Block stacks, and every two Dense Blocks are connected by a transition layer. The transition layer includes a batch normalization layer, a convolution layer, and an average pooling layer. At the same time, the activation function of the intelligent arrhythmia classification network adopts the order of BN-ReLU-Conv, and finally the fully connected layer outputs five types of arrhythmia.
8. The device for intelligently classifying arrhythmias based on deep learning according to claim 1, characterized in that: The analysis module uses four methods: LIME, SHAP, Grad_CAM++ and HiResCAM to perform interpretable analysis on the model classification results.
Citation Information
Patent Citations
Electrocardiogram signal classifying method based on one-dimensional convolutional neural network
CN107495959A
Atrial fibrillation recognition method, device and equipment, and computer-readable storage medium
CN109171712A
Method for constructin image classification model and image classification method
CN112836729A
ResOHEM-net-based arrhythmia classification method and system
CN113743259A
Image classification method and system based on space and channel attention mechanism
CN113743484A
Cited By
Fatigue intervention method, system, equipment, medium and product
CN119818800A
SHAP-based new classical circumferential viscous moment interpretable machine learning method and system
CN120409742A