Abstract
BACKGROUND: Central nervous system (CNS) aspergillosis is a rare but highly fatal infection, particularly among immunocompromised individuals. Timely diagnosis and optimal treatment selection are crucial for improving patient outcomes, yet clinical decision-making remains challenging. METHODS: We integrated clinical data from 64 published CNS aspergillosis cases (2014–2024) and structured electronic medical records (EMRs) from 200 ICU patients. After preprocessing (one-hot encoding, Z-score standardization, BERT-based text feature extraction), a Gradient Boosting Classifier (GBC) was trained to predict 30-day survival. Additionally, a LinUCB-based adaptive treatment policy was developed to dynamically optimize therapy choices. Model performance was evaluated against logistic regression, random forest models, and baseline treatment policies. RESULTS: In a retrospective cohort of 64 patients, the contextual LinUCB policy outperformed ε-greedy and a random recommender, achieving the highest average predicted survival rate of 76.5% (max 83.0%, min 67.0%) versus 56.7% for ε-greedy and 49.3% for Random; the observed survival under clinician decisions was 50%. Feature ablation demonstrated that removing sex, clinical presentation, and imaging findings reduced the estimated survival by 19.6% points from an 83.3% baseline, whereas other features (e.g., age, country) each had smaller effects (< 10% points). The LinUCB adaptive policy demonstrated superior cumulative survival gain compared to random and ε-greedy strategies, indicating that incorporating patient context materially improves treatment recommendations. CONCLUSION: Integrating meta-analytic and EMR-derived data with machine learning models can accurately predict survival and inform adaptive treatment strategies in CNS aspergillosis. The proposed LinUCB-guided approach offers a promising framework for real-time, personalized decision-making in critically ill patients. CLINICAL TRIAL REGISTRATION: Not applicable. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12879-026-12573-7.