A Heart Arrhythmia Classification Method Based on Continuous Testing Time Adaptation

By using GAN-based methods to generate small class samples to expand the dataset and a continuous testing time-domain adaptation method, the problems of class imbalance, weak generalization ability, and catastrophic forgetting in ECG data classification are solved, achieving efficient ECG data classification in constantly changing testing environments.

CN115982624BActive Publication Date: 2025-11-14NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211740943.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-11-14
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing ECG data classification methods suffer from problems such as class imbalance, weak model generalization ability, high annotation cost, susceptibility to catastrophic forgetting, and the need to access source domain data during the adaptation process, especially in constantly changing test environments.

Method used

We employ a generative adversarial network (GAN)-based method to generate small class samples to augment the dataset. By continuously testing time-domain adaptation methods, we use weighted average pseudo-labels, augmented average pseudo-labels, and random recovery of source model weights to alleviate the model's adaptation to constantly changing environments and reduce catastrophic forgetting, without requiring access to the source data or target domain labels.

Benefits of technology

It improves the model's generalization ability in constantly changing test environments, reduces catastrophic forgetting, simplifies the data preprocessing process, and reduces annotation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115982624B_ABST
    Figure CN115982624B_ABST
Patent Text Reader

Abstract

This invention discloses an ECG data classification method based on continuous test-time adaptation. This method improves the model's generalization ability during testing without modifying the source model's training process, accessing the source data, or requiring target domain data labels. This allows the model to adapt to constantly changing testing environments. The proposed continuous test-time adaptation ECG data classification method mitigates catastrophic forgetting by restoring some model parameters to their original source parameters during the test-time adaptation process, without affecting model performance. The ECG data preprocessing method used in this invention is simple and does not require noise filtering or feature extraction. Traditional ECG data preprocessing methods heavily rely on the researcher's experience and are ineffective. Due to suboptimal extracted features, the model is highly sensitive to noise signals during training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data classification, specifically relating to a method for classifying heart rate arrhythmias based on continuous testing time adaptation. Background Technology

[0002] The goal of test-time domain adaptation is to adapt a source pre-trained model by learning from unlabeled test data (the target domain) at test time. Existing work primarily considers the case where the target domain is static. However, real-world machine perception systems operate in unstable and constantly changing environments where the target domain distribution changes over time. In such a changing environment, most self-training and entropy regularization-based methods are affected by these changes, leading to a significant degrade in model performance. Due to privacy concerns or legal constraints, source domain data is often considered unavailable during testing in the test-time domain adaptation setting, making it more challenging, but also more realistic, than unsupervised domain adaptation. Therefore, test-time domain adaptation is crucial for the success of real-world machine perception system applications under domain transformation.

[0003] Electrocardiography (ECG) is widely used by cardiologists and medical professionals to monitor heart health. An ECG examination can detect any arrhythmias. Arrhythmias are a typical type of cardiovascular disease, referring to irregular changes in the normal heart rhythm. Several typical arrhythmias include atrial fibrillation, premature beats, ventricular fibrillation, and tachycardia. While a single arrhythmic heartbeat may not have a serious impact on life, consecutive arrhythmic heartbeats can pose a very serious threat to the heart. Therefore, regular monitoring of heart rhythm is crucial for managing and preventing cardiovascular disease. Existing methods for classifying ECG data face several challenges: reliance on manual data labeling, inability of the models to adapt well to constantly changing testing environments, and susceptibility to catastrophic amnesia. The main problems are as follows:

[0004] 1) Class Imbalance in Datasets. In deep learning classification tasks, model performance is easily affected by class imbalance in the dataset. This results in the final model performing well in classifying large classes, but performing extremely poorly in classifying small classes with a small number of participants. The class imbalance problem is particularly prominent in electrocardiogram (ECG) related datasets because there are many normal heartbeats and very few abnormal heartbeats in ECG data, resulting in a serious class imbalance problem. This leads to poor performance of traditional deep learning methods in ECG classification.

[0005] 2) Weak model generalization ability. The strength of a model's generalization ability determines whether it can be well applied to various machine perception systems in the real world. Existing ECG data classification methods can show good performance when the target domain is static, but the model performance drops significantly when the target domain changes continuously.

[0006] 3) High labeling costs. Supervised learning-based ECG data classification methods require a large number of manually labeled datasets during training. However, labeling data consumes significant human and material resources, making it extremely expensive. For specific time-series medical datasets like ECG, labeling relies on experienced healthcare professionals with specialized knowledge, further raising the barrier to entry for manual labeling and making the labeling of large-scale, more complex datasets extremely difficult. The lack of labeled training data hinders the comprehensive clinical impact of supervised machine learning in healthcare; therefore, unsupervised learning-based methods are becoming increasingly important.

[0007] 4) Models are susceptible to catastrophic forgetting. Catastrophic forgetting refers to the phenomenon where a model almost completely forgets previously learned content after acquiring new knowledge. In the real world, many tasks cannot obtain all training data at once. This necessitates that models continuously learn new knowledge using constantly generated new data while retaining previously learned important content. Therefore, mitigating catastrophic forgetting is of great significance for the practical deployment and application of models.

[0008] 5) The adaptation process requires the use of source domain data. Existing ECG classification methods based on domain adaptation typically require access to source data during testing. The model is usually retrained using both source and target domain data to adapt to the changing target domain data. However, this may not always be feasible due to privacy or legal constraints, as the source domain data may no longer be available, and only the source pre-trained model that was pre-trained during the training phase is available during testing.

[0009] Data preprocessing is complex. Electrocardiogram (ECG) signals are weak signals with strong nonlinearity, non-stationarity, and randomness. During acquisition, they are highly susceptible to influences from both internal and external environments, such as limb movement, respiration, and electromagnetic interference. Therefore, directly acquired ECG signals are accompanied by significant noise, including baseline drift, power line interference, electromyography (EMG) interference, and motion artifacts. Traditional ECG data denoising methods, such as wavelet filtering, FIR filtering, and median filtering, heavily rely on the researcher's experience for parameter selection. Inappropriate parameter selection can lead to poor denoising results, consequently affecting subsequent ECG data classification tasks. Summary of the Invention

[0010] To address the technical problems mentioned in the background section, this invention proposes a heart rate arrhythmia classification method based on continuous testing time adaptation.

[0011] To achieve the above-mentioned technical objectives, the technical solution of the present invention is as follows:

[0012] (Basically the same as the rights document)

[0013] The beneficial effects of adopting the above technical solution are as follows:

[0014] This invention proposes an ECG data classification method based on continuous test time domain adaptation. It can improve the generalization of the model during testing without modifying the training process of the source model, without accessing the source data, and without needing the target domain data labels. This enables the model to adapt to the constantly changing test environment.

[0015] The ECG data classification method with continuous test time-domain adaptation proposed in this invention can alleviate catastrophic forgetting of the model by restoring a portion of the model parameters to the original model parameters during the test time adaptation process, without affecting the model performance.

[0016] The ECG data preprocessing method used in this invention is very simple and does not require noise filtering or feature extraction preprocessing. Traditional ECG data preprocessing methods rely heavily on the researcher's experience and are ineffective. Due to the imperfect extracted features, the model is very sensitive to noise signals during training. Attached Figure Description

[0017] Figure 1 This is a flowchart of the workflow for continuously testing time-domain adapted ECG data classification methods;

[0018] Figure 2 This is a diagram of the generator and discriminator models in ECGGAN;

[0019] Figure 3 This is a graph showing the loss variation during the ECGGAN training process;

[0020] Figure 4 This is a comparison of supraventricular ectopic beats between samples generated using ECGGAN and real samples.

[0021] Figure 5 This is a comparison image of ventricular ectopic beats between samples generated using ECGGAN and real samples;

[0022] Figure 6 This is a comparison image of a fused sample generated using ECGGAN and a real sample;

[0023] Figure 7It is an unclassifiable comparison image of samples generated using ECGGAN and real samples;

[0024] Figure 8 This is a diagram of a pre-trained convolutional neural network model;

[0025] Figure 9 This is a diagram of the continuous testing time-domain adaptation process. Detailed Implementation

[0026] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.

[0027] This invention discloses a method for classifying heart rate arrhythmias based on continuous testing time adaptation, such as... Figure 1 As shown, Figure 1 This paper demonstrates the working steps of an ECG data classification method based on continuous testing time-domain adaptation. First, ECG data preprocessing is performed, and the heartbeat location is determined by detecting the position of the Q-peak. Then, a generative adversarial network (GAN) is used to generate subclass samples to expand the dataset. Next, a convolutional neural network is pre-trained on the MIT-BIH Arrhythmia Database (MITdb) dataset, and the model parameters are saved. Finally, during testing, the pre-trained convolutional neural network model is loaded as the source model and tested on the MIT-BIH ST Change Database (MITst) arrhythmia dataset. During testing, the continuous testing time-domain adaptation method proposed in this invention is used to continuously adapt the source model to the target data, ultimately completing the ECG classification task. The specific execution process is as follows: Step 1: Data Preprocessing

[0028] 1.1 Heartbeats were acquired using Q-peak positions annotated within the dataset itself. This experiment used the MITdb and MITst arrhythmia databases as datasets. The MITdb dataset consists of ECG recordings from 47 different subjects at a sampling rate of 360Hz, with each beat annotated by at least two cardiologists. MITdb contains 48 dual-lead ECG recordings; except for a few, the first lead of each recording is lead II. Each recording is 30 minutes long, with a sampling rate of 360Hz and 650,000 sampling points. The MITst dataset includes 28 ECG recordings of varying lengths, most of which were recorded during exercise stress testing. According to the standards proposed by the Association for the Advancement of Medical Devices (AAM), all heartbeats can be classified into five categories: normal heartbeats (N), supraventricular ectopic beats (S), ventricular ectopic beats (V), fusion beats (F), and unclassifiable beats (Q). Since Q is an unclassifiable beat and the MITst dataset does not have fused beats, only the three classes N, S, and V are ultimately selected, with labels coded as 0, 1, and 2, respectively. Other data not belonging to these three classes are deleted. The index of the Q peak's location is obtained from the dataset's annotation file. Then, based on the Q peak's location, 150 points are included to the left and 100 points to the right, and this segment of data is extracted as the heartbeat.

[0029] 1.2 Using ECGGAN to Generate Small Class Samples to Expand the Dataset. In this invention, a GAN (ECGGAN) suitable for the ECG dataset was designed. ECGGAN is an improvement on the traditional WGAN, adding gradient penalty to WGAN and improving some network modules in WGAN (in the generator G, the DeConv module in WGAN is replaced with the ConvTranspose module, and a Dropout layer is added before the fully connected layer; in the discriminator D, the BatchNorm module in WGAN is replaced with the InstanceNorm layer), making it more suitable for generating time-series data like the ECG dataset. It also solves the problems of GAN being difficult to train and WGAN being prone to gradient explosion and vanishing gradients. The network model diagram of ECGGAN is shown below. Figure 2As shown, the ECGGAN generator consists of a convolutional block composed of five deconvolutional layers, a batch normalization layer, ReLU activation layers, a deconvolutional layer, a dropout layer, a fully connected layer, and a tanh activation function layer. The discriminator consists of a one-dimensional convolutional layer, a LeakReLU activation function layer, a convolutional block composed of four one-dimensional convolutional layers, an instance normalization layer, ReLU activation layers, a one-dimensional convolutional layer, a dropout layer, a fully connected layer, and a sigmoid activation function layer. ECGGAN consists of a generator G and a discriminator D. G generates samples that are close to reality, and D determines whether a sample comes from a real sample or a generated sample. During training, G and D compete against each other and learn from each other. After 3000 training rounds, when a sample generated by G is input into D, and D cannot determine whether the sample is a real sample or a generated sample, it means that the sample generated by G is very close to a real sample. Training ends, and the model parameters of G are saved for batch generation of small class samples to expand the dataset. The trend of the loss function values ​​of the generator and discriminator during training is shown in the figure. Figure 3 As shown, Figure 4 , Figure 5 , Figure 6 and Figure 7 The images show a comparison between real and generated samples of the SVFQ category.

[0030] 1.3 Converting one-dimensional ECG data into two-dimensional ECG images. Since the final input model is a two-dimensional image rather than one-dimensional ECG data, the one-dimensional ECG data is plotted into a two-dimensional ECG image using the Matplotlib plotting tool.

[0031] 1.4 Splitting the Dataset. The MITdb dataset was relabeled and rearranged, and then divided into a training set and a validation set. The first 70% of the data was used as the training set, and the last 30% was used as the validation set.

[0032] Step 2: Building the Convolutional Neural Network for the Training Phase

[0033] 2.1 Building the Convolutional Neural Network for the Training Phase. The network model used in the training phase consists of 6 convolutional layers, 6 batch normalization layers, 3 max pooling layers, 1 Flatten layer, and 2 linear layers. The model structure diagram is shown below. Figure 5 As shown.

[0034] Step 3: Pre-train the convolutional neural network model

[0035] 3.1 Initialize model parameters. Set the model learning rate to 10. -3 The batch size was 128 samples, and the number of iterations was 30. SGD was used to optimize the learning rate, with a momentum coefficient of 0.7 and a weight decay of 10. -4 The loss function uses cross-entropy.

[0036] 3.2 Input the preprocessed MITdb dataset into the model for pre-training. Input the preprocessed MITdb dataset into the model, first initialize the model parameters, and then start training the model. The value of the loss function gradually decreases until convergence. At this point, the initialized parameters will change. Save the changed parameters and use the pre-trained convolutional neural network model as the source model.

[0037] 3.3 Save the model. Save the trained model and use the parameters of the trained convolutional neural network model as the initialization parameters for the ECG classification task.

[0038] Step 4: Continuously test time-domain adaptation

[0039] 4.1 Weighted Average Pseudo-Labels. The continuous testing time-domain adaptation method consists of three parts: weighted average pseudo-labels, augmented average pseudo-labels, and random recovery of source model weights. The first two parts are to mitigate the accumulation of errors caused by the use of pseudo-labels. Using weighted average pseudo-labels and augmented average pseudo-labels can improve the quality of pseudo-labels, thereby improving model performance. Random recovery of source model weights is to prevent the model from forgetting previously learned knowledge during continuous adaptation to new testing environments, thus mitigating catastrophic forgetting. Inspired by previous methods, weighted average pseudo-labels are more effective than directly using pseudo-labels. Therefore, we use student model weights to update the teacher model weights using an exponential moving average to generate pseudo-labels. In the continuous testing time-domain adaptation method, there are three models: a pre-trained source model f... θ Teacher Model and student model At time step t = 0, the teacher and student models are initialized with the source model parameters. At time step t, pseudo-labels are generated using the teacher model. Then, the cross-entropy loss predicted by the teacher and student models is calculated, and the loss is calculated using Equation 1. The parameters θ of the student model are then updated via backpropagation. s After updating the student model weights (θ) s →θ s+1 The weights (θ) of the teacher model are updated using the exponential moving average of the student model parameters. t →θ t+1 The exponential moving average rule is as shown in Equation 2.

[0040]

[0041] Among them, y t The teacher model predicts the probability of each class, y sThe student model predicts the probability of each class, and the cross-entropy loss between the teacher model and the student model ensures the consistency of the predictions between the two models.

[0042] θ′ t+1 =αθ′ t +(1-α)θ t+1 (2)

[0043] Where, θ′ t+1 θ represents the parameters of the teacher model at time step t+1. t+1 The parameters of the student model at time step t+1 are represented by α, which is the hyperparameter smoothing factor of the exponential moving average. In this invention, α = 0.7. The output probability y of the teacher model is also represented by α. t The class with the highest probability in the model is the one with respect to the input x. t The predicted class.

[0044] Weighted average pseudo-labels offer two main advantages. First, by using more accurate weighted average predictions as pseudo-label targets, the model suffers less error accumulation during continuous adaptation. Second, averaged teacher predictions encode information from past time steps, thus reducing the likelihood of catastrophic forgetting during long-term continuous adaptation and improving the model's generalization ability to new, unknown domains.

[0045] 4.2 Enhancing the Average Pseudo-Label. Data augmentation during training has been widely used to improve model performance, and different data augmentation strategies are usually manually designed for different datasets. While test-time data augmentation has also been shown to improve robustness, augmentation strategies are usually determined and fixed for specific datasets without considering distribution changes during testing. In constantly changing environments, the test distribution can change dramatically, which may render the augmentation strategy ineffective. In this invention, we take into account the test-time domain shift and approximate the differences between domains by predicting confidence, applying augmentation only when the domain differences are large to reduce error accumulation. First, the source model f is calculated. θ For the current input x t The entropy value is used as the model confidence score. The confidence score is calculated as shown in Equation 3. When the model confidence score is... θ When the value is greater than the confidence threshold (set to 0.9 in this invention), the prediction y from the teacher model is used directly. t As pseudo-labels, no data augmentation is used. When the confidence level is less than a confidence threshold, additional N random augmentations are applied to further improve the quality of the pseudo-labels. By predicting the confidence level, an attempt is made to approximate the domain difference between the source and the current domain, assuming that a lower confidence level indicates a larger domain difference, and a relatively higher confidence level indicates a smaller domain difference.

[0046] confidence(fθ )=-∑ c f θ (x t logf θ (x t (3)

[0047]

[0048]

[0049]

[0050] in, It is the prediction of the teacher model after data augmentation, y t The teacher model makes predictions without data augmentation. After using augmented average pseudo-labels, the cross-entropy loss is updated from equation (1) to equation (6).

[0051] 4.3 Random Recovery of Source Model Weights. While more accurate pseudo-labels can mitigate error accumulation, continuous testing and time-domain adaptation inevitably lead to error accumulation and catastrophic forgetting. Catastrophic forgetting is more pronounced when we encounter strong domain shifts in a data sequence, as strong distribution shifts lead to miscalibration and even incorrect predictions. In such cases, self-training may only reinforce incorrect predictions. Therefore, the model may become unable to recover due to continuous adaptation, and even if the new data does not have a severe shift, the model will still make incorrect predictions. To further address the catastrophic forgetting problem, we propose a random recovery method that explicitly recovers knowledge from the source pre-trained model. The weight recovery rule is shown in Equation (7).

[0052] W t+1 = (1-T)*W0+T*W t+1 (7)

[0053] T~Bernoulli(p) (8)

[0054] Where * denotes element-wise multiplication between two matrices, p is the probability of random recovery (set to 0.99 in this invention), T is the mask tensor following a Bernoulli distribution, W represents the convolutional kernel weights of the model's convolutional layers, W0 is the convolutional kernel weights of the source model's convolutional layers, and W... t+1 These are the convolutional kernel weights of the convolutional layer at time step t+1. Random recovery can also be seen as a special form of dropout. By randomly restoring a small number of tensor elements from the trainable weights to the initial weights, the network avoids deviating too far from the initial source model, thus avoiding catastrophic forgetting.

[0055] 4.4 ECG Data Classification Task. After continuous testing and time-domain adaptation, the source model is continuously adapted to the target data. During the adaptation process, the weight parameters of the source model are updated, and the adjusted model is used for the final ECG classification task.

[0056] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0057] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0058] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0059] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0060] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0061] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A heart rate dysregulation classification method based on continuous testing time adaptation, characterized in that, Includes the following steps: S1. Obtain ECG data to generate a dataset. Collect heartbeats by using the Q peak positions labeled in the dataset itself. Use ECGGAN to generate small class samples to expand the dataset. Convert the one-dimensional ECG data into two-dimensional ECG images and divide the dataset. S2. Build the convolutional neural network model for the training phase; S3. Initialize the parameters of the convolutional neural network model and input the preprocessed MITdb dataset into the model for pre-training. S4. Update the weights of the convolutional neural network model trained in step S3 using the continuous testing time domain adaptation method, which includes weight averaging pseudo-labels, augmented averaging pseudo-labels, and random recovery of source model weights. The updated convolutional neural network model was used for ECG classification; In step S4 above, the specific value of the weighted average pseudo-label is as follows: the weights of the student model are updated using an exponential moving average to generate pseudo-labels; let the three models be the pre-trained source models f. θ Teacher Model and student model At time step t = 0, the teacher and student models are initialized with the source model parameters. At time step t, pseudo-labels are generated using the teacher model, and then the cross-entropy loss predicted by the teacher and student models is calculated. The formula is expressed as follows: In the formula, y t The teacher model predicts the probability of each class, y s It is the student model that predicts the probability of each class; Backpropagation updates the parameters θ of the student model s After updating the student model weights (θ) s →θ s+1 The weights (θ) of the teacher model are updated using the exponential moving average of the student model parameters. t →θ t+1 The exponential moving average rule formula is expressed as follows: θ′ t+1 =θ′ t +(1-α)θ t+1 In the formula, θ' t+1 θ represents the parameters of the teacher model at time step t+1. t+1 Let represent the parameters of the student model at time step t+1, α be the hyperparameter smoothing factor of the exponential moving average, and take a value of α = 0.

7. The output probability y of the teacher model is... t The class with the highest probability in the model is the one with respect to the input x. t Predicted classes; Enhanced average pseudo-labels specifically refer to: finding the source model f θ For the current input x t The entropy value is used as the model confidence score, and the confidence score calculation formula is expressed as follows: When the model confidence (f_θ) is greater than the confidence threshold of 0.9, the teacher model's prediction y_t is directly used as the pseudo-label without any data augmentation. When the confidence is less than the confidence threshold, N additional random augmentations are applied to further improve the pseudo-label quality. By predicting the confidence, we attempt to approximate the domain difference between the source and the current domain. We assume that a lower confidence indicates a larger domain difference, while a relatively higher confidence indicates a smaller domain difference. The formula is expressed as follows: In the formula, It is the prediction of the teacher model after data augmentation, y t The teacher model's predictions without data augmentation, and the updated cross-entropy loss formula after using augmented average pseudo-labels, are expressed as follows: The formula for the weights of the random recovery source model is expressed as follows: W t+1 =(1-T)*W0+T*W t+1 T~Bernoulli(p) In the formula, * indicates that the elements between the two matrices are multiplied one by one, p is the probability of random recovery, p is set to 0.99, T is the mask tensor that follows the Bernoulli distribution, W represents the convolutional kernel weights of the model's convolutional layer, W_0 is the convolutional kernel weights of the source model's convolutional layer, and W_(t+1) is the convolutional kernel weights of the convolutional layer at time step t+1.

2. The heart rate dysregulation classification method based on continuous testing time adaptation according to claim 1, characterized in that, In step S1, the arrhythmia data is obtained to generate a dataset. The heartbeats are collected by the Q-peak position labeled in the dataset itself. Specifically, the MITdb and MITst arrhythmia databases are used as datasets. The MITdb dataset consists of ECG records from 47 different subjects at a sampling rate of 360Hz. MITdb contains 48 dual-lead ECG records. Except for a few records, the first lead of each record is lead II. Each record is 30 minutes long, with a sampling rate of 360Hz and 650,000 sampling points per record. The MITst dataset includes 28 ECG records of different lengths. The heartbeats are divided into normal heartbeats, supraventricular ectopic beats, and ventricular ectopic beats, with corresponding labels coded as 0, 1, and 2. Data of fused beats and unclassifiable beats are deleted. Based on the index of the Q-peak position in the dataset, and using the Q-peak position as a reference, 150 points are included to the left and 100 points to the right. This segment of data is then extracted as the heartbeat.

3. The heart rate dysregulation classification method based on continuous testing time adaptation according to claim 1, characterized in that, Step S1 uses ECGGAN to generate subclass samples to expand the dataset, converting one-dimensional ECG data into two-dimensional ECG images. The specific values ​​for dataset partitioning are as follows: Design a GAN suitable for the ECG dataset, including a generator G and a discriminator D. During training, G and D compete against each other and learn from each other. After 3000 training rounds, when a sample generated by G is input into D, and D cannot determine whether the sample is a real sample or a generated sample, it indicates that the sample generated by G is very close to the real sample. Training ends, and the model parameters of G are saved for batch generation of subclass samples to expand the dataset. The one-dimensional ECG data is plotted into two-dimensional ECG images using Matplotlib. The MITdb dataset is relabeled and shuffled. The MITdb dataset is divided into a training set and a validation set, with the first 70% of the data used as the training set and the last 30% used as the validation set.

4. The heart rate arrhythmia classification method based on continuous testing time adaptation according to claim 1, characterized in that, The convolutional neural network in step S2 includes six convolutional layers, six batch normalization layers, three max pooling layers, one Flatten layer, and two linear layers.

5. The heart rate dysregulation classification method based on continuous testing time adaptation according to claim 1, characterized in that, Step S3 includes the following steps: S31. Set the model learning rate to 10^(-3), the batch size to 128, the number of iterations to 30, use SGD to optimize the learning rate, the momentum coefficient to 0.7, the weight decay to 10^(-4), and the loss function to cross-entropy. S32. Input the preprocessed MITdb dataset into the model. First, initialize the model parameters, and then start training the model. The value of the loss function will become smaller and smaller until convergence. At this time, the initialized parameters will change. Save the changed parameters and use the pre-trained convolutional neural network model as the source model. S33. Save the trained model. When performing the ECG classification task, directly use the parameters of the trained convolutional neural network model as the initialization parameters for the ECG classification task.

Citation Information

Patent Citations

  • ECG data classification method based on continuous deep learning

    CN113171102A

  • KR20190141326A