Accurate rhythm generation method based on generative adversarial network

By constructing an optimized GAN architecture that integrates CNN-LSTM and a multi-level screening mechanism, the problems of scarce and unevenly distributed ECG data are solved, generating high-quality ECG signals, improving the diagnostic performance of AI models for rare arrhythmias, and promoting the clinical application of ECG intelligent analysis technology.

CN121456467APending Publication Date: 2026-02-03ZHENGZHOU UNIVERSITY OF AERONAUTICS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511570056.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

The scarcity and uneven distribution of existing ECG data have led to a decline in the diagnostic performance of AI models for rare arrhythmias. Traditional GAN ​​generation models are unstable and have difficulty generating high-quality, multi-type ECG signals.

Method used

After wavelet transform, downsampling, and standardization, an optimized GAN architecture integrating CNN-LSTM is constructed. Combined with DCMA start-stop strategy and multi-level evaluation and screening, high-quality, multi-type ECG signals are generated.

Benefits of technology

It improves the diagnostic performance of AI models for rare arrhythmias, provides high-quality, balanced training data, alleviates the problem of long-tailed data distribution, and promotes the clinical translation of ECG intelligent analysis technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456467A_ABST
    Figure CN121456467A_ABST
Patent Text Reader

Abstract

The invention discloses an accurate rhythm generation method based on a generative adversarial network. The method comprises the following steps: data preprocessing; carrying out data downsampling processing; performing standardized optimization; an optimized GAN architecture model with CNN-LSTM fusion is constructed; setting a DCMA start-stop strategy; making a multi-stage evaluation screening strategy, and making a screening strategy to carry out further examination and screening on the generated data; constructing a simulation database; verifying the validity of the enhanced data set; and experiment comparison. Through the multi-stage screening mechanism, the powerful learning ability of the GAN model in time series data generation can be fully played, and the physical authenticity and clinical effectiveness of generated ECG data can be strictly ensured, so that high-quality and balanced-distribution training data is provided for the AI diagnosis model, the problem of data long-tail distribution is effectively relieved, and the method has the advantages of being high in practicability and high in practicability. The diagnosis performance of the model on rare arrhythmia is improved, and clinical transformation of an ECG intelligent analysis technology is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cardiac monitoring technology, and in particular to a method for generating precise rhythms based on generative adversarial networks. Background Technology

[0002] With the global incidence of cardiovascular disease continuing to rise, cardiac health monitoring and early disease diagnosis have become one of the core issues in the field of public health. Electrocardiography (ECG), as a non-invasive detection method that captures the electrical activity of the heart, has become the "gold standard" for clinical diagnosis of diseases such as arrhythmia, myocardial infarction, and heart failure due to its convenience, cost-effectiveness, and high timeliness. With the deep penetration of artificial intelligence (AI) technology into the medical field, deep learning-based ECG intelligent analysis models (such as arrhythmia classification models based on convolutional neural networks (CNN), recurrent neural networks (RNN), and Transformer architectures, real-time early warning systems for critical values, and automatic myocardial ischemia identification algorithms) are gradually becoming core tools for clinical auxiliary diagnosis. The performance of these models is highly dependent on "data-driven" approaches—only through training and optimization with large-scale, high-quality, multi-scenario labeled ECG data can they achieve accurate learning of complex heart rhythm patterns, thereby achieving diagnostic accuracy close to or even surpassing that of professional doctors in actual clinical scenarios. However, in actual research and clinical translation, the acquisition and application of ECG data face multiple bottlenecks, among which the problem of "data scarcity and uneven distribution" is the most prominent. On the one hand, ECG data annotation requires the collaboration of professional medical teams. On the other hand, there is an extreme scarcity of rare arrhythmia samples—taking ventricular flutter and ventricular fibrillation, which have extremely high clinical mortality rates, as examples. Their onset is sudden and transient, and they are only occasionally recorded in emergency situations in clinical practice. As a result, the proportion of such rhythm data in public databases is generally less than 5%, and the sample size of some extremely rare types (such as torsades de pointes) is even less than 100 cases. This phenomenon of "redundant common rhythm samples and scarce rare rhythm samples" directly leads to AI models overfitting to common rhythms and underfitting to rare rhythms during training. Ultimately, this results in a significant decrease in the sensitivity and specificity of diagnosis for rare diseases, making it difficult to meet the clinical need for "full coverage and no omissions" in diagnosis. Besides the problem of data scarcity, existing ECG rhythm generation technologies also have significant shortcomings, making it difficult to effectively compensate for the data gap. Currently, mainstream ECG generation methods are centered around Generative Adversarial Networks (GANs), which simulate the temporal characteristics and rhythmic patterns of ECG signals through adversarial training between the generator and discriminator. However, traditional GAN ​​models (such as DCGAN and WGAN-GP) have flaws in ECG generation. GANs exhibit poor generation stability, and due to the strong temporal dependence of ECG signals, traditional GANs are prone to "pattern collapse." A method and system for optimizing ECG signal denoising based on conditional generative adversarial networks (GANs) is disclosed in Chinese patent document CN116250844B. This method and system includes: acquiring an ECG signal; segmenting the ECG signal according to a sample length T; performing maximum and minimum value normalization on the segmented data segments; inputting the processed data segments into a trained ECG signal denoising model to obtain a denoised ECG signal; wherein the ECG signal denoising model is constructed based on a deep neural network and a conditional generative adversarial network; by calculating the ratio of the model's denoising performance to its computational complexity, and under the premise of ensuring the model's denoising performance, determining the optimal values ​​of modeling parameters such as sample length, the number of neural network layers in the encoder and decoder based on the fitting function curve of the corresponding modeling parameters and the ratio, so as to achieve optimal denoising performance and computational cost of the denoising model. This invention proposes a noise reduction performance to computational complexity ratio index, which can obtain a noise reduction system with better cost performance. However, the ECG signal noise reduction optimization method based on conditional generative adversarial networks and the traditional noise reduction methods of the system have high computational complexity and large models, making them difficult to deploy on resource-constrained devices.

[0003] A method for reconstructing a 12-lead electrocardiogram (ECG) based on an attention-based generative adversarial network (GAN) is disclosed in Chinese patent document CN119006882A. This method preprocesses 12-lead ECGs of various diseases by performing filtering, time segmentation, and data augmentation to obtain ECG segments. The I-lead signal is extracted, copied, and zero-filled, and input into the network. Using the corresponding 12-lead ECG as the ground truth label, the network is trained to learn the correspondence between the two, achieving a game balance between the generator and the discriminator, thus realizing the reconstruction from a single-lead ECG to a 12-lead ECG. This invention incorporates an attention mechanism into the GAN model, applying it to the generator. This effectively focuses on salient regions, highlighting the salient features of specific local areas, improving the model's sensitivity and prediction accuracy. However, this attention-based GAN-based 12-lead ECG reconstruction method has limited information in a single lead ECG and cannot provide comprehensive diagnostic information across multiple leads.

[0004] A lightweight electrocardiogram (ECG) diagnostic method and device based on generative adversarial networks (GANs) and distillation learning is disclosed in Chinese patent document CN119577551A. This method and device converts a 12-lead ECG signal to obtain multiple views. A teacher network learns the features of each view in the multiple views and fuses them to obtain realistic features. A student network acts as a generator, extracting features from single-lead ECG signals to obtain the most realistic generated features possible. A discriminator classifies the input features, determining whether the input features originate from the teacher network or the student network based on the classification results. This application effectively improves the knowledge transfer capability of the teacher model by combining multi-view feature extraction with generative adversarial learning, allowing the student network to maintain performance similar to the teacher network while achieving a lightweight model. However, this lightweight ECG diagnostic method and device based on GANs and distillation learning suffers from high computational overhead of the deep learning model, low single-lead diagnostic accuracy, and underutilization of multi-view features.

[0005] Against this backdrop, the research on "GAN-based precise rhythm generation algorithm based on multi-level evaluation and screening strategy" has important theoretical and clinical value. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of traditional GAN-generated data lacking clinical effectiveness, and to provide a precise rhythm generation method based on generative adversarial networks, thereby improving the model's diagnostic performance for rare arrhythmias.

[0007] The objective of this invention is achieved through the following technical solution: A precise rhythm generation method based on generative adversarial networks includes the following steps: Step 1: Data preprocessing, using wavelet transform and baseline drift techniques to reduce noise in the raw ECG data; Step 2: Data downsampling. For the dataset with a sampling rate of 360Hz, the rhythm data of different time periods are downsampled. The interval sampling method is used to reduce the sampling points of the 2s sub-signal from 720 to 360, extract the key parts of the data, and improve the learning speed of the model. Step 3: Standardization optimization. First, calculate the global minimum and maximum values ​​of the downsampled data and map the data to the range of [-1,1] to avoid interference from differences in signal amplitude among different patients on model training. After normalization, convert the data into tensors that can be recognized by GPU / CPU, and output the mean and standard deviation to ensure stable data distribution. At the same time, preserve the physiological amplitude characteristics of ECG signals, including the amplitude ratio of QRS waves and P waves, to lay the foundation for the physical authenticity of the generated data. Step 4: Construct an optimized GAN architecture model that integrates CNN and LSTM; Step 5: DCMA start-stop strategy setting. In the early stage of model training, analyze the morphological characteristics and accuracy of the generated data, and set a threshold to determine whether to start saving the generated data. In the later stage of model training, calculate the average model accuracy in groups of 10 rounds. When the accuracy continues to decline, stop the model's data generation, thereby ensuring that the model generates data in a relatively effective manner. Step Six: Develop a multi-level evaluation and screening strategy to further review and screen the generated data; Step 7: Construct the simulation database; Step 8: Enhance dataset validity verification. By fusing the generated valid data with the original rhythm data through dataset fusion, the data is generated again. The validity of the generated data is verified by the accuracy and model training effect. Step Nine: Experimental Comparison. Set up comparative experiments to evaluate and verify the performance of the algorithm by comparing it with various existing models such as traditional GAN ​​and TimeGAN. This will provide high-quality, balanced training data for AI diagnostic models, effectively alleviate the problem of "long-tailed data distribution", improve the model's diagnostic performance for rare arrhythmias, and promote the clinical translation of ECG intelligent analysis technology.

[0008] Optionally, in the data preprocessing step one, the raw ECG data from MIT-BIH is read, and the raw data is truncated into sub-signals of 720 sampling points for 2 seconds, 1800 sampling points for 5 seconds, 2880 sampling points for 8 seconds, and 3600 sampling points for 10 seconds using the sliding window method. Based on the annotation information of the MIT-BIH database, 15 common and rare rhythm types, including sinus rhythm, atrial fibrillation, premature atrial contractions, premature ventricular contractions, ventricular flutter, and ventricular fibrillation, are extracted to construct an initial rhythm dataset. Rare rhythm samples are stored separately, and rare rhythms are processed in a targeted manner to avoid data imbalance problems, thus constructing a high-quality, multi-type rhythm dataset to provide reliable input for subsequent model generation.

[0009] Optionally, the optimized GAN architecture model in step four, which constructs the generator and discriminator, integrates the static feature extraction capabilities of CNN and the temporal modeling capabilities of LSTM, as detailed below: The input is Gaussian noise with dimension 32. The noise is mapped to a feature vector with dimension matching the time length of the ECG signal through linear transformation, which corresponds to the number of ECG signal sampling points in 2 seconds after downsampling. Set up a CNN block consisting of 4 layers of residual convolutional units, and design differentiated convolutional kernels for ECG waveforms of different amplitudes: Part 1: A 7×7 large convolutional kernel is used to capture high-amplitude QRS group features, and a padding width of 3 is used to ensure that the input and output timing lengths are consistent. Part 2: Using a 5×5 medium-sized convolution kernel with an edge padding width of 2, the number of output feature channels is increased from 32 to 64, enhancing the ability to extract medium-amplitude T-wave features; Part 3: Using a 3×3 small-size convolution kernel with an edge padding width of 1, while maintaining the number of output feature channels at 64, we can accurately capture low-amplitude P-wave features. Part 4: A 1×1 convolution kernel is used to compress the number of feature channels back to 32, reducing the number of parameters and computational cost; at the same time, instance normalization and a LeakyReLU activation function with a negative slope of 0.2 are introduced to avoid model overfitting; The feature map output by the CNN is transposed to match the input format of the LSTM. A 3-layer bidirectional LSTM structure is adopted, with the hidden layer dimension set to 32, and a 20% dropout probability is introduced to prevent overfitting. The bidirectional structure simultaneously captures the forward and backward temporal dependencies of the ECG signal. The forward temporal dependency is the order of P wave → QRS wave → T wave, and the backward temporal dependency is the reverse order of T wave → QRS wave → P wave, which improves the ability to model the dynamic features of heart rate variability. Output projection module: Feature mapping is achieved through three-layer linear transformation: first, the 64-dimensional features output by LSTM are reduced to 32-dimensional, then increased to 64-dimensional, and finally reduced to 1-dimensional. Through the feature transformation process of "dimensionality reduction-dimensionality increase-dimensionality reduction", the feature expression capability is enhanced, the spatiotemporal features of ECG signals (such as QRS wave, P wave, T wave) are accurately captured, the physiological authenticity and temporal consistency of the generated data are improved, a high-fidelity ECG rhythm generation model is constructed, and the shortcomings of traditional GANs in the generation of time-series signals are overcome.

[0010] Optionally, the DCMA start-stop strategy in step five implements phased generation start-stop logic to ensure that the model only saves generated data in a valid state, preventing model overfitting or mode collapse; it only saves high-quality generated data, reducing storage and computation waste, optimizing training efficiency, and ensuring that generated data is only saved in a stable model state.

[0011] Optionally, the DCMA start-stop strategy is as follows: In the initial training phase, the first 100 rounds are set as a model warm-up stage. During this stage, the generator and discriminator have not yet reached an adversarial balance, resulting in low-quality generated data, which is not saved at this time. Simultaneously, the startup conditions are dynamically adjusted through visualization. In the later stages of training, the model is prone to "mode collapse." An evaluation cycle is defined as 10 epochs. By recording the average accuracy of each epoch, the average accuracy of each cycle is calculated. If the average accuracy of multiple consecutive cycles decreases by ≥5% compared to the previous cycle, or if the average accuracy of a single epoch is ≤0.5, a stop command is triggered. The model stops saving generated data, retaining only the data generated in the last 3 epochs before the stop, dynamically adapting to the training state and avoiding invalid iterations. This ensures high accuracy and stability of the generated data, achieving intelligent control of the training process and improving the reliability of the generated data.

[0012] Optionally, the multi-level evaluation and screening strategy in step six includes: First-level screening: Model convergence evaluation (MCE); based on the graph of the GAN loss function, determine whether the model is in a convergent state, and thus determine whether the generated data is within the valid data range; Secondary screening: Data morphology feature analysis; Based on the visualization results during the data generation process, observe the difference between the generated data and the real data to determine whether the data meets the retention criteria; Three-tier screening: Expert review; The reliability of the data is verified by multiple experts to evaluate whether the data meets clinical requirements and can be used for data augmentation of real data. The data usability is ensured by combining technical indicators and clinical experience; Invalid or distorted data is avoided, and a strict data quality control system is established to guarantee the clinical value of the generated data.

[0013] Optionally, in step seven, the simulation database construction integrates the simulation data filtered through the three-level evaluation to build a precise simulation rhythm database, providing high-quality, multi-type rhythm data resources; supporting downstream model training and medical research. This forms a reusable, highly reliable rhythm data asset.

[0014] Optionally, the validity verification of the augmented dataset in step eight is based on the fusion of the simulation dataset constructed in step seven and the real MIT-BIH dataset. Before fusion, the data format is verified, and then the fused augmented dataset is used to train the arrhythmia classification model. By comparing the model performance of "training with only the real dataset" and "training with the augmented dataset", and focusing on the sensitivity, specificity and overall F1 score of rare rhythm detection, the validity of the generated data is verified and whether it is suitable for subsequent training, ensuring that the generated data is not only morphologically realistic, but also has practical diagnostic value.

[0015] Optionally, the experimental comparison in step nine is based on the augmented dataset in step eight, which is used in various models such as traditional GAN ​​and TimeGAN to verify the effectiveness multiple times. The horizontal comparison highlights the superiority of this method; it provides a reproducible experimental benchmark to prove that this method is significantly better than the existing technology in terms of generation quality and stability.

[0016] Positive and beneficial effects: 1. This precise rhythm generation method based on generative adversarial networks, through a multi-level screening mechanism, can fully leverage the powerful learning ability of GAN models in time-series data generation (such as capturing the nonlinear and non-stationary characteristics of ECG signals), while strictly ensuring the "physical authenticity" and "clinical validity" of the generated ECG data. This provides high-quality, balanced training data for AI diagnostic models, effectively alleviating the problem of "long-tailed data distribution", improving the model's diagnostic performance for rare arrhythmias, and promoting the clinical translation of ECG intelligent analysis technology.

[0017] 2. This precise rhythm generation method based on generative adversarial networks uses a sliding window method to extract 2s / 5s / 8s / 10s sub-signals and extract 15 rhythm types (including sinus rhythm, atrial fibrillation, ventricular fibrillation, etc.). Rare rhythms are stored separately to ensure data diversity and representativeness. Rare rhythms are specifically processed to avoid data imbalance and to build a high-quality, multi-type rhythm dataset, providing reliable input for subsequent generative models. Attached Figure Description

[0018] Figure 1 This is an overall flowchart of the present invention; Figure 2 This is the algorithm design diagram and specific flow of the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0020] Example 1 like Figures 1 to 2 As shown, a precise rhythm generation method based on generative adversarial networks includes the following steps: Step 1: Data preprocessing, using wavelet transform, baseline drift and other techniques to reduce noise in the raw ECG data; Step 2: Data downsampling. For the dataset with a sampling rate of 360Hz, the rhythm data of different time periods are downsampled. The interval sampling method is used to reduce the sampling points of the 2s sub-signal from 720 to 360, extract the key parts of the data, and improve the learning speed of the model. Step 3: Standardization optimization. First, calculate the global minimum and maximum values ​​of the downsampled data and map the data to the range of [-1,1] to avoid interference from differences in signal amplitude among different patients on model training. After normalization, convert the data into tensors that can be recognized by GPU / CPU, and output the mean and standard deviation to ensure stable data distribution. At the same time, preserve the physiological amplitude characteristics of ECG signals, including the amplitude ratio of QRS waves and P waves, to lay the foundation for the physical authenticity of the generated data. Step 4: Construct an optimized GAN architecture model that integrates CNN and LSTM; Step 5: DCMA start-stop strategy setting. In the early stage of model training, analyze the morphological characteristics and accuracy of the generated data, and set a threshold to determine whether to start saving the generated data. In the later stage of model training, calculate the average model accuracy in groups of 10 rounds. When the accuracy continues to decline, stop the model's data generation, thereby ensuring that the model generates data in a relatively effective manner. Step Six: Develop a multi-level evaluation and screening strategy to further review and screen the generated data; Step 7: Construct the simulation database; Step 8: Enhance dataset validity verification. By fusing the generated valid data with the original rhythm data through dataset fusion, the data is generated again. The validity of the generated data is verified by the accuracy and model training effect. Step Nine: Experimental Comparison. A comparative experiment is set up to evaluate and verify the algorithm's performance against various existing models, including traditional GANs and TimeGANs. Addressing the instability of traditional GAN-generated models, a three-tiered evaluation system is constructed: "Model Convergence Evaluation - Data Morphological Feature Analysis - Expert Review and Screening." This multi-tiered screening mechanism fully leverages the powerful learning capabilities of GAN models in time-series data generation (such as capturing the nonlinear and non-stationary characteristics of ECG signals) while rigorously ensuring the "physical authenticity" and "clinical effectiveness" of the generated ECG data. This provides high-quality, balanced training data for AI diagnostic models, effectively alleviating the "long-tailed data distribution" problem, improving the model's diagnostic performance for rare arrhythmias, and promoting the clinical translation of ECG intelligent analysis technology.

[0021] In step one, the data preprocessing process involves reading the raw ECG data from MIT-BIH and using a sliding window method to extract sub-signals from the raw data into 720 sampling points for 2 seconds, 1800 sampling points for 5 seconds, 2880 sampling points for 8 seconds, and 3600 sampling points for 10 seconds. Based on the annotation information of the MIT-BIH database, 15 common and rare rhythm types, including sinus rhythm, atrial fibrillation, premature atrial contractions, premature ventricular contractions, ventricular flutter, and ventricular fibrillation, are extracted to construct an initial rhythm dataset. Rare rhythm samples are stored separately. By using the sliding window method to extract 2s / 5s / 8s / 10s sub-signals and extracting 15 rhythm types (including sinus rhythm, atrial fibrillation, and ventricular fibrillation), and storing rare rhythms separately, data diversity and representativeness are ensured. Rare rhythms are specifically processed to avoid data imbalance and to construct a high-quality, multi-type rhythm dataset, providing reliable input for subsequent model generation.

[0022] Example 2 Step four involves optimizing the GAN architecture model to construct the generator and discriminator, integrating the static feature extraction capabilities of CNNs with the temporal modeling capabilities of LSTMs, as detailed below: The input is Gaussian noise with dimension 32. The noise is mapped to a feature vector with dimension matching the time length of the ECG signal through linear transformation, which corresponds to the number of ECG signal sampling points in 2 seconds after downsampling. Set up a CNN block consisting of 4 layers of residual convolutional units, and design differentiated convolutional kernels for ECG waveforms of different amplitudes: Part 1: A 7×7 large convolutional kernel is used to capture high-amplitude QRS group features, and a padding width of 3 is used to ensure that the input and output timing lengths are consistent. Part 2: Using a 5×5 medium-sized convolution kernel with an edge padding width of 2, the number of output feature channels is increased from 32 to 64, enhancing the ability to extract medium-amplitude T-wave features; Part 3: Using a 3×3 small-size convolution kernel with an edge padding width of 1, while maintaining the number of output feature channels at 64, we can accurately capture low-amplitude P-wave features. Part 4: A 1×1 convolution kernel is used to compress the number of feature channels back to 32, reducing the number of parameters and computational cost; at the same time, instance normalization and a LeakyReLU activation function with a negative slope of 0.2 are introduced to avoid model overfitting; The feature map output by the CNN is transposed to match the input format of the LSTM. A three-layer bidirectional LSTM structure is adopted, with the hidden layer dimension set to 32, and a 20% dropout probability is introduced to prevent overfitting. The bidirectional structure simultaneously captures the forward and backward temporal dependencies of the ECG signal. The forward temporal dependency is the order of P wave → QRS wave → T wave, and the backward temporal dependency is the reverse order of T wave → QRS wave → P wave, which improves the ability to model the dynamic features of heart rate variability.

[0023] Output projection module: Feature mapping is achieved through three-layer linear transformation: first, the 64-dimensional features output by LSTM are reduced to 32-dimensional, then increased to 64-dimensional, and finally reduced to 1-dimensional. Through the feature transformation process of "dimensionality reduction-dimensionality increase-dimensionality reduction", the feature expression capability is enhanced, the spatiotemporal features of ECG signals (such as QRS wave, P wave, T wave) are accurately captured, the physiological authenticity and temporal consistency of the generated data are improved, a high-fidelity ECG rhythm generation model is constructed, and the shortcomings of traditional GANs in the generation of time-series signals are overcome.

[0024] The DCMA start-stop strategy in step five implements phased generation start-stop logic to ensure that the model only saves generated data in a valid state, preventing model overfitting or mode collapse; it only saves high-quality generated data, reducing storage and computation waste, optimizing training efficiency, and ensuring that generated data is only saved in a stable state of the model.

[0025] The specific DCMA start / stop strategy is as follows: In the initial training phase, the first 100 rounds are set as a model warm-up stage. During this stage, the generator and discriminator have not yet reached an adversarial balance, resulting in low-quality generated data, which is not saved at this time. Simultaneously, the startup conditions are dynamically adjusted through visualization. In the later stages of training, the model is prone to "mode collapse." An evaluation cycle is defined as 10 epochs. By recording the average accuracy of each epoch, the average accuracy of each cycle is calculated. If the average accuracy of multiple consecutive cycles decreases by ≥5% compared to the previous cycle, or if the average accuracy of a single epoch is ≤0.5, a stop command is triggered. The model stops saving generated data, retaining only the data generated in the last 3 epochs before the stop, dynamically adapting to the training state and avoiding invalid iterations. This ensures high accuracy and stability of the generated data, achieving intelligent control of the training process and improving the reliability of the generated data.

[0026] Example 3 The multi-level evaluation and screening strategy in step six includes: First-level screening: Model convergence evaluation (MCE); based on the graph of the GAN loss function, determine whether the model is in a convergent state, and thus determine whether the generated data is within the valid data range; Secondary screening: Data morphology feature analysis; Based on the visualization results during the data generation process, observe the difference between the generated data and the real data to determine whether the data meets the retention criteria; Three-tier screening: Expert review; The reliability of the data is verified by multiple experts to evaluate whether the data meets clinical requirements and can be used for data augmentation of real data. The data usability is ensured by combining technical indicators and clinical experience; Invalid or distorted data is avoided, and a rigorous data quality control system is established to guarantee the clinical value of the generated data.

[0027] Step seven involves building a simulation database by integrating the simulation data filtered through three levels of evaluation to construct a precise simulation rhythm database. This database provides high-quality, multi-type rhythm data resources, supporting downstream model training and medical research. The result is a reusable and highly reliable rhythm data asset.

[0028] The validation of the augmented dataset in step eight is based on the fusion of the simulation dataset constructed in step seven with the real MIT-BIH dataset. Before fusion, the data format is validated, and then the fused augmented dataset is used to train the arrhythmia classification model. By comparing the model performance of "training with only the real dataset" and "training with the augmented dataset", and focusing on the sensitivity, specificity and overall F1 score of rare rhythm detection, the validity of the generated data is verified and whether it is suitable for subsequent training, ensuring that the generated data is not only morphologically realistic, but also has practical diagnostic value.

[0029] The experimental comparison in step nine is based on the augmented dataset in step eight. It is used in various models such as traditional GAN ​​and TimeGAN to verify the effectiveness multiple times. The horizontal comparison highlights the superiority of this method. It provides a reproducible experimental benchmark to prove that this method is significantly better than the existing technology in terms of generation quality and stability.

[0030] The working principle of this invention is as follows: To address the instability of traditional GAN ​​generative models, a three-tiered evaluation system is constructed, consisting of "model convergence evaluation - data morphological feature analysis - expert review and screening." This multi-tiered screening mechanism fully leverages the powerful learning capabilities of GAN models in time-series data generation (such as capturing the nonlinear and non-stationary characteristics of ECG signals) while rigorously ensuring the "physical authenticity" and "clinical effectiveness" of the generated ECG data. This provides high-quality, balanced training data for AI diagnostic models, effectively alleviating the "long-tailed data distribution" problem, improving the model's diagnostic performance for rare arrhythmias, and promoting the clinical translation of ECG intelligent analysis technology.

[0031] The above is only used to illustrate the technical solution of the present invention and not to limit it. Any other modifications or equivalent substitutions made by those skilled in the art to the technical solution of the present invention, as long as they do not depart from the spirit and scope of the technical solution of the present invention, should be covered within the scope of the claims of the present invention.

Claims

1. A method for generating precise rhythms based on generative adversarial networks, characterized in that, Includes the following steps: Step 1: Data preprocessing, using wavelet transform and baseline drift techniques to reduce noise in the raw ECG data; Step 2: Data downsampling. For the dataset with a sampling rate of 360Hz, the rhythm data of different time periods are downsampled. The interval sampling method is used to reduce the sampling points of the 2s sub-signal from 720 to 360, extract the key parts of the data, and improve the learning speed of the model. Step 3: Standardization optimization. First, calculate the global minimum and maximum values ​​of the downsampled data and map the data to the range of [-1,1] to avoid interference from differences in signal amplitude among different patients on model training; After normalization, the data is converted into tensors that can be recognized by GPU / CPU, and the mean and standard deviation are output to ensure stable data distribution. At the same time, the physiological amplitude characteristics of ECG signals are preserved, including the amplitude ratio of QRS wave to P wave, laying the foundation for the physical authenticity of the generated data. Step 4: Construct an optimized GAN architecture model that integrates CNN and LSTM; Step 5: DCMA start-stop strategy setting. In the early stage of model training, analyze the morphological characteristics and accuracy of the generated data, and set a threshold to determine whether to start saving the generated data. In the later stage of model training, calculate the average model accuracy in groups of 10 rounds. When the accuracy continues to decline, stop the model's data generation, thereby ensuring that the model generates data in a relatively effective manner. Step Six: Develop a multi-level evaluation and screening strategy to further review and screen the generated data; Step 7: Construct the simulation database; Step 8: Enhance dataset validity verification. By fusing the generated valid data with the original rhythm data through dataset fusion, the data is generated again. The validity of the generated data is verified by the accuracy and model training effect. Step 9: Experimental comparison. Set up comparative experiments to evaluate and verify the performance of the algorithm by comparing it with various existing models such as traditional GAN ​​and TimeGAN.

2. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: In the data preprocessing process of step one, the raw ECG data from MIT-BIH is read, and the raw data is truncated into sub-signals of 720 sampling points for 2 seconds, 1800 sampling points for 5 seconds, 2880 sampling points for 8 seconds, and 3600 sampling points for 10 seconds using the sliding window method. Based on the annotation information of the MIT-BIH database, 15 common and rare rhythm types, including sinus rhythm, atrial fibrillation, atrial premature beats, ventricular premature beats, ventricular flutter, and ventricular fibrillation, are extracted to construct an initial rhythm dataset, in which rare rhythm samples are stored separately.

3. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The optimized GAN architecture model in step four, which constructs the generator and discriminator, integrates the static feature extraction capabilities of CNN and the temporal modeling capabilities of LSTM, is as follows: The input Gaussian noise with dimension 32 is transformed into a feature vector whose dimension matches the time length of the ECG signal through linear transformation, corresponding to the number of ECG signal sampling points after downsampling for 2 seconds. Set up a CNN block consisting of 4 layers of residual convolutional units, and design differentiated convolutional kernels for ECG waveforms of different amplitudes: Part 1: A 7×7 large convolutional kernel is used to capture high-amplitude QRS group features, and a padding width of 3 is used to ensure that the input and output timing lengths are consistent. Part 2: Using a 5×5 medium-sized convolution kernel with an edge padding width of 2, the number of output feature channels is increased from 32 to 64, enhancing the ability to extract medium-amplitude T-wave features; Part 3: Using a 3×3 small-size convolution kernel with an edge padding width of 1, while maintaining the number of output feature channels at 64, we can accurately capture low-amplitude P-wave features. Part 4: A 1×1 convolution kernel is used to compress the number of feature channels back to 32, reducing the number of parameters and computational cost; at the same time, instance normalization and a LeakyReLU activation function with a negative slope of 0.2 are introduced to avoid model overfitting; The feature map output by the CNN is transposed to match the input format of the LSTM. A 3-layer bidirectional LSTM structure is adopted, with the hidden layer dimension set to 32, and a 20% dropout probability is introduced to prevent overfitting. The bidirectional structure simultaneously captures the forward and backward temporal dependencies of the ECG signal. The forward temporal dependency is the order of P wave → QRS wave → T wave, and the backward temporal dependency is the reverse order of T wave → QRS wave → P wave, which improves the ability to model the dynamic features of heart rate variability. Output projection module: Feature mapping is achieved through three layers of linear transformation: first, the 64-dimensional features output by LSTM are reduced to 32-dimensional, then increased to 64-dimensional, and finally reduced to 1-dimensional. Through the feature transformation process of "dimensionality reduction-dimensionality increase-dimensionality reduction", the feature representation capability is enhanced.

4. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The DCMA start-stop strategy in step five ensures that the model saves generated data only when it is in a valid state by implementing phased generation start-stop logic.

5. The precise rhythm generation method based on generative adversarial networks according to claim 4, characterized in that: The DCMA start / stop strategy is as follows: In the initial training phase, the first 100 rounds are set as a model warm-up stage. During this stage, the generator and discriminator have not yet reached an adversarial balance, resulting in low-quality generated data, which is not saved at this time. Simultaneously, the startup conditions are dynamically adjusted through visualization. In the later stages of training, the model is prone to "mode collapse". Using 10 rounds as an evaluation cycle, the average accuracy of each round is recorded and the average accuracy of each cycle is calculated. If the average accuracy of multiple consecutive cycles decreases by ≥5% compared to the previous cycle, or the average accuracy of a single round is ≤0.5, a stop command is triggered, stopping the model from continuing to save the generated data, and only retaining the generated data of the last 3 cycles before the stop.

6. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The multi-level evaluation and screening strategy in step six includes: First-level screening: Model convergence evaluation (MCE); based on the graph of the GAN loss function, determine whether the model is in a convergent state, and thus determine whether the generated data is within the valid data range; Secondary screening: Data morphology feature analysis; Based on the visualization results during the data generation process, observe the difference between the generated data and the real data to determine whether the data meets the retention criteria; Three-tier screening: Expert review; The reliability of the data is verified by multiple experts to evaluate whether the data meets clinical requirements and can be used for data augmentation of real data.

7. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The construction of the simulation database in step seven integrates the simulation data after the three-level evaluation and screening to construct a precise simulation rhythm database.

8. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The validity verification of the augmented dataset in step eight is based on the fusion of the simulation dataset constructed in step seven and the real MIT-BIH dataset. Before fusion, the data format is verified, and then the fused augmented dataset is used to train the arrhythmia classification model. By comparing the model performance of "training with only the real dataset" and "training with the augmented dataset", and focusing on the sensitivity, specificity and overall F1 score of rare rhythm detection, the validity of the generated data and its suitability for subsequent training are verified.

9. The precise rhythm generation method based on generative adversarial networks according to claim 1, characterized in that: The experimental comparison in step nine is based on the augmented dataset in step eight, which is used in various models such as traditional GAN ​​and TimeGAN to verify its effectiveness multiple times.

Citation Information

Patent Citations

  • Optimization method and system for electrocardiogram signal denoising based on conditional generative adversarial network

    CN116250844B

  • 12-lead electrocardiogram reconstruction method based on attention mechanism generative adversarial network

    CN119006882A

  • Lightweight electrocardiogram diagnosis method and device based on generative adversarial network and distillation learning

    CN119577551A