Interpretable machine learning for early risk stratification of post-viral encephalitis epilepsy using routine blood and CSF markers
Post-viral encephalitis epilepsy (PEE) is a common and debilitating neurological sequela, yet early risk stratification tools remain lacking, particularly those based on routine blood and cerebrospinal fluid (CSF) tests obtained during standard diagnostic workup. This study aimed to develop and validate an interpretable machine learning (ML) model for PEE risk stratification using only routine blood and CSF markers. We retrospectively enrolled 443 patients diagnosed with viral encephalitis from a tertiary hospital (training set: 353; test set: 90). Seven ML algorithms—logistic regression, K-nearest neighbours, random forest, XGBoost, LightGBM, decision tree, and support vector machine—were trained and validated using demographic, serum, and CSF features. Model transparency was ensured via the SHapley Additive exPlanations (SHAP) framework. The XGBoost model achieved the best performance in the hold-out test set, with an AUC of 0.816 (95% CI: 0.729–0.904) and a sensitivity of 0.906, underscoring its potential as an effective early screening tool. SHAP analysis identified serum white blood cell count, CSF white blood cell count, and age as the predominant predictors. This XGBoost-based model, leveraging routine blood and CSF markers, demonstrates good discriminative ability and clinical utility. It may facilitate early identification and prioritisation of high-risk patients in post-viral encephalitis management—particularly valuable in resource-limited settings where advanced neuroimaging or EEG expertise is unavailable. This approach highlights a pragmatic trade-off between maximal predictive accuracy and real-world accessibility.
Authors
- 曹勇军
- Dongxing Wang (ORCID: https://orcid.org/0000-0001-9916-8329)
- Jie Pan (ORCID: https://orcid.org/0009-0006-8901-520X)
- Hong Tao
- Pengzhu Yang
- Yanlin Zhang
- Aiming Shi
- Bo Lv
Institutions
- Second Affiliated Hospital of Soochow University (CN)
Publication Details
- Journal
- BMC Neurology
- Published
- 2026-11-18
- DOI
- https://doi.org/10.1186/s12883-026-05455-7
- Primary Topic
- Infectious Encephalopathies and Encephalitis
- Type
- article
- Field-Weighted Citation Impact
- 0.00