A real-time classification method for arrhythmia based on continuous learning

Through the real-time classification method of arrhythmia based on continuous learning, combined with deep convolutional neural network and clustering algorithm, the problems of low efficiency, low accuracy and concept drift in real-time classification of arrhythmia are solved, and efficient and accurate real-time rhythms are achieved Abnormal classification and continuous learning ability.

CN114970612BActive Publication Date: 2025-01-07GUANGZHOU XINGSHU CLOUD TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210497273.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2025-01-07
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

The prior art has problems such as low efficiency, low accuracy, concept drift and online classification in real-time classification of arrhythmia, especially when processing unbalanced data, resulting in reduced diagnostic misdiagnosis and model prediction accuracy.

Method used

Using the real-time classification method of arrhythmia based on continuous learning, the deep convolutional neural network heart beat classification model is constructed by positioning QRS waves, combining the clustering algorithm to calculate the data prototype, and iteratively update the model using the exponential weighted average to realize real-time data Combining processing and buffer data reduces the impact of concept drift.

Benefits of technology

It realizes efficient and accurate arrhythm classification under unbalanced conditions, ensures real-time output and high classification accuracy, effectively solves the concept drift problem, and is suitable for continuous learning environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114970612B_ABST
    Figure CN114970612B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time classification method for arrhythmia based on continuous learning, including: locating QRS wave, intercepting heartbeats in ECG signals, sampling different heartbeat types to obtain several data streams; constructing a heartbeat classification model based on a deep convolutional neural network; calculating the prototype of the same type of data based on a clustering algorithm, storing the prototype of each type of data and part of the data stream together in a buffer; importing the data stream in batches for multiple times, reading data of the same batch size from the buffer, synthesizing new training data, iteratively updating the prototype after each input in an exponentially weighted average manner, training the heartbeat classification model and updating parameters; importing the new ECG beat data to be identified into the trained heartbeat classification model, and performing heartbeat type identification. The present invention can efficiently and accurately realize arrhythmia classification under data imbalance conditions, and can also realize arrhythmia classification under continuous learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer software, and in particular relates to a real-time classification method for arrhythmia based on continuous learning. Background Art

[0002] The pervasiveness of data streams in contemporary life forces systems to continuously learn. Autonomous vehicles, perception robot data, and video streams generate a never-ending stream of data, with the observed environment changing drastically every time a vehicle turns a corner, a robot enters a new room, or a camera switches to a subsequent scene. Learning from streaming data is far from trivial due to these changes. But in everyday life, data is not static. Because neural network learning schemes are developed under the assumption that all data are identical and independent, design inventions for analyzing information from imbalanced data in real time are critical.

[0003] A sensor (English name: transducer / sensor) is a detection device that can sense the information being measured and can transform the sensed information into electrical signals or other required forms of information output according to certain rules to meet the requirements of information transmission, processing, storage, display, recording and control. Therefore, sensors can meet the needs of real-time data when collecting data. In today's life, the popularity of devices such as smart bracelets has greatly facilitated the collection of people's physiological data. Especially the collection of electrocardiogram signals in medicine.

[0004] Through sensors, people can get relevant physiological data in the first place. Doctors can analyze and judge it and give a diagnosis in time. In recent years, there has been an increasing number of studies on the classification of physiological signals using deep learning models. Driven by the development of large-scale data sets and deep neural networks, the development of classification models has made great progress. In order to improve the efficiency and accuracy of model classification, people have made many improvements on basic neural networks. Continuous learning means that the system can learn many tasks from one or more fields. They efficiently retain the knowledge they have learned and use this knowledge to learn new tasks more effectively. Among them, the problem of concept drift still needs a solution. Concept drift refers to the phenomenon in predictive analysis and machine learning that the statistical characteristics of the target variable change in unpredictable ways over time. Over time, the prediction accuracy of the model will decrease. For classification models, concept drift will affect the accuracy of model classification, and how to solve this problem is still the focus of current research. Summary of the invention

[0005] Technical problems to be solved: In order to enable computers to more automatically, accurately and efficiently classify the types of physiological signals, there are still some problems to be solved in the existing automatic classification of physiological signals. The present invention aims to solve the following problems:

[0006] (1) Low efficiency. When classifying physiological signals, if the computer processing time for each signal is too long, it will lead to low efficiency. In real-life scenarios, incorrect diagnosis leads to misdiagnosis and even delays the best treatment time.

[0007] (2) Low accuracy. Since most data is unbalanced, the accuracy of model classification will be limited to a certain extent. If the accuracy is not high enough, the model implementation will be meaningless and cannot provide corresponding help and play a real auxiliary role.

[0008] (3) Concept drift. For unbalanced data, a small number of data errors may lead to errors in the entire result. Effectively solving concept drift can improve the accuracy of model classification, ensure the prediction accuracy of the model, and ensure that the model itself does not become inapplicable over time.

[0009] (4) Online classification. When classifying physiological signals, the data is not output in real time and lacks immediacy. Online continuous learning can meet more classification needs and achieve wider and more effective applications.

[0010] Technical solution:.

[0011] A real-time classification method for arrhythmia based on continuous learning, the real-time classification method comprising the following steps:

[0012] S1, locate the QRS wave, extract the heartbeat in the ECG signal, and sample different heartbeat types to obtain several data streams;

[0013] S2, building a heartbeat classification model based on a deep convolutional neural network, which is used to classify the imported heartbeat data;

[0014] The sampled data stream is processed based on the clustering algorithm to calculate the prototype of the same type of data. The prototype refers to the average value of all data with the same category label. The prototype of each type of data and part of the data stream are stored in the buffer together; the data stream is imported in batches multiple times, and the data of the same batch size is read from the buffer to synthesize new training data. The prototype after each input is iteratively updated by exponential weighted average, and the heartbeat classification model is trained and the parameters are updated;

[0015] S3, importing the ECG heartbeat data to be identified into the trained heartbeat classification model to perform heartbeat type identification.

[0016] Further, in step S1, the heartbeat types include normal heartbeat, supraventricular ectopic heartbeat, ventricular ectopic heartbeat, fused heartbeat and inseparable heartbeat.

[0017] Further, in step S2, the heartbeat classification model includes an input layer, 5 feature extraction modules with the same structure, a first fully connected layer, a first ReLU activation layer, a second fully connected layer and a softmax activation layer connected in sequence;

[0018] The feature extraction module includes a second convolutional layer, a second ReLU activation layer, a third convolutional layer, a fusion layer, a fourth convolutional layer and a pooling layer connected in sequence; the output end of the first convolutional layer is respectively connected to the input ends of the second convolutional layer and the fusion layer, the output features of the first convolutional layer are processed in sequence by the second convolutional layer, the second ReLU activation layer, and the third convolutional layer, and the fusion layer fuses the processing results with the original output features and then imports them into the fourth convolutional layer.

[0019] Furthermore, the training process of the heartbeat classification model includes the following steps:

[0020] S21, divide the sampled data stream into two parts: a training set and a test set, and the ratio of the number of data streams in the training set to the number of data streams in the test set is 9:1;

[0021] S22, uses the heartbeat classification method of deep convolutional neural network 1D-Resnet network to classify the data stream of the training set; among them, convolution with stride=2 is used for downsampling, and the fully connected layer is replaced by the global average pool layer;

[0022] S23, for each heartbeat type, using the K-means method, divide the corresponding sample set into K clusters according to the distance between samples, calculate the most representative point from all data with the same label, record it as the prototype of the class, and store the calculated prototype and part of the data into a buffer;

[0023] S24, importing the data stream in batches for multiple times, reading data of the same batch size from the buffer, synthesizing new training data, iteratively updating the prototype after each input by exponential weighted average, training and updating the parameters of the heartbeat classification model; wherein the exponential weighting parameter β=0.9, and the loss function is to take the negative log-likelihood and sum it over all instances in the batch;

[0024] S25, retain the optimal parameters finally obtained, input the test set into the heartbeat classification model for testing, if the test passes, end the training process, otherwise return to step S21.

[0025] Furthermore, in step S25, the classification result of the test set is compared with the nearest neighbor prototype to continuously update the prototype.

[0026] Beneficial effects:

[0027] First, the real-time arrhythmia classification method based on continuous learning of the present invention can efficiently and accurately realize arrhythmia classification under data imbalance conditions.

[0028] (1) Efficiency: Some existing classification models for arrhythmias cannot meet the requirements of real-time online classification. To address this problem, the present invention uses batch processing for data input. We call the size of the input data block the horizon, and its data and size are determined by specific settings or applications. When the horizon size is equal to the input data length, it can meet the requirements of offline learning, and when the horizon size is the batch size, it can meet the requirements of online learning. In addition, the data results can be output in real time, solving the problem of slow and untimely data processing.

[0029] (2) Accuracy: First, the present invention is based on a heartbeat classification method based on a deep convolutional neural network, which can accurately classify five different arrhythmias according to the AAMI EC57 standard. Secondly, for the concept drift caused by some erroneous data, an updated prototype model is used to encourage inter-class differences and reduce intra-class differences, thereby reducing the possibility of classification errors caused by concept drift. Therefore, the present invention can ensure a higher classification accuracy.

[0030] Second, the real-time arrhythmia classification method based on continuous learning of the present invention can realize arrhythmia classification under continuous learning. There are still many problems to be solved in continuous learning, such as the inability of traditional machine learning models to meet the application problems in the new big data environment. The present invention adds a buffer for storing data on the basis of the basic classification model, combines the new data with the data in the buffer, and uses them as the input of the model together. This can effectively solve the problem that the model gradually fails to meet the needs of training old data due to training new data, effectively retains its classification ability, and can classify new data more effectively and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 1D-Resnet structure diagram of an embodiment of the present invention.

[0032] Figure 2 A schematic diagram of a model structure corresponding to the real-time arrhythmia classification method based on continuous learning according to an embodiment of the present invention.

[0033] Figure 3 Schematic diagram of the principle of preventing concept drift in the real-time arrhythmia classification method based on continuous learning according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following embodiments may enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. The present invention proposes a real-time classification method for arrhythmia based on continuous learning, and the real-time classification method comprises the following steps:

[0035] S1, locate the QRS wave, extract the heartbeat in the ECG signal, and sample different heartbeat types to obtain several data streams.

[0036] S2, builds a heartbeat classification model based on a deep convolutional neural network, and the heartbeat classification model is used to classify the imported heartbeat data.

[0037] The sampled data stream is processed based on the clustering algorithm, and the prototype of the same type of data is calculated. The prototype refers to the average value of all data with the same category label. The prototype of each type of data and part of the data stream are stored in the buffer together; the data stream is imported in batches multiple times, and the data of the same batch size is read from the buffer to synthesize new training data. The prototype after each input is iteratively updated using exponentially weighted averaging, and the heartbeat classification model is trained and the parameters are updated.

[0038] S3, importing the ECG heartbeat data to be identified into the trained heartbeat classification model to perform heartbeat type identification.

[0039] Figure 2 A schematic diagram of a model structure corresponding to the real-time arrhythmia classification method based on continuous learning according to an embodiment of the present invention.

[0040] Step 1: Sampling to obtain data stream

[0041] Locate the QRS wave and extract the heartbeat from the ECG signal. A normal ECG signal is composed of P wave, QRS complex and T wave in one cycle. P wave: represents cardiac depolarization, generally presents a blunt round shape, with an amplitude of about 0.25mV and a duration of 0.08-0.11s. PR interval: refers to the conduction time from the start of atrial depolarization to the start of ventricular depolarization, generally from the start of the P wave to the starting point of the QRS wave, and the normal PR interval is: 0.12s-0.20s. QRS: represents the potential change caused by the depolarization of the ventricular muscle, and is the highest and fastest waveform in the ECG. T wave: represents the repolarization of the ventricular muscle QT interval: represents the depolarization and repolarization process of the heart, that is, the total time of ventricular contraction. The QT interval is related to the heart rate. The faster the heart rate, the shorter the QT interval, and vice versa. RR interval: refers to the change characteristics of the R peak interval between two consecutive ECG cycles, which is one of the commonly used heartbeat recognition standards. For the classification model, the object of the classification model is the heartbeat. Among the various wave bands of various types of heartbeats, the QRS wave is often the largest, most obvious, and sharpest, which is conducive to detection. In mathematics, it is called the "singularity" of the QRS wave, which is manifested as a sudden change in slope and the existence of non-differentiable points, that is, the peak (or trough) point. This property can be used in conjunction with a variety of processing methods, such as differential method, wavelet transform method, etc. for effective detection.

[0042] The data used in this embodiment comes from the American MIT-BIH arrhythmia data set. According to the standards proposed by the Association for the Advancement of Medical Instrumentation (AAMI), all heartbeats can be divided into five categories: normal beat (N), supraventricular ectopic beat (S), ventricular beat (V), fusion beat (F) and unclassifiable beat (Q). After the interception of the heartbeat, the numbers corresponding to the five types of heartbeats N, S, V, F, and Q obtained in this embodiment are: 86717, 3026, 7008, 802, and 15 respectively.

[0043] Step 2: Build and train the model

[0044] In this stage, small batch processing is used to divide the data stream and learn the training set using 1D-Resnet. After the classification is completed, the K-means method is used to calculate the most representative point from all the data with the same label and record it as the prototype of the class. All prototypes are stored in the buffer M, and some data are also stored in it.

[0045] Step 1: Divide the dataset. We choose to divide the dataset into two parts. 90% of it is set as the training set and 10% is set as the test set. Repeat the training set data for 100 times. In simple terms, all ECG data is divided into ten parts, nine for training model parameters and one for testing accuracy. The batch size is set to 10, and the dataset is input in batch size, which can be iterated multiple times.

[0046] Step 2: Use the heartbeat classification method 1D-Resnet network with deep convolutional neural network for classification. Figure 1 It is a schematic diagram of the 1D-Resnet structure of an embodiment of the present invention. Resnet directly uses convolution with stride=2 for downsampling, and replaces the fully connected layer with a global average pool layer. An important design principle of Resnet is that when the feature map size is reduced by half, the number of feature maps is doubled, which maintains the complexity of the network layer. The same type of data with the same label is used to calculate the prototype of each category, that is, the most representative point of each category using the K-means method. For a given sample set t, K-means divides the sample set t into K clusters according to the distance between the samples. Make the points within the cluster as closely connected as possible, and make the distance between clusters as large as possible.

[0047] Step 3: Store the calculated prototype and partial data into the buffer.

[0048] Step 4: Prevent concept drift and catastrophic forgetting. Catastrophic forgetting means that in the process of continuous learning, the model that has learned new knowledge cannot solve the problem of old knowledge well. In order to alleviate catastrophic forgetting, the newly added data set j will read data of the same batch size from the buffer to synthesize new training data. The prototype is updated using exponential weighted average to stabilize the drastic changes in the data stream. The exponential weighting parameter β = 0.9. The loss function is used to optimize the model parameters. We map the data to the latent space through the embedding function to calculate the loss. The loss function loss takes the negative log-likelihood and sums it over all instances in the batch.

[0049] Step 3: Test the model effect and continuously update the model

[0050] After the model is trained, the optimal parameters are retained and the test set is input for testing. At this time, inputting ECG heartbeat data of an unknown category into the model can achieve automatic classification.

[0051] See also Figure 3, continue to use Resnet classification, find the closest prototype based on the nearest neighbor classification, and form a predicted type. If the Resnet classification result of the current data is different from its prototype, using exponential weighted average to update the prototype can reduce the possibility of mutation and prevent concept drift caused by very individual data. When there are enough data with different classification results, based on the continuous update of the prototype, the prototype of this type of data will eventually be updated to the classification category.

Claims

1. A real-time classification method for arrhythmia based on continuous learning, characterized in that: The real-time classification method The following steps are involved: S1, locate the QRS wave, extract the heartbeat in the ECG signal, and sample different heartbeat types to obtain several data streams; S2, building a heartbeat classification model based on a deep convolutional neural network, which is used to classify the imported heartbeat data; The sampled data stream is processed based on the clustering algorithm to calculate the prototype of the same type of data. The prototype refers to the average value of all data with the same category label. The prototype of each type of data and part of the data stream are stored in the buffer together; the data stream is imported in batches multiple times, and the data of the same batch size is read from the buffer to synthesize new training data. The prototype after each input is iteratively updated by exponential weighted average, and the heartbeat classification model is trained and the parameters are updated; S3, importing the ECG heartbeat data to be identified into the trained heartbeat classification model to identify the heartbeat type; In step S2, the heartbeat classification model includes an input layer, a first convolutional layer, 5 feature extraction modules with the same structure, a first fully connected layer, a first ReLU activation layer, a second fully connected layer and a softmax activation layer connected in sequence; The feature extraction module includes a second convolutional layer, a second ReLU activation layer, a third convolutional layer, a fusion layer, a fourth convolutional layer and a pooling layer connected in sequence; the output end of the first convolutional layer is respectively connected to the input ends of the second convolutional layer and the fusion layer, the output features of the first convolutional layer are processed in sequence by the second convolutional layer, the second ReLU activation layer, and the third convolutional layer, and the fusion layer fuses the processing results with the original output features and then imports them into the fourth convolutional layer; The training process of the heartbeat classification model includes the following steps: S21, divide the sampled data stream into two parts: a training set and a test set, and the ratio of the number of data streams in the training set to the number of data streams in the test set is 9:1; S22, a heartbeat classification model 1D-Resnet network is constructed using a deep convolutional neural network to classify the data stream of the training set; convolution with stride=2 is used for downsampling, and the fully connected layer is replaced by the global average pool layer; S23, for each heartbeat type, using the K-means method, divide the corresponding sample set into K clusters according to the distance between samples, calculate the most representative point from all data with the same label, record it as the prototype of the class, and store the calculated prototype and part of the data into a buffer; S24, import the data stream in batches multiple times, read the data of the same batch size from the buffer, synthesize new training data, iteratively update the prototype after each input by exponential weighted average, train the heartbeat classification model and update the parameters; where the exponential weighting parameter β=0.9, and the loss function is to take the negative log-likelihood and sum it over all instances in the batch; S25, retain the optimal parameters finally obtained, input the test set into the heartbeat classification model for testing, if the test passes, end the training process, otherwise return to step S21.

2. The method for real-time classification of arrhythmias based on continuous learning according to claim 1, characterized in that: In step S1, the heartbeat types include normal heartbeat, supraventricular ectopic heartbeat, ventricular ectopic heartbeat, fusion heartbeat and inseparable heartbeat.

3. The method for real-time classification of arrhythmias based on continuous learning according to claim 1, characterized in that: In step S25, the classification results of the test set are compared with the nearest neighbor prototype to continuously update the prototype.