A method and system for predicting early postoperative adverse outcomes in patients with craniopharyngioma

By preprocessing and feature selection of preoperative data from craniopharyngioma patients, various machine learning models were constructed, which filled the gap in predicting early adverse outcomes after craniopharyngioma surgery, improved prediction accuracy and clinical applicability, and reduced the incidence of postoperative complications.

CN120895266BActive Publication Date: 2026-03-24南昌大学第一附属医院
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

The lack of effective methods for predicting early adverse outcomes in craniopharyngioma patients in the current technology leads to a high incidence of postoperative complications, affecting patient prognosis and the allocation of medical resources.

Method used

By extracting patients' preoperative data, performing rigorous data preprocessing and feature selection, constructing multiple machine learning models, employing synthetic minority class oversampling technology and feature redundancy elimination, selecting the optimal model for prediction, and providing a prediction system to output the probability of early postoperative adverse outcomes.

Benefits of technology

It improves the accuracy and generalization of predicting adverse outcomes within 30 days after craniopharyngioma surgery, assists doctors in taking preventive measures, reduces the incidence of complications, and optimizes the allocation of medical resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120895266B_ABST
    Figure CN120895266B_ABST
Patent Text Reader

Abstract

The present application relates to the medical technical field, specifically relates to a kind of early postoperative adverse outcome prediction method for craniopharyngioma patient, comprising: extracting preoperative data and label data of patient, store in database;The data in database is preprocessed, is randomly divided into training set and verification set according to preset proportion, and the training set is handled using the minority class oversampling technique, obtain the training set after processing;From the training set after processing, the most predictive value feature subset is identified and screened;Predictive model is constructed;The predictive model is evaluated and compared, and the best model is selected as the final deployment model;Receive new preoperative data of patient, input final deployment model, output prediction result.The present application fills the blank of existing prediction craniopharyngioma postoperative early overall adverse outcome model, overcomes the single data processing method in existing prediction technology, feature selection is not accurate enough, prediction accuracy is not high and lacks clinical usability and other problems.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical treatment, in particular to a craniopharyngioma patient postoperative early adverse outcome prediction method and system. BACKGROUND

[0002] Craniopharyngioma is a relatively rare tumor originating from the intracranial saddle area or parapituitary region. Although it is benign in pathological nature, due to its proximity to important neural structures such as the hypothalamus, pituitary, optic nerve, etc., surgical resection is difficult, and the incidence of postoperative complications and adverse events is high, which has a great impact on postoperative recovery and long-term quality of life of patients. Despite this, surgery is still the main way to treat craniopharyngioma.

[0003] However, due to the large number of common postoperative early adverse outcomes, such as cerebrospinal fluid leakage, epilepsy, stroke, intracranial infection, intracranial hemorrhage, deep vein thrombosis, pulmonary embolism, unplanned reoperation, unplanned readmission, and even death, etc., which seriously affect the prognosis of patients and the rational allocation of medical resources, there is currently no research on predicting the postoperative risk of the above overall adverse outcomes. SUMMARY

[0004] The purpose of the present application is to provide a craniopharyngioma patient postoperative early adverse outcome prediction method and system to improve the problems existing in the prior art.

[0005] The present application is realized in this way. On the one hand, the present application provides a craniopharyngioma patient postoperative early adverse outcome prediction method, comprising the following steps:

[0006] S1, extracting preoperative data and label data of the patient, and storing them in a structured data table form in a database, with clear data source annotation developing a data set or external validation data set;

[0007] S2, preprocessing the data in the database to obtain preprocessed data, randomly dividing them into a training set and a validation set according to a preset ratio, and processing the training set using a synthetic minority over-sampling technique to obtain a processed training set;

[0008] S3, identifying and selecting the most valuable feature subset from the processed training set;

[0009] S4, constructing a prediction model and training the prediction model using the processed training set to obtain a preliminarily optimized single classifier prediction model;

[0010] S5, evaluating and comparing the preliminarily optimized single classifier prediction model, and selecting the best performing model as the final deployment model;

[0011] S6. Receive new patient preoperative data, input it into the final deployment model, and output the prediction results.

[0012] More preferably, the preoperative data in step S1 includes demographic characteristics, clinical characteristics, laboratory indicators, and imaging characteristics; wherein, the demographic characteristics include gender, age, history of hypertension, history of diabetes, smoking history, history of radiotherapy and chemotherapy, and surgical history; the clinical characteristics include left visual acuity, left visual field, right visual acuity, right visual field, surgical procedure, central diabetes insipidus, and American College of Anesthesiologists risk level; the laboratory indicators include white blood cell count, platelet count, neutrophil count, lymphocyte count, thyroid hormone level, cortisol level, growth hormone level, sex hormone level, prolactin level, high-density lipoprotein, low-density lipoprotein, and serum sodium; the imaging characteristics include tumor location, Kassam classification, QST classification, Samii classification, tumor volume, tumor cystic-solid texture, calcification, and hydrocephalus.

[0013] More preferably, the label data in step S1 is the numbers "0" and "1", representing whether an early postoperative adverse outcome has occurred. Specifically, early postoperative adverse outcome events include: cerebrospinal fluid leakage, epileptic seizure, stroke, intracranial hematoma, meningitis, intracranial infection, deep vein thrombosis / pulmonary embolism, unplanned reoperation, unplanned readmission, and death occurring within 30 days after surgery. If any of the above adverse outcome events occur within 30 days after surgery, it is considered an early postoperative adverse outcome and is marked as "1" in the database; if no of the above adverse outcome events occur within 30 days after surgery, it is marked as "0".

[0014] More preferably, the data feature entries collected in the development dataset and the external verification dataset are the same, the difference being that the data sources of the two are different.

[0015] More preferably, S2 specifically includes:

[0016] S201. Digitize the non-numeric features in the database and handle missing feature values. Then, transform, enhance, and standardize the data to obtain preprocessed data. Specifically, features with a missing value ratio exceeding 25% are removed, and the remaining missing values ​​are imputed using the K-nearest neighbor imputation method based on Euclidean distance. In the K-nearest neighbor imputation process, the K value is set to 10, the distance metric is Euclidean distance, and the imputed value is the weighted average or mode of the 10 nearest neighbor samples. All continuous variables are standardized using Z-score, i.e., the mean is subtracted and the standard deviation is divided. Unordered categorical variables are transformed using One-Hot encoding, representing each category as an independent binary variable.

[0017] S202. The development dataset in the preprocessed data is randomly divided into a training set and an internal validation set at a ratio of 3:1. The external validation dataset is processed independently.

[0018] S203. The training set is balanced using a synthetic minority class oversampling technique to obtain a processed training set. Specifically, the SMOTE algorithm randomly selects several neighbors from each minority class sample's five nearest neighbors and constructs a synthetic sample between the original sample and its neighboring samples. The interpolation formula is as follows:

[0019] ;

[0020] in, For the original minority class samples, For one of its neighbor samples, It is a random number.

[0021] More preferably, S3 specifically includes:

[0022] S301. On the processed training set, a random forest classifier is used for recursive feature elimination, and 10-fold cross-validation is combined with the intersection of the significant features identified by univariate regression analysis. The final feature set is the final feature set that is included. The final feature set includes: tumor cystic-solid texture, gender, Kassam classification, right visual field and American Association of Anesthesiologists risk level.

[0023] S302. Calculate the Pearson correlation coefficient matrix between all candidate features in the final feature set, identify and exclude feature pairs whose absolute correlation coefficient value is greater than a preset threshold, reduce feature redundancy, and obtain the feature subset with the most predictive value.

[0024] More preferably, S4 specifically includes:

[0025] S401. Select a variety of supervised machine learning models for training, including but not limited to: logistic regression, random forest, support vector machine, lightweight gradient boosting machine, and K-nearest neighbors. The training of the above models is achieved by calling the corresponding model R package through R software. Different prediction models are constructed by inputting the feature subset with the most predictive value and the preprocessed label data.

[0026] S402. For each selected model, use hyperparameter tuning and perform 10-fold cross-validation on the training set through grid search to obtain the optimal hyperparameter combination.

[0027] S403. Using the optimal combination of hyperparameters, retrain each model on the processed training set to obtain a preliminary optimized single classifier prediction model.

[0028] More preferably, S5 specifically includes:

[0029] S501. Perform predictions on the internal validation set and the external validation dataset using the initially optimized single classifier prediction model.

[0030] S502. Calculate and compare the key performance evaluation indicators of each model, including but not limited to: area under the receiver operating characteristic curve, accuracy, F1 score, sensitivity, specificity, positive predictive value, negative predictive value, Brier score, and Youden index.

[0031] S503. Based on the evaluation metrics, comprehensively compare the performance of each model on the internal validation set and the external validation dataset, and select the best-performing model as the final deployment model.

[0032] More preferably, S6 specifically includes:

[0033] S601. Receive new patient preoperative data, which is the final feature set determined in S301, namely: tumor cystic-solid nature, gender, Kassam classification, right visual field and American College of Anesthesiologists risk level;

[0034] S602. Load and run the final deployment model, calculate the predicted probability of the patient experiencing early postoperative adverse outcomes, which is a value between 0 and 1, and output the prediction result.

[0035] On the other hand, the present invention also provides a system for predicting early adverse outcomes after surgery in patients with craniopharyngioma, implemented by any of the prediction methods described above, including:

[0036] Data acquisition module: used to acquire patients' preoperative data and labeling data;

[0037] Data preprocessing module: Used to preprocess the data in the data acquisition module;

[0038] Feature selection module: Identifies and filters the most predictive subset of features from the preprocessed data;

[0039] Prediction model training module: Utilizes the feature set determined by the feature selection module and the preprocessed data to build and train various prediction models;

[0040] Prediction model evaluation module: rigorously evaluates and compares the trained prediction models to identify the best model;

[0041] Prediction Output Module: Integrates and runs the best model confirmed by the prediction model evaluation module to predict new patient data.

[0042] Compared with the prior art, the present invention has the following advantages: The present invention can effectively improve the model accuracy and generalization ability, accurately predict the risk of multiple adverse outcomes in craniopharyngioma patients within 30 days after surgery. The prediction results can assist doctors and patients to take targeted preventive measures in advance, optimize postoperative management, reduce the incidence of complications, improve patient prognosis, and save medical resources.

[0043] This invention fills the gap in existing models for predicting early overall poor outcomes after craniopharyngioma surgery, and overcomes the problems of single data processing methods, inaccurate feature selection, low prediction accuracy and lack of clinical usability in existing prediction technologies.

[0044] This invention effectively improves the stability and accuracy of the prediction model through a rigorous data preprocessing process, advanced feature selection methods, multiple candidate algorithm models, and comprehensive model evaluation metrics.

[0045] Furthermore, the SHAP method employed in this invention improves the clinical interpretability of the model and enables rapid real-time prediction through an interactive user interface, thereby significantly improving the efficiency and effectiveness of its application in clinical practice. Attached Figure Description

[0046] Figure 1 This is a flowchart of the prediction method of the present invention.

[0047] Figure 2 This is a block diagram of the prediction system of the present invention.

[0048] Figure 3 This is the internal validation ROC curve of the prediction model of this invention.

[0049] Figure 4 This is the external validation ROC curve of the prediction model of this invention.

[0050] Figure 5 This is an important feature ranking diagram of the prediction model of this invention.

[0051] Figure 6 This is a feature-interpretive visualization of the prediction model of this invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "comprising" and similar expressions used herein mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, but does not exclude other elements or objects.

[0053] Example 1: This example provides a method for predicting early adverse outcomes after surgery in patients with craniopharyngioma, such as... Figure 1 As shown, it includes the following steps:

[0054] S1. Extract the patient's preoperative data and label data, and store them in the database in the form of structured data tables. The data source is clearly marked as either the development dataset or the external validation dataset.

[0055] Furthermore, the preoperative data in step S1 consists of preoperative data extracted from patients pathologically diagnosed with craniopharyngioma and undergoing surgical resection from different medical institutions. Specifically, this includes: demographic characteristics, clinical characteristics, laboratory indicators, and imaging characteristics. Demographic characteristics include gender, age, history of hypertension, history of diabetes, smoking history, history of radiotherapy and chemotherapy, and surgical history. Clinical characteristics include left visual acuity, left visual field, right visual acuity, right visual field, surgical method (endoscopic or craniotomy), central diabetes insipidus, and American Society of Anesthesiologists (ASA) risk level. Laboratory indicators include white blood cell count, platelet count, neutrophil count, lymphocyte count, thyroid hormone levels, cortisol levels, growth hormone levels, sex hormone levels, prolactin levels, high-density lipoprotein, low-density lipoprotein, and serum sodium. Imaging characteristics include tumor location, Kassam classification, QST classification, Samii classification, tumor volume, tumor cystic / solid texture, calcification, and hydrocephalus.

[0056] Further, in step S1, the label data consists of the numbers "0" and "1", representing whether an early postoperative adverse outcome has occurred. Specifically, early postoperative adverse outcome events include: cerebrospinal fluid leakage, epileptic seizures, stroke, intracranial hematoma, meningitis, intracranial infection, deep vein thrombosis / pulmonary embolism, unplanned reoperation, unplanned readmission, and death occurring within 30 days postoperatively. If any of the above adverse outcome events occur within 30 days postoperatively, it is considered an early postoperative adverse outcome and is marked as "1" in the database; if no of the above adverse outcome events occur within 30 days postoperatively, it is marked as "0".

[0057] Furthermore, the data feature entries collected in the development dataset and the external validation dataset are the same, the difference being that the data sources are different. The development dataset comes from the First Affiliated Hospital of Nanchang University, and the external validation dataset comes from the Second Hospital of Lanzhou University.

[0058] S2. Preprocess the data in the database to obtain preprocessed data, randomly divide it into training set and validation set according to a preset ratio, and use synthetic minority class oversampling technology to process the training set to obtain the processed training set.

[0059] S201. Digitize the non-numeric features in the database and handle missing values ​​(delete or imput). Then, transform, enhance, and standardize the data to obtain preprocessed data. Specifically, for variables with a missing value ratio exceeding 25%, remove them. The remaining missing values ​​are imputed using the K-Nearest Neighbors (KNN) method based on Euclidean distance. In the KNN imputation process, the K value is set to 10, the distance metric is Euclidean distance, and the imputed value is the weighted average (for continuous variables) or mode (for categorical variables) of the 10 nearest neighbor samples. All continuous variables are Z-score standardized, i.e., the mean is subtracted and the standard deviation is divided to eliminate the influence of units and accelerate model convergence. Unordered categorical variables are transformed using One-Hot encoding, representing each category as an independent binary variable, thus adapting it to the input format of the machine learning model.

[0060] In one embodiment, the remaining missing values ​​are imputed using a random forest or median / mean method;

[0061] S202. The development dataset in the preprocessed data is randomly divided into a training set and an internal validation set according to a preset ratio of 3:1. The external validation dataset is processed independently.

[0062] S203. To address the uneven distribution of target variable categories in the training set, this invention employs a synthetic minority class oversampling technique to balance the training set data, resulting in a processed training set. This method interpolates minority class samples in the feature space to synthesize new minority class samples, thereby expanding the number of minority class samples and mitigating the model's bias towards the majority class. In specific implementation, the SMOTE algorithm randomly selects several neighbors from each minority class sample's K nearest neighbors (K is set to 5 in this embodiment) and constructs synthetic samples between the original sample and its neighboring samples. The interpolation formula is as follows:

[0063] ;

[0064] in, For the original minority class samples, For one of its neighbor samples, The values ​​are random; this method is only implemented on the training set to avoid data leakage and distortion of the validation set distribution, thereby ensuring the objectivity of model evaluation.

[0065] S3. Identify and select the most predictive feature subset from the processed training set;

[0066] S301. On the training set processed in S2, a recursive feature elimination (RFE) feature selection method is used with a random forest (RF) classifier, combined with 10-fold cross-validation (K is set to 10 in this embodiment). The intersection of this cross-validation with the significant features identified by univariate regression analysis is the final feature set. The final feature set includes: tumor cystic-solid nature, gender, Kassam classification, right visual field, and American College of Anesthesiologists risk level. More specifically, the final feature set includes female gender, Kassam classification type II, and right visual field defect.

[0067] In one embodiment, the feature selection method employs a method based on univariate analysis, LASSO regression, ridge regression, or principal component analysis (PCA).

[0068] S302. Calculate the Pearson correlation coefficient matrix between all candidate features in the final feature set, identify and exclude feature pairs with an absolute correlation coefficient greater than a preset threshold (e.g., 0.9), reduce feature redundancy, and obtain the feature subset with the most predictive value.

[0069] S4. Construct a prediction model and train it using the processed training set to obtain a preliminary optimized single classifier prediction model.

[0070] S401. Select a variety of supervised machine learning models for training, including but not limited to: Logistic Regression (LR), Random Forest (RF), Support Vector Machine (SVM), Lightweight Gradient Boosting Machine (LightGBM), and K Nearest Neighbors (KNN). The training of the above models is achieved by calling the corresponding model R package through R software. Different prediction models are constructed by inputting the feature subset with the most predictive value and the preprocessed label data.

[0071] In one embodiment, a neural network (such as a multilayer perceptron or a convolutional neural network) or an ensemble learning method (such as XGBoost, CatBoost) is used as the prediction model to improve prediction performance.

[0072] S402. For each selected model, use hyperparameter tuning and perform K-fold cross-validation on the training set through grid search (K is set to 10 in this embodiment) to obtain the optimal hyperparameter combination;

[0073] S403. Using the optimal combination of hyperparameters, retrain each model on the processed training set to obtain a preliminary optimized single classifier prediction model.

[0074] S5. Evaluate and compare the preliminary optimized single classifier prediction models, and select the best-performing model as the final deployment model; specifically including:

[0075] S501. Perform predictions on the internal validation set and the external validation dataset using the initially optimized single classifier prediction model.

[0076] S502. Calculate and compare the key performance evaluation metrics of each model, including but not limited to: Area under the receiver operating characteristic curve (AUC), accuracy, F1 score (harmonic mean of recall and precision), sensitivity, specificity, positive predictive value (PPV / Precision), negative predictive value (NPV), Brier score, and Youden index.

[0077] Table 1

[0078] Actual Positive Actual Negative Predicted Positive True Positive (TP) False Positive (FP) Predicted Negative False Negative (FN) True Negative (TN)

[0079] Accuracy = Among them, TP represents data that was predicted to be positive and was actually positive, TN represents data that was predicted to be negative and was actually negative, FP represents data that was predicted to be positive and was actually negative, and FN represents data that was predicted to be negative and was actually positive.

[0080] Sensitivity / Recall = ;

[0081] Specificity = ;

[0082] Positive Predictive Value (PPV / Precision) = ;

[0083] Negative Predictive Value (NPV) = ;

[0084] F1 Score = = Where Precision is the accuracy rate and Recall is the recall rate;

[0085] Youden's Index = Sensitivity + Specificity−1; where Sensitivity is the sensitivity and Specificity is the specificity.

[0086] Brier Score = Where N is the sample size. The model predicts the probability that sample i belongs to a certain category; that is, the predicted probability given by the model. The actual label for sample i is "0" or "1", representing the actual category in a binary classification problem.

[0087] Area Under ROC Curve (AUC): AUC is usually calculated by numerical integration to find the area under the ROC curve.

[0088] S503. Based on the evaluation metrics, comprehensively compare the performance of each model on the internal validation set and the external validation dataset, and select the best-performing model as the final deployment model.

[0089] S6. Receive new patient preoperative data, input it into the final deployment model, and output the prediction results.

[0090] S601. Receive new patient preoperative data, which is the final feature set determined in S301, namely: tumor cystic-solid nature, gender, Kassam classification, right visual field and ASA grade;

[0091] S602. Load and run the final deployment model, calculate the predicted probability of the patient experiencing early postoperative adverse outcomes, which is a value between 0 and 1, and output the prediction result.

[0092] Example 2: Based on Example 1, such as Figure 2 As shown, the present invention also provides a system for predicting early adverse outcomes after surgery in patients with craniopharyngioma, implemented through the prediction method described in the above embodiments, including:

[0093] Data acquisition module: used to acquire patients' preoperative data and label data; specifically including demographic characteristics, clinical variables, laboratory indicators and imaging characteristics data, which are stored in the database in the form of structured data tables;

[0094] The data preprocessing module is used to preprocess the data from the data acquisition module. Specifically, the data preprocessing module includes: a dataset partitioning unit, which randomly divides the obtained patient dataset into a training set and a validation set at a ratio of 3:1; a missing value handling unit, which uses the K-nearest neighbor imputation algorithm to fill in missing data using the weighted mean of the five nearest neighbors in the feature space; a variable standardization unit, which processes continuous variables using the Z-score standardization method; a categorical variable encoding unit, which processes categorical variables using one-hot encoding technology; and a class balancing unit, which uses Synthetic Minority Oversampling Technique (SMOTE) to solve the data class imbalance problem and enhance the model's predictive performance for the minority class.

[0095] Feature selection module: Identifies and filters the most predictive feature subset from the preprocessed data; specifically, the feature selection module includes: a correlation filtering unit: calculates the Pearson correlation coefficient between predictor variables and removes features with a correlation coefficient greater than 0.9; a recursive feature elimination (RFE) unit: uses a random forest classifier combined with 5-fold cross-validation, determines the best feature subset based on the AUC value, and ranks the importance of features according to the node impurity (Gini importance) of the variables in the random forest.

[0096] Prediction model training module: Using the feature set determined by the feature selection module and the preprocessed data, various prediction models are built and trained. The prediction model training module integrates five machine learning algorithms: logistic regression (LR), random forest (RF), support vector machine (SVM), lightweight gradient boosting machine (LightGBM), and k-nearest neighbors (KNN). The hyperparameters of the model are optimized through 10-fold cross-validation and grid search. After the hyperparameters are tuned, the model is finally trained using all the training data.

[0097] Predictive model evaluation module: This module rigorously evaluates and compares the trained predictive models to identify the best model. It also performs performance evaluation on the trained models, including ROC curve analysis, calculating AUC, accuracy, F1 score, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), and Brier score. Feature importance analysis of the best model is performed using the SHAP method.

[0098] Prediction Result Output Module: Integrates and runs the best model confirmed by the prediction model evaluation module to predict new patient data; the prediction result output module is used to intuitively display the model's prediction results to the user, providing the probability of early postoperative adverse outcomes, and combining risk stratification for intuitive display;

[0099] In one embodiment, a user interface module is also included to provide an entry point for interaction between the system and users (doctors, patients, etc.) and to display prediction results; specifically, it includes a user input interface and a result display interface, which allows users to input preoperative patient information, and the interface automatically completes data processing and prediction, and provides real-time feedback on prediction results.

[0100] Specifically, the user interface module provides an input interface for users to input the characteristic data of the patient to be predicted, namely: tumor cystic-solid nature, gender, Kassam classification, right visual field, and ASA grade; it calls the prediction result output module to perform prediction calculations; it clearly and intuitively displays the prediction probability and the risk classification ("high risk" or "low risk") based on a threshold (default 0.5) to the user; it can selectively display the contribution of key features to the prediction results (e.g., integrating SHAP value analysis results) and provide necessary explanatory information to help users understand the prediction results.

[0101] Example 3: Based on Example 2, such as Figures 3-6 As shown, this invention provides a specific implementation method for predicting early adverse outcomes after craniopharyngioma surgery:

[0102] 1. Data collection;

[0103] In this embodiment, preoperative data and labeling data of patients pathologically diagnosed with craniopharyngioma and who had undergone surgical resection were obtained from the First Affiliated Hospital of Nanchang University and the Second Hospital of Lanzhou University. The specific data collected included:

[0104] Gender, age, history of hypertension, history of diabetes, smoking history, history of radiotherapy and chemotherapy, surgical history, left visual acuity, left visual field, right visual acuity, right visual field, surgical method (e.g., transnasal endoscopic or craniotomy), central diabetes insipidus, American Society of Anesthesiologists (ASA) risk rating, white blood cell count, platelet count, neutrophil count, lymphocyte count, thyroid hormone levels, cortisol levels, growth hormone levels, sex hormone levels, prolactin levels, high-density lipoprotein (HDL), low-density lipoprotein (LDL), serum sodium concentration, tumor location, Kassam classification, QST classification, Samii classification, tumor volume, texture, calcification, and presence of cerebrospinal fluid. Water; the labeled data are the numbers "0" and "1", representing whether an early postoperative adverse outcome occurred; specifically, early postoperative adverse outcome events include: cerebrospinal fluid leakage, seizure, stroke, intracranial hematoma, meningitis, intracranial infection, deep vein thrombosis / pulmonary embolism, unplanned reoperation, unplanned readmission, and death occurring within 30 days after surgery. If any of the above adverse events occurs within 30 days after surgery, it is considered an early postoperative adverse outcome and is marked as "1" in the database; if no of the above adverse events occurs within 30 days after surgery, it is marked as "0". The above data is stored in the database in the form of a structured table and is clearly marked as originating from the development dataset or an external validation dataset.

[0105] 2. Data preprocessing;

[0106] In data preprocessing, a series of rigorous processing methods were adopted to address potential problems in the original data: features with a missing value ratio exceeding 25% were removed; for the remaining missing values, the K-Nearest Neighbors (KNN) method based on Euclidean distance was used to impute them. In the KNN interpolation process, K is set to 10, Euclidean distance is used as the distance metric, and the interpolated value is the weighted average (for continuous variables) or mode (for categorical variables) of the 10 nearest neighbor samples, thus avoiding the impact of incomplete data on model performance. All continuous variables undergo Z-score standardization, i.e., subtracting the mean and dividing by the standard deviation, to eliminate the influence of unit of measurement and accelerate model convergence. For unordered categorical variables, One-Hot encoding is used to transform each category into an independent binary variable, thereby adapting it to the input format of machine learning models. The preprocessed development dataset is randomly divided into a training set and an internal validation set at a preset ratio of 3:1, with the external validation set processed separately. To address the problem of uneven distribution of poor results in the early stages of the training set, this embodiment employs the Synthetic Minority Over-sampling Technique. SMOTE balances the training data by interpolating minority class samples in the feature space to synthesize new minority class samples, thereby expanding the number of minority class samples and reducing the bias of the model towards majority class samples. In the specific implementation, the SMOTE algorithm randomly selects several neighbors from its K nearest neighbors (K is set to 5 in this embodiment) for each minority class sample and constructs a synthetic sample between the original sample and the neighbor samples.

[0107] 3. Feature selection;

[0108] In the feature selection stage, this invention employs a combination of random forest (RF) feature importance assessment, recursive elimination process of RFE, performance evaluation of K-fold cross-validation, and significance testing of univariate regression analysis to screen key features significantly associated with poor overall outcomes in the early postoperative period of craniopharyngioma from numerous preoperative features. The specific operation is as follows:

[0109] Calculate the Pearson correlation coefficient matrix among all candidate features, identify and exclude feature pairs with an absolute correlation coefficient greater than a preset threshold (0.9) to reduce feature redundancy. RF is an ensemble learning method based on decision trees. It makes predictions by constructing multiple decision trees and voting on them. In feature selection, the RF classifier can evaluate the importance of each feature to the model's performance. Recursive Feature Elimination (RFE) is a technique for iteratively removing unimportant features. First, a model (an RF classifier in this example) is trained, and the importance scores of all features are calculated. Then, the least important features are removed in each iteration until the optimal feature set remains. K-fold cross-validation is a technique for evaluating the generalization ability of a model. The dataset is divided into K subsets (K is set to 10 in this example). The model is trained using K-1 subsets each time, with the remaining subset used as the validation set. This process is repeated K times, and the model performance is evaluated by averaging the validation results. In feature selection, cross-validation helps select the features that have the greatest impact on model performance, avoiding overfitting caused by randomness in a single training iteration. Univariate regression analysis is used to evaluate the relationship between each feature and early overall poor outcomes, identifying significant features. It determines the importance of features by testing the statistical significance (p-value < 0.05) between each feature and early overall poor outcomes; significant features are retained, while insignificant features are removed. Finally, the intersection of the significant features identified by RFE and univariate regression analysis is taken as the final feature set, namely: cystic-solid tumor texture, female sex, Kassam type II, right visual field defect, and ASA grade.

[0110] 4. Predictive model construction;

[0111] This invention employs various supervised machine learning models for training, including Logistic Regression (LR), Random Forest (RF), Support Vector Machine (SVM), Lightweight Gradient Boosting Machine (LightGBM), and K-Nearest Neighbors (KNN). Different prediction models are constructed by inputting processed feature data and label data. For each selected model, a hyperparameter tuning method is used, and K-fold cross-validation (K is set to 10 in this embodiment) is performed on the training set using grid search. Grid search exhaustively traverses all possible hyperparameter combinations. For each hyperparameter combination, grid search trains the model and evaluates its performance. Cross-validation is used to evaluate the model performance of each hyperparameter combination. Based on the evaluation results, grid search selects the hyperparameter combination with the best performance as the final model's hyperparameter configuration. Finally, using the optimal hyperparameter configuration, each model is retrained on the entire training set to obtain a preliminarily optimized classifier prediction model.

[0112] 5. Evaluation of the prediction model;

[0113] This invention employs multiple evaluation metrics to assess model performance, including: Area Under the Receiver Operating Characteristic (AUC-ROC): Measures the model's ability to distinguish between positive and negative samples at different discrimination thresholds; an AUC value closer to 1 indicates better discriminative performance. Accuracy: Represents the proportion of correctly classified samples out of the total number of samples, reflecting the overall predictive accuracy of the model. F1 Score: The harmonic mean of precision and recall, comprehensively considering false positives and false negatives, suitable for prediction scenarios with imbalanced class distributions. Sensitivity / Recall: Represents the proportion of correctly identified positive samples among all actual positive samples, measuring the model's ability to identify positive classes. Specificity: Represents the proportion of correctly identified negative samples among all actual negative samples, measuring the model's ability to identify negative classes. Positive Predictive Value (PPV / Precision): Represents the proportion of samples predicted as positive that are actually positive, reflecting the accuracy of the model's positive predictions. Negative Predictive Value (NPV): Represents the proportion of samples predicted as negative that are actually negative, reflecting the accuracy of the model's predictions when they are negative. Brier Score: Measures the mean squared error between the model's predicted probability and the actual result; a smaller value indicates better probability calibration performance. Youden Index: Calculated by subtracting 1 from the sum of Sensitivity and Specificity, it comprehensively reflects the model's overall ability to distinguish between positive and negative classes; a higher value indicates stronger classification performance.

[0114] As shown in Table 2 and Table 3, Figure 3 and Figure 4 As shown, after comparing the performance of various models, the SVM model performed best. In the internal validation set, its AUC reached 0.802, F1 score was 0.615, and Brier score was 0.188; in the external validation set, its AUC reached 0.790, F1 score was 0.714, and Brier score was 0.197. Overall, the SVM model outperformed other models on multiple evaluation metrics. This indicates that the SVM model has high accuracy and reliability in predicting overall adverse outcomes in the early postoperative period of craniopharyngioma surgery.

[0115] Table 2

[0116] Model Logistic Regression Random Forest Light Gradient Boosting Machine Support Vector Machine K-Nearest Neighbors Accuracy Accuracy (%) 67.8 71.2 71.2 74.6 74.6 Sensitivity Sensitivity (%) 75.0 56.2 50.0 75.0 43.8 Specificity Specificity (%) 65.1 76.7 79.1 74.4 86.0 Positive Predictive Value PPV (%) 44.4 47.4 47.1 52.2 53.8 Negative Predictive Value NPV (%) 87.5 82.5 81.0 88.9 80.4 F1 score F1 score (%) 55.8 51.4 48.5 61.5 48.3 Brier score Brier score (%) 21.8 19.3 20.5 18.8 19.2 Area under the Receiver Operating Characteristic Curve AUC (%) 73.9 76.7 75.6 80.2 74.1

[0117] Table 3

[0118] Model Logistic Regression Random Forest Light Gradient Boosting Machine Support Vector Machine K-Nearest Neighbors Accuracy Accuracy (%) 66.7 70.0 70.0 73.3 60.0 Sensitivity Sensitivity (%) 50.0 56.2 50.0 62.5 50.0 Specificity Specificity (%) 85.7 85.7 92.9 85.7 71.4 Positive Predictive Value PPV (%) 80.0 81.8 88.9 83.3 66.7 Negative Predictive Value NPV (%) 60.0 63.2 61.9 66.7 55.6 F1 score F1 score (%) 61.5 66.7 64.0 71.4 57.1 Brier score Brier score (%) 23.4 25.8 22.3 19.7 23.6 Area under the Receiver Operating Characteristic Curve AUC (%) 67.9 68.3 71.0 79.0 73.2

[0119] 6. Model interpretability analysis;

[0120] To enhance the clinical applicability of the model, this invention introduces a visualization analysis method based on SHAP (SHapley Additive ex Planations) theory to interpret key predictive features in the SVM model. By constructing a SHAP value summary chart, the system can display the average influence of each feature on the model output results. Figure 5 ) and the direction and magnitude of their positive and negative effects in different patient samples ( Figure 6 The results showed that the cystic-solid nature of the tumor, female sex, Kassam type II classification, right visual field defect, and ASA grade contributed to the model performance. This analysis further validated the importance of these features and improved the reliability of the model.

[0121] While embodiments of the present invention have been described in detail above, it will be apparent to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations fall within the scope and spirit of the invention as set forth in the claims. Furthermore, the invention described herein may have other embodiments and can be implemented or carried out in various ways.

Claims

1. A method for predicting early adverse outcomes after surgery in patients with craniopharyngioma, characterized in that, Includes the following steps: S1. Extract the patient's preoperative data and label data, and store them in the database in the form of structured data tables. The data source is clearly marked as either the development dataset or the external validation dataset. S2. Preprocess the data in the database to obtain preprocessed data, randomly divide it into training set and validation set according to a preset ratio, and use synthetic minority class oversampling technology to process the training set to obtain the processed training set. S3. Identify and select the most predictive feature subset from the processed training set; S4. Construct a prediction model and train it using the processed training set to obtain a preliminary optimized single classifier prediction model. S5. Evaluate and compare the preliminary optimized single classifier prediction models, and select the best-performing model as the final deployment model. S6. Receive new patient preoperative data, input it into the final deployment model, and output the prediction results; Specifically, S2 includes: S201. Digitize the non-numeric features in the database and handle missing feature values. Then, transform, enhance, and standardize the data to obtain preprocessed data. Specifically, features with a missing value ratio exceeding 25% are removed, and the remaining missing values ​​are imputed using the K-nearest neighbor imputation method based on Euclidean distance. In the K-nearest neighbor imputation process, the K value is set to 10, the distance metric is Euclidean distance, and the imputed value is the weighted average or mode of the 10 nearest neighbor samples. All continuous variables are standardized using Z-score, i.e., the mean is subtracted and the standard deviation is divided. Unordered categorical variables are transformed using One-Hot encoding, representing each category as an independent binary variable. S202. The development dataset in the preprocessed data is randomly divided into a training set and an internal validation set at a ratio of 3:

1. The external validation dataset is processed independently. S203. The training set is balanced using a synthetic minority class oversampling technique to obtain a processed training set. Specifically, the SMOTE algorithm randomly selects several neighbors from each minority class sample's five nearest neighbors and constructs a synthetic sample between the original sample and its neighboring samples. The interpolation formula is as follows: ;in, For the original minority class samples, For one of its neighbor samples, It is a random number.

2. The method for predicting early adverse outcomes after craniopharyngioma surgery according to claim 1, characterized in that, The preoperative data in step S1 includes demographic characteristics, clinical characteristics, laboratory indicators, and imaging characteristics. Demographic characteristics include gender, age, history of hypertension, history of diabetes, smoking history, history of radiotherapy and chemotherapy, and surgical history. Clinical characteristics include left visual acuity, left visual field, right visual acuity, right visual field, surgical procedure, central diabetes insipidus, and American College of Anesthesiologists risk level. Laboratory indicators include white blood cell count, platelet count, neutrophil count, lymphocyte count, thyroid hormone levels, cortisol levels, growth hormone levels, sex hormone levels, prolactin levels, high-density lipoprotein, low-density lipoprotein, and serum sodium. Imaging characteristics include tumor location, Kassam classification, QST classification, Samii classification, tumor volume, tumor cystic / solid texture, calcification, and hydrocephalus.

3. The method for predicting early adverse outcomes after craniopharyngioma surgery according to claim 2, characterized in that, In step S1, the label data consists of the numbers "0" and "1", representing whether an early postoperative adverse outcome has occurred. Specifically, early postoperative adverse outcome events include: cerebrospinal fluid leakage, epileptic seizure, stroke, intracranial hematoma, meningitis, intracranial infection, deep vein thrombosis / pulmonary embolism, unplanned reoperation, unplanned readmission, and death occurring within 30 days postoperatively. If any of the above adverse outcome events occur within 30 days postoperatively, it is considered an early postoperative adverse outcome and is marked as "1" in the database; if no of the above adverse outcome events occur within 30 days postoperatively, it is marked as "0".

4. The method for predicting early adverse outcomes after craniopharyngioma surgery according to claim 3, characterized in that, The data feature entries collected in the development dataset and the external verification dataset are the same, the difference lies in the different data sources.

5. The method for predicting early adverse outcomes after surgery in patients with craniopharyngioma according to claim 4, characterized in that, S3 specifically includes: S301. On the processed training set, a random forest classifier is used for recursive feature elimination, and 10-fold cross-validation is combined with the intersection of the significant features identified by univariate regression analysis. The final feature set is the final feature set that is included. The final feature set includes: tumor cystic-solid texture, gender, Kassam classification, right visual field and American Association of Anesthesiologists risk level. S302. Calculate the Pearson correlation coefficient matrix between all candidate features in the final feature set, identify and exclude feature pairs whose absolute correlation coefficient value is greater than a preset threshold, reduce feature redundancy, and obtain the feature subset with the most predictive value.

6. The method for predicting early adverse outcomes after surgery in patients with craniopharyngioma according to claim 5, characterized in that, S4 specifically includes: S401. Select a variety of supervised machine learning models for training, including but not limited to: logistic regression, random forest, support vector machine, lightweight gradient boosting machine, and K-nearest neighbors. The training of the above models is achieved by calling the corresponding model R package through R software. Different prediction models are constructed by inputting the feature subset with the most predictive value and the preprocessed label data. S402. For each selected model, use hyperparameter tuning and perform 10-fold cross-validation on the training set through grid search to obtain the optimal hyperparameter combination. S403. Using the optimal combination of hyperparameters, retrain each model on the processed training set to obtain a preliminary optimized single classifier prediction model.

7. The method for predicting early adverse outcomes after surgery in patients with craniopharyngioma according to claim 6, characterized in that, S5 specifically includes: S501. Perform predictions on the internal validation set and the external validation dataset using the initially optimized single classifier prediction model. S502. Calculate and compare the key performance evaluation indicators of each model, including but not limited to: area under the receiver operating characteristic curve, accuracy, F1 score, sensitivity, specificity, positive predictive value, negative predictive value, Brier score, and Youden index. S503. Based on the evaluation metrics, comprehensively compare the performance of each model on the internal validation set and the external validation dataset, and select the best-performing model as the final deployment model.

8. The method for predicting early adverse outcomes after craniopharyngioma surgery according to claim 7, characterized in that, S6 specifically includes: S601. Receive new patient preoperative data, which is the final feature set determined in S301, namely: tumor cystic-solid nature, gender, Kassam classification, right visual field and American College of Anesthesiologists risk level; S602. Load and run the final deployment model, calculate the predicted probability of the patient experiencing early postoperative adverse outcomes, which is a value between 0 and 1, and output the prediction result.

9. A system for predicting early adverse outcomes after surgery in patients with craniopharyngioma, implemented by the prediction method described in any one of claims 1 to 8, characterized in that, include: Data acquisition module: used to acquire patients' preoperative data and labeling data; Data preprocessing module: Used to preprocess the data in the data acquisition module; Feature selection module: Identifies and filters the most predictive subset of features from the preprocessed data; Prediction model training module: Utilizes the feature set determined by the feature selection module and the preprocessed data to build and train various prediction models; Prediction model evaluation module: rigorously evaluates and compares the trained prediction models to identify the best model; Prediction Output Module: Integrates and runs the best model confirmed by the prediction model evaluation module to predict new patient data.

Citation Information

Patent Citations

  • Intelligent prediction method and system for NSCLC lymph node metastasis risk

    CN114743672A

  • Method for predicting methylene blue treatment response of infectious shock patient based on interpretable model

    CN118609852A