ckd-detection: NephroScan, the CKD detector that tries to behave like a clinical tool, not a notebook

A Flask and React pipeline turns an imbalanced kidney dataset into risk scores, stage estimates, and a visual fingerprint of renal health.

9 min read View on GitHub More from sharanugd2305

A clinician's desk split into two working zones. One side is cluttered with paper lab results, warning markers, and a stressed kidney symbol. The other side is a clean screen with a radial kidney chart, a risk gauge, and a saved-history ledger, showing how messy inputs become a readable decision workflow.
NephroScan's real contribution is not prediction alone. It is the translation of scattered clinical data into a workflow that looks usable.
Key Takeaways

The CKD app that acts like a workflow, not a form

The first thing NephroScan gets right is the experience. It does not stop at a yes-or-no prediction. It returns a risk level, a stage estimate, a visual readout, and saved history for logged-in users, which makes it feel closer to clinical decision support than a demo classifier.

This project focuses on predicting chronic kidney disease (CKD) using machine learning techniques. The goal is to assist in early detection by analyzing patient medical data and identifying patterns associated with chronic disease risk.

sharanugd2305, Project Author · ckd-detection/README.md

That framing matters. A lot of CKD repos can predict one label. Far fewer build a loop that helps a user enter incomplete values, understand the output, and preserve the result in a way that feels operational.

Why CKD detection is a nasty machine learning problem

CKD prediction is not a clean benchmark problem. The dataset is small, the classes are imbalanced, and the features mix continuous lab values with binary clinical markers. That combination is where many hobby ML projects quietly fall apart.

The important move is not a fancier model. It is the order of operations that keeps a rare-disease pipeline honest.

The repo treats that problem like a production constraint, not an academic footnote. It uses SMOTENC so the oversampling step respects mixed feature types, and it splits data before any scaling so test leakage does not inflate the result.

The model pipeline is quietly doing the right things

The training flow is the technical center of gravity. The code compares Logistic Regression, Random Forest, SVM, and XGBoost, then ranks them by F1 score. That choice is telling. In a disease setting, F1 is a better signal than raw accuracy because the class balance is not your friend.

StageWhat it doesWhy it matters
Train/test splitSeparates raw data before preprocessingPrevents leakage from the test set
Median imputationFills missing values from the training data profileKeeps the model usable on incomplete input
SMOTENCOversamples the minority class with mixed feature awarenessAddresses imbalance without flattening binary markers
F1 rankingCompares models on the balance of precision and recallRewards better disease detection behavior

This is the part that makes the project feel more serious than a typical UCI dataset clone. The code is not trying to impress with one giant model. It is trying to avoid obvious mistakes, then choose the best performing candidate in a disciplined way.

A close-up of a circular clinical chart being assembled from individual markers. Spokes labeled by lab values and vital measures lock into a radial shape, and the final spoke completes a readable kidney fingerprint. The image explains how the UI turns separate measurements into a single visual pattern.
The kidney radar chart turns raw values into a visual fingerprint. That is the kind of UX move that makes a prediction easier to trust.

The backend turns a saved model into a resilient service

`app.py` is the bridge between the pickle file and the user-facing product. It loads the model, computes feature medians at startup, and uses those medians when the input is incomplete. That keeps the app usable without forcing the user to understand the dataset behind it.

The persistence layer is practical too. Authenticated users can save prediction history, and the result payload is flexible enough to evolve. That matters in a medical tool, where output fields often change as the model or product matures.

The backend is not elegant for elegance's sake. It is doing the boring work that makes inference feel like a service instead of a script.

The frontend does the translation from lab values to a visual story

The frontend is where NephroScan stops looking like machine learning infrastructure and starts looking like a clinical interface. `Predict.js` combines a kidney radar chart, risk gauges, a BMI helper, and report generation so the user sees more than a raw probability.

That matters because medical numbers are hard to scan in isolation. A creatinine level or GFR reading is useful, but a radial chart makes the pattern legible at a glance. The UI is not decorative. It is doing interpretive work.

The report export is another product signal. It suggests the app expects the result to leave the browser and become part of a real workflow, not just a one-off prediction screen.

How this compares to other CKD repos

Repo typeStrengthWeaknessWhere NephroScan sits
Basic UCI classifierEasy to build and easy to understandOften ends at a notebook or minimal formMore complete as a product
Ensemble plus SHAP projectStronger explainability and often better modeling depthCan feel heavier and less workflow-focusedLess explainable, but cleaner UX
Research-first CKD studyBetter validation and clinical credibilityLess deployable as an appLess rigorous, more approachable
NephroScanBalanced end-to-end product flowNot a benchmark leader or explainability showcaseA strong prototype with product instincts

So the judgment is not that NephroScan is the most advanced CKD model. It is that the repo is unusually coherent. It handles imbalance, inference, persistence, and visualization as one system, which is rarer than it should be.

What NephroScan gets right, and what keeps it in prototype territory

The repo shows real judgment in the places that usually get ignored. It avoids leakage, respects mixed feature types, and presents its output in a way that a human could actually use.

But it is still a prototype. The repository hygiene is not perfect, with committed dependencies visible in the tree, and the app does not lean on explainability tools like SHAP or LIME. Those are not fatal flaws. They are the difference between a solid demo and a mature clinical system.

That is why NephroScan is worth noticing. It is not trying to win the machine learning leaderboard. It is trying to make a medical classifier feel operational, and that is a harder engineering problem than it looks.