Diabetes does not arrive as a single diagnosis. It creeps along a continuum, from healthy metabolism through the murky intermediate zone of prediabetes and onward to full disease, and clinicians have long struggled to pin down where on that path any individual patient stands. Now researchers at Arizona State University have built a machine learning framework that not only classifies patients across all three stages with near-perfect accuracy but also explains, in human-readable terms, exactly which clinical variables drove each prediction. The study, published in Frontiers in Digital Health, could reshape how clinicians think about personalized diabetes risk stratification and early intervention.
The research team, led by Nosakhare Lucky Igbinedion and Folorunsho Mercy Olorunfemi at Arizona State University, trained their models on a dataset of 1,000 patient records drawn from medical files in Iraq, containing demographic information alongside clinical measurements such as HbA1c, cholesterol, urea, creatinine, body mass index, and age. Rather than treating diabetes as a binary diagnosis, the framework classifies each patient into one of three distinct stages: non-diabetic, prediabetic, or diabetic. This multiclass approach reflects the clinical reality that prediabetes is a genuine transitional state, one where metabolic dysregulation is already underway but where intervention can still alter the trajectory.
The researchers evaluated six different machine learning algorithms, including XGBoost, Random Forest, Gradient Boosting, Support Vector Machines, Decision Trees, and Logistic Regression. XGBoost emerged as the clear winner, achieving 98.7 percent accuracy across all three classes, with Random Forest close behind at 98.2 percent. The Support Vector Machine achieved 96.4 percent, while Logistic Regression trailed at 94.8 percent. The researchers used stratified k-fold cross-validation to ensure that these results reflected genuine generalization ability rather than overfitting to the training data, and they reserved a hold-out test set to verify the models’ performance on unseen patients.
What sets this study apart from most machine learning diabetes research is its commitment to explainability. The researchers applied SHAP (SHapley Additive exPlanations) analysis to the winning model, a technique rooted in cooperative game theory that assigns each clinical variable a fair share of credit for every prediction. SHAP analysis revealed that HbA1c was by far the most influential variable across all three classes, followed by BMI and age. Cholesterol, urea, and creatinine played supporting roles, with their influence varying depending on the class being predicted. The researchers found that lower HbA1c values pushed predictions toward the non-diabetic class, while higher values drove predictions toward the diabetic class, with the prediabetic class occupying a genuine intermediate zone where HbA1c values exerted bidirectional influence.
The SHAP analysis also uncovered some surprising findings. In the prediabetic class, the researchers found that age and BMI exerted bidirectional contributions to the model’s predictions, which makes clinical sense given the transitional nature of this stage. In the diabetic class, lipid biomarkers such as cholesterol played a more prominent role, with higher cholesterol values pushing predictions toward diabetes. The researchers also found that renal markers like urea and creatinine influenced predictions in the older non-diabetic patients, suggesting that in older individuals there are additional clinical variables beyond glycemic control that shape the model’s reasoning.
To illustrate how the framework works in practice, the researchers generated SHAP force plots for six representative patients spanning all three classes and both age groups. In one case, a younger non-diabetic patient was classified with high confidence, driven primarily by low BMI and low HbA1c, with a slightly elevated cholesterol value acting as the only counterweight. In another case, an older non-diabetic patient was classified with somewhat lower confidence, with renal markers like urea and creatinine influencing the prediction alongside glycemic control. In a third case, an older prediabetic patient was classified based on a combination of age, urea, and slightly elevated HbA1c, suggesting genuine metabolic dysregulation already underway.
The researchers also found that the framework revealed genuine differences between younger and older patients within the same class. In the prediabetic class, the younger patient’s prediction was driven primarily by glycemic control and body composition, while the older patient’s prediction incorporated renal markers and lipid biomarkers alongside glycemic control. This suggests that the clinical variables that shape diabetes risk evolve with age, and that a one-size-fits-all approach to risk stratification may miss genuine differences between demographic groups.
Notably, the researchers found that there were no diabetic patients under the age of 35 in the dataset, which limited the framework’s ability to generate explanations for this demographic group. This finding highlights the impact of class imbalance and sample size on explainable machine learning, and it suggests that clinicians should interpret the framework’s reasoning with caution when applying it to demographic groups that are underrepresented in the training data.
The researchers argue that their framework could support personalized risk stratification and early intervention by revealing the genuine clinical turning points that drive diabetes classification across all three stages. Rather than relying on population-level thresholds, clinicians could use the framework’s explanations to identify which clinical variables are driving each individual patient’s risk, and to tailor interventions accordingly. The framework’s multiclass approach also reflects the clinical reality that prediabetes is a genuine transitional state, one where intervention can still alter the trajectory of disease.
The study also carries implications for how explainable machine learning should be deployed in clinical settings. The researchers argue that techniques like SHAP bridge the gap between model complexity and clinical interpretability, allowing clinicians to understand not only what the model predicts but also why it predicts it. This transparency could boost clinical confidence in machine learning tools and support their integration into genuine clinical workflows, where understanding the reasoning behind a prediction is often as important as the prediction itself.
Subject of Research: Explainable machine learning for multiclass diabetes stage classification
Article Title: Development of an explainable machine learning framework for early diabetes detection, multiclass classification, and risk stratification across age groups
Article References: Lukhele, N., & Mostafa, F. (2026). Development of an explainable machine learning framework for early diabetes detection, multiclass classification, and risk stratification across age groups. Frontiers in Digital Health, 8, Article 1952669. https://doi.org/10.3389/fdgth.2026.1952669
Image Credits: AI Generated
DOI: 10.3389/fdgth.2026.1952669
Keywords: diabetes, machine learning, SHAP, explainable AI, prediabetes, risk stratification, Development, explainable, machine, learning, framework, early
News Source: Ophelia Keating. (October 17, 2026). Explainable AI spots diabetes risk stages with near-perfect accuracy. Scienmag.



