A method for predicting the risk of postoperative complications in a patient with acute abdomen
By constructing an MGA-XGBoost combined prediction model and performing feature importance analysis, the problems of overfitting and insufficient interpretability in the risk assessment of postoperative complications in patients with acute abdomen were solved, achieving more accurate and reliable risk prediction and enhancing its clinical application value.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AFFILIATED HOSPITAL OF CHENGDE MEDICAL COLLEGE
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies for assessing the risk of postoperative complications in patients with acute abdomen suffer from overfitting, poor generalization, and insufficient interpretability, making it difficult to meet the needs of individualized and precise early warning in clinical practice.
The MGA-XGBoost combined prediction model is adopted, and feature variables are screened by combining single-factor and multi-factor analysis. Step-by-step parameter tuning is performed through a moderately greedy algorithm to construct a weighted ensemble model. The SHAP framework is used for feature importance analysis to improve the model's generalization ability and interpretability.
It improves the accuracy and clinical applicability of predicting postoperative complication risks, enhances the interpretability of the model, helps clinicians understand the prediction results, and promotes the transformation of risk warnings into clinical interventions.
Smart Images

Figure CN122158061A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of postoperative complication prediction technology, and in particular to a method for predicting the risk of postoperative complications in patients with acute abdomen. Background Technology
[0002] Acute abdomen is a general term for abdominal diseases characterized by acute abdominal pain and often requiring surgical intervention. It encompasses various conditions such as acute appendicitis, gastrointestinal perforation, and intestinal obstruction. For these patients, timely surgical treatment is crucial to eliminating the cause and saving their lives. However, surgical treatment itself carries the risk of postoperative complications, among which infectious complications (such as surgical site infection, abdominal abscess, and pneumonia) are particularly common and serious.
[0003] Currently, the risk assessment of postoperative complications in patients with acute abdomen in clinical practice mainly relies on the personal experience of surgeons and traditional scoring systems based on some clinical indicators. Although these methods are widely used, they have significant limitations. They depend on subjective experience, leading to large differences in judgment among different doctors, and lack objective and unified quantitative standards. Furthermore, traditional scoring systems are mostly built on linear assumptions, making it difficult to capture and characterize the complex risk relationships that are multidimensional, nonlinear, and highly interactive, such as patient age, underlying diseases, laboratory inflammatory markers, and surgical trauma. Their predictive accuracy and discrimination are limited, making it difficult to meet the needs of personalized and precise early warning in clinical practice.
[0004] With the integration of artificial intelligence and medical big data technologies, machine learning methods have provided powerful new tools for disease risk prediction. Compared to traditional statistical models, machine learning algorithms, such as random forests, support vector machines, and gradient boosting decision trees, can automatically learn complex nonlinear patterns from massive, high-dimensional clinical data, demonstrating potential to surpass traditional methods in the diagnosis and prognosis prediction of various diseases. Previous studies have attempted to apply algorithms such as XGBoost to the prediction of postoperative surgical complications, achieving initial success.
[0005] However, directly applying machine learning models, especially complex ensemble models like XGBoost, to predict postoperative complications in the specific field of acute abdomen still faces a series of serious challenges. First, clinical research on acute abdomen is often limited by single-center sample sizes. Building complex models on limited data is prone to overfitting, resulting in excellent performance on the training set but a sharp drop in generalization performance on new patient populations (validation sets), leading to poor clinical applicability. Second, the model optimization process is cumbersome and unstable. XGBoost contains a large number of hyperparameters that need to be manually tuned. Traditional grid search or random search methods are computationally expensive, and standard greedy hyperparameter tuning strategies are prone to getting trapped in local optima due to error accumulation, making it difficult to obtain robust and high-performance models. Finally, the models lack interpretability. Machine learning models are often regarded as "black boxes," and their predictions lack intuitive clinical evidence, leading to low trust from clinicians and difficulty in translating the risk warnings output by the model into specific clinical intervention decisions.
[0006] Therefore, there is an urgent need for a method designed specifically for patients with acute abdomen, which can effectively balance model performance and generalization ability and has a certain degree of interpretability to predict the risk of postoperative complications, so as to assist clinicians in predicting the probability of postoperative complications in patients with acute abdomen. Summary of the Invention
[0007] To address or partially address the problems existing in related technologies, this application provides a method for predicting the risk of postoperative complications in patients with acute abdomen. The aim is to solve the problems that prediction models for postoperative complications in patients with acute abdomen are prone to overfitting, poor generalization performance, and getting trapped in local optima under single-center limited sample conditions.
[0008] This application provides a method for predicting the risk of postoperative complications in patients with acute abdomen, including: Clinical data of patients with acute abdomen after surgical treatment were collected, including basic patient information, laboratory test indicators, surgery-related information and postoperative complications; missing data were cleaned, continuous variables were normalized, and categorical variables were coded. Risk factor variables associated with postoperative complications were screened from clinical data using univariate and multivariate analyses to construct a set of characteristic variables; Based on the selected feature variables, a risk prediction model for postoperative complications was constructed. The risk prediction model for postoperative complications was based on the XGBoost base model. A moderately greedy algorithm was used to perform step-by-step parameter tuning. Multiple optimal parameter subsets were selected to construct multiple XGBoost sub-models. These sub-models were then combined using a weighted ensemble method to construct the MGA-XGBoost combined prediction model. The MGA-XGBoost combined prediction model was used to predict the probability of postoperative complications in patients and to identify the most important risk factors.
[0009] Optionally, a predictive model for the risk of postoperative complications may be constructed, including: Construct an XGBoost base model, initialize the XGBoost classifier, set the objective function as binary logistic regression, and evaluate the area under the receiver operating characteristic curve (ROC). Configure initial hyperparameters, including learning rate, maximum tree depth, minimum weight of leaf nodes; The XGBoost base model was initially trained using a set of feature variables, and the training process was monitored using an early stopping method to prevent overfitting.
[0010] Optionally, a moderately greedy algorithm can be used for step-by-step parameter tuning, including: Adjust the maximum tree depth and minimum leaf node weights and parameter sets of the XGBoost base model, and evaluate and retain the two optimal parameter combinations from the given search space; Adjust the threshold parameter to minimize loss, and retain the two optimal sets of parameters; Adjust the row sampling ratio and column sampling ratio parameter sets, retaining the two optimal parameter sets; Adjust the L1 regularization weight and L2 regularization weight parameter sets and select the optimal set of parameters; Adjust the learning rate parameter; Determine the number of iterations to improve performance to reach the preset training set performance threshold; Multiple optimal or suboptimal hyperparameter combinations are generated through a step-by-step parameter tuning process.
[0011] Optionally, the final prediction model can be assembled using a weighted integration method, including: Multiple sets of hyperparameters obtained by step-by-step parameter tuning were used to train multiple XGBoost sub-models. Based on the final performance ranking of each sub-model during the optimization process, differentiated weights are assigned to each sub-model. The sub-model with the highest performance ranking has a weight of 2 / 3, the second-ranked model has a weight of 1 / 3, and the weights of subsequent rankings are halved before normalization is performed to obtain a set of normalized weights. The final MGA-XGBoost model is a weighted ensemble of the sub-models.
[0012] Optional, univariate and multivariate analyses include: Univariate analysis was used for initial screening. For each candidate feature variable in the clinical dataset, the association strength and statistical significance between the univariate variable and the postoperative complication outcome were calculated. For continuous variables that conform to a normal distribution, the independent samples t-test was used. For continuous variables that do not conform to a normal distribution, the Mann-Whitney U rank-sum test was used. For categorical variables, the chi-square test or Fisher's exact test was used. Multivariate analysis confirmed that the statistically significant characteristic variables from the univariate analysis were collectively included in a binary logistic regression model for regression analysis. Independent risk factor determination: In a binary logistic regression model, after controlling for the influence of other variables, if a certain characteristic variable still has a significant statistical association with the occurrence of postoperative complications, then that characteristic variable is determined to be an independent risk factor.
[0013] Optional information includes: basic patient information, laboratory test results, surgery-related information, and postoperative complications. Patient basic information: age, gender, body mass index, past medical history; Laboratory indicators: white blood cell count, C-reactive protein, platelets, lymphocytes, neutrophils, albumin, prealbumin; Surgical data: surgical method, operation time, intraoperative blood loss, blood transfusion during operation, and extent of surgical resection; Postoperative complication data: Whether infection, anastomotic leakage, abdominal abscess or pulmonary infection occurred, recorded according to the Clavien-Dindo classification.
[0014] Optional methods for predicting the risk of postoperative complications in patients with acute abdomen include: The constructed MGA-XGBoost model was comprehensively evaluated using an independent validation set. Evaluation metrics included the area under the receiver operating feature curve, accuracy, recall, precision, and F1 score to quantify the model's overall predictive performance. The SHAP framework is used to calculate the contribution of each feature to the model's prediction results, generate a ranking of feature importance, and visualize how key features affect the predicted risk of individual patients, thereby improving the clinical interpretability of the model.
[0015] The technical solution provided in this application may include the following beneficial effects: By constructing an ensemble prediction model based on XGBoost and employing a moderately greedy algorithm for step-by-step parameter tuning, the model more accurately captures nonlinear and high-dimensional risk associations in clinical data of patients with acute abdomen, thereby improving the accuracy of predicting postoperative complication risks. Furthermore, univariate and multivariate analyses are used for feature selection, coupled with an early stop method to monitor the training process, enhancing the model's generalization ability with limited samples, avoiding overfitting, and improving clinical applicability. The SHAP framework is used for feature importance analysis and visualization, clearly demonstrating the contribution of each risk factor to the prediction results for individual patients, helping clinicians understand the model's decision-making basis, increasing trust in the prediction results, and promoting the transformation of risk warnings into clinical interventions.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0018] Figure 1 This is a flowchart illustrating a method for predicting the risk of postoperative complications in patients with acute abdomen, as shown in an embodiment of this application. Detailed Implementation
[0019] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0020] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0021] In some implementations, see Figure 1 A method for predicting the risk of postoperative complications in patients with acute abdomen, comprising: S101. Collect clinical data of patients with acute abdomen after surgical treatment, including basic patient information, laboratory test indicators, surgery-related information and postoperative complications; clean missing data, normalize continuous variables, and encode categorical variables. Specifically, basic patient information includes age, gender, body mass index, and past medical history; laboratory indicators include white blood cell count, C-reactive protein, platelets, lymphocytes, neutrophils, albumin, and prealbumin; surgical data includes surgical procedure, operation time, intraoperative blood loss, blood transfusion during operation, and extent of surgical resection; postoperative complication data records whether the patient develops infectious complications within 30 days after surgery, including incision infection, abdominal infection, pulmonary infection, and anastomotic leakage, and classifies the severity according to the Clavien-Dindo classification, defining grade II and above complications as positive events.
[0022] Data cleaning involves removing variables with a missing rate greater than 10%, imputing the mean / median for continuous variables, and winsorizing outliers.
[0023] Data standardization was performed: continuous variables were normalized using Z-scores; categorical variables were encoded using One-hot encoding and converted into binary vectors.
[0024] Stratified random sampling was used, with the occurrence of complications as the stratification basis. The total dataset was randomly divided into a training set and an independent validation set in a 7:3 ratio to ensure that the proportion of positive samples in both sets was consistent.
[0025] S102. Screen risk factor variables associated with postoperative complications from clinical data through univariate and multivariate analysis, and construct a set of characteristic variables; Specifically, univariate analysis and multivariate analysis include: Univariate analysis was used for initial screening. For each candidate feature variable in the clinical dataset, the association strength and statistical significance between the univariate variable and the postoperative complication outcome were calculated. For continuous variables that conform to a normal distribution, the independent samples t-test was used. For continuous variables that do not conform to a normal distribution, the Mann-Whitney U rank-sum test was used.
[0026] For categorical variables, the chi-square test or Fisher's exact test is used. When the expected frequency is <5, the differences in distribution between groups are compared. The significance level is set at P<0.05, and variables with statistical significance are included in the next step of analysis.
[0027] Multivariate analysis confirmed the presence of significant variables. All variables identified in the univariate analysis were then incorporated into a binary logistic regression model for multivariate regression analysis. Variable selection was performed using either the forward likelihood ratio method or stepwise regression.
[0028] Independent risk factor determination: After controlling for the influence of other variables, if a variable's p-value in the binary Logistic regression model is still less than 0.05, and the 95% confidence interval of the odds ratio (OR) does not include 1, then that variable is determined to be an independent risk factor for postoperative complications. Ultimately, these independent risk factors constitute the set of feature variables used for model training.
[0029] S103. Based on the selected feature variables, construct a risk prediction model for postoperative complications. The risk prediction model for postoperative complications is based on the XGBoost base model. A moderately greedy algorithm is used to perform step-by-step parameter tuning. Multiple optimal parameter subsets are selected to construct multiple XGBoost sub-models. These sub-models are then combined using a weighted integration method to construct the MGA-XGBoost combined prediction model. Specifically, a predictive model for the risk of postoperative complications is constructed, including: Construct an XGBoost base model using Python and the xgboost library, initializing an XGBoost classifier as the base model. Configure basic parameters, setting the objective function to binary logistic regression and the evaluation metric to the area under the receiver operating characteristic curve (AUC). Set the initial learning rate, maximum tree depth, and minimum sum of weights for leaf nodes. The binary logistic regression is as follows: (1) In the formula, n is the total number of training samples; Let be the true label of the i-th sample, i.e. 0 represents no complications and 1 represents complications; Let be the predicted value of the i-th sample after the t-th iteration; L is the binary log loss function; Let be the regularization term for the k-th decision tree.
[0030] The binary log loss function is: (2) In the formula, To convert the model's raw output using the Sigmoid function Convert to predicted probability; when When complications occur, the loss function simplifies to ;when When no complications occur, the loss function simplifies to .
[0031] The regularization term in the XGBoost base model is used to control model complexity and prevent overfitting for the k-th decision tree. Its regularization term is defined as: (3) In the formula, Let be the number of leaf nodes in the k-th decision tree; Let be the weight of the j-th leaf node in the k-th tree; The regularization parameter, gamma, is used to control the number of leaf nodes. The L2 regularization coefficient is adjusted via the reg_lambda parameter; This is the L1 regularization coefficient, which is adjusted using the reg_alpha parameter.
[0032] Since directly optimizing the objective function is quite complex, XGBoost uses a second-order Taylor expansion for approximation. In the t-th iteration, the objective function can be approximated as: (4) In the formula, For the t-th tree pair of samples The predicted output; It is the first derivative; It is the second derivative.
[0033] The weights of the leaf nodes are calculated using a Taylor expansion approximation, which allows us to derive the optimal weight for each leaf node j. Closed solution: (5) In the formula, This is the set of indices of all training samples belonging to leaf node j; It is the sum of the first derivatives of all samples in the leaf node; Add an L2 regularization term to the sum of the second derivatives of all samples in the leaf nodes.
[0034] The XGBoost base model was initially trained using a set of feature variables, and the training process was monitored using an early stopping method to prevent overfitting.
[0035] A moderately greedy algorithm is used for step-by-step parameter tuning, including: Adjust the parameter sets of maximum tree depth (max_depth) and minimum child weight (min_child_weight) to evaluate and retain the two optimal parameter combinations from the given search space; Based on the aforementioned optimal combination, the minimum loss reduction threshold (gamma) parameter is adjusted to retain the two optimal sets of parameters; Based on the aforementioned results, the row sampling ratio (subsample) and column sampling ratio (colsample_bytree) parameter sets were adjusted to retain the two optimal parameter sets; Based on the aforementioned results, the L1 regularization weight (reg_alpha) and L2 regularization weight (reg_lambda) parameter sets were adjusted, and the optimal set of parameters was selected. Based on the aforementioned results, adjust the learning rate parameter; Determine the number of boost iteration rounds (num_boost_round) to reach the preset training set performance threshold; Finally, through the above step-by-step optimization process, 8 sets (2×2×2×1) of high-performance hyperparameter combinations with different parameters were generated.
[0036] The final prediction model is composed of components obtained through weighted integration, including: Eight sets of hyperparameters obtained from step-by-step parameter tuning were used to train eight XGBoost sub-models. Based on the final performance ranking of each sub-model during the optimization process, differentiated weights are assigned to each sub-model. The sub-model with the highest performance ranking has a weight of 2 / 3, the second-ranked model has a weight of 1 / 3, and the weights of subsequent rankings are halved before normalization, resulting in a set of normalized weights, such as [0.296, 0.148, 0.148, 0.074, 0.148, 0.074, 0.074, 0.038].
[0037] The final MGA-XGBoost model is a weighted ensemble of these 8 sub-models. For a new sample x, its predicted risk probability is calculated as follows: (6) In the formula, Let a be the weight of the a-th sub-model. This is the predicted output of the sub-model for sample x.
[0038] The constructed MGA-XGBoost model was comprehensively evaluated using an independent validation set. Evaluation metrics included the area under the receiver operating feature curve, accuracy, recall, precision, and F1 score to quantify the model's overall predictive performance.
[0039] The Shapley Additive Explanations (SHAP) framework is used for post-hoc interpretation of the model. SHAP values quantify the contribution of each feature to the prediction outcome for a single patient. By analyzing the SHAP values of all patients, a global ranking of feature importance can be obtained, and the influence of key features on the predictive risk of individual patients can be visualized, thereby transforming the "black box" model into a decision-making basis that clinicians can understand.
[0040] S104. The MGA-XGBoost combined prediction model is used to predict the probability of postoperative complications in patients and to identify the most important risk factors.
[0041] When new patients with acute abdomen require evaluation, their relevant clinical characteristics data are collected and they undergo the same pre-treatment process as during the training phase.
[0042] The processed feature vector is input into the MGA-XGBoost model, which outputs the probability of the patient developing postoperative complications. .
[0043] Set a clinical risk threshold, such as 0.5, to classify patients into “high-risk” or “low-risk” groups and issue corresponding warnings to medical staff.
[0044] List the top 3-5 risk factors that contribute most to the prediction of this patient, as determined by SHAP analysis.
[0045] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for predicting the risk of postoperative complications in patients with acute abdomen, characterized in that, include: Collect clinical data of patients with acute abdomen who have undergone surgical treatment, including basic patient information, laboratory test indicators, surgery-related information and postoperative complications. The missing data is cleaned, the continuous variables are normalized, and the categorical variables are coded. Risk factor variables associated with postoperative complications were screened from the clinical data using univariate and multivariate analyses to construct a set of characteristic variables; Based on the selected feature variables, a risk prediction model for postoperative complications is constructed. The risk prediction model for postoperative complications is based on the XGBoost base model. A moderately greedy algorithm is used to perform step-by-step parameter tuning. Multiple optimal parameter subsets are selected to construct multiple XGBoost sub-models. These sub-models are then combined using a weighted integration method to construct an MGA-XGBoost combined prediction model. The MGA-XGBoost combined prediction model was used to predict the probability of postoperative complications in patients and to identify the most important risk factors.
2. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, The construction of the prediction model for the risk of postoperative complications includes: Construct an XGBoost base model, initialize the XGBoost classifier, set the objective function as binary logistic regression, and evaluate the area under the receiver operating characteristic curve (ROC). Configure initial hyperparameters, including learning rate, maximum tree depth, minimum weight of leaf nodes; The XGBoost base model is initially trained using the aforementioned set of feature variables, and the training process is monitored using an early stopping method to prevent overfitting.
3. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, The step-by-step parameter tuning using a moderately greedy algorithm includes: Adjust the maximum tree depth and minimum leaf node weights and parameter sets of the XGBoost base model, and evaluate and retain the two optimal parameter combinations from the given search space; Adjust the threshold parameter to minimize loss, and retain the two optimal sets of parameters; Adjust the row sampling ratio and column sampling ratio parameter sets, retaining the two optimal parameter sets; Adjust the L1 regularization weight and L2 regularization weight parameter sets and select the optimal set of parameters; Adjust the learning rate parameter; Determine the number of iterations to improve performance to reach the preset training set performance threshold; The step-by-step parameter tuning process generates multiple optimal or suboptimal hyperparameter combinations.
4. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, The weighted integration method is used to combine the components into the final prediction model, including: Multiple sets of hyperparameters obtained by the step-by-step parameter tuning are used to train multiple XGBoost sub-models respectively. Based on the final performance ranking of each sub-model during the optimization process, differentiated weights are assigned to each sub-model. The sub-model with the highest performance ranking has a weight of 2 / 3, the second-ranked model has a weight of 1 / 3, and the weights of subsequent rankings are halved before normalization is performed to obtain a set of normalized weights. The final MGA-XGBoost model is a weighted ensemble of the sub-models.
5. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, The univariate and multivariate analyses include: Univariate analysis was used for initial screening. For each candidate feature variable in the clinical dataset, the association strength and statistical significance between the univariate variable and the postoperative complication outcome were calculated. For continuous variables that conform to a normal distribution, the independent samples t-test was used. For continuous variables that do not conform to a normal distribution, the Mann-Whitney U rank-sum test was used. For categorical variables, the chi-square test or Fisher's exact test was used. Multivariate analysis confirmed that the statistically significant characteristic variables from the univariate analysis were collectively included in a binary logistic regression model for regression analysis. Independent risk factor determination: In the binary logistic regression model, after controlling for the influence of other variables, if a certain characteristic variable still has a significant statistical association with the occurrence of postoperative complications, then that characteristic variable is determined to be an independent risk factor.
6. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, The patient's basic information, laboratory test results, surgery-related information, and postoperative complications include: Patient basic information: age, gender, body mass index, past medical history; Laboratory indicators: white blood cell count, C-reactive protein, platelets, lymphocytes, neutrophils, albumin, prealbumin; Surgical data: surgical method, operation time, intraoperative blood loss, blood transfusion during operation, and extent of surgical resection; Postoperative complication data: Whether infection, anastomotic leakage, abdominal abscess or pulmonary infection occurred, recorded according to the Clavien-Dindo classification.
7. The method for predicting the risk of postoperative complications in patients with acute abdomen according to claim 1, characterized in that, Also includes: The constructed MGA-XGBoost model was comprehensively evaluated using an independent validation set. Evaluation metrics included the area under the receiver operating feature curve, accuracy, recall, precision, and F1 score to quantify the model's overall predictive performance. The SHAP framework is used to calculate the contribution of each feature to the model's prediction results, generate a ranking of feature importance, and visualize how key features affect the predicted risk of individual patients, thereby improving the clinical interpretability of the model.