Clinical multivariate time series data interpolation method based on generative adversarial network
By using the adversarial training framework of WGAN and the improved network structure of the generator and discriminator, the problem of missing clinical multivariate time series data was solved. The generated imputed values are consistent with the distribution of the original data, which improves data quality and the performance of downstream tasks.
Patent Information
- Application Number
- CN202511428236.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-09
AI Technical Summary
When dealing with missing clinical multivariate time-series data, existing technologies struggle to fully model the overall probability distribution of the original data, resulting in overly simplistic imputation results that fail to effectively reflect the randomness and uncertainty of the data, thus limiting the model's ability to capture potential data variability.
We employ a Wasserstein-based Generative Adversarial Network (WGAN) approach to construct an adversarial training framework for the generator and discriminator. The generator uses an attention-based network architecture, while the discriminator uses an improved GRU network structure. By minimizing the loss function, we train the generator to produce complete time-series data that conforms to the original data distribution.
This enables more accurate modeling of the underlying distribution of the original data, and the generated interpolated values are consistent with the distribution of the original data, thereby improving data quality and the performance of downstream tasks.
Smart Images

Figure CN121306586A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of biomedical information processing technology, specifically relating to a clinical multivariate time-series data interpolation method based on generative adversarial networks. Background Technology
[0002] An Electronic Health Record (EHR) is a digital patient health information recording system that records basic patient information, medical history, diagnoses, medical orders, medication use, and measurement results. EHRs contain a large amount of time-series data, such as changes in a patient's blood pressure at different times of the day. This time-series data can fully reflect changes in a patient's condition and is crucial for clinical research. However, this type of time-series data often suffers from missing data. Data gaps may stem from variables not being measured or technical issues such as network or equipment malfunctions, thus degrading data quality.
[0003] In recent years, artificial intelligence (AI) technology has been widely applied in the medical field, and high-quality data is a crucial factor driving its development. Many mainstream machine learning algorithms require complete datasets; therefore, effectively processing missing data is essential.
[0004] In clinical research, researchers spend a significant amount of time on data preprocessing, a process that often occupies a large portion of the entire research effort. Addressing missing values in the dataset is the most critical part of this process. The quality of data imputation not only affects data integrity but also directly determines the performance of downstream tasks. High-quality data imputation can restore the true distribution characteristics of the data to the greatest extent possible, thereby improving the accuracy, robustness, and reliability of machine learning models or statistical analyses. Conversely, low-quality or inappropriate data imputation may introduce bias, distort the data distribution, and even lead to misleading model conclusions. Therefore, choosing an appropriate imputation method requires considering not only its adaptability to data missing mechanisms but also ensuring that the imputed data can support subsequent task optimization and performance improvement.
[0005] In today's world, where data quality is difficult to guarantee and artificial intelligence technology is developing rapidly, imputation research on missing data has become particularly important, especially for datasets with a large number of missing values. Imputation of clinical time-series data has the following significant implications: (1) Discovering new clinical knowledge to help optimize clinical decision-making. (2) Promoting personalized and precision medicine to better meet the individual needs of patients. (3) Improving the credibility and accuracy of clinical research results. Therefore, conducting research on missing value imputation technology has important practical value and application scenarios. Summary of the Invention
[0006] This invention aims to overcome the limitations of existing technologies and provide a time-series data interpolation method based on Wasserstein Generative Adversarial Network (WGAN). Existing interpolation methods based on a single attention mechanism typically focus on minimizing the reconstruction error (such as mean squared error) between the generated data and the observed data points, striving to generate point estimates that are as similar as possible to the original observations. This method struggles to adequately model the overall probability distribution of the original data, potentially leading to overly simplistic interpolation results that fail to fully reflect the inherent randomness and uncertainty of the original data. This limits the model's ability to capture potential data variability and may cause the interpolated values to deviate from the true data distribution.
[0007] To address the aforementioned issues, this invention constructs an adversarial training framework. The generator employs an attention-based network architecture, while the discriminator utilizes a modified GRU network architecture. The core of this framework lies in the generator learning to generate complete time-series samples that conform to the original data distribution, thus "deceiving" the discriminator. The discriminator, in turn, continuously improves its ability to distinguish between real and generated data. This adversarial training process drives the generator to learn deeper levels of data distribution.
[0008] The specific technical solution adopted in this invention is as follows:
[0009] A clinical multivariate time-series data imputation method based on generative adversarial networks includes:
[0010] Obtain the time series data to be processed, and construct a mask matrix based on the missing data of the time series data to be processed;
[0011] The time series data to be processed is used as the original input data and the mask matrix are input into the trained generator, and the output generates complete time series data.
[0012] The generator is obtained by training a constructed generative adversarial network to minimize the loss function; the generative adversarial network includes a generator for generating complete time-series data and a discriminator for distinguishing real data from data generated by the generator.
[0013] The generator includes a first linear layer, a first encoder, a second linear layer, a third linear layer, a second encoder, a fourth linear layer, a first activation function layer, a fifth linear layer, a sixth linear layer, a second activation function layer, and a weighted combination layer;
[0014] The first encoder and the second encoder are respectively composed of N stacked diagonal mask multi-head self-attention modules and feedforward networks, and layer normalization and residual connections are applied after each diagonal mask multi-head self-attention module and feedforward neural network layer; in the diagonal mask multi-head self-attention module, the diagonal elements of the attention map are set to -∞.
[0015] The input data and mask matrix are concatenated and fed into the first linear layer for dimensional transformation, and positional encoding information is added to form the final input, which is then fed into the first encoder. The output of the first encoder is fed into the second linear layer for decoding to obtain the generated data for the first stage and update the input data. The updated input data and mask matrix are concatenated and fed into the third linear layer for dimensional transformation, and positional encoding information is added to form the final input, which is then fed into the second encoder. The output of the second encoder is sequentially fed into the fourth linear layer, the first activation function layer, and the fifth linear layer for decoding to obtain the generated data for the second stage. The mean of the weight matrices of each attention head in the last multi-head attention block of the second encoder is calculated to obtain the comprehensive attention weight. The comprehensive attention weight is concatenated with the mask matrix and fed into the sixth linear layer and the second activation function layer to generate the fusion weight. The weighted combination layer is used for...
[0016] The generated data from the first stage and the generated data from the second stage are weighted and combined using fusion weights to obtain fused generated data; the fused generated data is then combined with the original input data to generate complete time series data.
[0017] The discriminator adopts an improved GRU network structure, in which a decay variable is set to adjust the memory strength of the historical hidden state.
[0018] Furthermore, the decay variable The calculation formula is as follows:
[0019]
[0020] Then, the hidden state from the previous time step is decayed:
[0021]
[0022] in This represents the i-th time point. This is the current time interval vector; and These are the corresponding weight matrix and bias parameters, respectively; It is the original hidden state calculated and retained from the previous time point without decay. This represents the hidden state at the previous time point after decay.
[0023] Furthermore, the internal computation process in the improved GRU network structure is as follows:
[0024]
[0025]
[0026]
[0027]
[0028] in, This indicates element-wise multiplication; To update the gate, control the degree of state update; To reset the door and control the degree to which historical information is forgotten; This is the candidate hidden state; Input data for the current time step; This is the hidden state from the previous time step after decay; and These are the weight matrix and bias parameters for the corresponding gates, respectively.
[0029] Furthermore, generate complete time series data. It is expressed as follows:
[0030]
[0031] in, This indicates that the data has been merged and generated. This represents the original input data. This represents the mask matrix.
[0032] Furthermore, the loss function is divided into three parts: discriminant loss, reconstruction loss, and imputation loss. The discriminant loss is used to constrain the adversarial training of the generative adversarial network; the reconstruction loss is used to constrain the generator's reconstruction accuracy of the observations; and the imputation loss aims to improve the model's accuracy in predicting artificially introduced missing values.
[0033] Furthermore, the reconstruction loss includes the error loss between the generated data and the original data in the first stage, the error loss between the generated data and the original data in the second stage, and the error loss between the fused complete time-series data and the original data.
[0034] Furthermore, the interpolation loss is the interpolation error of the artificial mask positions in the generated complete time series data.
[0035] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a nanopore sequencing current prediction method based on a time-series base map structure as described above.
[0036] A storage medium containing computer-executable instructions that, when executed by a computer processor, implement the aforementioned clinical multivariate time-series data interpolation method based on generative adversarial networks.
[0037] A computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned clinical multivariate time-series data interpolation method based on generative adversarial networks.
[0038] This invention also provides a method for predicting in-hospital mortality rates, specifically:
[0039] Acquire clinical multivariate time-series data of the patient to be predicted, and interpolate the clinical multivariate time-series data based on the aforementioned generative adversarial network-based clinical multivariate time-series data interpolation method to obtain the original input data;
[0040] The raw input data is fed into a trained prediction model, and the output is the in-hospital mortality rate of patients.
[0041] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a method for predicting in-hospital mortality of patients as described.
[0042] A storage medium containing computer-executable instructions that, when executed by a computer processor, implement the method for predicting in-hospital mortality rates.
[0043] A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method for predicting in-hospital mortality of patients.
[0044] Therefore, this invention provides a time series data interpolation method that can more accurately model the potential distribution of the original data. By utilizing the generation capabilities of WGAN, it generates interpolated values that are consistent with the distribution of the original complete dataset in terms of statistical characteristics, thus providing higher quality and more representative complete time series data for downstream tasks. Attached Figure Description
[0045] Figure 1 This is a flowchart of the training process for the generative adversarial network of this invention;
[0046] Figure 2 This is a schematic diagram of the generator of the present invention;
[0047] Figure 3 This is a schematic diagram of the downstream prediction task of the present invention. Detailed Implementation
[0048] To clearly illustrate the present invention, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0049] This invention provides a method for interpolating multivariate clinical time-series data based on generative adversarial networks, comprising:
[0050] Obtain the time series data to be processed, and construct a mask matrix based on the missing data of the time series data to be processed;
[0051] The time series data to be processed is used as the original input data and the mask matrix are input into the trained generator, and the output generates complete time series data.
[0052] like Figure 1 As shown, the generator is obtained by training a constructed generative adversarial network to minimize the loss function; the generative adversarial network includes a generator for generating complete time-series data and a discriminator for distinguishing real data from data generated by the generator.
[0053] like Figure 2 As shown, the generator includes a first linear layer, a first encoder, a second linear layer, a third linear layer, a second encoder, a fourth linear layer, a first activation function layer, a fifth linear layer, a sixth linear layer, a second activation function layer, and a weighted combination layer;
[0054] The first encoder and the second encoder are each composed of an N-layer stacked diagonal mask multi-head self-attention module and a feedforward network, and layer normalization and residual connections are applied after each diagonal mask multi-head self-attention module and feedforward neural network layer; in the diagonal mask multi-head self-attention module, the diagonal elements of the attention map are set as ;
[0055] The input data and mask matrix are concatenated and fed into the first linear layer for dimensional transformation, and positional encoding information is added to form the final input, which is then fed into the first encoder. The output of the first encoder is fed into the second linear layer for decoding to obtain the generated data for the first stage and update the input data. The updated input data and mask matrix are concatenated and fed into the third linear layer for dimensional transformation, and positional encoding information is added to form the final input, which is then fed into the second encoder. The output of the second encoder is sequentially fed into the fourth linear layer, the first activation function layer, and the fifth linear layer for decoding to obtain the generated data for the second stage. The mean of the weight matrices of each attention head in the last multi-head attention block of the second encoder is calculated to obtain the comprehensive attention weight. The comprehensive attention weight is concatenated with the mask matrix and fed into the sixth linear layer and the second activation function layer to generate the fusion weight. The weighted combination layer is used for...
[0056] The generated data from the first stage and the generated data from the second stage are weighted and combined using fusion weights to obtain fused generated data. The fused generated data is then combined with the original input data to generate complete time series data.
[0057] The discriminator adopts an improved GRU network structure, in which a decay variable is set to adjust the memory strength of the historical hidden state.
[0058] To further illustrate the effects of this invention, this embodiment uses the Physionet 2012 clinical dataset (from the Physionet platform) as an example to explain the specific steps of the imputation method in detail. It should be noted that the application scope of this invention is not limited to this specific dataset, but is also applicable to other multivariate clinical time-series datasets.
[0059] First, a generative adversarial network is constructed and trained to obtain a pre-trained generator, specifically including:
[0060] Dataset preparation and preprocessing:
[0061] Dataset Description: The Physionet 2012 clinical dataset contains monitoring records of 12,000 ICU patients for 48 hours after admission. Each record contains 42 clinical features, with a missing data rate as high as 80%. This invention selects and processes 37 of the time-series features (such as body temperature, heart rate, blood pressure, and respiratory rate). This dataset is used to develop an in-hospital mortality risk prediction model (binary classification task).
[0062] Missing value representation: Given multivariate time series data of length T and dimension D ,in, This represents the value of the d-th variable at time point i. To identify missing data locations, a mask matrix M is introduced:
[0063]
[0064] Artificial masking mechanism: Since the data at the missing locations is unknown, the model cannot directly evaluate the imputation effect. Therefore, an artificial masking operation needs to be applied to the original time-series dataset to simulate the Missing Completely At Random (MCAR) scenario, thereby obtaining training data with known true values. Specifically, some known true observations are randomly masked according to a preset ratio (10% in this invention). After artificial masking, the new time-series data is denoted as... Its corresponding mask matrix is denoted as To distinguish between original missing values and artificially created missing values, an indicative mask matrix is introduced. , means as follows:
[0065]
[0066] Generative Adversarial Network Framework:
[0067] The generative adversarial network structure used in this method is as follows: Figure 1 It includes the following core modules:
[0068] Generators: such as Figure 2 As shown, complete time-series data is generated based on the improved self-attention mechanism (SAITS architecture).
[0069] Discriminator: Based on an improved GRU network, it distinguishes between real data and generated data.
[0070] Generator Design:
[0071] according to Figure 2 A generator module in a generative adversarial network (GAN) is constructed, employing a network architecture based on an improved attention mechanism. Compared to the original Transformer model, the symmetric decoder is discarded, and a linear layer is used as the decoder, significantly reducing computational complexity. To maximize interpolation quality, data generation is performed in two stages, and the two generated data are then weighted and combined to obtain the final interpolation data. In the encoder module, a diagonal masking mechanism is introduced compared to the traditional self-attention mechanism, where the diagonal elements of the attention map are set as... (In practice, it is set to) The mathematical expression is as follows:
[0072]
[0073] in, Representation matrix The value of the element in the i-th row and j-th column. Representation matrix The value of the element in the i-th row and j-th column of the new matrix after applying a diagonal mask operation.
[0074] After processing by the Softmax layer, the diagonal elements of the attention weight matrix are infinitely close to 0. The purpose of introducing the diagonal mask is to prevent each time step from using its own feature information for prediction, thereby more effectively capturing the dependencies between different time steps and the correlations between features.
[0075] The expression for calculating self-attention using a diagonal mask is as follows:
[0076]
[0077] Furthermore, DiagMasked Multi-Head Attention (DiagMaskedMHA) is defined as follows:
[0078]
[0079]
[0080] in, This represents the self-attention computation function that introduces a diagonal mask; These represent the query vector, key vector, and value vector, respectively. Represents the key vector The dimension; This represents the feature representation input to the attention layer; Indicates in The above applies diagonal mask multi-head self-attention computation; Indicates a splicing operation; This is a learnable weight matrix used to project the outputs of multiple attention heads to the final output dimension. The input will be respectively The query vector projected onto the i-th attention head. Key vector Sum value vector The weight matrix.
[0081] The first stage of the generation process is as follows: Time series data with missing values are... and its corresponding mask matrix After concatenation, the data undergoes dimensionality transformation in the first linear layer, and positional encoding information is added to form the final input representation. The data is then fed into the diagonal mask multi-head self-attention block module of the first encoder. The specific calculations are as follows:
[0082]
[0083] in, and These are the weight matrix and bias parameters for the linear transformation, respectively. For position encoding.
[0084] Next, The input is fed into the first encoding structure, which consists of N stacked diagonal mask multi-head attention modules and a feedforward network (FFN), to obtain an intermediate representation. :
[0085]
[0086] Layer normalization and residual connections are applied after each diagonal mask multi-head self-attention module and feedforward neural network layer to stabilize the training process and improve model performance. Specifically, the output of each sub-layer is:
[0087]
[0088] in, This represents the output of the attention layer or feedforward network layer. Representation layer normalization.
[0089] The generated data from the first stage is then obtained through decoding in the second linear layer. And update the input data:
[0090]
[0091]
[0092] in, and These are the weight matrix and bias parameters of the second linear decoding layer, respectively; This indicates element-wise multiplication.
[0093] The second-stage generation process is as follows: The data updated in the first stage... and mask matrix As input, after passing through the third linear layer and adding position encoding, the embedded representation is obtained:
[0094]
[0095] in, and These are the weight matrix and bias parameters for the linear transformation, respectively.
[0096] Then, The input is fed into a second encoder structure consisting of N stacked layers of diagonal mask multi-head self-attention modules and feedforward neural network layers to extract intermediate representations. :
[0097]
[0098] Similarly, layer normalization and residual connection mechanisms are also used after each diagonal mask multi-head self-attention module and feedforward neural network layer to ensure training stability and model expressive power.
[0099] The output data for the second stage is further obtained through the fourth and fifth linear layers and the ReLU activation function. :
[0100]
[0101] in, and for Weight matrix and bias parameters of the fourth linear layer before activation; and yes The weight matrix and bias parameters of the fifth linear layer after activation are used to map the results to the target output dimension.
[0102] The specific process of the weighted fusion stage is as follows: First, calculate the mean of the weight matrices of each attention head in the last layer of the multi-head attention block of the second stage, i.e., the second encoder, to obtain the comprehensive attention weight. :
[0103]
[0104] in, Indicates the number of attention heads; This indicates the last diagonal mask in the attention block. The attention weight matrix output by each attention head.
[0105] Next, the overall attention weight will be... With mask matrix The parts are spliced together and then subjected to a linear transformation of a sixth linear layer. Activation function generates fusion weights :
[0106]
[0107] in, and These are the weight matrix and bias parameters for the linear transformation, respectively.
[0108] Utilizing fusion weights Time series data generated in two stages and By performing weighted combination, the fusion result is obtained. :
[0109]
[0110] Finally, the fused data is combined with the original input data to generate complete time-series data. :
[0111]
[0112] Discriminator Design:
[0113] In clinical time series data, the time intervals between adjacent valid observations are often irregular. These irregular time intervals themselves possess significant informational value. If the current value is missing for a long period (i.e., a large time interval since the last valid observation), the influence of earlier historical data on the current or future state should be correspondingly diminished.
[0114] To utilize this information, a time interval matrix is defined. This is used to record the time difference between each variable at the current time point and its previous non-missing observation. The calculation rules are as follows:
[0115]
[0116] Where i represents the time point index. This indicates the j-th variable at time point. The time interval since the last non-missing observation. A value of 1 indicates at time point This variable represents observed values, or missing values.
[0117] To fully utilize time interval information, an improvement to the traditional GRU network structure is proposed: a GRUI unit (GRU for Imputation) suitable for imputation tasks. Its core idea is to introduce a decay vector. This is used to adjust the memory strength of hidden historical states. Decay factor. The calculation formula is as follows:
[0118]
[0119] Then, the hidden state from the previous time step is decayed:
[0120]
[0121] in, This is the current time interval vector. and These are the corresponding weight matrix and bias parameters, respectively. It is the original hidden state calculated and retained from the previous time point without decay.
[0122] The internal calculation process of the GRUI unit is as follows:
[0123]
[0124]
[0125]
[0126]
[0127] in, This indicates element-wise multiplication; To update the gate, control the degree of state update; To reset the door and control the degree to which historical information is forgotten; This is the candidate hidden state; Input for the current time step; This is the hidden state from the previous time step after decay; and These are the weight matrix and bias parameters for the corresponding gates, respectively.
[0128] Loss function design:
[0129] This invention uses the mean absolute error (MAE) as the basic evaluation index for interpolation performance, and its definition is as follows:
[0130]
[0131] The model's overall loss function consists of three parts: discriminant loss, reconstruction loss, and imputation loss. The discriminant loss originates from the adversarial training mechanism of generative adversarial networks. The reconstruction loss constrains the model's accuracy in reconstructing observations. The imputation loss aims to improve the model's accuracy in predicting artificially introduced missing values.
[0132] Reconstruction loss is defined as the average of the MAE losses of the three generated outputs and the real data:
[0133]
[0134] The interpolation loss measures the interpolation error at the positions of the artificial mask in the final complete data:
[0135]
[0136] The generator's total loss function is:
[0137]
[0138] in, This represents a complete time-series data sample output by the generator. This represents the adversarial loss of the generator, which aims to improve the realism of generated samples. and These are the weighting coefficients for the reconstruction loss and the interpolation loss, respectively.
[0139] The discriminator loss function is:
[0140]
[0141] in, and These represent the discriminator's output for distinguishing between real samples and generated samples, respectively.
[0142] Finally, the dataset is input into the generator to produce complete time-series data. Then, the original time-series data with missing values and the complete time-series data output by the generator are input into the discriminator, which distinguishes between real samples and generated samples, and trains the generator by minimizing the loss function.
[0143] Specific experiment:
[0144] To validate the effectiveness of this method, imputation experiments were conducted on the Physionet 2012 clinical dataset and compared with existing baseline methods. The experiments were evaluated from the following two dimensions:
[0145] 1. Interpolation accuracy: Calculate the MAE (mean absolute error) and RMSE (root mean square error) of the interpolation results on the test set. The lower the value, the better the interpolation effect.
[0146] 2. Downstream Task Performance: Based on the imputed complete data, train a binary classification model consisting of an LSTM layer and a linear classification layer (structure as follows). Figure 3 As shown in the figure, it is used to predict in-hospital mortality rate of patients, with AUC as the evaluation index. The higher the value, the better the performance of the downstream task.
[0147] The table below shows the comparison results between the method of this invention and the baseline model SAITS under the same experimental settings:
[0148] index Baseline Models (SAITS) This invention model MAE 0.1886 0.1878 RMSE 0.424 0.419 Mortality prediction AUC 0.8477 0.8553
[0149] Experimental results show that the method of the present invention outperforms the baseline model in both interpolation accuracy (MAE, RMSE) and downstream mortality prediction tasks, verifying its effectiveness and superiority in dealing with the problem of missing multivariate time series data.
[0150] Corresponding to the aforementioned embodiment of a clinical multivariate temporal data interpolation method based on generative adversarial networks, the present invention also provides an embodiment of an electronic device for implementing a clinical multivariate temporal data interpolation method based on generative adversarial networks.
[0151] An electronic device provided in this invention includes one or more processors for implementing a clinical multivariate time-series data interpolation method based on generative adversarial networks as described in the above embodiments.
[0152] The embodiments of the electronic device of the present invention can be applied to any device with data processing capabilities, such as a computer or other equipment or apparatus.
[0153] The device embodiment can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device in which it resides reading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, in addition to the processor, memory, network interface, and non-volatile memory, the data processing device in which the device in the embodiment resides may also include other hardware depending on the actual function of that data processing device, which will not be elaborated further.
[0154] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0155] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0156] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a clinical multivariate time-series data interpolation method based on generative adversarial networks as described in the above embodiments.
[0157] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0158] Furthermore, the present invention also provides a method for predicting in-hospital mortality rates, specifically:
[0159] Acquire clinical multivariate time-series data of the patient to be predicted, and interpolate the clinical multivariate time-series data based on the aforementioned generative adversarial network-based clinical multivariate time-series data interpolation method to obtain the original input data;
[0160] The raw input data is fed into a trained prediction model, and the output is the in-hospital mortality rate of patients.
[0161] Similarly, the present invention also provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a method for predicting in-hospital mortality of patients as described.
[0162] The present invention also provides a storage medium containing computer-executable instructions that, when executed by a computer processor, implement the method for predicting in-hospital mortality rates.
[0163] The present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method for predicting in-hospital mortality of patients.
[0164] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A clinical multivariate time-series data interpolation method based on generative adversarial networks, characterized in that, include: Obtain the time series data to be processed, and construct a mask matrix based on the missing data of the time series data to be processed; The time series data to be processed is used as the original input data and the mask matrix are input into the trained generator, and the output generates complete time series data. The generator is obtained by training a constructed generative adversarial network to minimize the loss function. The generative adversarial network includes a generator for generating complete time-series data and a discriminator for distinguishing real data from the complete time-series data generated by the generator. The generator includes a first linear layer, a first encoder, a second linear layer, a third linear layer, a second encoder, a fourth linear layer, a first activation function layer, a fifth linear layer, a sixth linear layer, a second activation function layer, and a weighted combination layer; The first encoder and the second encoder are each composed of an N-layer stacked diagonal mask multi-head self-attention module and a feedforward network, and layer normalization and residual connections are applied after each diagonal mask multi-head self-attention module and feedforward neural network layer; in the diagonal mask multi-head self-attention module, the diagonal elements of the attention map are set as ; The process involves several steps: First, the input data and mask matrix are concatenated and fed into the first linear layer for dimensional transformation. Position encoding information is then added to form the final input, which is fed into the first encoder. The output of the first encoder is fed into the second linear layer for decoding to obtain the generated data for the first stage and update the input data. The updated input data and mask matrix are then concatenated and fed into the third linear layer for dimensional transformation. Position encoding information is then added to form the final input, which is fed into the second encoder. The output of the second encoder is then fed into the fourth linear layer, the first activation function layer, and the fifth linear layer for decoding to obtain the generated data for the second stage. The mean of the weight matrices of each attention head in the last multi-head attention block of the second encoder is calculated to obtain the comprehensive attention weight. The comprehensive attention weight is concatenated with the mask matrix and fed into the sixth linear layer and the second activation function layer to generate fusion weights. The weighted combination layer is used to weight and combine the generated data from the first stage and the generated data from the second stage using the fusion weights to obtain fused generated data. The fused generated data is then used to interpolate the original input data to obtain the final complete temporal data. The discriminator adopts an improved GRU network structure, in which a decay variable is set to adjust the memory strength of the historical hidden state.
2. The method according to claim 1, characterized in that, The attenuation variable The calculation formula is as follows: ; Then, the hidden state from the previous time step is decayed: ; in, This represents the i-th time point. This is the current time interval vector; and These are the corresponding weight matrix and bias parameters, respectively; It is the original hidden state calculated and retained from the previous time point without decay. This represents the hidden state at the previous time point after decay.
3. The method according to claim 1, characterized in that, The internal computation process in the improved GRU network structure is as follows: ; ; ; ; in, This indicates element-wise multiplication; To update the gate, control the degree of state update; To reset the door and control the degree to which historical information is forgotten; This is the candidate hidden state; Input data for the current time step; This is the hidden state from the previous time step after decay; and These are the weight matrix and bias parameters for the corresponding gates, respectively.
4. The method according to claim 1, characterized in that, Generate complete time series data It is expressed as follows: ; in, This indicates that the data has been merged and generated. This represents the original input data. This represents the mask matrix.
5. The method according to claim 1, characterized in that, The loss function consists of three parts: discriminant loss, reconstruction loss, and imputation loss. Discriminant loss is used to constrain the adversarial training of the generative adversarial network. Reconstruction loss is used to constrain the generator's accuracy in reconstructing observations. Imputation loss aims to improve the model's accuracy in predicting artificially introduced missing values.
6. The method according to claim 5, characterized in that, The reconstruction loss includes the error loss between the generated data and the original data in the first stage, the error loss between the generated data and the original data in the second stage, and the error loss between the complete time-series data generated by the fusion of the two stages and the original data.
7. The method according to claim 5, characterized in that, The interpolation loss is the interpolation error of the artificial mask positions in the generated complete time series data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements a clinical multivariate time-series data interpolation method based on generative adversarial networks as described in any one of claims 1-7.
9. A storage medium containing computer-executable instructions, which, when executed by a computer processor, implement a clinical multivariate time-series data interpolation method based on generative adversarial networks as described in any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the clinical multivariate time-series data interpolation method based on generative adversarial networks as described in any one of claims 1-7.
Citation Information
Cited By
A track missing value completion method based on spatio-temporal correlation perception and information alignment
CN122594263A