Improved hemodialysis data generation method and system based on generative adversarial network

By using an improved adversarial generative network, the problems of insufficient temporal modeling ability and lack of physical constraints in the generation of hemodialysis data were solved, achieving high-quality data generation and improving the training effect of complication prediction models and the formulation of personalized treatment plans.

CN121144817BActive Publication Date: 2026-07-10NINGBO ARTIFICIAL INTELLIGENCE RES INST OF SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NINGBO ARTIFICIAL INTELLIGENCE RES INST OF SHANGHAI JIAOTONG UNIV
Filing Date
2025-09-12
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies lack the ability to model time series in the generation of hemodialysis data, lack modeling of long-term and short-term dependencies, and fail to introduce physical constraints, resulting in broken time series logic and poor generation stability of the generated data, which cannot meet the needs of precision medicine.

Method used

An improved adversarial generative network is adopted, which extracts global dynamic features and local instantaneous fluctuation patterns by embedding the network. A multi-scale attention mechanism and dynamic gradient pruning strategy are introduced, and combined with a supervised loss function, the joint training of the generator and discriminator is optimized to generate synthetic data that conforms to physiological constraints.

Benefits of technology

It significantly improves the authenticity, diversity, and clinical rationality of the generated data, provides high-quality hemodialysis data support, and enhances the training effect of complication prediction models and the formulation of personalized treatment plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144817B_ABST
    Figure CN121144817B_ABST
Patent Text Reader

Abstract

The application discloses an improved hemodialysis data generation method and system based on a generative adversarial network, relates to the technical field of medical data generation and artificial intelligence, and comprises the following steps: step 1, collecting hemodialysis multivariate time series data; step 2, mapping original time series data to a low-dimensional latent space through an embedding network; reconstructing the original data from the low-dimensional latent space through a restoration network; step 3, introducing a multi-scale attention mechanism into the generator, dynamically allocating weights by calculating the similarity of query vectors and key vectors, and combining value vectors to generate weighted context vectors; the discriminator performs a binary classification task and introduces a dynamic gradient clipping strategy: if the gradient L2 norm exceeds a preset threshold c, the gradient is scaled in proportion, otherwise the original value is retained; step 4, introducing a supervised loss function, and constraining the generator to learn the time series dynamic law through an autoregressive prediction task; and step 5, jointly optimizing the reconstruction loss, the adversarial loss and the supervised loss to output synthetic hemodialysis data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical data generation and artificial intelligence technology, and in particular to an improved method and system for generating hemodialysis data based on generative adversarial networks. Background Technology

[0002] Hemodialysis is a core treatment for end-stage renal disease patients, involving complex dynamic changes in physiological parameters such as blood pressure, blood volume, and dialysate composition. However, due to high costs of clinical data collection, significant individual patient variability, and limitations of equipment monitoring, the availability of high-quality dialysis time-series data is extremely limited. This data scarcity directly restricts the training effectiveness of predictive models for dialysis complications (such as hypotensive events in IDH), resulting in insufficient model generalization ability and failing to meet the needs of precision medicine.

[0003] Despite the progress made by Generative Adversarial Networks (GANs) in the field of medical data generation, they still suffer from the following technical limitations in generating time-series data for hemodialysis: Insufficient temporal modeling capabilities and a lack of modeling for long- and short-term dependencies: Traditional GANs (such as convolutional GANs) generate data by extracting static features, but hemodialysis data has strong temporal characteristics, such as the instantaneous response of blood volume and blood pressure, and the dynamic changes in dialysate composition over time. Existing methods fail to effectively capture multi-scale temporal dependencies, leading to a break in the temporal logic of the generated data and an inability to reflect true physiological dynamics. Secondly, they neglect physical constraints. During hemodialysis, there are strict physical correlations between parameters, such as the positive correlation between ultrafiltration rate and the rate of blood volume decline. However, traditional GANs do not introduce constraint mechanisms, and the generated data may violate physiological laws (such as abnormally high blood volume).

[0004] Therefore, those skilled in the art are dedicated to developing an improved method and system for generating hemodialysis data to address the shortcomings of existing technologies, such as insufficient time-series modeling capabilities, lack of physical constraints, and poor generation stability. Summary of the Invention

[0005] In view of the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is how to solve the problems of insufficient time series modeling capability, lack of physical constraints and poor generation stability in the prior art.

[0006] To achieve the above objectives, this invention provides an improved hemodialysis data generation method based on generative adversarial networks, the method comprising the following steps:

[0007] Step 1: Collect multivariate time-series data of hemodialysis, including blood pressure, blood volume and dialysate concentration, and perform data standardization and missing value imputation.

[0008] Step 2: Map the original time series data to a low-dimensional latent space through an embedded network to extract global dynamic features and local instantaneous fluctuation patterns; reconstruct the original data from the low-dimensional latent space through a recovery network to minimize the constraint reconstruction loss with mean square error.

[0009] Step 3: The generator generates synthetic time-series data based on random noise. Its LSTM structure introduces a multi-scale attention mechanism, dynamically assigning weights by calculating the similarity between the query vector and the key vector, and combining the value vector to generate a weighted context vector, thereby enhancing the modeling ability of physiological indicator mutations or stage features. The discriminator uses an LSTM structure to perform a binary classification task and introduces a dynamic gradient pruning strategy: if the gradient L2 norm exceeds a preset threshold c, the gradient is scaled proportionally; otherwise, the original value is retained.

[0010] Step 4: Introduce a supervised loss function and learn the temporal dynamics through an autoregressive prediction task constraint generator;

[0011] Step 5: Jointly optimize the reconstruction loss, adversarial loss, and supervised loss to output synthetic hemodialysis data that conforms to physiological constraints.

[0012] Furthermore, the embedding network in step 2 adopts an LSTM structure to convert the hemodialysis multivariate time series data collected in step 1 into a latent vector.

[0013] Furthermore, in step 2, the recovery network adopts a decoder structure symmetrical to the embedded network; if the embedded network adopts an LSTM structure, then the recovery network adopts a symmetrical LSTM decoder.

[0014] Furthermore, the calculation formula for the multi-scale attention mechanism in step 3 is as follows:

[0015]

[0016] Where Q represents the query vector Query, which is the request information for the current generated location;

[0017] K represents the key vector Key, which is the identifier of each element in the input sequence;

[0018] V represents the value vector, which is the actual information of each element in the input sequence;

[0019] This represents the dimension of the key vector Key.

[0020] Furthermore, the formula for calculating the L2 norm of the dynamic gradient pruning strategy in step 3 is as follows:

[0021]

[0022] in, Represents the first element in the gradient vector. Each element.

[0023] Furthermore, the preset threshold in step 3 It is 0.5.

[0024] Furthermore, before introducing the supervised loss function in step 4, the generator and the discriminator generate data by alternately optimizing against adversarial loss. The generator continuously improves its generation capabilities by learning from the feedback of the discriminator, while the discriminator promotes the progress of the generator by improving its discrimination capabilities, until a dynamic equilibrium is reached. Finally, the generator can generate high-quality synthetic data based on random noise when running independently.

[0025] Furthermore, the formula for calculating the reconstruction loss in step 5 is as follows:

[0026]

[0027] in, For real data, To reconstruct the data;

[0028] The adversarial loss aims to maximize the generator's ability to deceive the discriminator while minimizing the discriminator's classification error. Its calculation formula is as follows:

[0029] Generator:

[0030]

[0031] Discriminator:

[0032]

[0033] in, It is random noise. The output of the generator, The output of the discriminator, For mathematical expectation;

[0034] The supervised loss is calculated by supervising the generator to learn dynamic patterns of the time series through an autoregressive prediction task, and the formula is as follows:

[0035]

[0036] in, For true future values, These are predicted values.

[0037] Furthermore, the objective function for the joint optimization is:

[0038]

[0039] in, These are the weighting coefficients.

[0040] This invention also provides an improved hemodialysis data generation system based on generative adversarial networks, the system comprising:

[0041] Data preprocessing unit: Configured to standardize hemodialysis multivariate time series data and fill in missing values;

[0042] Embedded network units: Employing an LSTM structure to extract global dynamic features and local instantaneous fluctuation patterns from the data;

[0043] Recovery network unit: The original data is reconstructed using a symmetric LSTM decoder, and the reconstruction loss is calculated;

[0044] Generator unit: Integrates a multi-scale attention mechanism into the LSTM structure to generate synthetic temporal data;

[0045] Discriminator unit: It uses an LSTM structure to perform binary classification tasks and integrates a dynamic gradient pruning module;

[0046] Joint training unit: Synchronously optimizes reconstruction loss, adversarial loss and supervised loss to achieve collaborative training of the generator unit and the discriminator unit, and outputs synthetic hemodialysis data that conforms to physiological constraints;

[0047] The system also includes an improved hemodialysis data method based on generative adversarial networks as described in any of the preceding items.

[0048] The improved hemodialysis data generation method and system based on generative adversarial networks provided by this invention have at least the following technical effects:

[0049] 1) This invention introduces adversarial generative techniques into the field of hemodialysis, achieving high-quality time-series data generation based on an improved temporal generative adversarial network. This addresses the problem that traditional generative adversarial networks (GANs) lack the ability to model the strong temporal characteristics of hemodialysis data, such as the instantaneous response of blood volume and blood pressure, and the dynamic changes in dialysate composition, leading to a break in the temporal logic of the generated data. Furthermore, traditional methods do not incorporate physical constraint mechanisms, such as the positive correlation between ultrafiltration rate and the rate of blood volume decline, which may result in generated data that violates clinical physiological principles. In addition, traditional methods (such as SAS-based statistical analysis or simple interpolation) can only handle static data or low-dimensional features, failing to capture the complex dynamic dependencies of multivariate time series, and exhibiting poor generation stability, prone to gradient explosion or fluctuations in long-sequence modeling.

[0050] 2) This invention introduces an attention mechanism, dynamically allocating weights at different time scales to enhance the modeling of short-term fluctuations and long-term trends, addressing the shortcomings of traditional methods in modeling short- and long-term dependencies. Through a dynamic gradient pruning strategy, the discriminator gradient magnitude is monitored and adjusted in real time, mitigating the gradient explosion problem in long-sequence training and improving generation stability. Finally, by jointly optimizing reconstruction loss, adversarial loss, and supervised loss, and through an autoregressive prediction task-constrained generator, the dynamic patterns of the time series are learned, ensuring that the generated data conforms to the true statistical distribution while preserving physiological constraints. Compared to existing technologies, this invention significantly improves the authenticity, diversity, and clinical rationality of the generated data, providing high-quality data support for training hemodialysis complication prediction models and developing personalized treatment plans, filling a key gap in time-series data generation in the field of medical AI.

[0051] The following will further explain the concept, specific structure, and technical effects of the present invention in conjunction with the accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Attached Figure Description

[0052] Figure 1 This is a schematic diagram of the system architecture of a preferred embodiment of the present invention;

[0053] Figure 2 This is a diagram of the LSTM network architecture used in the generator, discriminator, and embedded network of this invention. Detailed Implementation

[0054] The following description, with reference to the accompanying drawings, illustrates several preferred embodiments of the present invention to make its technical content clearer and easier to understand. The present invention can be embodied in many different forms, and the scope of protection of the present invention is not limited to the embodiments mentioned herein.

[0055] This invention relates to a hemodialysis data generation model based on an improved Time Generative Adversarial Network (TimeGAN), aiming to address the problem of insufficient model training due to the lack of clinical data during hemodialysis. While traditional adversarial generative networks (GANs) can effectively capture long-term dependencies and local consistency in hemodialysis time-series data by jointly training the embedding network and using supervised loss, and by integrating adversarial goals and supervised prediction tasks, the realism and diversity of the generated data are improved; however, GANs suffer from drawbacks such as gradient explosion, fluctuations in long-sequence modeling, and poor generation stability. This invention, by introducing a multi-scale attention mechanism and a dynamic gradient pruning strategy, significantly improves the model's ability to fit complex dynamic patterns and its generation stability, enhancing the realism, diversity, and physiological rationality of the generated data, thus providing high-quality data support for training complication prediction models in precision medicine. Specifically, the innovative core of TimeGAN's time-series data generation through a joint training mechanism and the fusion of adversarial and supervised objectives lies in combining the advantages of Generative Adversarial Networks (GANs) and autoregressive models. Through joint training of the embedding network and the supervisory loss, it simultaneously captures long-term dependencies and local consistency of sequences. Building upon this, it further integrates generative adversarial objectives and supervised prediction tasks (such as autoregressive prediction) to collaboratively optimize the realism and diversity of the generated data. Furthermore, an attention module is introduced into the TimeGAN generator network. By adaptively allocating weights at different time scales, it captures short-term fluctuations (such as sudden drops in blood pressure) and long-term trends (such as changes in blood volume) in hemodialysis data and models dynamic intervariate dependencies, addressing the shortcomings of traditional TimeGAN in modeling short- and long-term dependencies. A dynamic gradient pruning strategy is added to the discriminator, enabling real-time monitoring of gradient magnitude and dynamic adjustment of the pruning threshold (e.g., adjusting the threshold strength according to the training stage) during the joint training of the generator and discriminator. This alleviates the gradient explosion problem in long sequence modeling, improving model stability and the continuity of generated data.

[0056] Specifically, TimeGAN stands for Time-series Generative Adversarial Network, a deep learning framework designed specifically for time-series data generation. It combines the advantages of Generative Adversarial Networks (GANs) and autoregressive models, achieving high-quality time-series data generation through a joint training mechanism and a fusion of supervision and adversarial objectives. The core architecture of the TimeGAN network consists of the following five key modules:

[0057] 1) Embedding Network: This network maps raw time-series data to a low-dimensional latent space, extracting global features and dynamic patterns from the time series. It maps raw time-series data (such as multivariate time-series data like blood pressure and blood volume) into a latent representation, preserving the key dynamic characteristics of the time series. Employing a recurrent neural network structure, it captures time dependencies through autoregressive modeling. Through the embedding network, TimeGAN can learn the long-term dependencies (such as trend changes) and local dynamic details (such as instantaneous fluctuations) of time series, providing a foundation for subsequent generation and reconstruction.

[0058] 2) Recovery Network: Reconstructs the original time-series data from the latent space, verifying whether the latent representation extracted by the embedding network fully preserves the information of the original data. It maps the latent representation output by the embedding network to the reconstructed original time-series data. A decoder structure symmetric to the embedding network (such as an inverse LSTM) is employed. The learning process of the embedding network is supervised by the reconstruction error (such as mean squared error, MSE) of the recovery network, ensuring that the latent representation can fully preserve the temporal dynamics of the original data.

[0059] 3) Generator: Generates new time series samples based on random noise vectors to simulate the distribution characteristics of real data. Random noise vectors (randomly sampled from Gaussian distributions or other prior distributions) are synthesized into time series data. An LSTM structure is used to generate time series data through autoregressive prediction. The generator aims to produce synthetic data that is highly similar to real data in statistical characteristics and dynamic patterns, deceiving the discriminator into being unable to distinguish between generated and real data.

[0060] 4) Discriminator: Determines whether the generated time series data matches the distribution characteristics of the real data. Input is either the generated time series data or the real time series data. Output is a binary classification result (real / generated). Implementation: Employs a fully connected network or a shallow LSTM, optimizing the discriminative ability through supervised learning (such as cross-entropy loss). Adversarial training drives the generator to produce more realistic data.

[0061] 5) Supervised Loss: Through autoregressive prediction tasks (such as predicting the value at the next time step), the generator is supervised to learn the dynamic patterns of the time series. Inputs are either generated time series data or real time series data. Output is the prediction error (e.g., mean squared error, MSE). Introducing supervised loss into the generator and recovery network forces the model to learn the autoregressive characteristics of the time series. The combination of supervised loss and adversarial loss ensures that the generated data not only closely approximates the statistical distribution of the real data but also preserves the local dynamic patterns of the time series.

[0062] Example 1

[0063] like Figure 1 As shown, this embodiment of the invention provides an improved hemodialysis data generation method based on generative adversarial networks, including the following steps:

[0064] Step 1: Collect multivariate time-series data of hemodialysis, including blood pressure, blood volume and dialysate concentration, and standardize the data to eliminate dimensional differences and impute missing values ​​to ensure the integrity and consistency of the input data.

[0065] Step 2: Initially train the embedding network and the recovery network using the reconstruction loss function. Then, use the embedding network to map the original time series data to a low-dimensional latent space to extract global dynamic features and local instantaneous fluctuation patterns. Use the recovery network to reconstruct the original data from the low-dimensional latent space, constraining the reconstruction loss with the mean squared error minimization (MSE) to ensure that the latent representation completely preserves the temporal characteristics of the original data.

[0066] Step 3: After training the embedding network and the recovery network, construct a generator and discriminator with improved structures. The generator generates synthetic time-series data based on random noise. To enhance the model's ability to focus on key time points or features, a multi-scale attention mechanism is introduced into its LSTM structure. Weights are dynamically assigned by calculating the similarity of the query vector and key vector, and a weighted context vector is generated by combining the value vector to strengthen the modeling ability for physiological indicator mutations or stage features. The discriminator uses an LSTM structure to perform binary classification tasks to optimize the discrimination ability. To prevent the gradient explosion problem during training, a dynamic gradient clipping strategy is introduced. The gradient magnitude is limited during backpropagation: if the gradient L2 norm exceeds a preset threshold c, the gradient is scaled proportionally; otherwise, the original value is retained.

[0067] Step 4: Based on adversarial training, a supervised loss function is further introduced. The generator is constrained to learn the dynamic laws of time series through the autoregressive prediction task. The generator needs to minimize both the adversarial loss and the supervised loss to ensure that the generated data not only conforms to the statistical distribution of the real data, but also retains the local dynamic characteristics.

[0068] Step 5: Jointly optimize the reconstruction loss, adversarial loss, and supervised loss to achieve collaborative training of the generator and discriminator, and finally output synthetic hemodialysis data that conforms to physiological constraints.

[0069] Specifically, the embedding network in step 2 uses a recurrent neural network (LSTM) structure to convert the hemodialysis multivariate time-series data collected in step 1 into latent vectors. The recovery network adopts a decoder structure symmetric to the embedding network; if the embedding network adopts an LSTM structure, then the recovery network adopts a symmetric LSTM decoder.

[0070] Specifically, the multi-scale attention mechanism in step 3 is a deep learning technique that mimics the human ability to selectively focus attention. It aims to allow the model to dynamically allocate weights when processing information, highlighting key parts and ignoring irrelevant information. Its core principle is to generate attention weights by calculating the similarity (such as dot product or scaled dot product) between the query vector and the key vector, and then combining this with the value vector for a weighted sum, thereby extracting the most relevant information.

[0071] Specifically, gradient clipping in step 3 is a technique to prevent gradient explosion by limiting the magnitude of the gradient. Its core principle is to clip the gradient vector after backpropagation to calculate the gradient: if the norm of the gradient (such as the L2 norm) exceeds a preset threshold, the gradient is scaled proportionally so that it does not exceed the threshold; if it does not exceed the threshold, the original value is retained.

[0072] Specifically, before introducing the supervised loss function in step 4, the generator and discriminator alternately optimize using adversarial loss to generate data. The generator continuously improves its generation capabilities by learning from the discriminator's feedback, while the discriminator improves its discrimination capabilities to drive the generator's progress until a dynamic equilibrium is reached. Ultimately, the generator, running independently, can generate high-quality synthetic data based on random noise. Specifically, the data generation process for the generator and discriminator is as follows: the generator takes random noise as input and generates synthetic data through a neural network structure, aiming to simulate the distribution of real data and deceive the discriminator. The discriminator receives both real and generated data as input and determines the data source through a classification task, aiming to distinguish between the two as accurately as possible. During training, the generator and discriminator alternately optimize using adversarial loss. The generator continuously improves its generation capabilities by learning from the discriminator's feedback, making the synthetic data closer to real data; the discriminator improves its discrimination capabilities to drive the generator's progress. As training progresses, the two gradually reach a dynamic equilibrium, meaning the generator can generate samples that are difficult to distinguish from real data, while the discriminator cannot effectively distinguish between the two. Ultimately, the generator, running independently, can generate high-quality synthetic data based on random noise.

[0073] Specifically, in step 5, the introduction of supervised loss and the joint training output are as follows: Building upon the adversarial training of the generator and discriminator, a supervised loss function is further introduced. This supervised loss constrains the generator's learning of the dynamic patterns of the time series through an autoregressive prediction task. The generator must simultaneously minimize both the adversarial loss and the supervised loss to ensure that the generated data conforms to the statistical distribution of real data while retaining local dynamic characteristics. The final joint training achieves collaborative training of the generator and discriminator by optimizing three types of objective functions: reconstruction loss, adversarial loss, and supervised loss. The resulting synthetic hemodialysis data outperforms traditional methods in terms of statistical characteristics, time dependence, and key feature capture capabilities, and can be widely applied in clinical research, medical training, and algorithm development.

[0074] Example 2

[0075] Based on Example 1, the calculation formula for the multi-scale attention mechanism in step 3 is as follows:

[0076]

[0077] Where Q represents the query vector Query, which is the request information for the current generated location;

[0078] K represents the key vector Key, which is the identifier of each element in the input sequence;

[0079] V represents the value vector, which is the actual information of each element in the input sequence;

[0080] This represents the dimension of the key vector Key.

[0081] Example 3

[0082] Based on Example 1, the formula for calculating the L2 norm of the dynamic gradient clipping strategy in step 3 is as follows:

[0083]

[0084] in, The first term in the gradient vector represents the first term. Each element.

[0085] Specifically, preset threshold This is a parameter tuning value. During training, it needs to be adjusted by continuously observing the magnitude of the training loss. value. Adjusting the value is essentially a parameter tuning experiment, which roughly follows these principles: if the loss is too large, it is necessary to adjust the parameter value. Increase the value to advance gradient descent; if the loss decreases, then... Reduce the value; to save development costs, you can... The value is set as a fixed value; it can be dynamically adjusted to enhance the training effect. Values. Existing solutions are mostly adjusted according to different training stages, and the specific adjustment values ​​need to be determined based on the actual training loss. The following are the adjustments. One approach is to divide the training process into different phases (e.g., warm-up, stabilization, and convergence), and set different threshold strengths for each phase: In the warm-up phase (early training stage), gradient fluctuations are large, so a higher threshold (e.g., c = 1.0) should be set to allow for larger gradient updates to quickly explore the parameter space; in the stabilization phase (mid-to-late stage), gradients tend to be stable, so the threshold should be reduced (e.g., c = 0.5) to suppress abnormal fluctuations and prevent overfitting; in the convergence phase (near convergence), the threshold should be further reduced (e.g., c = 0.2) to fine-tune the parameters and improve model accuracy.

[0086] Example 4

[0087] Building upon Example 1, the reconstruction loss in step 5 minimizes the reconstruction error (e.g., MSE) of the recovery network, ensuring that the latent representation extracted by the embedded network fully preserves the original data information. The formula for calculating the reconstruction loss is:

[0088]

[0089] in, For real data, To reconstruct the data;

[0090] Adversarial loss aims to maximize the generator's ability to deceive the discriminator while minimizing the discriminator's classification error. Its calculation formula is as follows:

[0091] Generator:

[0092]

[0093] The goal of a generator is to maximize the value function. That is, to make the generated data as misleading as the discriminator into thinking it is real data, that is, to make Therefore, Ideally, the synthesized data output by the generator should be indistinguishable from real data; in this case, the discriminator would consider the synthesized data to be real data. However, if the generator training is ineffective, the generated synthetic data is easily identified as synthetic data by the discriminator, i.e. ,but In actual training, the adversarial loss of the generator is usually transformed into minimizing the negative value function (loss function).

[0094] Discriminator:

[0095]

[0096] in, It is random noise. The output of the generator, The output of the discriminator, For mathematical expectation;

[0097] The goal of the discriminator is to maximize the value function, that is, to identify the real data as accurately as possible. Ideally, if the input is real data, then... The discriminator's output should be 1, while the input is synthetic data. Then the output of the discriminator It should be 0:

[0098]

[0099] In extreme cases, such as when the discriminator identifies real data as synthetic data, i.e. When the value function approaches 0, then Approaching negative infinity; similarly, if the discriminator judges synthetic data as real data, that is... If the value function approaches 1, then the value function Approaching negative infinity;

[0100] In actual training, the adversarial loss of the discriminator is usually transformed into minimizing the negative value function (loss function). The larger the value, the greater the loss, and the more training and learning are needed. The closer the value is to 0, the smaller the loss, and the more stable the training area.

[0101] If the input is a latent vector, the output is the first half of the following loss:

[0102]

[0103] If the input is a composite vector, the discriminator's loss is the latter half of the following loss:

[0104]

[0105] The adversarial loss of the discriminator is only used in the training of the discriminator, not in the training of the generator.

[0106] Supervised loss is calculated by supervising the generator to learn dynamic patterns in the time series during an autoregressive prediction task (such as predicting the value at the next time step). The formula is as follows:

[0107]

[0108] in, For true future values, These are predicted values.

[0109] Example 5

[0110] Based on Examples 1-4, the objective function for joint optimization is:

[0111]

[0112] in, These are the weighting coefficients.

[0113] Supervised Loss: Calculated from the latent vector and the synthesized vector, used to optimize the generator. Adversarial Loss: Calculated using the synthesized vector, used to optimize the generator. Adversarial Loss: Calculated using either the synthesized vector or the latent vector, used to optimize the discriminator. Reconstruction Loss: Calculated from the output vector and the time-series hemodialysis data, used to optimize the recovery network and the embedding network. Specifically, the generator objective function is... The discriminator objective function is: The objective function of the embedded network is The objective function for restoring the network is: .

[0114] To increase or decrease the optimization of the objective function, multiplication by weights can be used (generally, no weighting is applied). Weighting occurs when additional adjustments are needed, such as accelerating generator convergence; in this case, the generator's objective function is multiplied by a weight. The selection of weights is also part of the parameter tuning process, requiring constant monitoring of changes in loss during training, following these principles: Larger weights lead to larger loss, resulting in faster convergence but potentially a loss of final accuracy; smaller weights lead to smaller loss, resulting in slower convergence, possibly achieving better results but also risking failure to converge.

[0115] Example 6

[0116] Based on Examples 1-5, such as Figure 2 The diagram shown is an LSTM network architecture diagram.

[0117] LSTM (Long Short-Term Memory) is an important variant of Recurrent Neural Networks (RNNs), primarily used to address the difficulty of traditional RNNs in capturing long-term dependencies (such as vanishing or exploding gradients) when processing long sequences of data. In this embodiment, the generator, discriminator, and embedding network can be understood as computational units, all employing LSTM networks, but with different inputs, outputs, and loss optimization objectives. Noisy data is input into the generator, which processes the data through the LSTM network to output a synthesized vector. The synthesized vector and latent vector optimize the generator's LSTM network parameters using supervised loss. Simultaneously, the synthesized vector participates in the generator's adversarial loss calculation, thereby optimizing the generator structure, i.e., the W matrix parameters and b bias term in the LSTM network. The embedding network does not participate in the data generation process; it is an LSTM architecture: the input is time-series hemodialysis data, and the output is a latent vector. The latent vector and synthesized vector are used to calculate the supervised loss, while the embedding network is trained by a weighted sum of the reconstruction loss. For the recovery network, a decoder structure symmetrical to the embedding network is adopted; if the embedding network adopts an LSTM structure, then the recovery network adopts a symmetrical LSTM decoder. During training, if real hemodialysis data is input into the embedding network to obtain a latent vector, the latent vector is input into the recovery network, and the output is the output vector. The reconstruction loss is calculated using the output vector and the time-series hemodialysis data, and training is performed using the reconstruction loss. During the data generation process, the synthetic vector is input into the recovery network to obtain the output vector of the adversarial generated time-series hemodialysis data.

[0118] Hemodialysis data typically includes continuous monitoring indicators during patient treatment (such as long-term trends in blood volume). LSTM networks' long-term dependency modeling capabilities can accurately capture these dynamic changes. Through gating mechanisms (input gate, forget gate, output gate) and cell states, LSTM networks effectively capture long-term dependencies in time series data. The forget gate determines which historical information to discard. The input gate determines how new information is stored. The output gate controls the output of the current state. The cell state acts like an "information conveyor belt," allowing key information to be stably transmitted throughout the sequence. Specifically, the cell state is the memory core of the LSTM network, like a channel running through the entire sequence. Information flows primarily linearly within it (with only minor modifications), thus gradients can propagate back more stably, avoiding vanishing / exploding gradients. The cell state is continuously updated according to the gating controls, ultimately retaining the information that needs to be remembered long-term. The three gating mechanisms consist of a sigmoid activation function and a dot product operation, with output values ​​between 0 and 1 (1 indicating complete retention of information, 0 indicating complete discarding).

[0119] Example 7

[0120] Based on Examples 1-6, this embodiment of the invention provides an improved hemodialysis data generation system based on generative adversarial networks, comprising:

[0121] Data preprocessing unit: Configured to standardize hemodialysis multivariate time series data and fill in missing values;

[0122] Embedded network units: Employing an LSTM structure to extract global dynamic features and local instantaneous fluctuation patterns from the data;

[0123] Recovery network unit: The original data is reconstructed using a symmetric LSTM decoder, and the reconstruction loss is calculated;

[0124] Generator unit: Integrates a multi-scale attention mechanism into the LSTM structure to generate synthetic temporal data;

[0125] Discriminator unit: It uses an LSTM structure to perform binary classification tasks and integrates a dynamic gradient pruning module;

[0126] Joint training unit: Simultaneously optimizes reconstruction loss, adversarial loss, and supervised loss to achieve collaborative training of generator and discriminator units, and outputs synthetic hemodialysis data that conforms to physiological constraints;

[0127] The system also includes the improved hemodialysis data method based on adversarial generative networks included in any one of Examples 1 to 6.

[0128] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. An improved hemodialysis data generation method based on generative adversarial networks, characterized in that, The method includes the following steps: Step 1: Collect multivariate time-series data of hemodialysis, including blood pressure, blood volume and dialysate concentration, and perform data standardization and missing value imputation. Step 2: Map the original time series data to a low-dimensional latent space through an embedded network to extract global dynamic features and local instantaneous fluctuation patterns; reconstruct the original data from the low-dimensional latent space through a recovery network to minimize the constraint reconstruction loss with mean square error. Step 3: The generator generates synthetic time-series data based on random noise. Its LSTM structure introduces a multi-scale attention mechanism, dynamically assigning weights by calculating the similarity between the query vector and the key vector, and combining the value vector to generate a weighted context vector, thereby enhancing the modeling ability of physiological indicator mutations or stage features. The discriminator uses an LSTM structure to perform a binary classification task and introduces a dynamic gradient pruning strategy: if the gradient L2 norm exceeds a preset threshold c, the gradient is scaled proportionally; otherwise, the original value is retained. The calculation formula for the multi-scale attention mechanism is as follows: Where Q represents the query vector Query, which is the request information for the current generated location; K represents the key vector Key, which is the identifier of each element in the input sequence; V represents the value vector, which is the actual information of each element in the input sequence; Indicates the dimension of the key vector Key; The formula for calculating the L2 norm of the dynamic gradient pruning strategy is as follows: in, The first term in the gradient vector represents the first term. One element; Step 4: Introduce a supervised loss function and learn the temporal dynamics through an autoregressive prediction task constraint generator; Step 5: Jointly optimize the reconstruction loss, adversarial loss, and supervised loss to output synthetic hemodialysis data that conforms to physiological constraints.

2. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 1, characterized in that, The embedding network in step 2 adopts an LSTM structure to convert the hemodialysis multivariate time series data collected in step 1 into a latent vector.

3. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 2, characterized in that, In step 2, the recovery network adopts a decoder structure that is symmetrical to the embedded network; if the embedded network adopts an LSTM structure, then the recovery network adopts a symmetrical LSTM decoder.

4. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 1, characterized in that, The preset threshold in step 3 It is 0.

5.

5. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 1, characterized in that, Before the supervised loss function is introduced in step 4, the generator and the discriminator generate data by alternately optimizing against adversarial loss. The generator continuously improves its generation ability by learning from the feedback of the discriminator, while the discriminator promotes the progress of the generator by improving its discrimination ability, until a dynamic equilibrium is reached. Finally, the generator can generate high-quality synthetic data based on random noise when running independently.

6. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 5, characterized in that, The formula for calculating the reconstruction loss in step 5 is as follows: in, For real data, To reconstruct the data; The adversarial loss aims to maximize the generator's ability to deceive the discriminator while minimizing the discriminator's classification error. Its calculation formula is as follows: Generator: Discriminator: in, It is random noise. The output of the generator, The output of the discriminator, For mathematical expectation; The supervised loss is calculated by supervising the generator to learn dynamic patterns of the time series through an autoregressive prediction task, and the formula is as follows: in, For true future values, These are predicted values.

7. The improved hemodialysis data generation method based on generative adversarial networks as described in claim 6, characterized in that, The objective function for the joint optimization is: in, These are the weighting coefficients.

8. An improved hemodialysis data generation system based on generative adversarial networks, characterized in that, The system includes: Data preprocessing unit: Configured to standardize hemodialysis multivariate time series data and fill in missing values; Embedded network units: Employing an LSTM structure to extract global dynamic features and local instantaneous fluctuation patterns from the data; Recovery network unit: The original data is reconstructed using a symmetric LSTM decoder, and the reconstruction loss is calculated; Generator unit: Integrates a multi-scale attention mechanism into the LSTM structure to generate synthetic temporal data; Discriminator unit: It uses an LSTM structure to perform binary classification tasks and integrates a dynamic gradient pruning module; Joint training unit: Synchronously optimizes reconstruction loss, adversarial loss and supervised loss to achieve collaborative training of the generator unit and the discriminator unit, and outputs synthetic hemodialysis data that conforms to physiological constraints; The system is used to execute an improved hemodialysis data method based on adversarial generative networks as described in any one of claims 1 to 7.