Abstract
<title>Abstract</title> <p>Background Invasive fungal infection (IFI) is a life-threatening complication in critically ill patients, yet externally validated, generalizable machine learning (ML) tools for early risk stratification remain scarce. We developed and rigorously validated an interpretable ML model for IFI prediction across two independent ICU databases. Methods This retrospective cohort study used MIMIC-IV (94,458 ICU admissions; 295 IFI cases, 0.31%) for model development and the eICU Collaborative Research Database (159,204 patients across 208 hospitals; 767 IFI cases, 0.48%) for external validation. IFI was defined by deep-site culture positivity in MIMIC-IV and by ICD codes plus antifungal therapy in eICU. We applied least absolute shrinkage and selection operator (LASSO) regression for feature selection, propensity score matching with SMOTE to address class imbalance, and XGBoost optimized via Optuna as the primary classifier. SHAP values provided model interpretability. Bidirectional cross-database validation characterized model transferability under reciprocal distribution shift. Results The MIMIC-IV model achieved an AUC of 0.876 (95% CI: 0.852–0.899), with SOFA score, ICU length of stay, age, white blood cell count, and platelet count ranking as top predictors. Striking directional asymmetry emerged in cross-database validation: the multi-center eICU model generalized successfully to MIMIC-IV (AUC 0.829), whereas the reverse transfer failed catastrophically (AUC 0.401). Key barriers included scoring system incompatibility (SOFA vs. APACHE), divergent feature availability, and IFI definition heterogeneity. Decision curve analysis demonstrated net clinical benefit at probability thresholds of 0.5–5%. Conclusions Multi-center training data substantially enhances cross-institutional generalizability of ML prediction models, though systematic feature harmonization and prospective validation remain indispensable. These findings provide actionable guidance for developing robust, deployable IFI prediction tools across diverse ICU settings.</p>