Abstract
Background:Liver diseases constitute one of the most prevalent global health problems that cause millions of deaths every year. Identification of potential patients even prior to their diagnosis could improve the efficacy of screening procedures and ensure timely interventions. Despite promising results yielded by Al and ML techniques in disease diagnostics, current models tend to be opaque and focus on binary disease prediction rather than pre-symptom detection. Methods: We propose a novel XAI-LiverSHAPNet framework to detect for liver disease stratification by employing ensemble machine learning. A publicly accessible synthetic dataset containing 1,700 patients records with 11 features was first prepared by removing outliers and imputing missing values and SMOTE oversampling was performed in order to balance classes in the data. LR, SVM, DT, RF, GB, KNN, CatBoost, XGBoost, and Extra Trees were tested individually and as stacking and voting ensembles. Latent relationships within the data set were discovered using t-distributed Stochastic Neighbor Embedding (t-SNE) and Uniform Manifold Approximation and Projection (UMAP). Unlike previous studies, the proposed model allows the identification of patients at high risk on the basis of the existing characteristics, facilitating risk stratification without necessarily needing data on symptoms. Additionally, conducted study further contributes methodological novelty through feature-level ablation analysis to evaluate the impact of key variables. The XAI-LiverSHAPNet framework follows a three-tiered analysis pipeline featuring data preprocessing and balancing, ensemble modeling, and interpretation through explainable AI. Results: XAI-LiverSHAPNet outperformed baseline and ensemble competitors, achieving a specificity of 97.19%, ROC-AUC of 96.61%, precision of 94.62%, recall of 94.24%, F1-score of 94.38%, and mean cross-validation accuracy of 93.12% (SD = 0.0151). The SHAP approach found that AlcoholConsumption, LiverFunctionTest, and Age had the greatest impact on the outcome, with the removal of all three parameters significantly decreasing model accuracy to around 70 percent. The statistical analysis revealed that the suggested model provided significantly better results than the Voting method for probabilistic calibration measures, namely Brier Score and Log Loss (p < 0.05). Conclusion: The presented XAI-LiverSHAPNet framework shows promise as a clinical decision support tool for liver disease risk stratification, where further validation is necessary on large-scale, multi-center data.