CoolFace
Apppublic

Rf33d/DR-CKD

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

DR–CKD Early Detection Web App

Diabetic Retinopathy Based Early Detection of Chronic Kidney Disease Using Deep Learning


Project Structure

dr_ckd_app/
├── app.py               ← Flask backend (model, inference, GradCAM, PDF)
├── model.pth            ← YOUR Phase 2 checkpoint (place here)
├── requirements.txt     ← Python dependencies
└── templates/
    └── index.html       ← Full frontend (upload, results, chatbot)

Setup (one time)

bash
# 1. Install dependencies
pip install -r requirements.txt

# 2. Place your Phase 2 .pth file in this folder, named model.pth
#    (this is the BEST_CKPT from Step 7 of your notebook)
cp /path/to/your/phase2_best.pth model.pth

Run

bash
python app.py
# or: python app.py path/to/your_model.pth

Then open → http://localhost:5000


What the Website Does

FeatureDescription
UploadDrag & drop or click to upload a fundus image
ValidationRejects non-fundus images with an error message
PreprocessingRuns the full cv2 pipeline: crop border → Ben Graham → CLAHE → normalize
InferenceConvNeXtDR Phase 2 model predicts DR grade 0–4 + confidence
GradCAMShows original + heatmap overlay side by side
CKD RiskLookup table maps DR grade → risk category, eGFR, CKD stage, clinical action
Probability barsConfidence for all 5 DR classes
PDF ReportDownloadable report with all results + GradCAM images
ChatbotKeyword-based Q&A about DR, CKD, GradCAM, model — no API needed

Notes

  • —The model runs on CPU by default (no GPU needed for inference)
  • —Model loads once at startup — predictions are fast
  • —The chatbot is pure JavaScript with ~17 Q&A topics, no external API
  • —PDF is generated server-side using ReportLab