A method and system for predicting the risk of postoperative delirium in elderly patients based on machine learning
By integrating multidimensional features and model interpretability analysis through machine learning, a risk prediction model for postoperative delirium in elderly patients was constructed. This solved the problems of insufficient accuracy and poor interpretability in traditional methods, and enabled efficient prediction and individualized intervention for postoperative delirium.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF ELECTRONICS SCI & TECH OF CHINA
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies lack a systematic integration of multidimensional features throughout the perioperative period in predicting delirium after hip and knee replacement surgery in elderly patients. Traditional methods are insufficient in accuracy and generalization ability, and lack effective model interpretability analysis, making it difficult to support individualized intervention.
Using a machine learning-based approach, a model for predicting postoperative delirium risk in elderly patients was constructed by combining various feature selection algorithms and classifiers with random search and cross-validation to optimize hyperparameters. The model integrates preoperative, intraoperative, and postoperative clinical characteristics and provides interpretive analysis.
It significantly improved the predictive accuracy of postoperative delirium, enhanced the predictive ability of delirium after joint replacement surgery, supported individualized intervention and clinical decision-making, and reduced the incidence of delirium.
Smart Images

Figure CN122369926A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and medical clinical decision support, specifically to a machine learning-based system for predicting the risk of postoperative delirium in elderly patients. Background Technology
[0002] With the accelerating aging of the population, the incidence of degenerative osteoarthritis is increasing year by year. Among them, postoperative delirium after hip and knee replacement surgery is a common and serious complication in elderly patients, with an incidence rate as high as 61% and 48%, respectively. It not only significantly affects patient prognosis but also increases the medical burden and treatment costs. Postoperative delirium mainly manifests as postoperative cognitive impairment, memory loss, sensory abnormalities, and sleep-wake rhythm disorders. Its pathogenesis is not yet clear, and there are currently no effective targeted treatments. Perioperative prevention is considered a key strategy to reduce its risk.
[0003] Although existing research has explored postoperative delirium, current methods mostly rely on traditional statistical analysis or are limited to studies of single surgical procedures, lacking a systematic integration of multidimensional characteristics throughout the perioperative period. The main technical bottlenecks are as follows: (1) Traditional regression analysis methods have limited ability to process perioperative data with high dimensionality, nonlinearity and multi-factor interaction, and it is difficult to screen key predictors from a large number of potential variables. The constructed models are insufficient in terms of accuracy and generalization ability. (2) In traditional methods, feature selection and model training are often carried out independently in separate steps: first, a fixed subset of features is selected based on all samples, and then this subset is input into different models for training. This approach not only leads to overly optimistic performance evaluation due to the premature leakage of test information, but also means that for a specific classifier, the fixed feature combination may not achieve the best performance. Other unselected feature combinations may actually achieve better performance. (3) The lack of effective means of model interpretability analysis makes it difficult to intuitively reveal the direction and degree of influence of each risk factor on the occurrence of postoperative delirium, making it difficult for clinicians to understand the basis of model decision-making, thus limiting its practical application in perioperative individualized intervention. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes a machine learning-based method for predicting postoperative delirium risk in elderly patients. By comparing combinations of various feature selection algorithms and classifiers, and employing random search and cross-validation, the optimal hyperparameters are determined, ultimately achieving early and accurate prediction of delirium after hip or knee replacement surgery in elderly patients. The technical solution of this invention is as follows: Figure 1 As shown, it includes the following steps: S1. Obtain perioperative data of the patient to be predicted, including clinical indicators in the preoperative, intraoperative and postoperative stages; S2. Preprocess and perform preliminary feature filtering on the acquired perioperative data to obtain a structured feature set, specifically including: S21. Patient inclusion and exclusion: The inclusion criteria are patients aged 60 years or older who have undergone endotracheal intubation and general anesthesia; the exclusion criteria include emergency surgery, non-general anesthesia or non-inhalation intravenous anesthesia, preoperative diagnosis of delirium, and incomplete medical records. S22. Data preprocessing: Numerically encode the classification features, which include gender, smoking history, etc.; delete features unrelated to postoperative delirium, including case establishment timestamps, patient identification, etc.; handle missing values, including deletion, imputation, and special value marking. S23. Redundant feature elimination: Calculate the correlation coefficient between all features. Among multiple features with a correlation coefficient exceeding the threshold, retain the feature that is more strongly correlated with the occurrence of delirium and eliminate the remaining features. S24. Split the dataset: The perioperative data after preprocessing and redundant feature elimination constitutes the dataset; the dataset is divided into training set and test set according to a preset ratio, and k-fold hierarchical cross-validation is further performed on the training set. S3. Construct and optimize a machine learning-based model for predicting the risk of postoperative delirium in elderly patients, specifically including: S31. Pipeline Modeling: For each feature, a method is selected (assuming a total of...). m (types) and each classifier (assuming a total of) n (type) combination to form m×n Modeling pipeline; S32. Hyperparameter Optimization within the Pipeline: For the i-th modeling pipeline, a random search is performed on all hyperparameter combinations. Then, in k-fold hierarchical cross-validation, the optimal hyperparameters are determined with the highest average area under the curve (AUC) as the objective. During the search process, the feature sequences retained by the hyperparameter combinations in each compromise feature selector are recorded simultaneously. S33. Feature stability assessment and stable subset determination: Count the number of occurrences of the feature sequences selected in step S32 in k folds, determine the stable feature subsets and calculate the feature stability score; S34. Optimal pipeline selection: Summarize all pipeline combination results and select the optimal pipeline combination as the final prediction model by combining multiple evaluation indicators, including average AUC, feature stability, DeLong test p-value, F1 score, etc. S4. Train and evaluate the performance of the final prediction model. Retrain the final prediction model selected in step S34 using the complete training set, and evaluate the model performance on the test set divided in step S24. S5. Output the postoperative delirium risk prediction results and provide model interpretation, specifically including: S51. Input the perioperative clinical data of the patient to be evaluated into the final prediction model and output the probability of postoperative delirium risk for early identification and clinical decision support of patients with high risk of postoperative delirium during the perioperative period. S52. The interpretability analysis method is used to quantify the contribution of each candidate variable in the full feature dataset to the model output, and the importance ranking of each feature is obtained to reveal the key factors affecting the occurrence of postoperative delirium and their contribution direction.
[0005] The beneficial effects of this invention are: (1) This invention proposes a machine learning-based method for predicting the risk of postoperative delirium in elderly patients. By cross-validation, the method randomly searches for parameter combinations of various feature selection algorithms and classifiers, selects the optimal hyperparameters and determines the best classification threshold based on various evaluation indicators, thereby systematically improving the model's predictive performance. (2) This invention fully integrates the clinical characteristics of the three major stages of preoperative, intraoperative and postoperative care, and in particular incorporates a large number of intraoperative real-time monitoring indicators, which makes up for the shortcomings of previous methods that neglected intraoperative dynamic factors and significantly enhances the predictive ability of delirium after joint replacement surgery. (3) This invention integrates feature selection and model training into the same cross-validation framework for joint optimization, avoiding the data leakage problem that may be caused by traditional methods; at the same time, it determines the exclusive stable feature subset for different feature selection methods and classifiers, overcoming the limitation that fixed feature combinations are difficult to adapt to all classifiers, so that each model can achieve better performance. (4) This invention can be applied to scenarios such as perioperative risk assessment of elderly patients, early warning of high-risk patients with postoperative delirium, formulation of individualized intervention plans, and clinical auxiliary decision-making system, providing reliable technical support for reducing the incidence of postoperative delirium and optimizing the allocation of medical resources. Attached Figure Description
[0006] Figure 1 This is a flowchart of the machine learning-based method for predicting the risk of postoperative delirium in elderly patients according to the present invention.
[0007] Figure 2 This is a schematic diagram of the structure of the machine learning-based postoperative delirium risk prediction system for elderly patients according to the present invention. The prediction model includes three sub-networks: data preprocessing, internal hyperparameter tuning, optimal pipeline selection, and model evaluation. Detailed Implementation
[0008] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0009] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below. Example
[0010] Reference Figure 2 As a first embodiment of the present invention, a machine learning-based method for predicting the risk of postoperative delirium in elderly patients is provided, the method comprising: S1. Obtain multi-source data of the patient during the perioperative period, including preoperative, intraoperative and postoperative clinical indicators; in this example, all data came from the electronic medical record system, including a total of 131 clinical indicators (48 preoperative, 67 intraoperative and 16 postoperative) for preoperative, intraoperative and postoperative periods; postoperative delirium diagnosis was performed by trained orthopedic nurses using the Nursing Delirium Screening Scale (Nu-DESC) three times a day, and those with a score ≥2 were further confirmed using the Confusion Assessment Method (CAM), and a psychiatrist was consulted if necessary; S2. Perform preprocessing operations on the raw data, specifically including: S21. Patient inclusion and exclusion: The inclusion criteria were patients aged 60 years or older who underwent hip or knee replacement surgery under general anesthesia with endotracheal intubation; the exclusion criteria included emergency surgery, non-general anesthesia or non-inhalation intravenous anesthesia, preoperative diagnosis of delirium, and incomplete medical records; in this case, a total of 812 samples were included, of which 143 cases had postoperative delirium and 669 cases had non-postoperative delirium. S22. Data preprocessing: Numerically encode categorical variables such as gender, assigning 0 to males and 1 to females; delete the start time column and patient identification column; delete sample records containing missing values; S23. Redundant Feature Elimination: Calculate the Pearson correlation coefficient among all features. ; in, n x is the total number of samples. ik For the first k The sample at the th i The values of each feature For the first i The mean of each feature; for any two features X i And Xj, if the absolute value of their Pearson correlation coefficient |r ij If |≥0.7, then compare the two with the predicted label. Y The absolute value of the correlation was used to select the feature with the highest correlation and remove the other feature. In this embodiment, after eliminating redundancy, 101 features were retained (including 44 preoperative features, 47 intraoperative features, and 10 postoperative features). S24. Split the dataset: Divide the preprocessed dataset into training and training sets in a 7:3 ratio. D train and test set D test In the training set D train The next step is to perform 5-fold hierarchical cross-validation, which involves randomly dividing the training set into 5 equal-sized subsets. D 1 ~D 5 Each time, four folds are used as the internal training set and one fold as the internal validation set, and this process is repeated five times to ensure that each subset is used as the validation set at least once. For each continuous feature, based on... D train Calculate the mean and standard deviation, respectively. D train and D test Perform Z-score normalization; S3. Construct and optimize a prediction model for postoperative delirium risk in elderly patients, specifically including: S31. Pipeline Modeling: Three feature selection methods and ten classifiers are paired to form 30 modeling pipelines. The feature selection methods include Least Absolute Shrinkage and Selection Operator (LASSO), F-Test, and Recursive Feature Elimination (RFE). The classifiers include Gaussian Naive Bayes (GNB), Adaptive Boosting (AdaBoost), Decision Tree (DT), Random Forest (RF), Gradient Boosting, Extra Trees, Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Bernoulli Naive Bayes (BNB), and Bootstrap aggregating (Bagging). S32. Hyperparameter optimization within the pipeline: For the i-th modeling pipeline, in the training set... D trainUnder the five-fold hierarchical cross-validation framework, a random search strategy is used to fine-tune all hyperparameter combinations for each pipeline, with a maximum number of iterations of 200. During the training process of each fold cross-validation, the hyperparameters are first selected using the features of the current fold. C i Feature selection is performed on the internal training set to identify a corresponding feature subset; subsequently, based on this feature subset, classifier hyperparameters are applied. λ k Train the classifier and calculate evaluation metrics such as AUC on the internal validation set of the fold; after completing all random search iterations, summarize and calculate the average AUC of all hyperparameter combinations, and determine the hyperparameter combination with the highest average AUC as the optimal hyperparameter combination for the pipeline, which will be used for subsequent model training and evaluation. S33. Feature Stability Assessment and Stable Subset Determination: Suppose that the feature subset selected from five folds of a certain pipeline is... S 1 ~ S 5. The Jaccard coefficients between any two pairs of elements are: ; The feature stability score of this pipeline is then the average of the 10 Jaccard coefficients. For each feature, its stability score in the five-fold feature subset is calculated. S 1 ~S The number of times a feature appears in 5, and features that appear at least 3 times are included in the stable feature subset; S34. Optimal Pipeline Selection: Summarize the average AUC of the best hyperparameter combinations for each modeling pipeline, and select the top 10 pipelines with the highest average AUC; from these 10 pipelines, select the top 3 pipelines with the highest Jaccard coefficients; for these 3 pipelines, determine the classification threshold that maximizes the average F1 score within each fold of cross-validation, and compare the maximum F1 scores of the three, selecting the pipeline with the highest maximum F1 score as the final prediction model; this final prediction model includes the corresponding stable feature subset, classifier type, and its optimal hyperparameters; in this embodiment, LASSO+RF is selected as the final prediction model. S4. Train and evaluate the performance of the final prediction model: Retrain the final prediction model determined in step S34 on the training set divided in step S24. Evaluation metrics were calculated on the test set to assess model performance. These metrics included AUC, accuracy, sensitivity, specificity, precision, F1 score, and Matthews Correlation Coefficient (MCC). To evaluate the statistical stability of AUC, the Bootstrap method was used to resample the test set 1000 times with replacement. One AUC value was calculated for each resampling, resulting in 1000 AUC estimates. The 2.5% and 97.5% quantiles were used as the 95% confidence intervals for AUC. In this embodiment, the final prediction model's evaluation metrics on the test set were: AUC = 0.9948, accuracy = 0.9713, recall = 0.9302, specificity = 0.9801, precision = 0.9091, F1 score = 0.9195, and MCC = 0.9021. Bootstrap confidence intervals: AUC 0.9756 [0.9639, 0.9860], AUPRC 0.9129 [0.8704, 0.9486] S5. Output the postoperative delirium risk prediction results and provide model interpretation, specifically including: S51. Input the perioperative clinical data of the patient to be evaluated into the final prediction model and output the probability of postoperative delirium risk for early identification and clinical decision support of patients with high risk of postoperative delirium during the perioperative period. S52. SHAP analysis was employed. For tree models, TreeExplainer was used; for non-tree models, KernelExplainer was used. The SHAP value of each feature was obtained by calculating its marginal contribution to the prediction results. The SHAP values of all samples were aggregated by feature to obtain the importance ranking of each feature, revealing the key factors influencing postoperative delirium and their contribution direction. In this embodiment, the SHAP feature importance ranking showed that age, ASA grade, extubation time, blood glucose at discharge from the PACU, perioperative lymphocyte percentage, vecuronium bromide, etomidate per kilogram, CV, eosinophil fluctuation, and perioperative white blood cell count were the top ten important features. Intraoperative features had a higher influence weight than preoperative and postoperative features. Decision Curve Analysis was used to evaluate the model's clinical net benefit. Within the threshold probability range of 0 to 1, the net benefit of the model at each threshold was calculated and compared with the "no treatment" strategy (net benefit of 0) and the "all treatment" strategy (net benefit is positive rate minus negative rate multiplied by weight). The formula for calculating the net benefit is: ; in, TPThe number of true positives FP The number of false positives N The total number of samples, p t The threshold probability is used. The decision curve can be used to intuitively judge the clinical application value of the model at different thresholds; in this embodiment, the decision curve shows that the net return rate is higher than the full treatment and no treatment lines, and it maintains a high net return rate stably within the threshold range of 0.1-0.5.
[0011] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A machine learning-based method for predicting the risk of postoperative delirium in elderly patients, characterized in that, The risk prediction method includes: S1. Obtain perioperative data of the patient to be predicted, including clinical indicators at the preoperative, intraoperative and postoperative stages; S2. Preprocess and perform preliminary feature screening on the perioperative data to obtain a structured feature set; S3. Construct and optimize a machine learning-based model for predicting postoperative delirium in elderly patients, including at least the following steps: S31. Construct several modeling pipelines based on a combination of multiple feature selection algorithms and multiple classifiers; S32. Within the cross-validation framework, the feature selection hyperparameters and classifier hyperparameters in each of the modeling pipelines are jointly optimized to determine the optimal hyperparameter combination for each of the modeling pipelines. S33. Evaluate the stability of the feature sequences selected by each of the modeling pipelines during the cross-validation process to determine a stable feature subset; S34. Based on the pre-set model performance evaluation indicators, select the final prediction model from several modeling pipelines; S4. Retrain the final prediction model selected in step S34 using the complete training set, and evaluate the model performance on the independent test set. S5. Output the postoperative delirium risk prediction results and provide model interpretation.
2. The method according to claim 1, characterized in that, The preprocessing includes removing redundant features based on correlation analysis between features.
3. The method according to claim 1, characterized in that, The stability of feature selection is evaluated by calculating the similarity between the feature subsets selected in each cross-validation round.
4. The method according to claim 1, characterized in that, The target prediction model includes: determining the final model by combining at least two of the following indicators: area under the curve, feature stability score, and F1 score.
5. The method according to claim 1, characterized in that, The target screening prediction model includes using a model interpretation tool to generate a ranking of the contribution of each clinical indicator to the prediction results.
6. A machine learning-based system for predicting the risk of postoperative delirium, characterized in that, include: (1) Data acquisition module, used to acquire perioperative data of patients to be predicted, including clinical indicators at the preoperative, intraoperative and postoperative stages; (2) Preprocessing module, used to preprocess and feature engineer the perioperative data to obtain a structured feature set; (3) Model building and optimization module, used to: construct several modeling pipelines based on a combination of multiple feature selection algorithms and multiple classifiers; and perform hyperparameter joint optimization of each modeling pipeline within the cross-validation framework; The stability of feature selection is evaluated and the final prediction model is selected by comprehensively considering the model performance indicators; (4) Model testing module, used to evaluate the performance of the final prediction model on the test set; (5) Prediction output module, used to output the postoperative delirium risk prediction result based on the target prediction model and provide model explanation.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 5.