A two-stage AI framework showed strong internal performance across four diabetes-related groups, but its reliance on separate public datasets leaves a critical test ahead.

Study: A data-driven machine learning model for effective diabetes diagnosis. Image Credit: CI Photos / Shutterstock

In a recent study accepted for publication in Scientific Reports, researchers developed a machine learning (ML) model based on common clinical variables and a derived pancreatic-health index for diabetes detection and classification. If externally validated in independent, clinically characterized cohorts, the model could potentially support future diabetes screening and classification. Such models could facilitate early detection and treatment planning, although this study did not assess clinical utility, patient outcomes, or quality of life.

Diabetes is one of the most common metabolic diseases worldwide. This condition affects millions of lives, with prevalence continuing to increase globally. People living with this chronic condition typically have high blood glucose levels due to insufficient insulin secretion, insulin resistance, or both. Persistent hyperglycemia can lead to serious complications that could affect organs such as the eyes, heart, kidneys, and nerves.

New strategies are required to detect and classify diabetes using readily accessible clinical data to identify individuals at risk. If externally validated, such tools could help clinicians identify individuals requiring further diagnostic assessment and appropriate dietary, lifestyle, or pharmacological management.

About the study

In the present study, researchers presented an integrated, ML-based approach to detect diabetes and assign records to one of four dataset classes.

The team trained the model using publicly available datasets related to diabetes. They used binary classification to detect diabetes status and multiclass classification to identify four classes. The model classified records into the prediabetes (PD), type 1 diabetes (T1D), type 2 diabetes (T2D), and diabetes from pancreatic disease (pancreatogenic or type 3c diabetes, T3cD) groups.

The researchers first used the Pima Indians Diabetes Database, maintained by the National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK), to classify records as diabetic or non-diabetic. They then used a dataset from the Kaggle repository to identify diabetes classes. The curated multiclass dataset comprised 21,539 samples, with 60% and 40% used for training and testing, respectively.

The multiclass model inputs included age, body mass index (BMI), waist circumference, cholesterol levels, blood glucose levels, insulin levels, and a derived pancreatic-health index. The team compared several ML algorithms, including logistic regression, decision trees, random forests, K-Nearest Neighbors (KNN), naive Bayes, and XGBoost, to identify the most effective model for the classification tasks.

The researchers used the Synthetic Minority Oversampling Technique (SMOTE) on the training data only to correct class imbalances. They also performed hyperparameter tuning to determine the best-performing parameter combinations and subsequently retrained the models using the selected parameters. They additionally performed Local Interpretable Model-agnostic Explanations (LIME) analysis on the authors’ preferred ML classifier to explore the contribution of individual features to model predictions.

Results

The authors selected XGBoost as their preferred classifier, although the paper reported inconsistent performance rankings across its tables. Table 2 reports a value of 0.97 for each evaluation parameter, including accuracy, precision, recall, and F1 Scores. However, Table 7 reported an accuracy of 95.67% for XGBoost and 96.67% for random forest, while random forest also achieved a marginally higher macro-average ROC-AUC, a measure of discrimination across the four classes. The authors attributed XGBoost’s performance to its ability to capture complex, non-linear associations between different features. XGBoost correctly classified all prediabetes and T1D records in the reported test results, though some confusion persisted between the T2D and T3cD groups. The KNN model was the least accurate.

The general feature-importance analysis identified blood glucose levels, insulin, and BMI as influential variables. However, the LIME analysis indicated that glucose dominated the model’s predictions, with age and cholesterol providing secondary contributions in some classes. BMI, waist circumference, insulin, and pancreatic health had comparatively lower influence in the LIME analysis. Blood glucose levels showed the strongest reported correlation with the class label (Pearson’s correlation: 0.86), while insulin showed a correlation of 0.59. Because numerical values were assigned to nominal disease classes, these Pearson correlations should be interpreted cautiously. Age, BMI, and waist circumference showed moderate to strong intercorrelations ranging from 0.63 to 0.68. Their respective correlations with the target were 0.41, 0.46, and 0.56, whereas pancreatic health showed a negligible negative correlation of -0.06.

The model primarily learned blood glucose-based decision patterns, which were consistent with the clinical diagnosis of diabetes. The authors interpreted these patterns as broadly concordant with diabetes pathophysiology and clinical knowledge, although this interpretation was not independently validated in clinical practice. Based on the observations, the model is not ready for clinical use and would require further evaluation before it could support, rather than replace, clinical judgment.

Conclusions and Future Directions

The findings highlight the development of an ML model that can classify diabetes status and assign positive cases to four labels, including prediabetes, T1D, T2D, and T3cD. In the future, the framework could potentially assist diabetes screening and guide further diagnostic investigation. The study did not determine whether using the model improves care, treatment outcomes, quality of life, or the global burden of diabetes.

The varying influences of lipid, pancreatic, and body measurements may reflect subtype-related biological differences, but they may also arise from dataset construction, class coding, correlated predictors, or the absence of clinically verified biomarkers. Researchers should investigate these patterns using clinically characterized datasets before drawing mechanistic conclusions. The framework should currently be considered a modular proof-of-concept because its binary and multiclass stages were trained on separate datasets with potentially different populations, variables, and collection methods.

Future studies should also consider a single training dataset containing both diabetes status and clinically adjudicated subtype labels, including verified pancreatic and autoimmune markers, rather than derived variables, and perform external validation in larger, more diverse clinical cohorts to improve the generalizability of the findings. They should also address ethical and data privacy concerns before translating AI-based models into clinical screening or decision-support settings.