An Explainable Artificial Intelligence Model to Predict Malignant Cerebral Edema after Acute Anterior Circulating Large-Hemisphere Infarction

Abstract Introduction: Malignant cerebral edema (MCE) is a serious complication and the main cause of poor prognosis in patients with large-hemisphere infarction (LHI). Therefore, the rapid and accurate identification of potential patients with MCE is essential for timely therapy. This study utilized an artificial intelligence-based machine learning approach to establish an interpretable model for predicting MCE in patients with LHI. Methods: This study included 314 patients with LHI not undergoing recanalization therapy. The patients were divided into MCE and non-MCE groups, and the eXtreme Gradient Boosting (XGBoost) model was developed. A confusion matrix was used to measure the prediction performance of the XGBoost model. We also utilized the SHapley Additive exPlanations (SHAP) method to explain the XGBoost model. Decision curve and receiver operating characteristic curve analyses were performed to evaluate the net benefits of the model. Results: MCE was observed in 121 (38.5%) of the 314 patients with LHI. The model showed excellent predictive performance, with an area under the curve of 0.916. The SHAP method revealed the top 10 predictive variables of the MCE such as ASPECTS score, NIHSS score, CS score, APACHE II score, HbA1c, AF, NLR, PLT, GCS, and age based on their importance ranking. Conclusion: An interpretable predictive model can increase transparency and help doctors accurately predict the occurrence of MCE in LHI patients not undergoing recanalization therapy within 48 h of onset, providing patients with better treatment strategies and enabling optimal resource allocation.


Introduction
Stroke is a major global health concern and the leading cause of death and long-term disability in adults in China [1][2][3][4][5][6][7].Cerebral infarction is the most common type of stroke; in particular, large-hemisphere infarction (LHI) accounts for the majority of deaths and disabilities associated with cerebral infarction [8].LHI refers to an infarction involving an area exceeding two-thirds of the middle cerebral artery (MCA) supply area, with or without the involvement of adjacent anterior or posterior cerebral artery supply areas [9].
Malignant cerebral edema (MCE) is a serious complication and the main cause of poor prognosis in patients with LHI, with mortality rates reaching 80% with conservative treatment [5].Previous randomized controlled studies [10,11] have confirmed that decompressive hemicraniectomy within 48 h of symptom onset is an effective treatment for reducing the incidence and mortality of MCE.Therefore, rapid and accurate identification of individuals at risk of developing MCE is essential to provide timely therapy.
The predictive factors for brain edema have been widely discussed, and several studies have attempted to develop prediction models for MCE in ischemic stroke [12][13][14][15].However, traditional research on predictive factors only suggests the importance of certain features.Although many predictive models have shown good performance in research settings, the evidence for their application in clinical settings and the availability of interpretable risk prediction models to assist disease prognosis remain limited.
In recent years, artificial intelligence has been widely applied to explore early warning signs and predictive factors for many diseases.Machine learning uses algorithms to analyze data and make decisions and predictions regarding real-world events.Given the inherent powerful features of capturing nonlinear relationships using machine-learning algorithms, many researchers now advocate the use of new predictive models based on machine learning to support the appropriate treatment of patients.The SHapley Additive exPlanations (SHAP) is a "model interpretation" tool used to interpret the output of any machine learning model.SHAP constructs an additive explanatory model that considers all features as "contributors."For each prediction sample, the model generates a SHAP prediction value that reflects the influence of a certain feature in each sample, whether it has a positive or negative impact [16].
This study aimed to establish an interpretable model by utilizing the eXtreme Gradient Boosting (XGBoost), an artificial intelligence-based machine learning approach, to predict the occurrence of MCE in patients with LHI.In addition, the SHAP method was used to explain the XGBoost model and explore the prognostic factors for MCE, while providing data support for clinical decisionmaking.

Participants
Patients diagnosed with LHI not undergoing recanalization therapy at the Department of Neurology, The Third Affiliated Hospital of Soochow University, between December 2018 and April 2023 were retrospectively enrolled in this study.The enrollment is illustrated in Figure 1.This study was approved by the Ethics Review Board of The Third Affiliated Hospital of Soochow University (Approval Number: 2023-S-080).Due to the retrospective nature of the study, the requirement of obtaining informed consent from the participants was waived.The inclusion criteria were as follows: (1) acute cerebral infarction within 48 h from the onset of LHI; (2) lesions affecting the MCA blood supply area, with or without additional regions affected, and the cerebral infarction area encompassing at least two-thirds of the MCA blood supply area; (3) age ≥18 years; (4) patients who exceed the time window for revascularization treatment and those who refuse recanalization treatment given the higher risk and treatment costs.Patients with severe organ dysfunction or those diagnosed with major medical conditions such as cancer were excluded from the study.Definition of MCE Patients meeting the following three criteria were considered having MCE: 1. Neurological dysfunction or a decline in cognitive function is evident through the deterioration of consciousness.This was indicated by an increase of at least one point in the level of consciousness item (1a) or an increase of at least two points in the overall NIHSS score.2. Demonstrated displacement of at least 5 mm in the midline position of the pineal gland/septum pellucidum, as confirmed by CT or MRI. 3. The presence of a low-density lesion in the territory of the MCA is accompanied by local signs of brain edema, such as sulcal effacement or compression of the lateral ventricle.

Data Collection
A dataset was constructed that included demographic characteristics, clinical variables, laboratory findings, and neuroimagings.Although a few pieces of information were missing, the proportion of missing data was within the acceptable range.To overcome this limitation, multiple imputation techniques were employed separately to accurately fill in the missing data for both patient groups, which were previously categorized based on the occurrence of MCE.

Statistical Analysis
Patients were divided into two groups based on the presence or absence of MCE.To address the missing values in both groups, multiple imputation techniques were applied.Categorical variables were presented as counts and composition ratios, while continuous variables were expressed as means and standard deviations to analyze the differences between the groups.Categorical variables between the groups were compared using the corrected χ 2 test, and one-way ANOVA was used to compare continuous variables.All statistical tests were two-sided, and the significance level was set at p < 0.05.
Subsequently, the dataset that underwent imputation was randomly split into a training set and a validation set, maintaining a 3:1 ratio.Notably, no discernible differences were observed in any of the variables between the two datasets.The training set data were used to train the XGBoost model.
For the XGBoost model, the nrounds, max_depth, eta, gamma, colsample_bytree, and min_child_weight parameters were optimized to minimize the underfitting and overfitting of the models.Fivefold cross-validation was performed to determine the optimal parameters.The best parameters were then used to construct the final model.We conducted an analysis of the validation set using decision curve analysis (DCA) to assess the clinical utility and net benefit of the model.

Model Evaluation
To compare the performances of the two models in terms of precision, recall, accuracy, F1 score, kappa, sensitivity, specificity, positive predictive value, and negative predictive value, confusion matrices were constructed using the validation set.This enabled a comprehensive evaluation of the performance of the model in predicting MCE.Additionally, for a deeper understanding of the highly performing models, SHAP interpretation technology was employed, which provided enhanced visualization and insights into the decision-making process of the models.We conducted an analysis of the validation set using DCA to assess the clinical utility and net benefit of the model.

Demographic Characteristics and Clinical Information
A total of 314 patients with acute anterior circulating LHI without undergoing recanalization therapy were recruited, with 38.5% of the patients assigned to the MCE group (n = 121).Baseline characteristics and clinical information of the patients are shown in Table 1.In Table 1, the item collateral status (CS) was assessed using the Tan score method [17].

Models
The confusion matrix was constructed using the validation set, incorporating metrics such as the positive predictive value, negative predictive value, sensitivity, F1 score, and other indicators.These metrics collectively indicate that the XGBoost model possesses an excellent generalization capability and predictive performance.Based on the SHAP results, the top ten important variables identified were the ASPECTS, NIHSS score, CS score, APACHE II score, HbA1c level, atrial fibrillation, neutrophil-lymphocyte ratio (NLR), platelet (PLT) count, GCS score, and age.

SHapley Additive exPlanations
Each row represents a feature, and the x-axis represents the SHAP value.Each point on the plot corresponds to a sample with SHAP values that gradually increase from yellow to purple.SHAP values exceeding zero for certain features indicate an elevated risk of MCE.Higher SHAP values indicate that the corresponding feature is a contributing factor to the MCE.The DCA results demonstrated that the XGBoost model exhibited a significantly higher clinical net benefit across almost the entire range of diagnostic thresholds compared with both full intervention and nonintervention strategies.As Table 2 shows, based on the aforementioned statistical data, a confusion matrix of the validation set can be obtained, which comprehensively reflects the model evaluation status.

Discussion
MCE is a devastating complication of LHI, with a high mortality rate ranging from 40% to 78% [18,19].Early decompressive craniectomy is an effective treatment to reduce mortality but is not beneficial for improving prognosis.Therefore, most studies have focused on early prediction of MCE.In this retrospective cohort study, we developed and validated a machine-learning algorithm to predict the incidence of MCE in patients with LHI.The results showed that the XGBoost model had excellent clinical utility.
In critical care studies [20,21], XGBoost is a popular machine-learning algorithm that has been extensively employed for predicting inpatient mortality rates.The model achieved high performance, according to the confusion matrix shown in Table 2 and the receiver operating characteristic curve presented in Figure 2. As Figure 3 shows in this study, the ASPECTS score was recognized as the most important predictor variable, followed by the NIHSS score, CS score, APACHE II score, HbA1c, AF, NLR, PLT, GCS, and age.We combined the SHAP method with XGBoost to provide further explanations based on TRIPOD guidelines [22].In Figure 4 and Figure 5, the plots showed how a single feature affects the output of the XGBoost prediction model.The incorporation of SHAP facilitated both model performance and clinical interpretability.This approach enables medical practitioners to gain a deeper understanding of the decision-making process of the model and to utilize the prediction results to devise optimal treatment strategies and enhance patient management.In addition, according to the DCA results shown in Figure 6, the XGBoost model demonstrated a significant clinical utility.By leveraging the SHAP method to explain the XGBoost model, we successfully identified several significant variables associated with MCE development in patients with LHI.The predictive factors for MCE have been widely discussed.Consistent with previous research findings [15,23,24], we found that ASPECT was a significant predictor of MCE and the most important predictor variable in our study.When the ASPECT score was less than 6, there was a significant increase in the risk of developing MCE.Previous studies [15,25] have shown that scores below 7 are associated with a higher likelihood of developing MCE.The ASPECT score was initially used to semi-quantitatively evaluate the degree of infarction on CT images and can be used to assess the degree of ischemic changes in the MCA region [26].The lower the ASPECT score, the higher the NIHSS score and the worse the severity and functional prognosis of cerebral infarction.
Consistent with previous studies [23,27], our study found that a higher NIHSS score was a significant predictor of MCE.We found that when the NIHSS score exceeded 17, the risk of malignant brain edema increased as the score increased.This is consistent with the findings of a previous study [28], which suggested that an NIHSS score greater than 18 was closely related to the development of MCE.A meta-analysis of 38 studies [19] showed that lower age, a higher NIHSS score, and large areas of hypodense parenchyma were independent risk factors for MCE, whereas successful revascularization was a protective factor against MCE.In this study, we did not include patients who underwent reperfusion therapy.Therefore, patients who choose conservative treatment are at a higher risk of developing MCE and require early prediction and intervention.
Collateral circulation plays an important role in the pathophysiology of cerebral ischemia.Poor collateral circulation accelerates the entry of the ischemic penumbra into the infarct, resulting in a larger infarct area.The collateral circulation score is an effective tool for evaluating pia mater collateral circulation on computed tomography angiography [28].In this study, we used the Tan score [17] to assess collateral circulation.The Tan score is based on the filling of collateral vessels in the ischemic area of the MCA infarction, with scores of 3 (collateral filling reaching 100%), 2 (collateral filling 50-100%), 1 (collateral filling <50%), and 0 (no collateral supply).A score of 0-1 indicates poor collateral circulation, whereas a score of 2-3 indicates good collateral circulation.We found that when the CS score was less than 2, the SHAP value was greater than 0, indicating an increased risk of developing MCE.Previous studies [24,28,29] have also shown that collateral circulation scores less than 2 can predict the development of MCE.
This study suggests that the APACHE II score is a risk factor for the occurrence of MCE in patients with LHI.APACHE II includes three parts: acute physiology score, age score, and chronic health status score.The higher the score, the more critical the condition.We found that an APACHE II score >14 was associated with an increased risk of MCE.Studies [30,31] have compared the APACHE II score with other scoring systems and found that the APACHE II score has the strongest ability to judge the deterioration of the condition in critically ill patients admitted to the ICU.Similarly, a previous study [32] showed that compared to other scores the APACHE II score had the strongest predictive ability for the severity of cerebral infarction in patients.Acute physiological indicators in the APACHE II score are controllable, and timely inter-vention is necessary for patients with LHI to maintain normal vital signs and improve their prognosis.
In some studies [33,34], hyperglycemia was found to be associated with the development of malignant cerebral artery infarction.Du et al. [34] found that an elevated fasting blood glucose level could predict the development of MCE in patients undergoing endovascular treatment and developed a new rating scale based on this association: the ACORNS grading scale.Hyperglycemia may damage the blood-brain barrier (BBB), impair collateral circulation, increase the release of excitatory chemokines, and cause acidosis, all of which can increase the risk of MCE [35][36][37].In this study, we found that the fasting blood glucose level on the second day after enrollment was not related to the occurrence of MCE, whereas HbA1c was related to MCE.HbA1c was chosen as the predictor in this study, mainly because HbA1c can effectively reflect the average blood sugar level over the past 8-12 weeks and HbA1c is less affected by factors such as hypoglycemic drugs and food intake than fasting blood glucose.
This study found that atrial fibrillation was a predictive factor for the development of malignant brain edema in patients with LHI.Sun et al. [38] conducted a retrospective analysis of 157 patients with LHI and found that a history of atrial fibrillation was a risk factor for malignant brain edema.Pastuzak et al. [18] analyzed 66 patients aged >85 years with MCA regional cerebral infarction and found that a history of atrial fibrillation was the main risk factor for worsening.Atrial fibrillation is associated with greater volumes of more severe baseline hypoperfusion, leading to higher infarct growth, more frequent severe hemorrhagic transformation, and worse stroke outcomes [39,40].
Inflammation plays an important role in the pathophysiology of vascular diseases [41].Acute ischemic stroke can cause a series of inflammatory reactions and immunosuppressive states.Cerebral ischemia may disrupt the BBB through oxidative stress and excitotoxicity, leading to increased vascular permeability and the development of cytotoxic edema, vasogenic edema, and hemorrhagic transformation.White blood cell (WBC) count, neutrophil count, lymphocyte count, PLT count, and C-reactive protein level can be easily obtained from laboratory data as markers of systemic inflammation.NLR can also comprehensively reflect the level of inflammation in the body and has been proven to be related to the severity and prognosis of cerebral infarction [42][43][44][45].
Our study found that a high NLR was associated with an increased risk of MCE, consistent with previous research findings.
During acute cerebral infarction, neutrophils are the first immune cells to migrate from the damaged BBB to the ischemic brain area, releasing inflammatory mediators that can exacerbate brain damage [41].A study [27] conducted on patients with acute basilar artery occlusion who received endovascular treatment suggested that among all inflammatory factors, the neutrophil count achieved the highest accuracy, sensitivity, and specificity for predicting MCE.Lymphocytes exert neuroprotective effects after stroke by inhibiting inflammation and maintaining BBB integrity [40,46].The NLR is a composite marker of peripheral neutrophil and lymphocyte counts.On one hand, early neutrophil activation induces an inflammatory response that exacerbates brain damage; on the other hand, it reflects lymphocyte apoptosis in the acute phase.Therefore, it is more reliable to determine the level of inflammation in the body.
The correlation between WBC count and the occurrence of MCE was not consistent.A multicenter retrospective study on patients with MCA stroke within 48 h of onset showed that WBC count was the most important independent risk factor for fatal brain edema [47].Another meta-analysis [48] also revealed that WBC count was a predictive factor for MCE.However, Guo et al. [23] and Jo et al. [24] published an article and our study did not find a significant correlation between WBC count and MCE, which could be attributed to the differences in the populations included in the study.Many previous studies on MCE have not included PLT as a variable, and conclusions regarding PLT count and the prognosis of cerebral infarction have also been inconsistent [27,43,49,50].However, our study found that a reduced PLT count was a risk factor for MCE.This was consistent with the finding of a higher risk of MCE in patients with a lower PLR.Under pathological conditions, excessive activation and aggregation of PLT can lead to thrombosis and vascular occlusion, thereby promoting the occurrence of ischemic heart disease or ischemic cerebral infarction [51].Research has shown that thrombosis leads to excessive PLT consumption, thereby reducing the PLT count [50].In patients with LHI, thrombosis has already formed in the major blood vessels, and the low PLT count observed in these patients may be attributed to the presence of more extensive and larger thrombi, resulting in PLT consumption.
The GCS score has been widely used in clinical trials and practice.A lower GCS score is widely recognized as a powerful predictor of MCE in patients with LHI.Chen et al. [52] found that a lower GCS score is associated with an increased likelihood of developing MCE.A meta-analysis [48] also found a close correlation between lower GCS scores and a higher likelihood of MCE.In this study, we observed that when the GCS score was less than 9, the risk of MCE significantly increased, indicating that GCS is a predictive factor for MCE.Many studies [19,34,48] have shown that the risk of MCE in elderly patients is reduced due to age-related cerebral atrophy, providing a buffer space for brain swelling.Moreover, the neuroimmune response in elderly patients is weak, thereby reducing edema around the lesion.
This study had some limitations that should be acknowledged.First, our results were derived from a singlecenter retrospective study, which may have introduced systematic bias and limited the generalizability of the findings.Multicenter studies with larger sample sizes are required to validate our results.Second, this study lacked an external validation cohort.Third, this study did not include patients who had received vascular recanalization therapy.Finally, this study did not investigate the correlation be-tween changes in dynamic inflammatory indicators and the risk of MCE.Future research should focus on investigating the dynamic changes in these indicators to further elucidate their relationship with the MCE.

Conclusion
In this study, we developed an interpretable XGBoost prediction model that performed well in estimating the risk of MCE in patients with LHI.The SHAP method revealed the top 10 predictive variables of MCE based on importance ranking, while the ASPECTS score was considered the most important predictive variable, followed by the NIHSS score, CS score, APACHE II score, HbA1c, AF, NLR, PLT, GCS, and age.The development of an interpretable predictive model can increase the transparency of the model and help doctors more accurately predict the occurrence of MCE in LHI patients within 48 h from the onset and not undergoing recanalization therapy.By providing more accurate predictions, this model benefits patients by providing them with better treatment strategies and enabling optimal allocation of resources.

Table 2 .
Confusion matrix from the XGBoost