DiabetesSense
93% accurate diabetes risk screening from an 11-model benchmark
- Timeline
- Jul 2023 - Jul 2024
- Role
- BSc thesis (with Inshra Javed), COMSATS University Islamabad
- Status
- Shipped
- Primary stack
- scikit-learn · React.js · Flask · pandas
Headline metrics
- What it tackles
- A diabetes classifier can hit high accuracy and still be useless: a clinician who cannot see why a patient was flagged will not act on the score.
- What it delivers
- An 11-model benchmark on the 253,680-record CDC BRFSS 2015 dataset, won by Random Forest at 93% accuracy and strongest on ROC-AUC and sensitivity, served as a lab-free 19-question screening app with the risk drivers shown alongside the score.
The problem in full
Clinical prediction models live or die by interpretability. A black-box classifier can hit 95% accuracy and still be useless if a clinician can't see why a particular patient was flagged. Diabetes risk already has good baseline accuracy from logistic regression and tree ensembles, so the real research question wasn't 'can we predict?' but 'can we predict and explain in a way clinicians will actually trust?'
Adoption literature on clinical ML is consistent: when clinicians can't trace a prediction back to features they recognise, they reject the tool - even when the tool is more accurate than their own judgement. The interpretability layer isn't optional polish; it's the load-bearing part.
System design
Built on the CDC BRFSS 2015 dataset - 253,680 records, 22 features, and a 14% positive class handled with Random Over-Sampling, chosen after comparing ROS against SMOTE and ADASYN. Benchmarked 11 classifiers spanning linear, instance-based, tree, boosting, and neural families under an 80/20 split.
The tree ensembles led the field, with Random Forest strongest on ROC-AUC and sensitivity, then the instance-based models, and the linear baseline last. Interpretability came from correlation-driven risk-factor analysis - general health (-0.41), high blood pressure (+0.38), high cholesterol and BMI (+0.29 each) topped the drivers, with prevalence climbing sharply from age 50 onward.
Persisted the winning model with joblib behind a Flask REST API with a React.js frontend: a 19-question, lab-free questionnaire that returns a risk classification plus a future-risk probability and lifestyle recommendations keyed to the user's dominant risk factors.
Explore the risk factors
Select a factor to see how it correlates with a diabetes diagnosis across the 253,680-record BRFSS 2015 dataset. These are the measured dataset statistics behind the study - not a prediction about you.
The strongest positive correlate in the dataset - and like every feature the app collects, it's self-reportable without a lab test.
Tied with BMI as the second-strongest positive correlate at +0.29.
Tied with high cholesterol at +0.29. One of the 19 lab-free questionnaire inputs the deployed screening app asks for.
Prevalence climbs sharply from age 50 onward - the steepest demographic gradient in the dataset.
Self-reported physical health tracks positively with a diabetes diagnosis - the last of the five positive correlates in the ranking.
Protective, but the weakest signal on the chart - far smaller in magnitude than the top risk factors.
Socioeconomic features are protective in this dataset; education at -0.15 sits just behind income.
The stronger of the two protective socioeconomic features, at -0.19.
The strongest correlate overall, and it's negative: better self-rated general health means lower diabetes prevalence. By magnitude it beats every positive risk factor.
Pearson correlation with diabetes status · BRFSS 2015, 253,680 records · dataset statistics, not a diagnostic tool.
Key technical decisions
Benchmark breadth over a single favourite
Eleven models spanning linear, instance-based, tree, boosting, and neural families. The tree ensembles' dominance over the linear baseline was a measured finding, not an assumption baked in at the start.
ROS over SMOTE and ADASYN
All three balancing techniques were run head-to-head on the 86/14 imbalance, with resampling confined to the training folds so the held-out split stayed untouched. Synthetic interpolation (SMOTE/ADASYN) blurred the categorical questionnaire features; plain random over-sampling preserved the feature distributions and produced the strongest downstream classifier.
Lab-free questionnaire over clinical inputs
BRFSS features are all self-reportable - blood pressure history, BMI, activity, general health. That constraint means anyone can complete the 19-question screen without lab tests, which is exactly what makes a public-facing risk tool usable.
The results in full
Random Forest led the 11-model benchmark on the held-out split at 93% accuracy, and was strongest on ROC-AUC and sensitivity - the metrics that matter on an 86/14 imbalance. The risk-factor analysis surfaced clinically coherent drivers: general health, high blood pressure, high cholesterol, BMI, and age.
Shipped as a screening app anyone can complete without lab tests: 19 questions in, a risk classification plus future-risk probability and tailored lifestyle recommendations out.
What I'd do next
If I rebuilt it, per-prediction attribution would ship in v1 rather than arriving with the follow-on assistantship - a risk score without 'why this score' is exactly the black box the thesis argued against.
For clinical deployment beyond a paper, the next blockers are calibration and population shift: performance on a single curated dataset does not transfer to a different hospital's intake. The model needs Platt-scaled probabilities and a population-shift detector before it's safe at the bedside.
Continue reading
Sleep Efficiency Predictor
Published ML research served as a lifestyle-factor prediction app
FinLaw-UK
Graph-augmented RAG for UK financial regulation