ICU ward residence time prediction method, device, equipment and medium

Through a multi-model fusion strategy, combined with large language models and classic machine learning models, the problems of scarcity of data and complexity of individual differences in ICU ward residence time prediction are solved, achieving more stable and accurate prediction effects.

CN120164592AInactive Publication Date: 2025-06-17SUN YAT SEN MEMORIAL HOSPITAL SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510288027.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-06-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art faces the scarcity of data samples and the complexity of individual differences in patients when predicting ICU ward residence time, and traditional machine learning models are difficult to effectively capture the association relationship between variables.

Method used

Using a multi-model fusion strategy, combining large language models and classic machine learning models, the tabular data is converted into natural language by designing a prompt word template, inference is performed and prediction probability is obtained, and an adaptive fusion model is constructed to fuse the prediction results of different models.

Benefits of technology

More stable and accurate ICU ward residence time prediction was achieved in small sample tasks, improving AUROC indicators, and overcoming the shortcomings of traditional models in data scarcity and complexity of individual differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164592A_ABST
    Figure CN120164592A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of medical information, and particularly discloses an ICU ward residence time prediction method, device and equipment and a medium, and the ICU ward residence time prediction method comprises the steps: obtaining original data, and carrying out the arrangement of the original data, and forming table data; preprocessing the table data of the ICU patient to construct a training set and a test set; designing a cue word template and reasoning the preprocessed table data by using a large language model to obtain the prediction probability of the ICU residence time prediction task; constructing a first classifier and a second classifier, and inputting the preprocessed table data into the first classifier to obtain a first prediction result; inputting a prediction probability obtained by prediction of the large language model into a second classifier to obtain a second prediction result; and inputting the first prediction result and the second prediction result into an adaptive fusion model, adaptively updating weight parameters by the adaptive fusion model, and fusing the first prediction result and the second prediction result to obtain a final prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical information, and particularly relates to a method, device, equipment and medium for predicting the length of stay in the ICU ward. Background Art

[0002] As a highly prevalent malignant tumor in the head and neck, radical surgery for oral cancer often involves extensive tissue resection and complex reconstruction processes, and postoperative management faces severe challenges. In traditional clinical practice, patients need to be transferred to the intensive care unit (ICU) for postoperative monitoring after surgery. Due to the complexity of the surgery and the frequency of postoperative complications, the duration of patients' continuous stay in the ICU ward is usually prolonged. However, the resources in the ICU ward are extremely scarce, and accurately predicting the length of stay of patients in the ICU ward is of great significance for clinical resource scheduling, treatment plan formulation, and patient evaluation.

[0003] In the field of prognostic prediction of patients in the intensive care unit (ICU), the existing technologies face the following challenges:

[0004] (a) There is a scarcity of data samples, and the clinical data samples are seriously insufficient. Classical machine learning models are prone to overfitting.

[0005] (b) The individual differences among patients are obvious, and the multivariate relationships among physiological indicators, preoperative status, and postoperative status are complex. Traditional machine learning models are difficult to effectively capture the correlation relationships between variables.

[0006] Large language models have shown significant technological breakthroughs in the field of intensive care medicine, especially in the integration and analysis of multi-source heterogeneous data; based on their powerful semantic understanding and context modeling capabilities, large language models can not only identify the potential associations between structured data (such as vital signs, laboratory indicators) and unstructured text (such as clinical reports), but also construct complex clinical relationship networks in a data-driven manner to assist doctors in risk stratification and prognostic assessment; however, traditional large language models mainly rely on unstructured text data and have certain limitations in complex medical prediction tasks, such as being unable to understand the complex dependency relationships between structured data and lacking sensitivity to variable numerical data.

[0007] To solve the above problems, multi-model fusion is one of the effective solutions. It has been proven that in small-sample tasks, the multi-model fusion strategy combining multiple large language models can achieve considerable prediction accuracy; the multi-model fusion method can effectively improve the utilization degree of data under limited sample conditions, thereby improving the AUROC index for predicting the length of stay of patients in the ICU ward. Summary of the Invention

[0008] To overcome the deficiencies of the prior art, the present invention provides a method for predicting the length of stay in the ICU, a corresponding device, an electronic device, and a computer-readable storage medium.

[0009] The technical solution of the present invention to solve the above technical problems is as follows:

[0010] A method for predicting the length of stay in the ICU, comprising the following steps:

[0011] Step S1: Obtain the original data from the electronic medical records or the medical data center of the patients transferred to the ICU after surgery, and organize the original data to form tabular data;

[0012] Step S2: Preprocess the tabular data of the patients, and group the preprocessed data according to the principle of multi-fold cross-validation to construct a training set and a test set;

[0013] Step S3: Design a prompt template for the task of predicting the length of stay in the ICU, and combine the prompt template to use a large language model to reason about the preprocessed tabular data to obtain the prediction probability of the ICU length of stay prediction task;

[0014] Step S4: Construct a first classifier and a second classifier, input the preprocessed tabular data in Step S2 into the constructed first classifier to obtain a first prediction result; input the prediction probability predicted by the large language model in Step S3 into the constructed second classifier to obtain a second prediction result;

[0015] Step S5: Quantitatively evaluate the two factors of distribution drift and prediction uncertainty, and construct an adaptive fusion model; input the first prediction result and the second prediction result into the constructed adaptive fusion model, and the adaptive fusion model adaptively updates the weight parameters and fuses the first prediction result and the second prediction result to obtain the final prediction result.

[0016] A preferred embodiment of the present invention, in Step S1, the tabular data includes the physiological index parameters, biochemical index parameters, medical history information, and demographic information of the patients.

[0017] A preferred embodiment of the present invention, in Step S2, the preprocessing includes a first preprocessing and a second preprocessing; the first preprocessing is used to preprocess the tabular data sent to the first classifier; the second preprocessing is used to preprocess the tabular data sent to the large language model; wherein,

[0018] The first preprocessing includes the following steps:

[0019] Step S201: According to the input requirements of the model, convert the unit object data of complex types into categorical data and numerical data, and recode the categorical data into an enumeration type or a categorical variable;

[0020] Step S202: Eliminate the samples with missing values in the tabular data;

[0021] Step S203: Use the Fisher discriminant analysis method to screen the variables in the tabular data with the aim of maximizing the between-class difference and minimizing the within-class difference;

[0022] Step S204: Randomly shuffle the preprocessed sample data multiple times and divide it into a training set and a test set according to a certain proportion;

[0023] The second preprocessing includes the following steps:

[0024] Step S211: According to the input requirements of the model, convert the unit object data of complex types into categorical data and numerical data, and recode the categorical data into an enumeration type or a categorical variable;

[0025] Step S212: Eliminate the samples with missing values in the tabular data;

[0026] Step S213: Select a large language model to screen the variables in the tabular data, convert all variables into natural text, instruct the large language model to screen out the important variables among them, and output the selected variable screening results;

[0027] Step S214: Randomly shuffle the preprocessed sample data multiple times and divide it into a training set and a test set according to a certain proportion.

[0028] In a preferred embodiment of the present invention, in step S3, the prompt template consists of four parts: role, task, instruction, and patient data. Among them, the role part instructs the large language model to act as an ICU doctor, and the specific scenario is designed to predict the likelihood of a patient leaving the ICU ward after 24h, 48h, and 72h based on existing demographic characteristics, medical history, laboratory test results, and pathological findings; the task part requires the large language model to predict the likelihood of a patient staying in the ICU ward for more than 24h, 48h, and 72h; the instruction part requires the output of the large language model to meet a preset format; the patient data part represents that the large language model performs the conversion of the tabular data after the second preprocessing into natural language.

[0029] In a preferred embodiment of the present invention, the large language model is one or more of Grok, ERNIE Bot, DeepSeek, ChatGPT, Gemini, and Claude.

[0030] In a preferred embodiment of the present invention, in step S4, the first classifier is one of LR, XGBoost, and AMFormer; the second classifier is LR.

[0031] In a preferred embodiment of the present invention, in step S5, the adaptive fusion step of the adaptive fusion model is as follows:

[0032] Step S501: Use the first classifier to train and test the training set and test set after the first preprocessing, and obtain the training and test ;

[0033] ;

[0034] Where: and are the training and test respectively; and are the training set samples and test set samples obtained after the first preprocessing respectively; is all the features in the training set sample , that is ; represents all the features in the test set sample , that is ; and represent the number of samples in the training set and test set respectively;

[0035] Step S502: Use the second classifier to train and test the training set and test set of the prediction probabilities predicted by the large language model, and obtain the training and test ;

[0036] ;

[0037] Where: and are the training and test respectively; and are the training set samples and test set samples of the prediction probabilities predicted by the large language model respectively; is all the features in the training set sample , that is ; represents all the features in the test set sample a feature, namely ; and respectively represent the number of samples in the training set and the test set;

[0038] Step S503: Calculate the average value of the sum of the training from each training sample in the training set of the first classifier and the second classifier to the training of all training samples;

[0039] ;

[0040] In the formula: and are respectively the training dispersions of the training of the first classifier and the second classifier;

[0041] Step S504: Calculate the sum of the test from each test sample in the test set of the first classifier and the second classifier to the test of all test samples;

[0042] ;

[0043] In the formula: and are respectively the test dispersions of the test of the first classifier and the second classifier;

[0044] Step S505: Normalize and in Step S504;

[0045] ;

[0046] Step S506: Calculate the prediction confidence;

[0047] ;

[0048] In the formula: represents the prediction probability of test set sample j; represents the entropy of test set sample j. The higher the entropy, the worse the confidence; represents the maximum value of the entropy of the output result of the first classifier and the entropy of the output result of the second classifier in test sample j; and respectively represent the importance degrees / confidences of the first classifier and the second classifier obtained based on the prediction entropy; (the smaller the entropy, the larger the value of the numerator, indicating that the uncertainty of the model prediction result is smaller and the obtained confidence is higher).

[0049] Step S506: Fuse the first prediction result of the first classifier and the second prediction result of the second classifier:

[0050] ;

[0051] ;

[0052] In the formula: is the first prediction result output by the first classifier; is the second prediction result output by the second classifier; is the final prediction result.

[0053] An ICU ward stay time prediction device, comprising:

[0054] A data acquisition module, configured to acquire the original data recorded after the patient enters the ICU ward from the patient's electronic medical record or the medical data center;

[0055] A data processing module: configured to perform data processing on the acquired original data of the patient, and divide the processed data to obtain a training set and a test set; and is also configured to design a prompt word template according to a specific scenario, convert the tabular data into natural language according to the prompt word template, input it into the large language model for inference, and obtain the prediction probability;

[0056] A model construction and training module: construct a first classifier for training and testing the preprocessed tabular data and a second classifier for training and testing the prediction probability after the large language model inference, and respectively train and test the first classifier and the second classifier to obtain the training and test results;

[0057] A model fusion module: fuse the first prediction result of the first classifier and the second prediction result of the second classifier through the constructed adaptive fusion model to obtain the final prediction result.

[0058] An electronic device, comprising a central processing unit and a memory, where the central processing unit is configured to call and run a computer program stored in the memory to execute the steps of the ICU ward stay time prediction method as described above.

[0059] A computer-readable storage medium stores a computer program implemented according to the ICU length of stay prediction method in the form of computer-readable instructions. When the computer program is called and run by a computer, it executes the steps included in the corresponding method.

[0060] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0061] The ICU length of stay prediction method of the present invention realizes the effective fusion of multi-modal data by combining a large language model guided by medical knowledge and a classical machine learning model, forming complementarity between models, so as to achieve more stable and accurate prediction on small sample tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of the ICU length of stay prediction method of the present invention.

[0063] Figure 2 It is a model architecture diagram of the ICU length of stay prediction method of the present invention.

[0064] Figure 3 It is a model structure diagram of the adaptive fusion model.

[0065] Figure 4 It is a schematic diagram of the prompt template.

[0066] Figure 5 It is a comparison result diagram of AUROC under using different types of large language models and integrated large language models.

[0067] Figure 6 It is a comparison result diagram of AUROC using different types of first classifiers.

[0068] Figures 7 - 9 They are respectively the feature diagrams of the top 20 important features obtained by the LR classifier using the SHAP method, where Figure 7 is 24h, Figure 8 is 48h, Figure 9 is 72h.

[0069] Figures 10 - 12 They are respectively the feature diagrams of the top 20 important features obtained by the XGBoost classifier using the SHAP method, where Figure 10 is 24h, Figure 11 is 48h, Figure 12 is 72h.

[0070] Figures 13 - 15 They are respectively the feature diagrams of the top 20 important features obtained by the AMFormer classifier using the SHAP method, where Figure 13 is 24h, Figure 14is 48h, Figure 15 is 72h.

[0071] Figure 16 is the structural block diagram of the ICU ward stay time prediction device of the present invention.

[0072] Figure 17 is the structural schematic diagram of the computer device of the present invention. Detailed implementation manners

[0073] The present invention will be further described in detail below in conjunction with embodiments and the accompanying drawings, but the implementation manners of the present invention are not limited thereto.

[0074] See Figures 1 - 9 , the ICU ward stay time prediction method of the present invention includes the following steps:

[0075] Step S1: Obtain raw data from the electronic medical records or medical data center of patients transferred to the ICU ward after surgery, and organize the raw data to form tabular data;

[0076] Specifically, the data set used in this embodiment is a data set collected and organized for the postoperative monitoring and treatment of tumor resection and ICU treatment in the hospital; the data collected includes structured data and unstructured data, where the structured data includes demographic characteristics and physiological and biochemical index data of patients; the unstructured data includes medical history, CT scans and pathology reports.

[0077] Step S2: Preprocess the tabular data of the patient, and group the preprocessed data according to the principle of multi-fold cross-validation to construct a training set and a test set;

[0078] Assume that each row of the table represents a sample and each column represents a categorical feature or a numerical feature; in this embodiment, the preprocessing includes a first preprocessing (i.e., preprocessing 1) and a second preprocessing (i.e., preprocessing 2); the first preprocessing is used to preprocess the tabular data sent to the first classifier; the second preprocessing is used to preprocess the tabular data sent to the large language model; where

[0079] The first preprocessing includes the following steps:

[0080] Step S201: According to the input requirements of the model, convert the complex type of unit object data into categorical data and numerical data, and re-encode the categorical data into an enumerated type or a categorical variable (for example, using one-hot encoding);

[0081] Step S202: Eliminate the samples with missing values in the tabular data;

[0082] Step S203: using Fisher Discriminant Analysis to maximize inter-class differences and minimize intra-class differences, and to screen the variables in the table data to reduce redundant features;

[0083] Step S204: The preprocessed sample data is randomly shuffled multiple times to prevent abnormal prediction results from small samples under accidental division, thereby ensuring the stability of the method; and divided into training set and test set in proportion; for example, 90% training set and 10% test set; in addition, the divided training set can be divided again to obtain training set and verification set.

[0084] The second pretreatment comprises the following steps:

[0085] Step S211: according to the input requirements of the model, convert the complex type unit object data into categorical data and numerical data, and re-encode the categorical data into an enumeration type or a categorical variable (for example, using one-hot encoding);

[0086] Step S212: Eliminate missing samples in the table data;

[0087] Step S213: Select a large language model (such as ChatGPT) to screen the variables in the table data, convert all variables into natural text, instruct the large language model to screen out the important variables, and output the screened variable selection;

[0088] Step S214: The preprocessed sample data is randomly shuffled multiple times to prevent abnormal prediction results due to accidental division of small samples and ensure the stability of the method; and divided into training set and test set in proportion; for example, 90% training set and 10% test set; in addition, the divided training set can be divided again to obtain training set and verification set.

[0089] Step S3: designing a prompt word template for the ICU ward stay time prediction task, combining the prompt word template, using the large language model to infer the preprocessed table data, and obtaining the prediction probabilities of the ICU ward stay time prediction tasks for three patients (i.e., greater than 24h, 48h, and 72h);

[0090] Specifically, a large language model (such as ChatGPT) is used to standardize the collected medical records and pathological findings and translate them into English; at the same time, predefined prompt word templates are used.

[0091] like Figure 4As shown, the designed prompt template consists of four parts: role, task, instruction, and patient data. Among them, the role part instructs the large language model to act as an ICU doctor. The specific scenario is designed to predict the likelihood of a patient leaving the ICU ward after 24 hours, 48 hours, and 72 hours based on existing demographic characteristics, medical history, laboratory test results, and pathological findings; the task part requires the large language model to predict the likelihood of a patient staying in the ICU ward for more than 24 hours, 48 hours, and 72 hours; the instruction part requires the output of the large language model to meet a preset format; the patient data part indicates that the large language model performs the conversion of the second preprocessed tabular data into natural language.

[0092] In this embodiment, the selectable large language models include Grok, Wenxin Yiyan, DeepSeek, ChatGPT, Gemini, Claude, etc.; three large language models are selected in this embodiment, and the specific models are GPT-4o, Gemini-2.0-Flash-thinking, and Claude-3.5-Sonnet.

[0093] According to the second preprocessed tabular data and the designed prompt template, the sample data is converted into a text sequence and input into the selected large language model, and the prediction probabilities of the large language model for the patient leaving the ICU ward after 24 hours, 48 hours, and 72 hours are recorded and concatenated.

[0094] Step S4: Construct a first classifier and a second classifier. Input the tabular data preprocessed in step S2 into the constructed first classifier to obtain a first prediction result; input the prediction probabilities predicted by the large language model in step S3 into the constructed second classifier to obtain a second prediction result;

[0095] For the first preprocessed tabular data, in this embodiment, one of three classic machine learning models (LR, XGBoost, and AMFormer) is selected as the first classifier to determine the potential pattern between the patient's clinical data and the state of the ICU ward stay time.

[0096] For the second preprocessed tabular data, LR is used as the second classifier in this embodiment to integrate the prediction results of different large language models.

[0097] Step S5: Quantitatively evaluate the two factors of distribution drift and prediction uncertainty, and construct an adaptive fusion model; input the first prediction result and the second prediction result into the constructed adaptive fusion model. The adaptive fusion model adaptively updates the weight parameters and fuses the first prediction result and the second prediction result to obtain a final prediction result.

[0098] In this embodiment, the prediction uncertainty can be measured by the difference in prediction probabilities of different classes in the same classifier or by the difference between the prediction probabilities in different classifiers.

[0099] As Figure 3 shown, the present invention uses the existing prediction entropy to measure the prediction uncertainty, which belongs to the difference between the prediction probabilities in different classifiers; during the fusion process, the model parameters of the first classifier and the second classifier are fixed.

[0100] The adaptive fusion step of the adaptive fusion model is as follows:

[0101] Step S501: Use the first classifier to train and test the training set and the test set after the first preprocessing, and obtain the training and the test ;

[0102] ;

[0103] In the formula: and are the training and the test respectively; and are the training set samples and the test set samples obtained after the first preprocessing respectively; is all the features in the training set sample , that is ; represents all the features in the test set sample , that is ; and represent the number of samples in the training set and the test set respectively;

[0104] Step S502: Use the second classifier to train and test the training set and the test set of the prediction probabilities predicted by the large language model, and obtain the training and the test ;

[0105] ;

[0106] In the formula: and are the training and the test respectively; and are the training set samples and the test set samples of the prediction probabilities predicted by the large language model (the data division is the same as the first preprocessing); For the training set samples all in the number of features, namely ; Indicates the test set samples all in the number of features, namely ; and respectively represent the number of samples in the training set and the test set;

[0107] In this embodiment, in the task of predicting the length of stay in 3 ICU wards, the interpretable method SHAP is used to interpret the trained first classifier, and the top 20 features in terms of importance are obtained. Among them,

[0108] The first classifier using LR obtains the top 20 features in terms of importance as shown in Figures 7 - 9 shown, where Figure 7 is 24h, Figure 8 is 48h, Figure 9 is 72h.

[0109] The first classifier using XGBoost obtains the top 20 features in terms of importance as shown in Figures 10 - 12 shown, where Figure 10 is 24h, Figure 11 is 48h, Figure 12 is 72h.

[0110] The first classifier using AMFormer obtains the top 20 features in terms of importance as shown in Figures 13 - 15 shown, where Figure 13 is 24h, Figure 14 is 48h, Figure 15 is 72h.

[0111] Step S503: Calculate the average value of the sum of the Gaussian distances from the training of each training sample in the training set of the first classifier to the training of all training samples;

[0112] ;

[0113] In the formula, and are the training dispersions of the training of the first classifier and the second classifier respectively; and The larger, the more it indicates the training of the first classifier and the training The higher the degree of aggregation in the training set, that is, the smaller the degree of dispersion in the training set; conversely, the lower the degree of aggregation in the training set, that is, the greater the degree of dispersion in the training set.

[0114] In addition, the hyperparameter controls the local degree of the Gaussian distance. , The larger and are, the more sensitive they are to the difference between values; conversely, they are less sensitive.

[0115] Step S504: Calculate the Gaussian distance sum of each test sample in the test sets of the first classifier and the second classifier from to for all test samples.

[0116] ;

[0117] In the formula: and are the test set dispersions of the first classifier and the second classifier respectively.

[0118] Step S505: Normalize and in Step S504.

[0119] ;

[0120] In the formula: and The larger they are, the closer the test is to the training , the higher the degree of distribution consistency, and the smaller the generalization risk of the first classifier or the second classifier.

[0121] Step S506: Calculate the prediction confidence.

[0122] ;

[0123] In the formula: represents the prediction probability of test set sample j. represents the entropy of test set sample j. The higher the entropy, the worse the confidence. represents the entropy of the output result of the first classifier in test sample j. and is the maximum value of the entropy of the output result of the second classifier. and respectively represent the importance degrees / confidences of the first classifier and the second classifier obtained based on the prediction entropy; (the smaller the entropy, the larger the value of the numerator, indicating that the uncertainty of the model prediction result is smaller and the obtained confidence is higher).

[0124] The hyperparameters in the formula control the influence of the prediction entropy on the prediction confidence.

[0125] Step S506: Fuse the first prediction result of the first classifier and the second prediction result of the second classifier:

[0126] ;

[0127] ;

[0128] In the formula: is the first prediction result output by the first classifier; is the second prediction result output by the second classifier; is the final prediction result.

[0129] The hyperparameters of the adaptive fusion model and are determined by cross-validation. In this embodiment, through the grid search method, the optimal hyperparameters and are selected within the value ranges of the hyperparameters and ; The weights of the first classifier and the second classifier are determined by the product of their difference degrees and confidences; if a certain model (i.e., the first classifier and the second classifier) is reliable and stable in predicting sample j, the weight is larger; the final prediction result is the weighted average of the first prediction result of the first classifier and the second prediction result of the second classifier, and the sum of the weights after normalization is 1 to ensure that the result is within a reasonable range.

[0130] The following are the specific implementation manners in this embodiment:

[0131] First, use the data of 412 patients collected by the hospital to construct a dataset; secondly, through the prediction tasks of the residence time in 3 ICU wards, that is, whether the residence time in the ICU ward is greater than 24 hours, whether it is greater than 48 hours, and whether it is greater than 72 hours; separately use ChatGPT, Gemini, Claude and the integration of 3 large language models (that is, linearly regress the prediction results of ChatGPT, Gemini, and Claude three large language models through the second classifier to obtain the final prediction result) for prediction; separately use one of the machine learning models LR, XGBoost and AMFormer for prediction; use the prediction results of the machine learning model and the prediction results of the large language model for adaptive fusion and make predictions.

[0132] As Figure 5 shown, the AUROC metric of integrating and using three large language models is better than using only one of them. In the prediction tasks of whether the length of stay in the ICU ward is greater than 24 hours, greater than 48 hours, and greater than 72 hours, the AUROC metrics are 0.628, 0.6816, and 0.6731 respectively; compared with the AUROC metrics of the sub-optimal Claude model, which are 0.5977, 0.6730, and 0.6661, there are improvements of 0.007, 0.0086, and 0.0303 respectively.

[0133] As Figure 6 shown, the prediction results obtained by the adaptive fusion model of the present invention are all better than those obtained without using the adaptive fusion model; in the prediction task of whether the length of stay in the ICU ward is greater than 24 hours, the best prediction result is the result of the fusion of XGBoost and the large language model, and the AUROC metric is improved from 0.6789 before fusion to 0.6827; in the prediction task of whether the length of stay in the ICU ward is greater than 48 hours, the best prediction result is the result of the fusion of XGBoost and the large language model, and the AUROC metric is improved from 0.6894 before fusion to 0.6949; in the prediction task of whether the length of stay in the ICU ward is greater than 72 hours, the best prediction result is the result of the fusion of AMFormer and the large language model, and the AUROC metric is improved from 0.7546 before fusion to 0.7644.

[0134] Based on any embodiment of the present invention, please refer to Figure 16 , another embodiment of the present invention further provides a prediction device for the length of stay in the ICU ward, which includes:

[0135] A data acquisition module, configured to acquire the original data recorded after the patient enters the ICU ward from the patient's electronic medical record or medical data center;

[0136] A data processing module: configured to perform data processing on the acquired original data of the patient, and divide the processed data to obtain a training set and a test set; and is also configured to design a prompt word template according to a specific scenario, convert the tabular data into natural language according to the prompt word template, and input it into the large language model for inference to obtain a prediction probability;

[0137] A model construction and training module: constructs a first classifier for training and testing the preprocessed tabular data and a second classifier for training and testing the prediction probability after the inference of the large language model, and respectively trains and tests the first classifier and the second classifier to obtain training and test results;

[0138] Model fusion module: The first prediction result of the first classifier and the second prediction result of the second classifier are fused through the constructed adaptive fusion model to obtain the final prediction result.

[0139] Based on any embodiment of the present invention, please refer to Figure 17 , another embodiment of the present invention further provides an electronic device, and the electronic device can be implemented by a computer device.

[0140] As Figure 17 shown, it is a schematic internal structure diagram of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected through a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The control information sequence can be stored in the database. When the computer-readable instructions are executed by the processor, the processor can implement a method for predicting the length of stay in the ICU ward. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device can store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the method for predicting the length of stay in the ICU ward of the present invention. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art can understand that Figure 16 the structure shown in

[0141] is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0142] The present invention further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, one or more processors are caused to execute the steps of the method for predicting the length of stay in the ICU ward according to any embodiment of the present invention.

[0143] The present invention further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by one or more processors, the steps of the method for predicting the length of stay in the ICU ward according to any embodiment of the present invention are implemented.

[0144] Those of ordinary skill in the art can understand that all or part of the processes in the above-described embodiments of the method of the present invention can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-described embodiments of each method. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0145] The above are the preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above content. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.

Claims

1. A method for predicting ICU ward stay time, characterized in that: The following steps are involved: Step S1: obtaining original data from the electronic medical records or medical data center of patients transferred to the ICU ward after surgery, and organizing the original data to form tabular data; Step S2: preprocessing the patient's tabular data, and grouping the preprocessed data according to the multi-fold cross-validation principle to construct a training set and a test set; Step S3: designing a prompt word template for the ICU ward stay time prediction task, combining the prompt word template, using a large language model to infer the preprocessed table data, and obtaining the prediction probability of the ICU stay time prediction task; Step S4: construct a first classifier and a second classifier, input the preprocessed table data in step S2 into the constructed first classifier to obtain a first prediction result; input the predicted probability obtained by the large language model prediction in step S3 into the constructed second classifier to obtain a second prediction result; Step S5: quantitatively evaluate the two factors of distribution drift and prediction uncertainty, and construct an adaptive fusion model; input the first prediction result and the second prediction result into the constructed adaptive fusion model, the adaptive fusion model adaptively updates the weight parameters, and fuses the first prediction result and the second prediction result to obtain the final prediction result.

2. The ICU ward stay time prediction method according to claim 1, characterized in that: In step S1, the table data includes the patient's physiological index parameters, biochemical index parameters, medical history information and demographic information.

3. The ICU ward stay time prediction method according to claim 1, characterized in that: In step S2, the preprocessing includes a first preprocessing and a second preprocessing; the first preprocessing is used to preprocess the tabular data sent to the first classifier; the second preprocessing is used to preprocess the tabular data sent to the large language model; wherein, The first pre-processing comprises the following steps: Step S201: according to the input requirements of the model, convert the complex type unit object data into categorical data and numerical data, and recode the categorical data into enumeration type or classification variable; Step S202: Eliminate missing samples in the table data; Step S203: using the Fisher discriminant analysis method to screen the variables in the table data with the purpose of maximizing the difference between classes and minimizing the difference within classes; Step S204: randomly shuffle the preprocessed sample data for multiple times, and divide them into a training set and a test set in proportion; The second pretreatment comprises the following steps: Step S211: according to the input requirements of the model, convert the complex type unit object data into categorical data and numerical data, and recode the categorical data into enumeration type or classification variable; Step S212: Eliminate missing samples in the table data; Step S213: select a large language model to screen the variables in the table data, convert all the variables into natural text, instruct the large language model to screen out the important variables, and output the screened variable selection; Step S214: randomly shuffle the preprocessed sample data for multiple times, and divide them into training sets and test sets in proportion.

4. The ICU ward stay time prediction method according to claim 3, characterized in that: In step S3, the prompt word template consists of four parts: role, task, instruction and patient data. The role part instructs the large language model to act as an ICU doctor. The specific scenario is designed to predict the possibility of the patient leaving the ICU ward after 24h, 48h and 72h based on the existing demographic characteristics, medical history, laboratory test results and pathological findings; the task part requires the large language model to predict the possibility of the patient staying in the ICU ward for more than 24h, 48h and 72h; the instruction part requires the output of the large language model to meet the preset format; the patient data part indicates that the large language model executes the conversion of the second preprocessed tabular data into natural language.

5. The ICU ward stay time prediction method according to claim 1, characterized in that: In step S3, the large language model is one or more of Grok, Wenxinyiyan, DeepSeek, ChatGPT, Gemini, and Claude.

6. The ICU ward stay time prediction method according to claim 1, characterized in that: In step S4, the first classifier is one of LR, XGBoost and AMFormer; the second classifier is LR.

7. The ICU ward stay time prediction method according to claim 5, characterized in that: In step S5, the adaptive fusion steps of the adaptive fusion model are: Step S501: Use the first classifier to train and test the training set and the test set after the first preprocessing to obtain the training set. and test ; ; Where: and Training and test ; and are respectively the training set samples and the test set samples obtained after the first preprocessing; For training set samples All Features, namely ; Represents the test set samples All Features, namely ; and Represent the number of samples in the training set and the test set respectively; Step S502: Use the second classifier to train and test the training set and test set of the predicted probability obtained by the large language model to obtain the training set. and test ; ; Where: and Training and test ; and They are respectively the training set samples and test set samples of the predicted probabilities predicted by the large language model; For training set samples All Features, namely ; Represents the test set samples All Features, namely ; and Represent the number of samples in the training set and the test set respectively; Step S503: Calculate the training probability of each training sample in the training set of the first classifier and the second classifier respectively. Training to all training samples The average of the sum of Gaussian distances; ; Where: and The training of the first classifier and the second classifier are The training concentration of Step S504: Calculate the test value of each test sample in the test set of the first classifier and the second classifier respectively. Tests on all test samples The sum of the Gaussian distances of ; Where: and The tests for the first and second classifiers are The test concentration of Step S505: and To standardize; ; Step S506: Calculate the confidence of the prediction; ; Where: represents the predicted probability of sample j in the test set; Represents the entropy of the test set sample j. The higher the entropy, the worse the confidence. Represents the entropy of the output result of the first classifier in the test sample j and the entropy of the output of the second classifier The maximum value of and Respectively represent the importance / confidence of the first classifier and the second classifier based on the predicted entropy; Step S506: Fusing the first prediction result of the first classifier and the second prediction result of the second classifier: ; ; Where: A first prediction result output by the first classifier; A second prediction result output by the second classifier; The final prediction result.

8. An ICU ward stay time prediction device using the ICU ward stay time prediction method according to any one of claims 1 to 7, characterized in that: include: A data acquisition module is used to obtain the original data recorded after the patient enters the ICU ward from the patient's electronic medical record or medical data center; Data processing module: used to process the original data of the patients obtained, and divide the processed data to obtain training sets and test sets; it is also used to design prompt word templates according to specific scenarios, convert the table data into natural language according to the prompt word template, input it into the large language model for reasoning, and obtain the prediction probability; Model building and training module: building a first classifier for training and testing preprocessed tabular data and a second classifier for training and testing the predicted probability after inference of the large language model, and training and testing the first classifier and the second classifier respectively to obtain training and testing results; Model fusion module: The first prediction result of the first classifier and the second prediction result of the second classifier are fused through the constructed adaptive fusion model to obtain the final prediction result.

9. An electronic device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run a computer program stored in the memory to execute the steps of the ICU ward stay time prediction method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: It stores a computer program implemented according to the ICU ward stay time prediction method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.