Introduction

Brain tumor resection with craniotomy is often a necessary step of brain tumor treatment. Due to the nature of the surgery and the highly vascularized anatomical structures of the brain and tumor, large amounts of blood loss may occur during these procedures, and this can frequently result in anemia1,2. Although blood transfusion can increase hemoglobin (HB) levels and improve tissue perfusion, it can result in many transfusion-related complications, such as fever, surgical site infection, acute lung injury, or even prolonged hospital stays and death3,4. In addition, blood shortages are an increasing problem in many countries5. Therefore, early identification of high-risk patients is a necessary step for implementing specific preoperative interventions to save blood resources and improve clinical outcomes.

Currently, blood transfusion guidelines suggest HB is a major indicator of blood transfusion. Blood transfusions in clinics are performed according to the HB levels2. However, a patientā€™s status, including heart function and preoperative comorbidity, affects the tolerance threshold to the blood HB level. Various prediction tools for guiding blood transfusion other than HB in other surgeries have been used in clinical settings6,7. A prediction tool that can quantitatively assess the probability of the necessity for intraoperative blood transfusion during brain tumor surgery has not been developed. Therefore, our study aims to develop a machine learning calculator to predict intraoperative blood transfusion in patients receiving brain tumor surgery and to evaluate its discriminative ability.

Methods

Ethics statement and patient selection

We performed this study following the Declaration of Helsinki, and the study was approved by the Ethics Committee of the Xiangyang Central Hospital, affiliated with the Hubei University of Arts and Science. Patient written informed consent was exempted. Patient information that could exactly identify a patient was removed prior to the data analysis.

Inclusion criteria: Patients who received elective brain tumor resection surgery in our tertiary hospital from January 2019 to December 2021 were included in this analysis. Exclusion criteria were emergency surgery; patients with hypovolemia or in shock or in a coma state; and patients who took oral anticoagulants before surgery or had participated in other clinical trials as subjects within the past 3Ā months. The brain tumor was diagnosed using magnetic resonance imaging (MRI). Blood transfusion was defined as receiving packed red blood cells intraoperatively. Intraoperative transfusion was conducted when the HB level was less than 70Ā g/L in stable patients and less than 90Ā g/L in patients with unstable hemodynamics. The blood transfusion decision was discussed between the anesthetist and the surgeon. If a variable had fewer than 10 events, the variable was excluded from the model establishment. Patient demographic information (gender and age), previous comorbidities (previous cerebrovascular disease, diabetes, cardiovascular disease, pulmonary disease, renal disease, and liver disease), brain tumor characteristics (diameter and number of brain tumors), patient status (American Society of Anesthesiologists (ASA) classification and heart function), and laboratory tests (white blood cell count (WBC), HB, platelet (PLT), prothrombin time (PT), activated partial prothrombin time (APTT), fibrinogen, D-dimer, total protein (TP), and albumin blood test (ALB)) were recorded. Preoperative cerebrovascular disease included ischemic and hemorrhage stroke. Previous cardiovascular disease included coronary artery stenosisā€‰>ā€‰80%, myocardial infarction, and major vascularĀ dissection. Pulmonary disease included chronic obstructive pulmonary disease, asthma, pulmonary fibrosis, and pulmonary arterial hypertension. Renal disease included glomerulonephritis and nephrotic syndrome. Liver disease included hepatitis and cirrhosis. Tumor diameter was averaged from the length, width, and height of the tumor recorded in the electronic history database. These variables were collected for each patient from the electronic history database of our hospital and were included for the feature selection during model development and validation.

Statistical analysis

Data imputation, standardization, and feature selection

All of the data were randomly split into training and test sets at a ratio of 7:3 (Fig.Ā 1). The missing data were imputed using recursive partitioning and regression trees with tenfold cross-validation (CV) and then standardized to the same range of values using the maxā€“min method in the training and test sets. Feature selection used the least absolute shrinkage and selection operator (LASSO, glmnet package in R with Ī±ā€‰=ā€‰1) with tenfold CV. LASSO shrinks the coefficients of some features, and those features with a coefficient of zero were interpreted as not being selected.

Figure 1
figure 1

Trial flowchart.

Machine learning algorithms and balanced performance evaluation

In our study, eight algorithms were applied to build the models and assess their predictive abilities for intraoperative blood transfusion. These algorithms included the K near neighbor algorithm (KNN)8, a linear discriminant analysis (LDA)9, a logistic regression model (LR), NaĆÆve Bayes, support vector machine (SVM)10, ranger (also called randomized forest)11, the extremely gradient boosting machine (xgboost)12, and the neural net (Nnet)13. The machine learning performance evaluation used a tenfold CV method with 1000 iterations in the training set. The hyperparameter setting used the default hyperparameterĀ (Supplementary InformationĀ 1). The classification error (CE) was used to evaluate the performance of the predictive ability in the training set, and the machine learning algorithm with the best performance was used for the calculator establishment. The calculator was then validated in the test set. Other measures of machine learning methods included accuracy (ACC), precision and recall area under the curve (PRAUC), area under the curve (AUC), and precision.

The quantitative data were expressed as the mean and standard division (SD) if the data were normally distributed; if not, the median and interquartile range were used. An independent t-test or Mannā€“Whitney U test was performed according to the data. The count data were expressed as their exact numbers and analyzed using the Ļ‡2 test. The discriminative ability between the prediction tool and HB was evaluated using the AUC of the receiver operating characteristic (ROC) curve14. The sample size selected for benchmarking various machine learning models met the standard of 10 events per variable15. The statistical analysis was performed using R software (version 4.2.2), and the machine learning models were benchmarked using the ā€œmlr3verseā€ package. A Pā€‰<ā€‰0.05 indicated statistical significance.Ā The checklist of STROBE (Strengthening the Reporting of Observational Studies in Epidemiology) is shown in Supplementary Information 2.

Ethics approval and consent to participate

This study was approved by the Ethics Committee of the Xiangyang Central Hospital, affiliated with the Hubei University of Arts and Science.

Results

Patient demographics

The patient baseline characteristics are shown in Table 1. Six patients were excluded as they took oral anticoagulants the day before surgery. Finally, a total of 541 patients who underwent brain tumor resection surgery were included in the analysis, and 141 patients (approximately 26%) received a blood transfusion. The patients in the transfused group were older than those in the non-transfused group (Pā€‰<ā€‰0.05). Patients with an ASA physical status III or heart function II had a higher incidence of transfusion than those with an ASA physical status I or II or heart function I (Pā€‰<ā€‰0.05). The tumor diameter, PT, and WBC were higher in the transfused group than in the non-transfused group (Pā€‰<ā€‰0.05). Patient demographic information (gender and weight), previous co-morbidities (previous cerebrovascular disease, diabetes, cardiovascular disease, pulmonary disease, renal disease, and/or liver disease), tumor characteristics (multi-site brain tumor), and laboratory tests (PLT, activated APTT, fibrinogen, D-dimer, TP, and ALB were not different between the transfused and non-transfused groups (Pā€‰>ā€‰0.05).

Table 1 Patients baseline characteristics.

Feature selection and machine learning model performance evaluation

LASSO identified seven variables, and the relevant plots are shown in Fig.Ā 2A and B. In our case, Ī»1se indicated that these variables were related to intraoperative blood transfusion and were chosen for model establishment: HB, diameter, PT, WBC, age, the physical status of the ASA classification, and heart function. HB and WBC had three missing values, and among the seven variables of interest, they were imputed using recursive partitioning and the regression trees algorithm prior to machine learning model benchmarking. The variance inflation factors for HB, diameter, PT, WBC, age, ASA, and heart function were 1.20, 1.18, 1.05, 1.08, 1.22, 1.20, and 1.19, respectively. The performance evaluation results of the various machine learning models showed that the CE values using KNN, LDA, LR, NaĆÆve Bayes, SVM, ranger, xgboost, and Nnet were 0.217, 0.193, 0.185, 0.204, 0.199, 0.196, 0.244, and 0.199, respectively. The boxplot is shown in Fig.Ā 3. Values of the CE, AUC, ACC, PRAUC, and precision for each machine learning method are shown in Table 2. The results showed that the LR, LDA, SVM, and ranger models performed better than the other four algorithms (Wilcox test, Pā€‰=ā€‰0.000).

Figure 2
figure 2

Results of the least absolute shrinkage and selection operator analysis for the feature selection on the training group. (A) With a decreasing log(Ī»), the influence of a variable that enters the model earlier is greater than that enters later. Each color line represents one of the explanatory variables. The plots demonstrate the extent that a variable enters the model and influences the response. (B) Binomial deviance changes with the values of Ī» are shown, and the acceptable variables are indicated by Ī» min to 1se. Seven features, namely hemoglobin, diameter, prothrombin time, WBC, age, the physical status of the American Society of Anesthesiologists classification, and heart function, were identified before the Ī»1se. Lines 1ā€“22 indicate the exploratory variables: [1] ASA, [2] DM, [3] age, [4] cardiovascular disease, [5] cerebrovascular disease, [6] diameter, [7] gender, [8] heart function, [9] hepatic disease, [10] multi-site tumor, [11] pulmonary disease, [12] surgery history of same site, [13] ALB, [14] APTT, [15] D-dimer, [16] HB, [17] NT-proBNP, [18] PLT, [19] PT, [20] TP, [21] WBC, and [22] fibrinogen.

Figure 3
figure 3

Boxplot of the classification errors of the eight machine learning algorithms. KNN K near neighbor, LDA linear discriminant analysis, LR logistic regression, NaĆÆve Bayes, SVM supporter vector machine, ranger, xgboost extremely gradient boosting model, Nnet neural net.

Table 2 Performance evaluation of eight machine learning algorithms.

Prediction tool establishment and performance evaluation

Considering the advantages of LR in terms of ease of implementation and understanding, as well as its comparable predictive ability to machine learning algorithms, LR was chosen to establish the nomogram. The prediction tool was established with the seven identified independent relative factors, namely HB, diameter, PT, WBC, age, ASA, and heart function (Fig.Ā 4). Briefly, to understand the prediction tool, we first acquired the patientā€™s baseline values of the seven variables. We then obtained the points of each variable from the first line and added all the scores. The total score predicted the probability of blood transfusion in patients receiving brain tumor surgery. The nomogram was then validated in the test set and the CE was 19.0%, similar with that of CE in the train set. An online calculator has been created (https://gongxrhbxysimple.shinyapps.io/dynnomapp/. Values of 1 and 2 represent ASA Iā€“II and III, respectively).

Figure 4
figure 4

Prediction tool to predict the probability of intraoperative blood transfusion in a patient who underwent brain tumor surgery. For example, a 75-year-old patient who underwent a 5Ā cm brain tumor resection surgery with ASA III, heart function II, WBC (6ā€‰Ć—ā€‰1012), PT (13S), and HB (110Ā g/L) had a total score of 364 in terms of these seven variables, and the probability of intraoperative blood transfusion was 91.6%. ASA American Society of Anesthesiologists, WBC white blood cell, HB hemoglobin, PLT Platelet.

In addition, we then compared the nomogram with HB for predicting the blood transfusion. The confusion matrices showed that the nomogram was superior to HB for predicting the blood transfusion in the test set (Table 3; Ļ‡2ā€‰=ā€‰36.76, Pā€‰=ā€‰1.339eāˆ’09, Yates' continuity correction). The AUC value of the predicted probability using a prediction tool [0.817, 95% CI (0.739, 0.895)] was better than that of HB [0.663, 95% CI (0.557, 0.770)] in the test group (Pā€‰=ā€‰0.000, Fig.Ā 5). In addition, the Hosmerā€“Lemeshow test of concordance between the virtual and predicted probability with prediction tool (Ļ‡2ā€‰=ā€‰10.97, Pā€‰=ā€‰0.278) was better than that of HB (Ļ‡2ā€‰=ā€‰27.94, Pā€‰=ā€‰0.001) alone.

Table 3 Confusion matrix for comparison the predictive ability of nomogram and HB.
Figure 5
figure 5

ROC curve of the prediction tool and HB of the probability of intraoperative blood transfusion in patients who underwent brain tumor surgery in the test group.

Discussion

In this study, approximately one-fourth of the patients who underwent craniotomy for brain tumor removal received an intraoperative blood transfusion. Seven preoperative indicators, namely HB, diameter, PT, WBC, age, ASA classification, and heart function, were identified as relevant factors for intraoperative blood transfusion during brain tumor resection surgery. We established a calculator to predict intraoperative blood transfusion, and the results showed that the prediction model had a good discriminative ability.

Feature selection removes the redundant features, and this makes the model much easier to interpret and generalize. The selection process of the shrinking ability of this operator depends on modifying the absolute value of the coefficient of functions. In this study, we used the LASSO classifier and identified seven relative factors for intraoperative blood transfusion. In addition, machine learning algorithms have been increasingly used in the anesthesiology16,17 and pain18 fields. We included eight machine learning methods and acquired a balanced performance evaluation by benchmarking various algorithms. Machine learning algorithms establish complex models and make accurate decisions when given relevant data. Our results suggest that conventional LR-based analyses can perform comparably to machine learning techniques. This might be attributable to the structure and dimensions of our data.

Given its strong interpretability and practical application in a clinical setting, we chose LR as the method to establish our prediction tool. The discriminative ability was assessed using the AUC in the test set. The AUC was over 0.8 and better than that of HB alone, indicating the good performance of the prediction tool. By calculating the points of the seven preoperative variables with the prediction tool, surgeons can easily assess the risk of intraoperative blood transfusion prior to surgery. Thus, preoperative blood-saving strategies can be considered to reduce the risk of blood transfusion for high-risk patients and to decrease the economic burden for low-risk families.

Tumor diameter was identified as an independent risk factor for intraoperative blood transfusion in our study. A big tumor typically has a fruitful blood supply and makes the surgery more difficult. High-grade tumors are more aggressive, large, less differentiated, and therefore more difficult to extract. The PT reflects the plasma levels of fibrinogen along with the coagulation factors II, V, VII, and X. Our results suggested that PT is an important indicator of intraoperative blood transfusion. The reason may be because prolonged PT decreases blood clots and results in massive blood loss19,20,21. Hemostasis disturbances during craniotomies are multifactorial and frequently comorbid with hyperfibrinolysis, abundant tissue factor expression, and the loss of coagulation factors22. Thus, our study identified an abnormal PT as a risk factor for intraoperative blood transfusion.

Our results also showed that age, WBC, ASA, and heart function are risk factors for intraoperative blood transfusion. Elderly patients are likely to have decreased hematopoietic activity, decreased platelet function, and a lower transfusion threshold and are frequently comorbid with cardiovascular and cerebrovascular diseases, which make critical organ tissue sensitive to ischemia. However, maintaining a higher HB level is an effective method to provide sufficient oxygen delivery during major surgery23,24,25. WBC indicates an inflammatory response in the body and may disrupt the coagulation process and result in increased blood loss during a surgical procedure26. The ASA physical status and heart function reflect the patientā€™s physical status, comorbidity, and activity tolerance before surgery, and patients in poorer conditions require higher blood HB levels to maintain hemodynamic stability27.

We established this prediction tool for predicting intraoperative blood transfusion using seven variables, and the prediction tool is simple and easy to use. However, the present study has some shortcomings: (1) This was a retrospective study, and some of the variables that may have affected the transfusion could not be measured. (2) The prediction tool was established based on our single center, and the prediction ability of this model needs to be confirmed by external tests in the future. However, the common preoperative variables make the prediction tool easy to use in clinics.

Conclusions

This study identified seven risk factors, namely preoperative HB, tumor diameter, PT, WBC, age, the physical status of the ASA classification, and heart function, that affect intraoperative blood transfusion during brain tumor resection surgery. Based on the seven indicators, a prediction tool was established, and this tool enables an accurate assessment of the probability of intraoperative blood transfusion during brain tumor resection surgery (Supplementary Information).