A Dual-Model Machine Learning Approach Using Routine Clinical, Laboratory, and Cerebrospinal Fluid Parameters for Early Differentiation of Autoimmune from Viral Encephalitis
Main Article Content
Abstract
Diagnostic tests for autoimmune encephalitis (AE) and viral encephalitis (VE) are often unavailable in resource-limited settings, delaying life-saving treatment decisions—a gap relevant to Sustainable Development Goal 3, Good Health and Well-being. This study provides a machine learning benchmark for early AE-versus-VE differentiation using routinely available data. We reanalyzed a public dataset of 75 patients (37 AE, 38 VE), using only routine clinical, peripheral blood, and cerebrospinal fluid (CSF) variables and deliberately excluding specialized immunophenotyping markers. LASSO logistic regression and a depth-constrained random forest were developed within a repeated stratified 5-fold cross-validation framework, with interpretability assessed via LASSO odds ratios, feature importance, and SHAP values. Fever, headache, and elevated lumbar puncture opening pressure significantly favored VE, while psychiatric symptoms and cognitive impairment favored AE (all p < 0.05). The random forest achieved a mean cross-validated ROC-AUC of 0.730 and threshold accuracy of 0.640, modestly outperforming LASSO (AUC = 0.655; accuracy = 0.520). Interpretability methods converged: fever, headache, elevated CSF white blood cell count, and LP opening pressure favored VE, while elevated CSF protein, CSF glucose, psychiatric symptoms, and lymphocyte percentage favored AE. Machine-learning models achieved modest-to-moderate discrimination using only routine variables; external validation and calibration are needed before clinical use.
Article Details
References
1. Auwal AM, Matthews R, Cook C, Sargent B, Easton A, Ray STJ, et al. Suspected encephalitis in adults. Pract Neurol. 2026;26(5):426-439. doi: 10.1136/pn-2024-004299.
2. Dubey D, Pittock SJ, Kelly CR, McKeon A, Lopez-Chiriboga AS, Lennon VA, et al. Autoimmune encephalitis epidemiology and a comparison to infectious encephalitis. Ann Neurol. 2018;83(1):166-177. doi: 10.1002/ana.25131.
3. Segal Y, Rotschild O, Mina Y, Maayan Eshed G, Levinson T, Paran Y, et al. Epidemiology of autoimmune encephalitis and comparison to infectious causes – experience from a tertiary center. Neurology. 2024;103(7 Suppl 1). doi: 10.1212/01.wnl.0001051488.35527.58.
4. Bongale S, Barwade S, Sarvagod S, Jadge D. Encephalitis disease: pathophysiology, clinical manifestations, diagnosis, treatment, and recent advances. International Journal of Pharmaceutical Sciences. 2026;4(6):97-118. doi: 10.5281/zenodo.20483906.
5. Abbuehl LS, Hofmann E, Hakim A, Dietmann A. Can we forecast poor outcome in herpes simplex and varicella zoster encephalitis? A narrative review. Front Neurol. 2023;14:1130090. doi: 10.3389/fneur.2023.1130090.
6. Gong X, Liu Y, Ma Y, Yan B, An D, Guo Y, et al. Long-term maintenance of mycophenolate mofetil in anti-NMDA receptor encephalitis (LEARN): a multicentre, open-label, blinded-endpoint, randomised controlled trial. J Neurol Neurosurg Psychiatry. 2025;96(10):998-1007. doi: 10.1136/jnnp-2024-335400.
7. Yu X, Gao S, Huang Y, Shen X, Zhao S, Chen J, et al. A nomogram for predicting viral encephalitis based on cerebrospinal fluid biomarkers. Front Neurol. 2026;17:1769471. doi: 10.3389/fneur.2026.1769471.
8. Xu K, Jia J, Duan Y, Chen S, Xiao X, Zhu F, et al. Development of a prediction model integrating PD-1 and ICOS for early differential diagnosis between autoimmune and viral encephalitis. Front Immunol. 2025;16:1550963. doi: 10.3389/fimmu.2025.1550963.
9. Petrosian D, Giedraitienė N, Taluntienė V, Apynytė D, Bikelis H, Makarevičius G, et al. Differential diagnosis of infectious versus autoimmune encephalitis using artificial intelligence-based modeling. J Clin Med. 2025;14(22):8222. doi: 10.3390/jcm14228222.
10. Hoang HE, Robinson-Papp J, Mu L, Thakur KT, Gofshteyn JS, Kim C, et al. Determining an infectious or autoimmune etiology in encephalitis. Ann Clin Transl Neurol. 2022;9(8):1125-1135. doi: 10.1002/acn3.51608.
11. Liu Z, Li Y, Wang Y, Zhang H, Lian Y, Cheng X. The neutrophil-to-lymphocyte and monocyte-to-lymphocyte ratios are independently associated with the severity of autoimmune encephalitis. Front Immunol. 2022;13:911779. doi: 10.3389/fimmu.2022.911779.
12. Almadhoun MB, Burhanuddin M. Optimizing feature selection and machine learning algorithms for early detection of prediabetes risk: comparative study. JMIR Bioinform Biotechnol. 2025;6. doi: 10.2196/70621.
13. Benninger F, Steiner I. CSF in acute and chronic infectious diseases. Handb Clin Neurol. 2018;146:187-206. doi: 10.1016/B978-0-12-804279-3.00012-5.
14. Bjursten S, Pandita A, Zhao Z, Fröjd C, Ny L, Jensen C, et al. Early rise in brain damage markers and high ICOS expression in CD4+ and CD8+ T cells during checkpoint inhibitor-induced encephalomyelitis. J Immunother Cancer. 2021;9(7). doi: 10.1136/jitc-2021-002732.
15. Martin GP, Riley RD, Ensor J, Grant SW. Statistical primer: sample size considerations for developing and validating clinical prediction models. Eur J Cardiothorac Surg. 2025;67(5). doi: 10.1093/ejcts/ezaf142.
