Electrolyte disorder-based severe case survival time prediction model training method and system
By constructing a time series of electrolyte changes and using an improved LSTM model, the inefficiency caused by multiple checks in traditional methods is solved, achieving efficient and accurate survival time prediction, which is suitable for predicting electrolyte disturbances in critically ill patients.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2024-05-28
- Publication Date
- 2026-04-24
AI Technical Summary
Traditional deep learning-based survival time prediction methods require the use of multiple inspection indicators from multiple inspection items, resulting in low prediction efficiency and potential delays in rescue time.
By acquiring patients' electrolyte data, a time series of electrolyte changes is constructed. An improved LSTM model is then used for training, which can predict survival time using only electrolyte detection data. A time decay module is used to process electrolyte changes at unequal time intervals.
It improves the efficiency and accuracy of survival time prediction, reduces the need for multiple examinations, saves valuable rescue time for medical staff, and enhances the dynamic perception capability of the prediction model.
Smart Images

Figure CN119724578B_ABST
Abstract
Description
[0001] This invention is a divisional application of a method and system for predicting the survival time of critically ill patients based on electrolyte imbalance. The parent application was filed on May 28, 2024, and the application number is 2024106711871. Technical Field
[0002] This invention belongs to the field of deep learning technology, and in particular relates to a training method and system for a critical care survival time prediction model based on electrolyte imbalance. Background Technology
[0003] In traditional diagnostic methods, doctors often rely solely on their clinical experience, the critical patient's current condition, and various test results to make a rough assessment of the patient's life-threatening situation. This assessment method is subjective, inaccurate, and limited, failing to predict the patient's current life-threatening condition in advance and hindering timely treatment. Predicting the life-threatening situation of critically ill patients several days in advance not only allows for the early identification of high-risk patients, giving medical staff valuable time for rescue, but also enables the rational allocation of medical resources based on the patient's risk level.
[0004] With the widespread adoption of information technology in healthcare systems, every patient's examination results, medication, and treatment are stored in hospital electronic medical records. This massive amount of data provides a foundation for building artificial intelligence models to analyze patient characteristics and predict life-threatening conditions. However, the number of patient indicators is extremely broad, approaching a hundred. In medical settings, the total amount of data is often insufficient compared to the number of dimensions. Inputting all dimensions of data into an AI model could negatively impact model accuracy due to indicators that are not critical to life-threatening conditions, and more importantly, it could lead to underfitting. Therefore, identifying critical indicators that are meaningful for life-threatening conditions is crucial for training and improving the accuracy of predictive models.
[0005] Most existing survival prediction methods use the APACHE II score and require multiple indicators, including temperature, arterial pressure, heart rate, respiratory rate, oxygenation index, sodium ions, potassium ions, pH, bicarbonate, and creatinine. This means that before predicting life-threatening conditions, critically ill patients need to undergo multiple tests, and predictions can only be made based on the indicators from these tests. These tests are time-consuming, potentially leading to life-threatening situations before the necessary indicators are collected, wasting precious rescue time. Furthermore, the APACHE II score cannot provide an accurate survival time, only a rough prognostic reference.
[0006] For example, to accurately predict a patient's life-threatening condition using appropriate critical illness indicators and address the impact of unimportant indicators on the accuracy of the prediction model, patent application CN116759098A discloses a training and prediction method for a critical illness survival probability prediction model. This method selects critical illness indicators from examinations such as complete blood count, liver and kidney function, erythrocyte sedimentation rate (ESR), C-reactive protein (CRP), coagulation function, and blood gas analysis, and then predicts the patient's survival probability based on these indicators. Compared to traditional diagnostic methods, this method can achieve early prediction of the life-threatening condition of critically ill patients and improves prediction accuracy. However, it requires multiple examinations of the critically ill patient before prediction can be performed, affecting prediction efficiency and potentially delaying valuable rescue time. Summary of the Invention
[0007] The purpose of this invention is to provide a training method and system for a critical care survival time prediction model based on electrolyte imbalance, in order to solve the problem that traditional deep learning-based survival time prediction methods require the use of multiple examination indicators from multiple examination items, resulting in low prediction efficiency and potentially delaying rescue time.
[0008] This invention solves the above-mentioned technical problems through the following technical solution: a training method for a critical care survival time prediction model based on electrolyte imbalance, the training method comprising the following steps:
[0009] Electrolyte data from different patients were acquired, and a time series of electrolyte changes for each patient was constructed based on the electrolyte data; wherein, the time series of electrolyte changes included the detection values of each electrolyte index and the number of examinations in different time periods;
[0010] Different time thresholds are set according to the survival time prediction range; based on each time threshold, a sample dataset corresponding to the time threshold is constructed according to the electrolyte change time series and survival time of each patient; a survival prediction model is constructed.
[0011] The survival prediction model is trained and validated using each sample dataset to obtain the target prediction model corresponding to the time threshold.
[0012] Furthermore, based on the electrolyte data, a time series of electrolyte changes for each patient is constructed, specifically including:
[0013] Determine the length of the time period;
[0014] An initial electrolyte change time series is constructed for each patient based on the stated time period length, and the initial electrolyte change time series is represented as follows:
[0015] ;
[0016] ;
[0017] in, This represents the time series of initial electrolyte changes for the i-th patient, where N represents the number of time periods. This represents the electrolyte data of the i-th patient in the j-th time period. This represents the start time of the j-th time interval. This represents the measured value of the nth electrolyte indicator in the j-th time period. Indicates the quantity of electrolyte indicators, This indicates the number of times the nth electrolyte indicator was checked during the j-th time period;
[0018] The initial electrolyte change time series is preprocessed to obtain the electrolyte change time series.
[0019] Furthermore, the length of the time period is determined, specifically including:
[0020] Set the initial value for the duration of the time period;
[0021] For each patient, the assessment score for each electrolyte indicator is calculated for the specified time period. The specific calculation formula is as follows:
[0022] ; ;
[0023] in, This indicates that when the time period length is At that time, the patient's assessment score for the nth electrolyte indicator; This indicates that when the time period length is At that time, the number of times the patient's nth electrolyte indicator was checked across all time periods; This indicates that when the time period length is The number of time periods in which the patient's nth electrolyte indicator was tested zero; This indicates that when the time period length is The number of time periods in which the patient's nth electrolyte indicator is checked once; This represents a hyperparameter, whose value range is... ;
[0024] Determine the minimum value of the patient's assessment scores for all electrolyte indicators over the specified time period, and use the minimum value as the patient's overall score over the specified time period.
[0025] By changing the time period length and repeating the steps of calculating the assessment score of each electrolyte index at different time periods, the patient's overall score at different time periods can be obtained.
[0026] The maximum value of the patient's overall score across different time periods is determined, and the time period corresponding to the maximum value is taken as the final time period length.
[0027] Furthermore, the electrolyte indicators include sodium ions, potassium ions, calcium ions, magnesium ions, chloride ions, phosphate ions, bicarbonate ions, and pH value, which measures the acidity or alkalinity of the blood.
[0028] Furthermore, based on each time threshold, a sample dataset corresponding to each time threshold is constructed according to the electrolyte change time series and survival time of each patient, specifically including:
[0029] Set the size of the sliding window; use the movement of the sliding window over the electrolyte change time series to divide the electrolyte change time series into multiple sample data;
[0030] A label is generated for each sample data based on the time threshold and the patient's survival time.
[0031] Construct a sample dataset corresponding to the time threshold based on all sample data and their labels.
[0032] Furthermore, labels are generated for the corresponding sample data based on the time threshold and the survival time of the patient corresponding to each sample data, specifically including:
[0033] Determine whether the survival time of the patient corresponding to the last time period in the sample data is greater than or equal to the time threshold. If so, generate a survival label; otherwise, generate a death label. The survival time of the patient corresponding to the last time period in the sample data refers to the time between the last time period in the sample data and death.
[0034] Furthermore, the survival prediction model employs an improved LSTM model. This improved LSTM model adds a time decay module for short-term memory to the original LSTM model. This time decay module is used to convert the sum of memories from the previous unit into a decayed sum of memories based on additional time input and a time decay function. The specific expression is as follows:
[0035] ;
[0036] ;
[0037] ;
[0038] ;
[0039] in, This represents the short-term memory of the (t-1)th unit; This represents the total memory usage of the (t-1)th unit; Represents the weight matrix; Indicates the bias parameter; This represents the decayed short-term memory of the (t-1)th unit; Represents the time decay function; Indicates two inputs and The actual time elapsed in the physical world between these two points; This represents the long-term memory of the (t-1)th unit; This represents the decayed memory sum of the (t-1)th unit, and is used to replace the original memory sum of the LSTM model.
[0040] Based on the same concept, the present invention also provides a training system for a critical illness survival time prediction model based on electrolyte disturbance, including a memory, a processor, and a computer program / instructions stored in the memory, wherein the processor executes the computer program / instructions to implement the training method for the critical illness survival time prediction model based on electrolyte disturbance as described above.
[0041] Based on the same concept, the present invention also provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the training method for a critical illness survival time prediction model based on electrolyte disturbance as described above.
[0042] Based on the same concept, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the training method for a critical illness survival time prediction model based on electrolyte disturbance as described above.
[0043] Beneficial effects
[0044] Compared with the prior art, the advantages of the present invention are as follows:
[0045] This invention only requires obtaining the patient's electrolyte test data to predict survival time, eliminating the need to spend a lot of time and money on multiple tests before prediction. While ensuring the accuracy of survival time prediction, this invention greatly improves prediction efficiency, leaving valuable rescue time for medical staff and improving the patient's chances of survival. Constructing an electrolyte change time series based on electrolyte data and fully exploring the dynamic change characteristics of electrolyte data can improve the prediction accuracy of the model.
[0046] The survival prediction model of this invention adopts an improved LSTM model, which adds a time decay model for short-term memory to the original LSTM model, enabling it to perceive time intervals of unequal length in the electrolyte change time series. That is, it can dynamically perceive time intervals in the electrolyte change time series. For sequences with long time intervals, the model pays more attention to the latter half of the electrolyte change time series, thereby improving the prediction accuracy of the model. Attached Figure Description
[0047] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart of a critical care survival time prediction method based on patient electrolyte imbalance in an embodiment of the present invention;
[0049] Figure 2 This is an example diagram of the labels used to generate sample data in an embodiment of the present invention;
[0050] Figure 3 This is a diagram of the improved LSTM model architecture in an embodiment of the present invention. Detailed Implementation
[0051] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0053] like Figure 1 As shown in the figure, the critical care survival time prediction method based on patient electrolyte imbalance provided by this invention includes the following steps:
[0054] Step S1: Obtain electrolyte data for different patients and construct a time series of electrolyte changes for each patient based on the electrolyte data.
[0055] With the widespread use of electronic medical records, most hospitals record patients' examination data. Electrolytes play a crucial role in maintaining extracellular fluid osmotic pressure, fluid distribution and transport, fluid tone, and acid-base balance. Normally, the total number of anions and cations in body fluids is equal, maintaining electroneutrality. Changes in any electrolyte level can lead to various bodily damages, i.e., electrolyte imbalances. In critical illness, electrolyte imbalances are closely linked to sepsis. If electrolyte imbalances are not corrected, the probability of developing sepsis increases significantly, potentially leading to death. Therefore, the severity of electrolyte imbalances is directly related to the survival time of critically ill patients. Patients with severe conditions may have shorter survival times and require more medical resources; patients with milder conditions may have longer survival times or even survive. To predict the survival risk of critically ill patients early, gain valuable time for intervention, improve survival chances, and facilitate the rational allocation of medical resources, this invention utilizes electrolyte data to predict the survival status of critically ill patients.
[0056] In a specific embodiment of the present invention, electrolyte data of different patients are exported from electronic medical records (e.g., the MIMIC-IV database). Since the data exported from electronic medical records is inconsistent and structurally disorganized, the present invention uses a program designed with the Pandas library in Python to organize and extract the exported electrolyte data according to preset standards, obtaining electrolyte data for different patients. This electrolyte data is presented as a standardized electrolyte data table. Each patient's electrolyte data includes a patient identifier, the examination time of the electrolyte data, and the measured value of the electrolyte index. In this embodiment, the electrolyte index includes sodium ions (Na+). + ), potassium ions (K) + ), calcium ions (Ca 2+ ), magnesium ions (Mg 2+ ), chloride ions (Cl) − ), phosphate (HPO4) 2− ), bicarbonate (HCO3) 3− (and pH value, which measures the acidity or alkalinity of the blood. Unless otherwise specified, these electrolyte indicators are assumed to be measured from the blood.)
[0057] In a specific embodiment of the present invention, constructing a time series of electrolyte changes for each patient based on electrolyte data specifically includes:
[0058] Step S1.1: Determine the length of the time period, specifically including:
[0059] Step S1.11: Set the initial value for the time period length;
[0060] Step S1.12: For each patient, calculate the assessment score for each electrolyte indicator over the specified time period. The specific calculation formula is as follows:
[0061] (1)
[0062] (2)
[0063] (3)
[0064] (4)
[0065] in, This indicates that when the time period length is At that time, the patient's assessment score for the nth electrolyte indicator; This indicates that when the time period length is At that time, the number of times the patient's nth electrolyte indicator was checked across all time periods; This indicates that when the time period length is The number of time periods in which the patient's nth electrolyte indicator was tested zero; This indicates that when the time period length is The number of time periods in which the patient's nth electrolyte indicator is checked once; This indicates a hyperparameter used to weigh whether to maximize the use of electrolyte data or to retain only one set of electrolyte data for each time period. The range of values is In this embodiment, The value is 1; N represents the number of time periods, and the number of time periods N is related to the length of the time period. It is related to the length of time the patient spends in the ICU; This indicates that when the time period length is The number of times the nth electrolyte indicator is checked during the j-th time period.
[0066] Step S1.13: Determine the minimum value of the patient's assessment scores for all electrolyte indicators over the specified time period, and use this minimum value as the patient's overall score for that time period.
[0067] Each electrolyte indicator for each patient corresponds to an assessment score; therefore, the overall score for each patient over the given time period is:
[0068] (5)
[0069] in, Indicates the length of time period for the i-th patient. The overall score below, This indicates the quantity of electrolyte indicators. In this embodiment, It is 8.
[0070] Step S1.14: Change the time period length and proceed to step S1.12 to obtain the patient's data for different time period lengths. The total score below .
[0071] Step S1.15: Determine the length of time for each patient at different time periods. The total score below The maximum value in the range is used as the final time period length, and the time period length corresponding to the maximum value is taken as the final time period length.
[0072] If the time period is too long, multiple electrolyte checks will occur within a single period. In practice, only the worst electrolyte check result within that period will be selected, discarding other results. This leads to inefficient use of discarded electrolyte data and information loss. Conversely, if the time period is too short, some periods will lack electrolyte data, increasing the number of missing values in the electrolyte change time series and impacting subsequent model training. This invention utilizes evaluation scores at different time periods to determine the appropriate time period length, avoiding both electrolyte data loss and a large number of missing values in the electrolyte change time series.
[0073] Step S1.2: Construct the initial electrolyte change time series for each patient based on the time period length, wherein the initial electrolyte change time series is represented as:
[0074] (6)
[0075] (7)
[0076] in, This represents the time series of initial electrolyte changes for the i-th patient. This represents the electrolyte data of the i-th patient in the j-th time period. This represents the start time of the j-th time interval. This represents the measured value of the nth electrolyte indicator in the j-th time period. Indicates the quantity of electrolyte indicators, This indicates the number of times the nth electrolyte indicator was checked during the j-th time period.
[0077] Electrolyte data for each patient is collected from the time the patient is admitted to the ICU until the patient is discharged from the ICU or dies; the time period is defined as 1. (Unit: hours), starting from the patient's admission to the ICU, every... Each hour is considered a time period. Since the length of time each patient spends in the ICU varies, the number of time periods N for different patients may differ. If no electrolyte tests are performed within a certain time period, that time period is empty. If only some electrolyte indicators are tested within a certain time period, the untested electrolyte indicators are considered missing values. If multiple electrolyte tests are performed within a certain time period, the worst electrolyte test result within that time period (meaning the result that deviates furthest from the normal range) is used as the electrolyte data for that time period.
[0078] Step S1.3: Preprocess the initial electrolyte change time series to obtain the electrolyte change time series for each patient.
[0079] In this embodiment, the initial electrolyte change time series is preprocessed, specifically including checking the data integrity of different electrolyte indicators and handling missing values. Specifically, checking the data integrity of different electrolyte indicators includes: first calculating the data integrity of each electrolyte indicator, then determining whether the data integrity of each indicator is less than an integrity threshold. If so, the electrolyte indicator is removed from all initial electrolyte change time series; otherwise, the electrolyte indicator is retained in all initial electrolyte change time series. In this embodiment, the specific formula for calculating the data integrity of each electrolyte indicator is as follows:
[0080] (8)
[0081] in, This indicates the data completeness of the nth electrolyte indicator. This represents the total number of all patients across all time periods. This represents the number of times the nth electrolyte indicator is empty across all time periods for all patients. In this embodiment, the integrity threshold is 0.5.
[0082] In a specific embodiment of the present invention, missing value processing specifically includes:
[0083] Determine whether there are missing values in the electrolyte change time series after checking data integrity. If so, use the LOCF method (Last Observation Carried Forward) to fill the missing values once.
[0084] Determine whether there are missing values in the electrolyte change time series after the first filling. If so, use the NOCB method (Next Observation Carried Backward) to fill the missing values a second time.
[0085] We determined whether there were missing values in the electrolyte change time series after the second filling. If so, we removed the electrolyte change time series of patients with missing values to ensure that there were no empty values in all electrolyte change time series.
[0086] Step S2: Set different time thresholds based on the predicted survival time range; based on each time threshold, construct a sample dataset corresponding to the time threshold according to the electrolyte change time series and survival time of each patient. The time thresholds and their number are determined by the predicted survival time range and the prediction accuracy. Different time thresholds include the maximum and minimum values of the predicted survival time range. The higher the prediction accuracy, the smaller the interval between two adjacent time thresholds. For example, if the predicted survival time range is 2 hours to 72 hours, then the first time threshold is 2 hours, and the last time threshold is 72 hours. Adding 2 hours to the first time threshold yields the second time threshold, i.e., the second time threshold is 4 hours, and so on, to obtain all time thresholds covering the predicted survival time range (i.e., 2 hours, 4 hours, 6 hours, ..., 72 hours). To improve the accuracy of survival time prediction, the interval between two adjacent time thresholds should be reduced (i.e., the amount of change in the time threshold should be reduced). For example, add 1 hour to the first time threshold to get the second time threshold, i.e., the second time threshold is 3 hours, and so on, to get all time thresholds covering the survival time prediction range (i.e., 2 hours, 3 hours, 4 hours, ..., 72 hours).
[0087] In a specific embodiment of the present invention, based on each time threshold, a sample dataset corresponding to that time threshold is constructed according to the electrolyte change time series and survival time of each patient, specifically including:
[0088] Step S2.1: Set the size of the sliding window; use the movement of the sliding window over the electrolyte change time series to divide the electrolyte change time series into multiple sample data.
[0089] For example, for a patient's electrolyte change time series If the sliding window size is 3, then the obtained sample data is , … .
[0090] Dividing a patient's electrolyte change time series into multiple sample data greatly increases the number of sample data in the sample dataset, which is beneficial to improving the training accuracy of the model.
[0091] Step S2.2: Generate labels for the corresponding sample data based on the time threshold and the survival time of the patients corresponding to each sample data, specifically including:
[0092] The system determines whether the survival time of the patient corresponding to the last time period in the sample data is greater than or equal to a time threshold. If so, a survival label is generated; otherwise, a death label is generated. The survival time of the patient corresponding to the last time period in the sample data refers to the time remaining until death in that last time period. For patients confirmed to be deceased, the remaining hours until death are calculated backwards from their time of death for each time period. For surviving patients, the remaining time until death in each time period is considered to be a very large value, much larger than the maximum value of the remaining hours until death for all patients confirmed to be deceased. Therefore, each patient will have a remaining time until death for each time period, which serves as a label for the patient in different time periods. For example,... Figure 2 As shown, the time period is 2 hours, the sliding window size is 3, and the red and blue boxes represent two sample data sets. For the sample data in the red box, the survival time corresponding to the last time period is 20 hours; for the sample data in the blue box, the survival time corresponding to the last time period is 18 hours. Assuming the time threshold is 19 hours, since the survival time corresponding to the last time period in the red box sample data is 20 hours, which is greater than the time threshold of 19 hours, the label for the red box sample data is survival (corresponding value 0, negative sample); since the survival time corresponding to the last time period in the blue box sample data is 18 hours, which is less than the time threshold of 19 hours, the label for the blue box sample data is death (corresponding value 1, positive sample).
[0093] The label for each sample data will be different depending on the time threshold.
[0094] Step S2.3: Construct a sample dataset corresponding to the time threshold based on all sample data and their labels.
[0095] For each time threshold, a corresponding sample dataset is obtained; therefore, the number of time thresholds is the same as the number of sample datasets. Each sample in the sample dataset includes sample data and its label. The sample dataset is divided into a training set and a validation set. The survival prediction model is trained using the training set and validated using the validation set.
[0096] Step S3: Construct a survival prediction model. In this embodiment, the survival prediction model uses an improved LSTM (Long Short-Term Memory) model. The short-term memory in the original LSTM model is only applicable to time series with regular intervals (i.e., equal intervals), and cannot be applied to time series with irregular intervals (i.e., unequal intervals). To overcome the problem of the original LSTM model, this invention adds a time decay module for short-term memory to the original LSTM model, enabling it to sense irregular time intervals in the patient's electrolyte change time series. An LSTM model is composed of multiple structurally identical units connected sequentially. Except for the first unit, each unit can receive the memory signal and hidden layer state passed from the previous unit. Similar to the original LSTM model, the improved LSTM model of this invention is composed of multiple identical units connected sequentially. The difference between it and the original LSTM model is the addition of a time decay module. The input and the time decay operation on short-term memory (i.e., formulas (9) to (12)). Each structurally identical unit shares a frame, the mathematical expression of which is:
[0097] (9)
[0098] (10)
[0099] (11)
[0100] (12)
[0101] (13)
[0102] (14)
[0103] (15)
[0104] (16)
[0105] (17)
[0106] (18)
[0107] in, This represents the short-term memory of the (t-1)th unit (i.e., the previous unit), with the superscript S indicating short-term; This represents the total memory of the (t-1)th unit, which includes both short-term and long-term memory of the (t-1)th unit. This represents the decayed short-term memory of the (t-1)th unit; Represents the time decay function, input The larger it is, The smaller the output, the less the impact of past information on the present is reduced by decaying long-term memory; Indicates two inputs and The actual time elapsed in the physical world between these two points; This represents the long-term memory of the (t-1)th unit, with the superscript T indicating long-term; This represents the total decayed memory of the (t-1)th unit, obtained by adding the decayed short-term memory and the undecayed long-term memory. Formulas (13) to (18) are consistent with the original LSTM model. , , These are the forget gate, input gate, and output gate in the LSTM model. The forget gate is used to forget part of the memory of the previous unit, the input gate is used to control the memory generated by the current unit, and the output gate is used to control the output of the current unit (this output is the hidden state of the output, not the memory). Represents the sigmoid function; Indicates candidate memories, This represents the input of the t-th unit (i.e., the current unit). and Let represent the hidden state of the (t-1)th unit and the hidden state of the tth unit, respectively. , , as well as These represent the neural network parameter matrices for the forget gate, input gate, output gate, and candidate memory, respectively. This represents the submatrices decomposed from the neural network parameter matrix. The dimensions of these matrices depend on the dimensions of the input, output, and the preset dimensions of the hidden parameters.
[0108] Formulas (9) to (18) represent a unit of the LSTM model. Besides multiple units with identical structures, the improved LSTM model also includes an input layer and an output layer. For example... Figure 3 As shown, circular or elliptical boxes represent matrix dot product or matrix addition, arrows indicate the direction of backpropagation, merging arrows indicate matrix concatenation, and separating arrows indicate matrix copying.
[0109] Step S4: Train and validate the survival prediction model using each sample dataset to obtain the target prediction model corresponding to the time threshold.
[0110] For example, a first sample dataset is constructed based on a first time threshold. The survival prediction model is then trained and validated using this first sample dataset, resulting in a target prediction model corresponding to the first time threshold. A second sample dataset is constructed based on a second time threshold. The survival prediction model is then trained and validated using this second sample dataset, resulting in a target prediction model corresponding to the second time threshold. This process is repeated to obtain multiple target prediction models corresponding to different time thresholds. The number of time thresholds is the same as the number of target prediction models.
[0111] For each sample dataset, the structure and training method of the survival prediction model remain unchanged. When training the improved LSTM model using each sample dataset, the training termination condition is:
[0112] (19)
[0113] in, Indicates accuracy rate. This represents the area under the ROC curve. Indicates recall rate, , , Indicates an optional time decay function. This represents the time threshold (e.g., a time threshold of 19 hours indicates a prediction of patient survival after 19 hours). The area under the ROC curve. The calculation formula is:
[0114] (20)
[0115] in, Indicates the number of positive samples. Indicates the number of negative samples; This means that the model sorts all the predicted samples by scores from smallest to largest and then labels the i-th score starting from 1. The closer the score is to 1, the greater the probability that the model considers the sample to be a positive sample. The closer the score is to 0, the greater the probability that the model considers the sample to be a negative sample. Indicates the positive class.
[0116] Recall rate The calculation formula is:
[0117] (twenty one)
[0118] in, This represents the number of positive samples that were correctly predicted. This indicates the number of positive samples that are predicted as negative samples.
[0119] Due to the time threshold in this embodiment The time decay function is set to be relatively small:
[0120] (twenty two)
[0121] (twenty three)
[0122] Therefore, the training termination condition can be obtained as follows:
[0123] (twenty four)
[0124] The actual accuracy of the target prediction model trained in this embodiment It is 0.795. It is 0.766. The value was 0.624, which all achieved good results.
[0125] Step S5: Obtain electrolyte test data of the patient to be predicted, use all target prediction models to perform survival prediction on the electrolyte test data, and obtain the patient's survival results at different time thresholds.
[0126] The electrolyte test data for the patient to be predicted can be from multiple tests or from a single test. When it is a single test result, the length of the corresponding electrolyte change time series is 1, that is, there is only one time period and the start time of this time period is the test time of the electrolyte test data.
[0127] Step S6: Determine the patient's survival time based on the patient's survival outcomes at different time thresholds.
[0128] The target prediction model can predict whether a patient will live or die at a corresponding time threshold. Therefore, the patient's survival time can be determined based on the patient's survival outcome at different time thresholds.
[0129] For example, if the patient's survival outcome is predicted at time thresholds of 2 hours, 4 hours, 6 hours, 8 hours, and 10 hours, and the survival outcome at time threshold of 2 hours is alive, at time threshold of 4 hours is alive, at time threshold of 6 hours is alive, at time threshold of 8 hours is dead, and at time threshold of 10 hours is dead, then it can be determined that the patient's survival time is at least 6 hours.
[0130] This invention also provides a critical care survival time prediction system based on patient electrolyte imbalance. The system includes a memory, a processor, and a computer program / instructions stored in the memory. The processor executes the computer program / instructions to implement the critical care survival time prediction method based on patient electrolyte imbalance as described above.
[0131] Although not shown, the system includes a processor that performs various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) or loaded from a storage portion into random access memory (RAM). The processor may be a multi-core processor or may contain multiple processors. In some embodiments, the processor may include a general-purpose main processor and one or more specialized coprocessors, such as a central processing unit, graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for system operation are also stored in RAM. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0132] The processor and memory described above are used together to execute programs / instructions stored in the memory. When the program / instructions are executed by the computer, they can implement the methods, steps, or functions described in the above embodiments.
[0133] Although not shown, embodiments of the present invention also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the critical care survival time prediction method based on patient electrolyte disturbances as described above.
[0134] Readable storage media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0135] Although not shown, embodiments of the present invention also provide a computer program product, comprising: a computer program / instructions that, when executed by a processor, implement the critical illness survival time prediction method based on patient electrolyte disturbances as described above.
[0136] The above description only discloses specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or modifications that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A training method for a critical illness survival time prediction model based on electrolyte imbalance, characterized in that, The training method includes the following steps: Electrolyte data from different patients were acquired, and a time series of electrolyte changes for each patient was constructed based on the electrolyte data. The time series of electrolyte changes included the measured values of each electrolyte indicator and the number of tests in different time periods. The electrolyte indicators included sodium ions, potassium ions, calcium ions, magnesium ions, chloride ions, phosphate ions, bicarbonate ions, and pH value, which measures the acidity or alkalinity of the blood. Different time thresholds are set according to the survival time prediction range; based on each time threshold, a sample dataset corresponding to the time threshold is constructed according to the electrolyte change time series and survival time of each patient; A survival prediction model is constructed; wherein the survival prediction model adopts an improved LSTM model, which adds a time decay module for short-term memory to the original LSTM model. The time decay module is used to convert the memory sum of the previous unit into a decayed memory sum based on additional time input and a time decay function. The specific expression is as follows: in, This represents the short-term memory of the (t-1)th unit; This represents the total memory usage of the (t-1)th unit; Represents the weight matrix; Indicates the bias parameter; This represents the decayed short-term memory of the (t-1)th unit; Represents the time decay function; Indicates two inputs and The actual time elapsed in the physical world between these two points; This represents the long-term memory of the (t-1)th unit; This represents the total memory decay of the (t-1)th unit; The survival prediction model is trained and validated using each sample dataset to obtain the target prediction model corresponding to the time threshold.
2. The training method for a critical care survival time prediction model based on electrolyte imbalance according to claim 1, characterized in that, Based on the electrolyte data, a time series of electrolyte changes for each patient was constructed, specifically including: Determine the length of the time period; An initial electrolyte change time series is constructed for each patient based on the stated time period length, and the initial electrolyte change time series is represented as follows: ; ; in, Indicates the first i Initial electrolyte changes time series for each patient N Indicates the number of time periods. Indicates the first i The patient in j Electrolyte data for a given time period Indicates the first j The start time of each time period Indicates the first j The first time period n The measured values of each electrolyte index, Indicates the quantity of electrolyte indicators, Indicates the first j The first time period n Number of times each electrolyte indicator is checked; The initial electrolyte change time series is preprocessed to obtain the electrolyte change time series.
3. The training method for a critical care survival time prediction model based on electrolyte imbalance according to claim 2, characterized in that, Determine the length of the time period, specifically including: Set the initial value for the duration of the time period; For each patient, the assessment score for each electrolyte indicator is calculated over the specified time period, using the following formula: ; ; in, This indicates that when the time period length is At that time, the patient's first n Evaluation scores for each electrolyte indicator; This indicates that when the time period length is At that time, the patient's first n The number of times each electrolyte indicator was checked across all time periods; This indicates that when the time period length is At that time, the patient's first n The number of time periods during which the number of tests for each electrolyte indicator was 0; This indicates that when the time period length is At that time, the patient's first n The number of time periods in which an electrolyte indicator was checked once; This represents a hyperparameter, whose value range is [0,1]. Determine the minimum value of the patient's assessment scores for all electrolyte indicators over the specified time period, and use the minimum value as the patient's overall score over the specified time period. By changing the time period length and repeating the steps of calculating the assessment score of each electrolyte index at different time periods, the patient's overall score at different time periods can be obtained. The maximum value of the patient's overall score across different time periods is determined, and the time period corresponding to the maximum value is taken as the final time period length.
4. The training method for a critical care survival time prediction model based on electrolyte imbalance according to claim 1, characterized in that, Based on each of the time thresholds, a sample dataset corresponding to each time threshold is constructed according to the electrolyte change time series and survival time of each patient, specifically including: Set the size of the sliding window; use the movement of the sliding window over the electrolyte change time series to divide the electrolyte change time series into multiple sample data; A label is generated for each sample data based on the time threshold and the patient's survival time. Construct a sample dataset corresponding to the time threshold based on all sample data and their labels.
5. The training method for a critical care survival time prediction model based on electrolyte imbalance according to claim 4, characterized in that, Labels are generated for each sample data based on the time threshold and the patient's survival time, specifically including: Determine whether the survival time of the patient corresponding to the last time period in the sample data is greater than or equal to the time threshold. If so, generate a survival label; otherwise, generate a death label. The survival time of the patient corresponding to the last time period in the sample data refers to the time from the last time period in the sample data to death.
6. A training system for a critical illness survival time prediction model based on electrolyte imbalance, comprising a memory, a processor, and a computer program / instructions stored in the memory, characterized in that, The processor executes the computer program / instructions to implement the training method for the critical care survival time prediction model based on electrolyte disturbance as described in any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the training method for the critical care survival time prediction model based on electrolyte disturbance as described in any one of claims 1 to 5.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the training method for the critical care survival time prediction model based on electrolyte disturbance as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Critical disease survival probability prediction model training and prediction method
CN116759098A
Medical monitor system, control method therefor and program storage medium
JP2002336352A