--- title: CKD Prediction System emoji: 🫘 colorFrom: blue colorTo: indigo sdk: gradio sdk_version: 5.23.3 app_file: app.py pinned: false license: mit --- # Chronic Kidney Disease (CKD) Prediction System **Research Project | PAF-IAST | HEC-Funded** **Principal Investigator:** Dr. Muhammad Rizwan --- ## Overview This web application provides an AI-powered screening tool for **Chronic Kidney Disease (CKD)** based on routine blood test parameters. It was developed as part of a peer-reviewed research study conducted at the **Pakistan Air Force Institute of Aerospace Technology (PAF-IAST)** under an HEC-funded project. The application accepts 21 blood parameters as input and returns a binary prediction (**CKD / No CKD**) along with class probabilities. --- ## Model | Property | Details | |---|---| | Algorithm | Random Forest Classifier | | Accuracy | ~95.5% | | F1 Score | ~95.4% | | ROC-AUC | ~98.5% | | Validation | 5-fold Stratified Cross-Validation | | Explainability | SHAP + LIME | The Random Forest model was selected after benchmarking 8 classifiers including XGBoost, CatBoost, Gradient Boosting, AdaBoost, Logistic Regression, Decision Tree, and K-Nearest Neighbors. --- ## Input Features The model uses the following 21 blood test parameters: **Demographic:** Sex, Age **CBC:** Haemoglobin, Hematocrit, RBC Count, WBC Count, Platelet Count **Red Cell Indices:** MCH, MCHC, MCV, RDW-SD, MPV, PCT, PDW **Differential Count:** Lymphocytes, Monocytes, Polymorphs, Eosinophils **Kidney Function:** Creatinine, Blood Urea, GFR --- ## Key Findings (from SHAP Analysis) Top predictive features (in order of importance): 1. **Creatinine** — strongest CKD indicator 2. **GFR** (Glomerular Filtration Rate) — inverse relationship with CKD 3. **Urea** — elevated in kidney dysfunction 4. **RDW-SD** — red cell distribution width 5. **MPV** — mean platelet volume --- ## Dataset - **Samples:** 398 patients - **Class distribution:** CKD: 241 (60.6%) | No CKD: 157 (39.4%) - **Missing values:** < 1.5% (imputed with zero-fill) - **No duplicates** --- ## Files in this Space ``` app.py ← Gradio application requirements.txt ← Python dependencies Random_Forest.pth ← Trained Random Forest model (joblib format) README.md ← This file ``` --- ## Disclaimer > This application is intended **for research and educational purposes only**. > It does **not** constitute medical advice, diagnosis, or treatment. > All clinical decisions must be made by a licensed and qualified physician. --- ## Citation If you use this work, please cite the associated research paper (details to be added upon publication). **Contact:** Dr. Muhammad Rizwan | PAF-IAST