Method and System for Determining Imbalanced Electrocardiogram Data Based on Adaptive Generative Adversarial Network
By introducing an adaptive generative adversarial network and feature encoding decoder into the generative adversarial network, the problem of data imbalance in the generation of heart rate data in the prior art is solved, and more efficient and accurate heart rate data generation and processing are achieved.
Patent Information
- Application Number
- CN202510213987.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-02-26
AI Technical Summary
When generating heart rate data in the prior art, it is difficult to generate a heart rate data with a small proportion, resulting in unbalanced data generation, which in turn affects the generation effect.
The method based on adaptive generation of adversarial network is adopted, and the original electrocardiogram data is preprocessed through the feature encoder and feature decoder. The generation network includes an autocorrelation residual module, a spatiotemporal convolution network and an adaptive coding module. The data generation and comparison are combined with the discriminant network to ensure the quality of the generated results.
It effectively reduces the computational burden of the model, improves the accuracy when processing abnormal heart rate data, significantly improves the efficiency of data processing, and reduces noise and outliers interference, making the generation results more reliable.
Smart Images

Figure CN119691691B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data processing, and specifically to a method and system for determining unbalanced electrocardiogram data based on an adaptive generative adversarial network. Background Art
[0002] With the development of disciplines such as computers, big data science, and artificial intelligence, machine deep learning combining deep neural network models and methods has been applied in many fields.
[0003] Generally, the conditional generative adversarial network (CGAN) can make the output of the generative adversarial network controllable, so as to more stably output results of a specified category. The prior art Delaney A M, Brophy E, Ward T E. Synthesisof realistic ECG using generative adversarial networks[J]. arxiv preprintarxiv:1909.09150, 2019 first realized the generation of heart rate data using the generative adversarial network architecture. Hazra D,Byun Y C. SynSigGAN: Generative adversarial networks for synthetic biomedicalsignal generation[J]. Biology, 2020, 9(12): 441 further designed a model called SynSigGAN, which can generate heart rate and epilepsy signals, and has a good generation effect, initially achieving the goal of heart rate generation.
[0004] However, it is found in the implementation process that the above prior art is limited to generating normal heart rate data and cannot generate abnormal heart rate with a relatively small proportion, resulting in unbalanced generated data, and then leading to poor generation effect and exacerbating the problem of unbalanced generated data. Summary of the Invention
[0005] Aiming at the problems existing in the prior art, the present invention provides a method and system for determining unbalanced electrocardiogram data based on an adaptive generative adversarial network.
[0006] The present invention is realized through the following technical solutions:
[0007] The present invention provides a method for determining unbalanced electrocardiogram data based on an adaptive generative adversarial network, which is characterized by including:
[0008] Preprocess the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data. The original electrocardiogram data includes descriptive data and constraint data. The descriptive data includes heart rate voltage data and heart rate data collected at specific time points. The constraint data includes the data types of each segment of heart rate data and patient information.
[0009] Process the electrocardiogram data through a generation network and input the processed result into an information integration module to obtain generated electrocardiogram data. The generated electrocardiogram data is marked with a fusion feature matrix. The fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than a preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive encoding module. The input of the adaptive encoding module includes the electrocardiogram data, random noise, and dynamic condition labels.
[0010] Compare the generated electrocardiogram data with the original electrocardiogram data through a discriminant network. When the comparison result is less than a preset value, output the generated electrocardiogram data as the generation result.
[0011] Further, before preprocessing the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data, it also includes:
[0012] Pass the original electrocardiogram data through an unscented Kalman filter to obtain electrocardiogram data with noise filtered out.
[0013] Perform segmentation processing on the electrocardiogram data with noise filtered out to obtain descriptive data and constraint data.
[0014] Further, the discriminant network includes: an objective function; the objective function:
[0015] ;
[0016] Among them, represents the original electrocardiogram data, is random noise drawn from a Gaussian distribution. The conditional variable and the original electrocardiogram data and the generated electrocardiogram data are input into the discriminator together. represents the generated electrocardiogram data obtained by the noise through the generation network under the condition , represents under the condition the discriminant network Probability of being judged as original electrocardiogram data , indicating that under the condition , the discriminative network judges as the probability of original electrocardiogram data, is the expected value of loss sampled from the real data distribution, is the expected value of loss sampled from the random noise distribution, represents the distribution of real data, represents the distribution of input noise.
[0017] Furthermore, a reproduction loss process is set between the feature encoder and the feature decoder to determine the difference between the electrocardiogram data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original electrocardiogram data. The reproduction loss process includes a reproduction loss function , where represents the number of sequence time points, represents the heart rate data after being decoded by the feature decoder at the th time point, represents the heart rate data reconstructed by the generation network through the encoder and decoder at the th time.
[0018] Furthermore, it also includes:
[0019] A consistency loss process and a gradient loss process are set between the generation network and the discriminative network. When it is determined that the processing result is less than the loss preset value, the operation of comparing the generated electrocardiogram data with the original electrocardiogram data through the discriminative network is executed;
[0020] A consistency loss objective function for determining the output consistency between the generation network and the discriminative network , where represents the number of sequence time points, represents the heart rate data after being decoded by the feature decoder at the th time point, represents the noise generated data through the generation network ;
[0021] The gradient loss process includes a gradient loss function , where is the gradient loss value, represents the number of sequence time points, represents the heart rate data after being decoded by the feature decoder at the The heart rate data decoded at a time point, represents the heart rate data at the next time point.
[0022] The present invention also provides an unbalanced electrocardiogram data determination system based on an adaptive generative adversarial network, including:
[0023] A preprocessing module, configured to preprocess the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data. The original electrocardiogram data includes description data and constraint data. The description data includes heart rate voltage data and heart rate data collected at specific time points, and the constraint data includes the data types of specific segments of heart rate data and patient information;
[0024] A generation module, configured to process the electrocardiogram data through a generation network and input the processed result into an information integration module to obtain generated electrocardiogram data. The generated electrocardiogram data is marked with a fusion feature matrix. The fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than a preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive encoding module. The input of the adaptive encoding module includes the electrocardiogram data, random noise, and dynamic conditional labels;
[0025] A discrimination module, configured to compare the generated electrocardiogram data with the original electrocardiogram data through a discrimination network. When it is determined that the comparison result is less than a preset value, output the generated electrocardiogram data as a generation result.
[0026] Further, the preprocessing module is further configured to obtain noise-filtered electrocardiogram data by passing the original electrocardiogram data through an unscented Kalman filter; and perform segmentation processing on the noise-filtered electrocardiogram data to obtain description data and constraint data.
[0027] Further, the discrimination module further includes: an objective function; the objective function:
[0028] ;
[0029] Wherein, represents the original electrocardiogram data, is the random noise drawn from a Gaussian distribution, the conditional variable and the original electrocardiogram data and the generated electrocardiogram data are input into the discriminator together, represents that under the condition the noise The generated electrocardiogram data obtained through the generation network represents the probability that, under the condition , the discrimination network judges it as the original electrocardiogram data . It represents the probability that, under the condition , the discrimination network judges as the probability of the original electrocardiogram data. is the expected value of the loss sampled from the true data distribution, and is the expected value of the loss sampled from the random noise distribution. represents the distribution of the true data, and represents the distribution of the input noise.
[0030] Furthermore, the preprocessing module is used to set a reproduction loss process between the feature encoder and the feature decoder to determine the difference between the electrocardiogram data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original electrocardiogram data. The reproduction loss process includes a reproduction loss function , where represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the -th time point, represents the heart rate data reconstructed by the encoder and decoder at the -th time through the generation network.
[0031] Furthermore, it further includes a loss judgment module, which is used to set a consistency loss process and a gradient loss process between the generation network and the discrimination network. When it is determined that the processing result is less than the loss preset value, the operation of comparing the generated electrocardiogram data with the original electrocardiogram data through the discrimination network is performed;
[0032] The consistency loss objective function for determining the output consistency between the generation network and the discrimination network , where represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the -th time point, represents the noise generated data through the generation network ;
[0033] The gradient loss process includes a gradient loss function , where is the gradient loss value, represents the number of sequence time points, represents the heart rate data after being decoded by the feature decoder at the th time point for the heart rate data, represents the heart rate data at the next time point of
[0034] Compared with the prior art, the present invention has the following beneficial technical effects:
[0035] The present invention provides a method and system for determining unbalanced electrocardiogram data based on an adaptive generative adversarial network. The method includes: preprocessing the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data, where the original electrocardiogram data includes descriptive data and constraint data, the descriptive data includes heart rate voltage data and heart rate data collected at specific time points, and the constraint data includes the data types of each segment of heart rate data and patient information; processing the electrocardiogram data through a generative network and inputting the processed result into an information integration module to obtain generated electrocardiogram data, where the generated electrocardiogram data is marked with a fusion feature matrix, and the fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors, where the data type is a data type for which the number of people corresponding to one data type is greater than a preset number, and the generative network includes an autocorrelation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive encoding module, and the input of the adaptive encoding module includes the electrocardiogram data, random noise, and dynamic condition labels; comparing the generated electrocardiogram data with the original electrocardiogram data through a discriminative network, and when the comparison result is less than a preset value, outputting the generated electrocardiogram data as the generated result. Using a feature encoder and a feature decoder enables the generative adversarial network to more accurately identify and generate data features. This method not only effectively reduces the computational burden of the model, but also improves the accuracy of the model in processing abnormal heart rate data, significantly improves the data processing efficiency, and reduces the interference of noise and outliers, making the generated result more reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a schematic flowchart of a method for determining unbalanced electrocardiogram data based on an adaptive generative adversarial network according to an embodiment of the present invention;
[0037] Figure 2 is a schematic diagram of the overall model according to an embodiment of the present invention;
[0038] Figure 3 is a model diagram of the LDM module according to an embodiment of the present invention;
[0039] Figure 4It is the structure diagram of the TCN model and the self - correlation residual Transformer model in an embodiment of the present invention;
[0040] Figure 5 It is the structure diagram of the adaptive coding in an embodiment of the present invention;
[0041] Figure 6 It is the structure diagram of the adaptive generative adversarial network in an embodiment of the present invention;
[0042] Figure 7 It is the proportion of various types of beats in the MIT - BIH dataset in an embodiment of the present invention;
[0043] Figure 8 It is the composite loss curve graph in an embodiment of the present invention;
[0044] Figure 9 It is the scatter plot of the single - patient experiment on the MIT - BIH dataset in an embodiment of the present invention;
[0045] Figure 10 It is the CDF graph of the single - patient experiment on the MIT - BIH dataset in an embodiment of the present invention;
[0046] Figure 11 It is the comparison graph of the influence of the MIT - BIH average pooling kernel on the waveform in an embodiment of the present invention;
[0047] Figure 12 It is the effect graph of the LDM - GAN model for expanding the MIT - BIH dataset in an embodiment of the present invention;
[0048] Figure 13 It is the structure diagram of ResNet50 in an embodiment of the present invention;
[0049] Figure 14 It is the confusion matrix graph of the classification effect of ResNet50 on the expanded dataset in an embodiment of the present invention;
[0050] Figure 15 It is the schematic structural diagram of the unbalanced electrocardiogram data determination system based on the adaptive generative adversarial network in an embodiment of the present invention. Detailed implementation manners
[0051] The following further elaborates on the present invention in detail with specific embodiments, which is an explanation rather than a limitation of the present invention.
[0052] Figure 1 It is the schematic flow diagram of the method for determining unbalanced electrocardiogram data based on the adaptive generative adversarial network in an embodiment of the present invention; as Figure 1 shown, the method for determining unbalanced electrocardiogram data based on the adaptive generative adversarial network includes the following steps:
[0053] Step 101: Preprocess the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data.
[0054] The original electrocardiogram data in this embodiment includes descriptive data and constraint data. The descriptive data includes heart rate voltage data and heart rate data collected at specific time points, and the constraint data includes the data types of each segment of heart rate data and patient information.
[0055] Preferably, before preprocessing the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data, it may further include:
[0056] Pass the original electrocardiogram data through an unscented Kalman filter to obtain electrocardiogram data with noise removed;
[0057] Perform segmentation processing on the electrocardiogram data with noise removed to obtain descriptive data and constraint data.
[0058] Optionally, a reproduction loss process is set between the feature encoder and the feature decoder to determine the difference between the electrocardiogram data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original electrocardiogram data. The reproduction loss process includes a reproduction loss function , where represents the number of sequence time points, represents heart rate data The heart rate data decoded by the feature decoder at the -th time point, represents the heart rate data reconstructed at the -th time point through the encoder and decoder by the generation network .
[0059] Specifically, the embodiment of the present invention combines a pre-training method in an extended space with a temporal loss value training method, effectively reducing the complexity of temporal information and improving the model's ability to detect heart rate abnormalities. At the same time, a TCN temporal convolutional network and a self-correlation residual Transformer are used in parallel in the model to extract the global information and high-frequency information of the model. As Figure 2 shown, the main objective of the present invention is to generate and process unbalanced electrocardiogram data through a variety of innovative technologies to overcome the limitations in the prior art, especially the problem of poor generation quality when dealing with minority classes (such as abnormal electrocardiogram signals). To address these challenges, the present invention proposes four main innovation points, which are optimized and improved at multiple levels of data preprocessing, feature capture, personalized generation, and model training.
[0060] First, to address the problems of high complexity and diverse features in electrocardiogram (ECG) signal data, the present invention designs a data pre-training method based on an extended space. Through a feature encoder and a feature decoder, the model can preprocess and transform the high and low complexity of ECG data before formal training. The design of the extended space aims to reduce the processing burden of the model on complex data, enabling it to focus more on key features, while improving generalization ability and computational efficiency. This pre-training method effectively enhances the adaptability of the model to complex ECG signals, ensuring that the features of the data can be accurately captured and utilized.
[0061] In terms of feature extraction and fitting, the present invention realizes the conditional fitting of high-frequency and global features through a Long-Term Dependence Generation Module (LDM Block). The LDM module combines the advantages of a Temporal Convolutional Network (TCN) and a Self-Correlation Residual Transformer (SRT), capable of simultaneously capturing short-term high-frequency features and long-term global dependencies in ECG signals. The TCN is responsible for extracting local details of the signal, while the SRT is used to capture global dependencies, enabling the model to consider both local and global aspects when generating ECG signals and ensuring the consistency of the generated data in terms of temporal continuity and global trends. This method greatly improves the accuracy and effectiveness of ECG signal generation.
[0062] Personalized heart rate generation based on an Adaptive Generative Adversarial Network (Adaptive GAN) is another important innovation of the present invention. Different from traditional generative adversarial networks, the Adaptive GAN can perform personalized generation according to individual ECG features, providing a more targeted solution especially for abnormal ECG signals and imbalanced datasets. Through adaptive encoding, the model can dynamically adjust input conditions, making the generated ECG signals more in line with individual health conditions and further improving the diversity and personalization of the generated signals. This personalized generation ability greatly enhances the feasibility of the model in practical clinical applications.
[0063] During the model training process, the present invention adopts a temporal loss value optimization method to comprehensively drive the training of the model. This temporal loss value optimization strategy can ensure that the model balances the periodic and aperiodic features of ECG signals during generation, effectively improving the diversity and authenticity of the generated signals, thereby enhancing the model's ability to handle data complexity, especially showing significant advantages in dealing with imbalanced datasets.
[0064] 1. Data pre-training method based on an extended space
[0065] When modeling high-complexity data, the variability and non-linear characteristics of time-series data often make it difficult for models to fully capture and utilize these data features, resulting in insufficient model performance. Existing models often fail to accurately identify key features and effectively model such complex time-series data when processing it. This deficiency is mainly reflected in the excessively high data complexity, leading to low computational efficiency and insufficient accuracy of the model. At the same time, it also makes it difficult for generative adversarial networks to effectively learn and generate on complex data sets.
[0066] To address the high complexity of time-series data, we propose an innovative solution, namely a data pre-training method based on an extended space. The core idea of this method is to preprocess the data through the extended space to help the model better handle the complexity and non-linear characteristics in time-series data during the training process. The extended space realizes the conversion of high and low complexity data through a feature encoder and a feature decoder. Before the model is formally trained, the feature encoder and the feature decoder first learn how to reduce the dimensionality of complex raw data and convert high-complexity data into a relatively simple and easy-to-process low-complexity representation. At the same time, the system also learns how to gradually restore the simplified features to complex representations during the generation process, thereby generating high-quality time-series data.
[0067] The core innovation of this method lies in that the pre-training of the extended space enables the model to not only more efficiently identify the core features of the data but also effectively avoid the computational burden brought by data complexity. By reducing the data complexity, the model can focus more on the key features of the data without wasting computational resources on processing redundant or useless information. Therefore, this method greatly improves the performance of generative adversarial networks, enabling them to more accurately learn important patterns in time-series data during the training phase.
[0068] The pre-training method in the extended space can also effectively filter out noise and outliers. By learning how to eliminate abnormal and interfering information in the data during the pre-training phase, the model can generate data more robustly, improving the accuracy and reliability of the generated data. Especially when dealing with imbalanced data, pre-training can lay a solid foundation for subsequent generation tasks, ensuring that the data generated by the model has better diversity and representativeness.
[0069] Another advantage of this pre-training method is that after the model is preprocessed by the extended space, the computational complexity is significantly reduced, thus simplifying the model structure and computational process. Compared with traditional methods that directly process high-dimensional data, the extended space not only simplifies the computational task but also improves the generalization ability of the model, enabling the model to better adapt to different input data scenarios, and thus showing more superior performance in dealing with imbalanced data sets.
[0070] The design of the extended space is as Figure 2As shown, the feature encoder is responsible for converting the original data from high complexity to low complexity, while the feature decoder re-boosts the low-complexity representation to high-complexity data during the generation phase. Such a training framework provides a more efficient and accurate path for the learning of generative adversarial networks, thus significantly improving the learning efficiency and generation performance of the model.
[0071] Step 102: Process the electrocardiogram data through the generation network and input the processed result into the information integration module to obtain generated electrocardiogram data.
[0072] The generated electrocardiogram data in this embodiment is represented by a fusion feature matrix, which includes: the relationship between the data type and all electrocardiogram data, the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than the preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive coding module. The input of the adaptive coding module includes the electrocardiogram data, random noise, and dynamic condition labels.
[0073] Preferably, a consistency loss processing and a gradient loss processing are set between the generation network and the discriminant network. When it is determined that the processing result is less than the loss preset value, the operation of comparing the generated electrocardiogram data with the original electrocardiogram data through the discriminant network is performed.
[0074] The consistency loss objective function for determining the output consistency between the generation network and the discriminant network , where represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the -th time point, represents noise The data generated by the generation network ;
[0075] The gradient loss processing includes a gradient loss function , where is the gradient loss value, represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the -th time point, represents the heart rate data at the next time point of
[0076] Specifically, this embodiment further includes:
[0077] 2. The conditional fitting model based on the high-frequency and global features of the LDM module
[0078] In the overall model, we adopted an LDM module (Long-Term Dependence Generation Module) that combines Self-Correlation Residual Transformer (SRT), Temporal Convolutional Network (TCN), and Adaptive Coding Fusion, as Figure 3 shown. This module combines the respective advantages of the three, ensuring that the model captures global features while maintaining the causality of the temporal network, and further achieving controllable generation of specified types of waveforms through adaptive coding.
[0079] As Figure 4 shown, in the model, the main information extraction is completed in parallel by the TCN temporal convolutional network and the self-correlation residual Transformer. Through its unique causal convolution and dilated convolution design, the TCN can effectively handle long-term dependence problems while ensuring that future information is not used when predicting the output at the current moment. This property of the TCN is very suitable for identifying and extracting short-term patterns and subtle changes in time series, and these high-frequency information are crucial for understanding the micro-dynamics of the data.
[0080] Assume is the input at time point , is the convolution operation, then the output of the causal convolution at this time can be expressed as Equation 1:
[0081] (1);
[0082] where is the size of the convolution kernel, is the value of the convolution kernel at the th time point, represents the input before time point . This way ensures that only the input at the current moment and before is considered when generating the current output, thus maintaining causality.
[0083] On the other hand, the self-correlation residual Transformer captures global dependencies in the sequence through its self-attention and residual fusion mechanism. The self-correlation residual Transformer can consider the interactions between all elements within the sequence. This ability makes the Transformer particularly good at extracting long-term dependencies and global context information in time series data, which is crucial for understanding the overall trends and patterns.
[0084] Each input sequence of the model is first fed into the TCN and the self - correlated residual Transformer modules in parallel and can consider the interactions between all elements within the sequence. This ability makes the self - correlated residual Transformer particularly good at extracting long - term dependencies and global context information in time - series data, which is crucial for understanding overall trends and patterns. The TCN module is responsible for extracting high - frequency temporal features, while the self - correlated residual Transformer module captures the global dependencies of the entire sequence. The strategy of using TCN and the self - correlated residual Transformer in parallel allows our model to simultaneously focus on local details and global context when processing time - series data.
[0085] Furthermore, as Figure 5 shown, we introduce adaptive encoding technology, incorporating patient information in the dataset as additional inputs into the feature matrix, allowing the model to learn the patterns of the time - series data itself and perform personalized analysis based on the specific background and characteristics of each patient. The adaptive encoding mechanism can encode patient personal information, such as weight, exercise habits, sleep quality, etc., into high - dimensional vectors and combine this vector with the feature matrix of the time - series data, thus ensuring that the output result of the generative adversarial network has a directional ability and ensuring that the model can controllably output a specific matrix.
[0086] Finally, we introduce information integration, integrating the output results of TCN, the self - correlated residual Transformer, and adaptive encoding. By fusing the output information of the three, a fused feature matrix is generated. This fused result contains the high - frequency information and global dependencies of the time - series data, while incorporating the patient's personal information and environmental factors, thus ensuring efficient and accurate directional generation of the specified type of heart rate.
[0087] 3. Personalized Heart Rate Generation Based on Adaptive Generative Adversarial Network (Adaptive GAN)
[0088] When dealing with an imbalanced heart - rate dataset, traditional data augmentation techniques such as random resampling, rotation, and flipping often produce extremely monotonous results, causing the dataset to lose its diversity. By leveraging the advantages of the adaptive generative adversarial network, which can learn the data distribution and generate diverse samples, and by adding conditional variable information, the required categories can be directly specified for generation. Such a generation method greatly increases the efficiency and diversity of the generated data. Therefore, introducing the adaptive generative adversarial network (Adaptive GAN) is the optimal solution for solving imbalanced datasets.
[0089] Step 103: Compare the generated electrocardiogram data with the original electrocardiogram data through a discriminant network. When it is determined that the comparison result is less than a preset value, output the generated electrocardiogram data as the generation result, which is used to assist the generation module to optimize the generation effect and gradually approach the target sample.
[0090] In this embodiment, the discriminant network includes: an objective function; the objective function:
[0091] ;
[0092] Among them, represents the original electrocardiogram data, is a random noise sampled from a Gaussian distribution, and the conditional variable and the original electrocardiogram data together with the generated electrocardiogram data are input into the discriminator . represents the generated electrocardiogram data obtained by the noise passing through the generation network under the condition . represents the probability that the discriminant network judges to be the original electrocardiogram data under the condition . represents the probability that the discriminant network judges to be the original electrocardiogram data under the condition . is the expected loss value sampled from the true data distribution, is the expected loss value sampled from the random noise distribution, represents the distribution of the true data, represents the distribution of the input noise.
[0093] Specifically, the structure of Adaptive GAN is as Figure 6 shown. In the initial stage, the generation network receives random noise and conditional labels as inputs, fuses data information and conditional information through the LDM module, and tries to generate as realistic heart rate data as possible, while the discriminant network tries to accurately distinguish whether the input data is real or generated by the generation network. During the training process, both use pre-trained feature encoders and feature decoders to assist in training, ensuring the training effect of the model, reducing data complexity, and alternately optimizing the parameters of the discriminant network and the generation network, thereby generating heart rate data more similar to the real data. This confrontation continues until the generation network and the discriminant network gradually converge stably in the confrontation. At this time, the model has the ability to generate waveforms of specific categories.
[0094] The objective function of Adaptive GAN can be expressed in the following form (Equation 2):
[0095] (2);
[0096] where represents the real data, is the random noise drawn from the Gaussian distribution, represents the conditional variable, which together with the data and the generated data are input into the discriminator . denotes the data generated by the noise through the generation network under the condition , denotes the probability that the discriminator network judges the real data to be real under the condition , denotes the probability that the discriminator network judges to be real under the condition , is the expected loss value sampled from the real data distribution, is the expected loss value sampled from the random noise distribution, represents the distribution of the real data, represents the distribution of the input noise.
[0097] 4. Training of the temporal loss value
[0098] The reconstruction loss is used to measure the difference between the generated data and the original data after the model encodes and decodes the features of the original data. Specifically, the original data extracts key features through the feature encoder and is then restored to an approximation of the original data through the feature decoder. The reconstruction loss calculates the error between the restored data and the original input data. By minimizing this loss, the model can learn more accurate feature representations and data restoration capabilities. The reconstruction loss is usually used in generative models such as autoencoders to ensure that the model can retain the core information of the original data, so as to restore the structure and details of the original data as much as possible during the reconstruction process. Its objective function is shown in Equation 3.
[0099] (3);
[0100] where represents the number of sequence time points, denotes the -th time point after the real heart rate data is encoded, It is through the generation network The heart rate data after being reconstructed by the encoder and decoder. The reconstruction loss measures the error between the real data and the generated data, ensuring that the model can reconstruct the input heart rate signal as accurately as possible, thereby enhancing the model's understanding and restoration ability of the original data structure.
[0101] The consistency loss framework constrains the output of the model to ensure the consistency of the model's output under different perturbations. This method can effectively utilize unlabeled data and improve the learning efficiency and accuracy of the model in the case of limited annotation resources. Especially when dealing with complex heart rate data, the consistency loss can enhance the model's understanding of the data structure and ensure the robustness of the model to noise and uncertainty, thereby improving the accuracy of prediction. Traditional generative adversarial network models usually adopt unsupervised learning, and the final effect of the generation network is guided by the loss function of the discriminative network. However, unsupervised learning has limited capabilities in dealing with complex data. By introducing the consistency loss, the generation network can maintain consistency under different input perturbations, thereby effectively improving the generation quality and the learning efficiency of the model. Its objective function is shown in Equation (4).
[0102] (4);
[0103] Where represents the number of sequence time points, denotes the real heart rate data at the -th time point after encoding, denotes the noise and
[0104] The time series loss value training mechanism can supervise the model learning from different perspectives and also promote the performance of the model in a multi-task learning environment, thereby achieving in-depth analysis and understanding of heart rate data. Based on the internal dynamic characteristics of time series data, we designed the gradient loss value and the consistency loss to jointly train the overall model, and the loss function is shown in Equation (5).
[0105] (5);
[0106] Where represents the number of sequence time points, represents the representation of the real heart rate data in the extended space, represents the next time point of That is, the difference metric of the trend between the current time point and the next time point ensures that the model effectively captures the inherent dynamic characteristics of the data. When the waveform exhibits oscillatory behavior, will increase, indicating that the generative network has enhanced its ability to master the overall trend of the data.
[0107] 5. Introduction and Statistics of the MIT-BIH Dataset
[0108] The MIT-BIH Arrhythmia Database is an important database widely used in the field of cardiac electrophysiology. This database was established by the Biomedical Engineering Center of the Massachusetts Institute of Technology in cooperation with Boston Hospital to promote the progress of arrhythmia and cardiac electrophysiology research. It contains ECG electrocardiogram records of a total of 47 patients, including approximately 110,000 heartbeats. Each patient has a total of two channels, recorded at a frequency of 360 Hz for about 30 minutes. The dataset contains a total of 17 different types of heart rates, as specifically recorded in Table 1 and Figure 7 shown. It contains many types of heart rate beats with extremely small proportions. For example, premature atrial contractions are generally used to evaluate the degree of mild abnormalities in atrial function, but they only account for 0.139% of the dataset. Junctional escape beats are used to reflect potential problems in the possible cardiac conduction system, usually occurring between normal heart rhythms, indicating the autonomous activity of the atrioventricular node region, and only accounting for 0.185% of the dataset. Ventricular escape beats imply the degree of impairment of ventricular function, which is particularly important for patients with heart diseases, accounting for approximately 0.093% of the dataset. These types of heartbeats have extremely small proportions in the database, but the study of them helps to deepen the understanding of the diversity of heart diseases and their treatments.
[0109] Table 1 Composition of Beat Types in the MIT-BIH Dataset and Proportions of Various Types
[0110]
[0111] In the study, we adopted four main statistical indicators for comparison to evaluate the generation quality of the model, namely the Percentage Residual Difference (PRD), Fréchet Distance (FD), Root Mean Square Error (RMSE), and Mean Absolute Error (MAE). Their respective meanings are defined as follows:
[0112] Percentage Residual Difference (PRD)
[0113] PRD is an indicator to measure the difference between the predicted value and the actual value, commonly used in the fields of medicine and signal processing, especially in the compression and reconstruction of electrocardiogram signals. The calculation formula is shown in Formula 6.
[0114] (6);
[0115] Where is the actual value, is the generated value, is the total number of observation points. The smaller its value, the smaller the difference between the two and the higher the generated similarity.
[0116] The Fréchet distance is a measure of the similarity between two curves that takes into account the order and position of the points. This metric works by simulating a situation where there is a point on each of the two curves, and these two points move along their respective curves but cannot move backward. The Fréchet distance is the maximum of the possible minimum distances between these two points. This makes the Fréchet distance very suitable for comparing time series data, and its definition is shown in Equation (7).
[0117] (7);
[0118] where is the actual value, is the generated value, is the total number of observation points.
[0119] Root Mean Square Error RMSE
[0120] RMSE is a common method for evaluating the prediction error of continuous variables. It is the square root of the average of the sum of the squares of the differences between the observed values and the predicted values, and the formula is shown in Equation (8):
[0121] (8);
[0122] where is the actual value, is the generated value, is the total number of observation points.
[0123] Mean Absolute Error MAE
[0124] MAE is another metric for measuring prediction accuracy. It calculates the average of the absolute values of the differences between the predicted values and the actual values, and the formula is shown in Equation (9):
[0125] (9);
[0126] where is the actual value, is the generated value, is the total number of observation points.
[0127] 6. Training of Time Series Loss Value and K-Fold Cross-Validation
[0128] In the experiment, to accurately evaluate the application effect of LDM-GAN in the actual medical environment, we adopted the K-fold cross-validation method to test the stability and prediction ability of the model. We found that during the actual training process, due to significant physiological differences among different patients, when too many patients were included in the training scope, the model could not converge effectively. To effectively solve this problem, we selected representative patients with various diseases for training. The patients included a total of seven patients numbered 100 / 107 / 109 / 114 / 124 / 208 / 210. The medical records of these patients were highly representative and covered the main disease types we focused on in the study. The distribution of heart rate information in the combined dataset is shown in Table 2, which includes all the trainable heart rate beat types that appeared in the dataset. We selected K values of 5 / 10 / 15 / 20 for the K-fold validation experiment, and the results are shown in Table 3.
[0129] Table 2. Distribution of the Core Case Dataset for K-fold Validation
[0130]
[0131] Table 3. K-fold Validation Experiment Table
[0132]
[0133] In the table, we found that when the value of K increased, the overall performance of the model improved, and each key indicator decreased. The utilization efficiency of model training increased, and each indicator in the parameter table met the expectations. The model performed best when K = 20, which verified the effectiveness of our model. Secondly, we visualized the designed time series loss value curve, and the results are as Figure 8 shown. Under the joint constraints of multiple loss functions, the model oscillated continuously in multiple ranges and gradually tended to converge. The overall indicators were relatively excellent, which verified the feasibility of LDM-GAN.
[0134] Figure 8 Composite Loss Curve Graph
[0135] Single Patient Experiment
[0136] In the current dataset, the individual physiological differences among patients and the complexity of disease types are relatively high. It is often difficult for a common training model for multiple patients to reach an ideal convergence state. To address this issue, we adopt a verification method of single-patient experiments. By focusing on the data analysis of a single patient, we can more precisely control and understand the experimental variables, thereby avoiding the interference of physiological differences and disease characteristics among different patients. The single-patient test results for each patient are shown in Table 4. From the single-patient experimental results, most patients show relatively low error values. The lowest RMSE reaches 0.012, and the lowest MAE reaches 0.007, indicating that the model can accurately predict the patient's response in most cases. At the same time, the value distributions of PRD and FD show the significant impact of physiological differences among patients on the training indicators. Due to the differences among patients, the indicators of individual patients are relatively poor. However, overall, the average indicators of the dataset are excellent. The average PRD reaches 57.665, FD reaches 0.981, RMSE is 0.151, and MAE is 0.135.
[0137] Table 4 Single-patient experimental results of the MIT-BIH dataset
[0138]
[0139] We plotted scatter plots and CDF plots for the test results, and the results are as Figure 9 and Figure 10 shown. It can be seen from the figure that there is a strong positive correlation between RMSE and MAE, while indicators such as FD and PRD are relatively independent of other indicators and vary greatly among patients. At the same time, the CDF plot shows that the RMSE and MAE of most patients are concentrated in a relatively low range, the PRD distribution is also relatively concentrated, while the FD distribution is relatively wide, which reflects the relatively large physiological differences among patients, and this indirectly confirms the necessity of single-patient experiments.
[0140] Sampling frequency comparison experiment
[0141] Furthermore, we conducted a comparison experiment on the input signal of the sampling waveform. In actual tests, we found that due to the length of the long-time sequence signal, the model training time was too long. Therefore, we cropped the signal sampling frequency to reduce the training speed while ensuring the model training effect. During the cropping process, we selected average pooling to reduce the time sequence signal, and we chose different convolutional kernels for cropping, such as Figure 11As shown in the figure, we have listed the effects of a total of six convolution kernels on the time series signal. We can find that when the convolution pooling kernel is between 3 and 6, the waveform can better reduce the length while maintaining the overall trend. When the pooling kernel continues to increase, the waveform will gradually distort. Therefore, we further fixed the pooling kernel range to 2~6 for model training. The overall model error gradually decreases with the increase of the pooling kernel, but at the same time, we believe that the integrity of the waveform should be considered. Therefore, in the subsequent waveform visualization experiments, the convolution kernel is fixed to 3 to ensure that the time series length is shortened while ensuring the integrity of the waveform as much as possible.
[0142] We generated supplements for each type of example in the dataset, so as to intuitively analyze and understand the generation effect of LDM-GAN. From the waveform results analysis, some types of waveforms have local jitters compared with the real data due to different training difficulties. Overall, the generated results are highly similar to the real heart rate. The LDM-GAN model fits the real data well. The visualization results also indirectly confirm the effectiveness of the LDM-GAN model in heart rate generation.
[0143] Comparative experiment on data expansion effect
[0144] Furthermore, we merge the augmented results generated by the LDM-GAN model with the original data to obtain a larger augmented data set. The augmentation effect is shown in Table 5. From the augmentation ratio, we can see that the imbalance of some beat types is extremely serious, which indirectly illustrates the necessity of the LDM-GAN model we proposed.
[0145] Table 5 LDM-GAN model expansion ratio for MIT-BIH dataset
[0146]
[0147] The expanded dataset is distributed as follows Figure 12 As shown in the figure, the LDM-GAN model uses a generative adversarial network to expand each type of heart rate beat to 70,000, each accounting for 10%. The entire data set contains 700,000 beats and ten types of heart rate beats, namely normal heartbeat, left bundle branch block heartbeat, right bundle branch block heartbeat, atrial premature beat, junctional premature beat, supraventricular premature beat, ventricular premature beat, ventricular escape beat, paced heartbeat and fusion heartbeat.
[0148] Figure 13 ResNet50 structure diagram
[0149] The test results are shown in Table 6. At the same time, we draw the confusion matrix, as shown in Figure 14As shown, all indicators of the expanded dataset have increased significantly. As a cost, all indicators of normal heart rate beats have decreased, but the slight decrease is acceptable for the significant increase in other indicators.
[0150] Table 6 Classification Effect Index Table of the Expanded Dataset ResNet50
[0151]
[0152] Finally, we compared the model generation effects with many models of the same type of tasks. As shown in Table 7, the LDM-GAN model is superior to other models in all indicators. At the same time, the LDM-GAN model has the function of generating specific heart rate waveforms, which demonstrates the feasibility of our model and also shows the superior performance of the model.
[0153] Table 7 Comparison of Indicators between LDM-GAN and Models of the Same Type
[0154]
[0155] In summary, through a series of technical improvements, the present invention proposes a more efficient and stable method for generating and processing heart rate data in view of the defects of the prior art. First, the extended spatial data pre-training method simplifies the complexity of the original time series data. By using a feature encoder and a feature decoder, the generative adversarial network can more accurately identify and generate data features. This method not only effectively reduces the computational burden of the model, but also improves the accuracy of the model in processing abnormal heart rate data, significantly improves the efficiency of data processing, and reduces the interference of noise and outliers.
[0156] The LDM module adopted by the present invention combines the TCN spatio-temporal convolutional network with the self-correlation residual Transformer module, and can simultaneously extract high-frequency local information and global features in the heart rate signal. This design can capture short-term dynamic features and maintain the dependence of the global context when processing complex time series data. Compared with the error accumulation problem that is prone to occur in traditional recurrent neural networks, the present invention has higher stability and accuracy in processing long time series tasks, and the generated results are more reliable.
[0157] In addition, the introduction of the adaptive generative adversarial network, combined with personalized constraint data, enables the model to generate personalized heart rate data according to the heart rate characteristics of specific patients. Different from most of the prior art that can only generate normal heart rate data, the present invention effectively solves the problem of dataset imbalance, can generate high-quality abnormal heart rate data, and enhances the ability of the model to detect abnormal heart rates.
[0158] In terms of model training, the present invention improves the limitations of traditional single loss functions by introducing the training of temporal loss values. By combining the reproduction loss and other loss functions, the multi-loss value supervision mechanism of the present invention can more comprehensively supervise the model training process, making the generated heart rate data more real, stable, and having better generalization ability. Compared with existing generative adversarial network models, the present invention shows significant advantages in data processing ability, generation accuracy, personalization, and anomaly detection performance, fully reflecting its innovation and practical value.
[0159] In this embodiment, the high and low complexity of the original electrocardiogram data is preprocessed through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data. The original electrocardiogram data includes descriptive data and constraint data. The descriptive data includes the heart rate voltage data and heart rate data collected at specific time points. The constraint data includes the data types of each segment of heart rate data and patient information. The electrocardiogram data is processed by a generation network, and the processed result is input into an information integration module to obtain generated electrocardiogram data. The generated electrocardiogram data is marked with a fusion feature matrix. The fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than a preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive encoding module. The input of the adaptive encoding module includes the electrocardiogram data, random noise, and dynamic condition labels. When the generated electrocardiogram data and the original electrocardiogram data are compared through a discriminant network and the comparison result is determined to be less than a preset value, the generated electrocardiogram data is output as the generation result. Using a feature encoder and a feature decoder enables the generative adversarial network to more accurately identify and generate data features. This method not only effectively reduces the computational burden of the model, but also improves the accuracy of the model in processing abnormal heart rate data, significantly improves the efficiency of data processing, and reduces the interference of noise and outliers, making the generation result more reliable.
[0160] Figure 15 It is a schematic structural diagram of an unbalanced electrocardiogram data determination system based on an adaptive generative adversarial network according to an embodiment of the present invention; as Figure 15 shown, the unbalanced electrocardiogram data determination system based on an adaptive generative adversarial network includes: a preprocessing module 171, a generation module 172, and a discriminant module 173, where
[0161] The preprocessing module 171 is used to preprocess the high and low complexity of the original electrocardiogram data through a feature encoder and a feature decoder to obtain preprocessed electrocardiogram data. The original electrocardiogram data includes descriptive data and constraint data. The descriptive data includes heart rate voltage data and heart rate data collected at specific time points. The constraint data includes the data types of each segment of heart rate data and patient information.
[0162] The generation module 172 is used to process the electrocardiogram data through a generation network and input the processed result into the information integration module to obtain generated electrocardiogram data. The generated electrocardiogram data is marked with a fusion feature matrix. The fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than a preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive coding module. The input of the adaptive coding module includes the electrocardiogram data, random noise, and dynamic condition labels.
[0163] The discrimination module 173 is used to compare the generated electrocardiogram data with the original electrocardiogram data through a discrimination network. When the comparison result is less than a preset value, the generated electrocardiogram data is output as the generation result.
[0164] Based on the above embodiment, the preprocessing module 171 is further used to obtain noise-filtered electrocardiogram data by passing the original electrocardiogram data through an unscented Kalman filter; and perform segmentation processing on the noise-filtered electrocardiogram data to obtain descriptive data and constraint data.
[0165] Further, based on the above embodiment, the discrimination module 173 further includes: an objective function;
[0166] The objective function:
[0167] ;
[0168] Wherein, represents the original electrocardiogram data, is the random noise drawn from the Gaussian distribution, the conditional variable and the original electrocardiogram data and the generated electrocardiogram data are input into the discriminator together, represents the generated electrocardiogram data obtained by the noise through the generation network under the condition , represents the discrimination network under the condition Probability of being judged as original electrocardiogram data , indicating that under the condition , the discrimination network judges as the probability of original electrocardiogram data, is the expected loss value sampled from the true data distribution, is the expected loss value sampled from the random noise distribution, represents the distribution of the true data, represents the distribution of the input noise.
[0169] Preferably, on the basis of the above embodiment, the preprocessing module 171 is used to set a reproduction loss process between the feature encoder and the feature decoder to determine the difference between the electrocardiogram data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original electrocardiogram data. The reproduction loss process includes a reproduction loss function , where represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the th time point, represents the heart rate data reconstructed by the generation network after passing through the encoder and decoder at the th time.
[0170] Preferably, on the basis of the above embodiment, it further includes a loss judgment module, which is used to set a consistency loss process and a gradient loss process between the generation network and the discrimination network. When it is determined that the processing result is less than the loss preset value, the operation of comparing the generated electrocardiogram data with the original electrocardiogram data through the discrimination network is performed;
[0171] The consistency loss objective function for determining the output consistency between the generation network and the discrimination network , where represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the th time point, represents the noise generated by the generation network ;
[0172] The gradient loss process includes a gradient loss function , where is the gradient loss value, represents the number of sequence time points, represents the heart rate data decoded by the feature decoder at the The heart rate data decoded at a time point, represent the heart rate data at the next time point of
[0173] Specifically, the original data set is filtered by unscented Kalman filter to remove noise. Subsequently, the heart rate data of the data set is segmented into descriptive data and constraint data. The descriptive data includes the heart rate voltage data collected at each specific time point, and the constraint data includes the data types of each segment of heart rate data and various related information of the patient. Subsequently, the data is pre-trained by a feature encoder to enable the model to obtain a time series information representation with lower complexity, facilitating model learning. After the adversarial alternating learning of the generation network and the discriminative network is completed, the generation network selects the specified conditional information, outputs the synthetic data through feature decoding, and gives it to the classification and judgment model. If the precision, recall rate, F1-score, etc. are improved compared with the original data set, it is judged that the expansion is effective and saved.
[0174] In this embodiment, the high and low complexity of the original electrocardiogram data is preprocessed by a feature encoder and a feature decoder to obtain the preprocessed electrocardiogram data. The original electrocardiogram data includes descriptive data and constraint data. The descriptive data includes the heart rate voltage data and heart rate data collected at specific time points, and the constraint data includes the data types of each segment of heart rate data and patient information; the electrocardiogram data is processed by a generation network, and the processed result is input into an information integration module to obtain the generated electrocardiogram data. The generated electrocardiogram data is marked by a fusion feature matrix, and the fusion feature matrix includes: the relationship between the data type and all electrocardiogram data, and the relationship between the patient's personal information and environmental factors. The data type is a data type for which the number of people corresponding to one data type is greater than a preset number. The generation network includes a self-correlation residual module SRT, a spatio-temporal convolutional network TCN, and an adaptive coding module. The input of the adaptive coding module includes the electrocardiogram data, random noise, and dynamic conditional labels; when the generated electrocardiogram data and the original electrocardiogram data are compared by a discriminative network and the comparison result is less than a preset value, the generated electrocardiogram data is output as the generation result. Using a feature encoder and a feature decoder enables the generative adversarial network to more accurately identify and generate data features. This method not only effectively reduces the computational burden of the model, but also improves the accuracy of the model in processing abnormal heart rate data, significantly improves the efficiency of data processing, and reduces the interference of noise and outliers, making the generation result more reliable.
[0175] As described above, it is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be covered within the protection scope of the present invention.
Claims
1. A method for determining imbalanced ECG data based on an adaptive generative adversarial network, characterized in that: include: Preprocessing the high and low complexity of the original ECG data by a feature encoder and a feature decoder to obtain preprocessed ECG data, wherein the original ECG data includes description data and constraint data, wherein the description data includes heart rate voltage data and heart rate data collected at a specific time point, and the constraint data includes data type and patient information of each specific segment of heart rate data; The ECG data are processed by a generative network, and the processing result is input into an information integration module to obtain generated ECG data, wherein the generated ECG data is indicated by a fusion feature matrix, wherein the fusion feature matrix includes: the relationship between the data type and all ECG data, the relationship between the patient's personal information and environmental factors, the data type is a data type corresponding to a data type with a number of people greater than a preset number of people, the generative network includes an autocorrelation residual module SRT, a spatiotemporal convolutional network TCN and an adaptive coding module, the input of the adaptive coding module includes the ECG data, random noise and dynamic condition labels, the autocorrelation residual module SRT captures the global dependency of the sequence in the ECG data through its self-attention and residual fusion mechanism, and the autocorrelation residual module SRT, the spatiotemporal convolutional network TCN and the adaptive coding module are connected in parallel; The generated ECG data is compared with the original ECG data through a discriminant network, and when it is determined that the comparison result is less than a preset value, the generated ECG data is output as a generated result.
2. The method for determining imbalanced ECG data based on an adaptive generative adversarial network according to claim 1, characterized in that: The method further comprises: preprocessing the high and low complexity of the original ECG data by the feature encoder and the feature decoder to obtain the preprocessed ECG data; Passing the original ECG data through an unscented Kalman filter to obtain ECG data with noise removed; The noise-filtered ECG data is segmented to obtain description data and constraint data.
3. The method for determining imbalanced ECG data based on adaptive generative adversarial network according to claim 2, characterized in that: The discriminant network includes the objective function: ; in, Represents the original ECG data, is random noise drawn from a Gaussian distribution, and the conditional variable and raw ECG data Generate ECG data Input to the discriminator together middle, Indicates that the condition Next, due to noise By generating a network The generated ECG data obtained, Indicates that the condition Next, the discriminant network Determined to be original ECG data The probability of Indicates that the condition Next, the discriminant network judge is the probability of the original ECG data, is the expected value of the loss sampled from the real data distribution, is the expected value of the loss sampled from a random noise distribution, represents the distribution of real data, represents the distribution of input noise.
4. The method for determining imbalanced ECG data based on an adaptive generative adversarial network according to claim 3, characterized in that: A reproduction loss process is provided between the feature encoder and the feature decoder to determine the difference between the ECG data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original ECG data and the original ECG data. The reproduction loss process includes a reproduction loss function ,in, Represents the number of sequence time points, Indicates heart rate data After the feature decoder The decoded heart rate data at each time point, Represented by generating a network After the encoder and decoder The heart rate data after reconstruction.
5. The method for determining imbalanced ECG data based on adaptive generative adversarial network according to claim 4, characterized in that: Also includes: A consistency loss process and a gradient loss process are provided between the generating network and the discriminating network, and when it is determined that the processing result is less than a preset loss value, the operation of comparing the generated ECG data with the original ECG data through the discriminating network is performed; Consistency loss objective function for determining the consistency of the output of the generator network and the discriminator network ,in, Represents the number of sequence time points, Indicates that the heart rate data is decoded by the feature decoder in the The decoded heart rate data at each time point, Indicates noise By generating a network Generated data; Gradient loss processing includes the gradient loss function ,in, is the gradient loss value, Represents the number of sequence time points, Indicates that the heart rate data is decoded by the feature decoder in the The decoded heart rate data at each time point, represent The heart rate data of the next time point.
6. A system for determining imbalanced ECG data based on an adaptive generative adversarial network, characterized in that: include: A preprocessing module, used for preprocessing the high and low complexity of the original ECG data through a feature encoder and a feature decoder to obtain preprocessed ECG data, wherein the original ECG data includes description data and constraint data, wherein the description data includes heart rate voltage data and heart rate data collected at a specific time point, and the constraint data includes data type and patient information of each specific segment of heart rate data; A generation module, used for processing the ECG data through a generation network, and inputting the processing results into an information integration module to obtain generated ECG data, wherein the generated ECG data is marked by a fusion feature matrix, wherein the fusion feature matrix includes: the relationship between the data type and all ECG data, the relationship between the patient's personal information and environmental factors, the data type is a data type corresponding to a data type with a number of people greater than a preset number of people, the generation network includes an autocorrelation residual module SRT, a spatiotemporal convolutional network TCN and an adaptive coding module, the input of the adaptive coding module includes the ECG data, random noise and dynamic condition labels, the autocorrelation residual module SRT captures the global dependency of the sequence in the ECG data through its self-attention and residual fusion mechanism, and the autocorrelation residual module SRT, the spatiotemporal convolutional network TCN and the adaptive coding module are connected in parallel; The discrimination module is used to compare the generated ECG data with the original ECG data through a discrimination network, and when it is determined that the comparison result is less than a preset value, output the generated ECG data as a generated result.
7. The imbalanced ECG data determination system based on adaptive generative adversarial network according to claim 6, characterized in that: The preprocessing module is also used to pass the original ECG data through an unscented Kalman filter to obtain ECG data after noise is filtered out; and segment the ECG data after noise is filtered out to obtain description data and constraint data.
8. The imbalanced ECG data determination system based on adaptive generative adversarial network according to claim 7, characterized in that: The discrimination module further includes: an objective function; the objective function: ; in, Represents the original ECG data, is random noise drawn from a Gaussian distribution, and the conditional variable and raw ECG data Generate ECG data Input to the discriminator together middle, Indicates that the condition Next, due to noise By generating a network The generated ECG data obtained, Indicates that the condition Next, the discriminant network Determined to be original ECG data The probability of Indicates that the condition Next, the discriminant network judge is the probability of the original ECG data, Indicates that the condition Next, the discriminant network judge is the probability of the original ECG data, is the expected value of the loss sampled from the real data distribution, is the expected value of the loss sampled from a random noise distribution, represents the distribution of real data, represents the distribution of input noise.
9. The imbalanced ECG data determination system based on adaptive generative adversarial network according to claim 8, characterized in that: The preprocessing module is used to set a reproduction loss process between the feature encoder and the feature decoder to determine the difference between the ECG data obtained after the feature encoder and the feature decoder perform feature encoding and feature decoding on the original ECG data and the original ECG data. The reproduction loss process includes a reproduction loss function ,in, Represents the number of sequence time points, Indicates heart rate data After the feature decoder The decoded heart rate data at each time point, Represented by generating a network After the encoder and decoder The heart rate data after reconstruction.
10. The imbalanced ECG data determination system based on adaptive generative adversarial network according to claim 9, characterized in that: It also includes a loss judgment module, which is used to set consistency loss processing and gradient loss processing between the generation network and the discrimination network, and when it is determined that the processing result is less than the preset loss value, performs the operation of comparing the generated ECG data with the original ECG data through the discrimination network; Consistency loss objective function for determining the consistency of the output of the generator network and the discriminator network ,in, Represents the number of sequence time points, Indicates that the heart rate data is decoded by the feature decoder in the The decoded heart rate data at each time point, Indicates noise By generating a network Generated data; Gradient loss processing includes the gradient loss function ,in, is the gradient loss value, Represents the number of sequence time points, Indicates that the heart rate data is decoded by the feature decoder in the The decoded heart rate data at each time point, represent The heart rate data of the next time point.
Citation Information
Patent Citations
Unbalanced heart rate data set processing method and system based on generative adversarial network
CN117972440A
ECG intelligent recognition algorithm based on TSF-GCN deep neural network
CN118535897A