Papers
Topics
Authors
Recent
Search
2000 character limit reached

StackLiverNet: Interpretable Liver Disease Detection

Updated 3 July 2026
  • StackLiverNet is an interpretable stacked ensemble framework engineered for highly accurate liver disease detection and transparent predictions.
  • It utilizes a multi-stage data preprocessing pipeline and a two-level stacking ensemble (XGB, KNN, LightGBM) to optimize feature selection and model performance.
  • The framework achieves state-of-the-art metrics (99.89% accuracy, 0.9993 AUC) and uses LIME, SHAP, and Morris methods to provide clear, clinician-friendly explainability.

StackLiverNet is an interpretable stacked ensemble framework specifically engineered for highly accurate and transparent liver disease detection. Designed to address deficiencies in prior machine learning models—namely, high misclassification error, limited interpretability, computational inefficiency, and inadequate preprocessing—StackLiverNet integrates rigorous data engineering, a two-level stacking ensemble architecture, and state-of-the-art explainability techniques to achieve robust and clinically viable diagnostic performance (Haque et al., 31 Jul 2025).

1. Data Preprocessing and Feature Engineering

StackLiverNet processes a large clinical dataset (26,303 samples from the Kaggle Liver Disease Patient Dataset) through a multi-stage pipeline aimed at maximizing predictive robustness and generalizability. Key steps include:

  • Missing Value and Outlier Handling: Categorical variables (Gender) undergo mode imputation and integer encoding, while rows with missing numeric features are dropped to preserve data integrity. Outliers in numeric features are winsorized according to the interval [Q11.5IQR,Q3+1.5IQR][Q_1-1.5\cdot\mathrm{IQR}, Q_3+1.5\cdot\mathrm{IQR}], clamping extreme values to the nearest boundary.
  • Standardization: Each numeric feature is scaled to zero mean and unit variance, computed as zi=(xiμ)/σz_i = (x_i - \mu)/\sigma.
  • Statistical Feature Pruning: One-way ANOVA is used to test the null hypothesis H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}} at α=0.05\alpha=0.05, discarding non-significant predictors (Age, Gender).
  • Recursive Feature Elimination with Cross-Validation (RFE-CV): Utilizes a random forest as the estimator, iteratively removing the least important of the remaining 9 features, recording mean accuracy at subsets with 3, 5, and 7 features, and selecting the size with maximal cross-validation accuracy. The final 5 features selected are Total Bilirubin, Alkaline Phosphatase, SGOT (AST), SGPT (ALT), and Albumin, achieving near-perfect cross-validation accuracy (1.0\approx 1.0).
  • Class Imbalance Correction: In the 80% training split, random undersampling is performed to match the majority (disease) and minority (healthy) class counts at N0=N1=5,282N_0'=N_1=5,282, with the 20% held-out set left imbalanced for unbiased model evaluation.

2. Stacked Ensemble Architecture

StackLiverNet’s classification core is a two-level stacking ensemble. The base layer comprises independently cross-validated, hyperparameter-tuned classifiers:

  • XGBoost (XGB): nestimators=150n_{\mathrm{estimators}}=150, max_depth=5max\_depth=5, learning_rate=0.1learning\_rate=0.1, subsample=0.8subsample=0.8, zi=(xiμ)/σz_i = (x_i - \mu)/\sigma0.
  • k-Nearest Neighbors (KNN): zi=(xiμ)/σz_i = (x_i - \mu)/\sigma1, zi=(xiμ)/σz_i = (x_i - \mu)/\sigma2, zi=(xiμ)/σz_i = (x_i - \mu)/\sigma3.

Out-of-fold predictions from each base learner construct the level-1 feature matrix, which the meta-learner—LightGBM—uses to make final predictions. The optimization objective for LightGBM at iteration zi=(xiμ)/σz_i = (x_i - \mu)/\sigma4 is:

zi=(xiμ)/σz_i = (x_i - \mu)/\sigma5

with regularization penalty zi=(xiμ)/σz_i = (x_i - \mu)/\sigma6 for zi=(xiμ)/σz_i = (x_i - \mu)/\sigma7 leaf nodes.

The stacking procedure employs zi=(xiμ)/σz_i = (x_i - \mu)/\sigma8-fold cross-validation to prevent data leakage between base and meta levels. For each fold, base learners are trained on zi=(xiμ)/σz_i = (x_i - \mu)/\sigma9 and predictions on H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}0 are concatenated for LightGBM meta-training.

3. Performance Evaluation

StackLiverNet attains state-of-the-art predictive metrics on the held-out test set (4,674 cases):

Metric Value
Accuracy 99.89%
Cohen’s Kappa (H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}1) 0.9974
AUC 0.9993
Total Misclassifications 5
Training Time 4.2783 s
Inference Time 0.1106 s

Cohen's Kappa is computed as:

H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}2

with H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}3 as observed agreement and H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}4 as chance agreement. High kappa confirms near-perfect reliability beyond chance. AUC of 0.9993 integrates TPR over FPR and establishes discriminative capability.

Five-fold stratified cross-validation provided mean accuracy H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}5 and mean AUC H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}6, indicating excellent stability. The framework also reports standard metrics including precision, recall, and F1-score, which can be traced to the underlying contingency matrix definitions as given in the data.

4. Explainability and Feature Attribution

StackLiverNet incorporates a triad of explainability methods to ensure transparency at both individual and population levels:

  • LIME: Constructs local surrogate models by minimizing

H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}7

where H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}8 quantifies similarity to the instance H0 ⁣:μfdisease=μfnoH_0\!: \mu_{f|\mathrm{disease}} = \mu_{f|\mathrm{no}}9. LIME explanations indicate that increased Alkaline Phosphatase (α=0.05\alpha=0.050 z-score) and moderately elevated SGOT predict positive (disease) cases, whereas high Albumin (α=0.05\alpha=0.051 z-score) and low Bilirubin favor negative (healthy) cases.

  • SHAP: Computes Shapley values α=0.05\alpha=0.052 for global and local attribution:

α=0.05\alpha=0.053

SHAP consistently ranks Total Bilirubin, Alkaline Phosphatase, and SGPT as most influential globally.

  • Morris Method: Executes global sensitivity analysis via elementary effects (EE) for α=0.05\alpha=0.054 randomized trajectories:

α=0.05\alpha=0.055

and summarizes with α=0.05\alpha=0.056, α=0.05\alpha=0.057. Alkaline Phosphatase (α=0.05\alpha=0.058) and SGPT (α=0.05\alpha=0.059) stand out, while SGOT and Albumin exhibit low sensitivity, corroborating SHAP findings.

Collectively, these methods render StackLiverNet interpretable at both granular and aggregate levels, facilitating both clinician scrutiny and research audit.

5. Clinical and Computational Implementation

StackLiverNet’s computational efficiency (training time 4.3 s, inference 0.11 s on standard hardware) is well within the operational constraints of point-of-care diagnostic workflows. The integration of rapid prediction generation with clear, feature-level interpretability supports its "amenability to clinical practice" and positions it for early disease screening. The explicit connection between predictive attributions and clinically validated biomarkers (notably, Alkaline Phosphatase, Total Bilirubin, and SGPT) is central to fostering clinician trust and regulatory acceptance.

6. Summary and Broader Significance

StackLiverNet represents an overview of rigorous preprocessing, high-capacity stacking ensembling, and complementary explainability tools (LIME, SHAP, Morris). It achieves near–perfect diagnostic accuracy for liver disease detection on a substantial real-world dataset, while systematically exposing the rationale for both global and patient-specific predictions. The framework demonstrates the feasibility of deploying interpretable ensemble models in real-world clinical settings, advancing the reliability, transparency, and speed of machine learning-based triage and screening solutions (Haque et al., 31 Jul 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to StackLiverNet.