An interpretable machine learning model for diabetic foot risk classification in patients with diabetes Authors: Xiaohua Hu, Huijun Xi, Zibo Fan, Leixia Zhu, Jia Shi, Shuangshuang Qian, Jing Qiu, Yingzhi Li, Hong Ding Published: 2026 ABSTRACT Diabetic foot is a severe chronic complication of diabetes, mainly resulting from peripheral neuropathy and vasculopathy, and may progress to ulcers, infections, and amputation if not treated in a timely manner. Early identification of patients who already present a high-risk diabetic foot profile at clinical evaluation is therefore critical for guiding preventive interventions. This study aimed to develop an interpretable machine learning–based risk classification platform for classifying current diabetic foot risk status in patients with diabetes and supporting clinical risk stratification and personalized care. The model was not designed to predict future ulcer occurrence, amputation, or wound healing outcomes. In this retrospective study, data from 1938 diabetic patients at Nanfang Hospital of Southern Medical University were used for model development, and an independent external validation cohort of 695 diabetic patients from Shanghai Changhai Hospital was used to assess generalizability. Fifty clinical features covering demographic, metabolic, vascular, neurological, inflammatory, renal, and diabetes-related factors were included. Ten machine learning models were developed and compared. Recursive Feature Elimination (RFE) was applied to the top-performing models for feature selection, and SHapley Additive exPlanations (SHAP) was used to interpret model predictions and construct a diabetic foot risk classification platform. Using sixteen selected features, the CatBoost model achieved the best performance on the internal test set, with an AUC of 0.935 ± 0.016 and accuracy, precision, and recall of 0.88. In the external validation cohort, the model maintained stable performance, with an AUC of 0.922 ± 0.006 and accuracy, precision, recall, and F1-score all equal to 0.88, demonstrating good generalizability. We developed a CatBoost-based diabetic foot risk classification model incorporating sixteen clinically accessible features. The model showed stable and reliable performance across internal and external cohorts and remained robust under data noise and class imbalance, supporting its potential utility for real-world clinical risk classification and early preventive care. Introduction Diabetic foot ulcers are primarily induced by repetitive mechanical stress in regions subjected to elevated vertical or shear forces, particularly in individuals with peripheral neuropathy. The presence of peripheral arterial disease further exacerbates the risk of ulcer formation1–3. Patients with diabetic feet often pursue further diagnostic evaluation only after the onset of overt symptoms or significant changes in clinical indicators, which frequently results in delayed intervention. Recent studies have predicted the probability of diabetic foot risk and analyzed influencing factors using statistical and traditional machine learning methods. However, these approaches often neglect targeted optimization and model interpretation, which can compromise both accuracy and interpretability4–9. In recent years, the integration of machine learning (ML) methods into clinical practice has gained significant attention, particularly with the growing use of EMR. EMR systems have greatly facilitated the collection of healthcare data, making it more accessible and accurate, which has, in turn, enabled clinicians to apply machine learning techniques more effectively10. In the field of diabetes care, early identification of high-risk individuals and the implementation of targeted interventions are critical for reducing the incidence of diabetic foot. Data routinely collected by nursing staff—such as foot examination findings (e.g., abnormal skin temperature, callus formation), patient self-management behavior records (e.g., adherence to foot care, frequency of blood glucose monitoring), and dynamic physiological indicators (e.g., frequency of intermittent claudication episodes)—can serve as valuable features for training machine learning models. By deeply integrating longitudinal data generated from nursing practice with electronic medical record systems, the model’s ability to dynamically capture disease progression can be significantly enhanced. Moreover, such integration empowers nursing teams to construct a precision care pathway—comprising screening, assessment, and intervention—based on model-derived risk stratification results. Unlike traditional statistical methods, which often impose strict data assumptions, machine learning algorithms are capable of handling complex, high-dimensional datasets, making them ideal for modeling intricate medical conditions. As a result, ML techniques have seen widespread application in various areas of healthcare, driving advancements in predictive modeling and decision-making processes11. Various ML models have been developed to predict a wide range of medical conditions. For example, a random forest model has been employed to predict the probability of acute kidney injury in pediatric patients12, Chen et al. developed Bayesian models for predicting complications like cesarean scar ectopic pregnancies13. In the field of diabetic foot, recent studies have made significant progress in applying machine learning models for disease risk prediction. For example, Amith et al. utilized machine learning algorithms for early diabetes detection based on thermographic images14, while Nora et al. classified diabetic foot ulcers using mapped binary patterns in conjunction with convolutional neural networks15, and other studies have employed techniques like LASSO to address issues such as data imbalance16. Despite the significant advantages of ML models, a major challenge remains in their interpretability. The complexity of these models often results in them being considered “black box” models17, where it is difficult to understand how specific features contribute to the final predictions. Although numerous studies have attempted to analyze feature importance in diabetic foot classification models18–20, traditional methods often fall short in providing a comprehensive understanding of how different variables influence the model’s output. These methods generally focus on global feature importance, which can provide a high-level view of the model’s performance but fail to offer insight into the micro-level interactions between features. Additionally, these approaches lack sufficient visualizations to make the model’s inner workings more transparent to clinicians. To address these challenges, recent advancements have incorporated the SHAP method, which offers a unified framework for interpreting machine learning model outputs. The SHAP method has been increasingly used to explain complex models and visualize individual variable contributions, providing more detailed insights into how each feature affects the classification21. This approach is particularly valuable in the context of diabetic foot, as it allows clinicians to better understand the underlying factors influencing risk predictions, ultimately improving model transparency and aiding clinical decision-making. Through the integration of SHAP with machine learning, the interpretability of models can be enhanced, helping bridge the gap between model complexity and clinical application. This study aimed to compare multiple machine learning models for classifying the current diabetic foot risk status of patients with diabetes using routinely collected clinical features. The endpoint of the model was the presence versus absence of clinically diagnosed diabetic foot or a high-risk diabetic foot profile at the time of evaluation, rather than future incident ulceration or amputation. In this regard, the proposed model differs from ulcer-healing, ulcer-recurrence, or amputation-risk models because it focuses on screening and risk stratification at the clinical encounter. Furthermore, we sought to identify the relative contribution of different features to model output and to establish a simplified, interpretable risk classification platform based on the optimal machine learning model, thereby enhancing its applicability and value in clinical practice. Method and materials Patients This retrospective cohort study was conducted among patients with diabetic foot in China, aiming to develop and validate a predictive model. The derivation cohort consisted of diabetic foot inpatients admitted to Nanfang Hospital of Southern Medical University between January 1, 2018, and December 31, 2023. The study was approved by the Ethics Committee of Nanfang Hospital, Southern Medical University (Approval No. NFEC-2024-149). Inclusion criteria were as follows: (1) age ≥ 18 years; (2) diagnosis of diabetes mellitus in accordance with the 2024 American Diabetes Association (ADA) diagnostic criteria; (3) presence of diabetic neuropathy and vasculopathy without prior amputation; (4) the patient or caregiver was fully conscious, with no cognitive impairment or communication barriers; (5) the patient or legal guardian provided written informed consent to participate in the study. Exclusion criteria included: (1) patients with concomitant malignant tumors; (2) patients with lower limb varicose vein ulcers; (3) patients with sepsis, osteomyelitis, or other severe comorbid malignant diseases; (4) patients with depression, hematological disorders, psychiatric illnesses, or other acute infectious diseases. The target outcome was a binary classification label indicating diabetic foot risk status at the time of data collection. Patients clinically diagnosed with diabetic foot or presenting a high-risk diabetic foot profile were labeled as the diabetic foot/risk-positive group, whereas patients with diabetes without diabetic foot were labeled as the non-diabetic foot/risk-negative group. Therefore, the model should be interpreted as a cross-sectional risk classification and screening-support tool, not as a longitudinal prognostic model for future ulcer onset, amputation, or wound-healing outcomes. Data acquisition We collected characteristics such as demographic information, anthropometric and nutritional status, diabetes-related information, lifestyle factors, glycemic and metabolic parameters, lipid profile, inflammatory and hematologic markers, renal function and microvascular assessment, neurological and vascular assessments and diabetes complications and clinical events as shown in Table 1.Table 150 recorded features of All data were obtained from the hospital’s Electronic medical record system.CategoryIndicatorsDemographic informationGender, age, ethnicityAnthropometric and nutritional statusWeight, BMI, obesityDiabetes-related informationDiabetes type, durationLifestyle factorsAlcohol consumption and smoking habitsGlycemic and metabolic parametersFasting blood glucose, 2-h oral glucose tolerance test, HbA1CLipid profileTriglycerides (TG), total cholesterol, HDL, LDLInflammatory and hematologic markersC-reactive protein (CRP), homocysteine (HCY), white blood cell count (WBC)Renal function and microvascular assessmentUrinary ACRNeurological and vascular assessments128 Hz tuning fork sensation, ankle-brachial IndexDiabetes complications and clinical eventsDiabetic nephropathy, diabetic retinopathy, ischemic stroke, dementia, diabetic ketoacidosis, osteomyelitis, hypertension, coronary heart disease, diabetic foot, nail abnormalities, sepsis Table 150 recorded features of All data were obtained from the hospital’s Electronic medical record system.CategoryIndicatorsDemographic informationGender, age, ethnicityAnthropometric and nutritional statusWeight, BMI, obesityDiabetes-related informationDiabetes type, durationLifestyle factorsAlcohol consumption and smoking habitsGlycemic and metabolic parametersFasting blood glucose, 2-h oral glucose tolerance test, HbA1CLipid profileTriglycerides (TG), total cholesterol, HDL, LDLInflammatory and hematologic markersC-reactive protein (CRP), homocysteine (HCY), white blood cell count (WBC)Renal function and microvascular assessmentUrinary ACRNeurological and vascular assessments128 Hz tuning fork sensation, ankle-brachial IndexDiabetes complications and clinical eventsDiabetic nephropathy, diabetic retinopathy, ischemic stroke, dementia, diabetic ketoacidosis, osteomyelitis, hypertension, coronary heart disease, diabetic foot, nail abnormalities, sepsis 50 recorded features of All data were obtained from the hospital’s Electronic medical record system. Power calculation As this was a retrospective study, the sample size was determined by the number of eligible patients available during the study period. To evaluate whether the available sample size was sufficient for model development and validation, we performed a post hoc power calculation based on ROC AUC analysis. With a two-sided significance level of 0.05, a null AUC of 0.80 representing the minimum acceptable discriminative performance, an expected AUC of 0.90, and the observed class distribution in the derivation cohort, the available sample size of 1938 patients, including 578 risk-positive cases and 1360 risk-negative cases, provided more than 99% statistical power. Therefore, the study cohort was considered adequate for developing and evaluating the proposed diabetic foot risk classification model. Statistical method Data balancing Since the outcome classes were imbalanced, we designed a probability-stratified boundary oversampling (PSBO) scheme to enhance minority representation specifically in clinically ambiguous regions of the decision space. Unlike conventional SMOTE, which generates synthetic minority samples mainly according to distance-based nearest-neighbor interpolation in the original feature space, PSBO first uses an initial classifier to estimate each sample’s predicted probability and then restricts interpolation to probability bins around the decision boundary. This design aims to reinforce minority cases that are most informative for classification while reducing unnecessary synthesis of easily separable or low-confidence minority samples. Within each training fold, an initial base classifier was first trained on the original data, and predicted probabilities \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\hat{p}_{i} \in [0,1]$$\end{document} were obtained for all samples. The training set was then partitioned into K = 10 probability bins \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$[0,0.1),\;[0.1,0.2),\; \ldots ,\;[0.9,1.0]$$\end{document}. For each bin \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$B_{k}$$\end{document}, we computed the number of positive and negative samples and the within-bin class ratio. We defined “boundary bins’’ as those located around the decision boundary where the minority class was severely underrepresented. Oversampling was only performed within these boundary bins. For each boundary bin, a target positive-to-negative ratio was specified, and the required number of additional minority samples was derived accordingly. New minority samples were generated by local linear interpolation among minority neighbors inside the same probability bin, i.e., for a randomly selected minority sample \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x_{i}$$\end{document} and one of its minority neighbors \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x_{nn}$$\end{document}, a synthetic sample was created as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x^{{{\mathrm{new}}}} = x_{i} + \lambda (x_{nn} - x_{i} )$$\end{document}, where λ was drawn from a uniform distribution on [0,1]. To prevent information leakage, PSBO was applied strictly within the training data of each cross-validation fold and within the 70% training split. The validation folds, independent internal test set, and external validation cohort were never used for oversampling. In this study, PSBO was selected because it explicitly targets boundary regions of clinical ambiguity; future work will further quantify its incremental benefit through head-to-head empirical comparisons with SMOTE, Borderline-SMOTE, ADASYN, and cost-sensitive learning approaches. The pseudo-code: of PSBO as shown below: Variable screening and feature analysis Features and samples with missing values exceeding 20% in the dataset were removed, and the remaining missing values were imputed using the median. One-hot encoding was applied to the discrete variables. After model training, RFE was employed to select the optimal feature combination. Following feature selection, the SHAP algorithm was used to analyze the feature importance and the global and local impact of each feature. Machine learning models In the study, ten distinct machine learning models were employed for training and testing, including Gradient Boosting Machine (GBM), CatBoost, LightGBM, Random Forest (RF), AdaBoost, Decision Tree (DT), Logistic Regression, Multi-Layer Perceptron (MLP), Support Vector Machine (SVM) and XGBoost. GBM is an ensemble learning algorithm that builds models sequentially, where each model corrects the errors of the previous one22,23. CatBoost is a gradient boosting library designed to handle categorical features without requiring explicit encoding24,25. LightGBM is another gradient boosting framework that is optimized for speed and memory efficiency26,27. RF is an ensemble method based on decision trees. It builds multiple decision trees and aggregates their results to improve predictive accuracy and reduce overfitting28–30. AdaBoost is an ensemble method that combines weak classifiers to create a strong classifier31,32. DT is a simple, interpretable model that splits the data into subsets based on feature values33–35. Logistic Regression is a linear model used for binary classification problems36,37. MLP is a type of neural network that consists of multiple layers of neurons38,39. SVM is a supervised learning model that finds the hyperplane that best separates data points of different classes38,40–42. XGBoost is an optimized gradient boosting framework designed for speed and performance43–45. Selection of machine learning models The dataset was split into a 7:3 ratio, with 70% used for model training and 30% for testing. During training, fivefold cross-validation was applied to all ten models to optimize hyperparameters and compute AUC values, ensuring the robustness and accuracy of the results. Subsequently, the top five performing models were subjected to feature selection using the RFE method. The model with the highest average performance was selected as the final predictive model. Evaluation metrics included the AUC, confusion matrix, and accuracy. To further interpret the model, the SHAP method was employed to visualize the contribution of each feature to the final prediction, both globally and locally. Finally, the model was deployed as a web-based application for clinical use. Additionally statistical techniques All statistical analyses were conducted using Python. Because no directional superiority hypothesis was pre-specified for baseline clinical characteristics or model-performance comparisons, all hypothesis tests were performed as two-sided tests with a predefined significance level of 0.05, and 95% confidence intervals (CI) were calculated where applicable. Continuous variables were reported as mean (standard deviation) for normally distributed data and as median (interquartile range) for non-normally distributed data. Categorical variables were summarized as frequency (percentage). For comparisons of continuous variables between two groups, Student’s t-test was used for normally distributed data with homogeneous variance. Welch’s t-test was applied when normality was met but variance was unequal. The Mann–Whitney U-test was used for non-normally distributed data. Ethics statement This study was approved by the Research Ethics Committee of Nanfang Hospital, Southern Medical University (NFEC-2024-149), and the Medical Ethics Committee of Shanghai Changhai Hospital (CHEC2025-129). All methods were performed in accordance with the relevant guidelines and regulations and with the ethical principles of the Declaration of Helsinki. Written informed consent was obtained from all participants or their legal guardians prior to participation in the study. Results Population characteristics This study collected data from 1938 individuals undergoing health examinations, including 36 features in the derivation cohort for model development. The data were primarily sourced from the Nanfang Hospital of Southern Medical University. The dataset was randomly split into training and testing sets in a 7:3 ratio. In the derivation cohort of 1938 records, 1,360 individuals (70%) were classified as the non-diabetic foot/risk-negative group, while 578 (30%) were diagnosed with diabetic foot or classified as risk-positive. The demographic and clinical characteristics of the non-diabetic foot and diabetic foot groups are summarized in Table 1. Details of the study design are displayed in Fig. 1.Fig. 1Flow chart for model development and validation. Flow chart for model development and validation. Variable screening Feature selection was performed using RFE in a training-only manner to avoid information leakage. Specifically, after cohort construction, the dataset was first split into a development set and an independent test set, and the external cohort was kept fully untouched for external validation. All preprocessing steps and feature selection procedures were conducted exclusively on the development set. Within the development set, we adopted a five-fold cross-validation framework. In each CV training fold, we applied RFE separately using the five best-performing candidate models as reported in Tables 2 and 3 as the base estimators. For each base model, RFE produced a ranked subset of features in that fold. To obtain a stable and reproducible feature set, we aggregated the fold-wise selections and retained features that appeared in at least three out of five folds. This stability criterion was applied within each base model. Finally, the selected features were defined as the intersection of the stable feature sets obtained from the five base models, resulting in the final feature subset used for model training as shown in Fig. 2. After feature selection, the final model was refit on the entire development set using only the selected features, and its performance was evaluated on the independent internal test set and further validated on the external cohort. To address class imbalance between diabetic foot and non-diabetic foot cases, we implemented a probability-guided oversampling strategy in a training-only manner. This procedure was applied within each cross-validation training fold of the development set, and no oversampling was performed on the corresponding validation fold, the independent internal test set, or the external cohort.Table 2Performance comparison of ten models before variable screening.ModelAccuracyPrecisionRecallF1-scoreAUCGBM0.870.870.870.860.934 ± 0.017CatBoost0.880.880.880.870.931 ± 0.014LightGBM0.860.860.860.860.929 ± 0.018Random Forest0.860.860.860.850.919 ± 0.021AdaBoost0.840.830.840.830.910 ± 0.026XGBoost0.850.850.850.850.909 ± 0.020MLP0.830.830.830.830.882 ± 0.018Logistic Regression0.820.820.820.820.873 ± 0.017SVM0.780.770.780.770.851 ± 0.009Decision Tree0.810.810.810.810.760 ± 0.021Table 3ROC curve analysis of the ten machine learning algorithms.ModelFold1Fold2Fold3Fold4Fold5Mean ROCGBM0.9130.9480.9190.9550.9480.934 ± 0.017Decision Tree0.7500.7420.7400.7770.7940.760 ± 0.021LightGBM0.9120.9480.9070.9470.9450.929 ± 0.018Random Forest0.8810.9310.9230.9380.9320.919 ± 0.021AdaBoost0.8850.9530.8810.9170.9210.910 ± 0.026XGBoost0.8890.9280.8840.9310.9210.909 ± 0.020MLP0.8670.9060.9050.8680.8710.882 ± 0.018Logistic Regression0.8650.8930.8930.8500.8710.873 ± 0.017SVM0.8400.8640.8600.8460.8470.851 ± 0.009CatBoost0.9120.9480.9220.9450.9410.931 ± 0.014Fig. 2The feature selection results obtained through RFE using five ensemble learning models. Table 2Performance comparison of ten models before variable screening.ModelAccuracyPrecisionRecallF1-scoreAUCGBM0.870.870.870.860.934 ± 0.017CatBoost0.880.880.880.870.931 ± 0.014LightGBM0.860.860.860.860.929 ± 0.018Random Forest0.860.860.860.850.919 ± 0.021AdaBoost0.840.830.840.830.910 ± 0.026XGBoost0.850.850.850.850.909 ± 0.020MLP0.830.830.830.830.882 ± 0.018Logistic Regression0.820.820.820.820.873 ± 0.017SVM0.780.770.780.770.851 ± 0.009Decision Tree0.810.810.810.810.760 ± 0.021 Performance comparison of ten models before variable screening. Table 3ROC curve analysis of the ten machine learning algorithms.ModelFold1Fold2Fold3Fold4Fold5Mean ROCGBM0.9130.9480.9190.9550.9480.934 ± 0.017Decision Tree0.7500.7420.7400.7770.7940.760 ± 0.021LightGBM0.9120.9480.9070.9470.9450.929 ± 0.018Random Forest0.8810.9310.9230.9380.9320.919 ± 0.021AdaBoost0.8850.9530.8810.9170.9210.910 ± 0.026XGBoost0.8890.9280.8840.9310.9210.909 ± 0.020MLP0.8670.9060.9050.8680.8710.882 ± 0.018Logistic Regression0.8650.8930.8930.8500.8710.873 ± 0.017SVM0.8400.8640.8600.8460.8470.851 ± 0.009CatBoost0.9120.9480.9220.9450.9410.931 ± 0.014 ROC curve analysis of the ten machine learning algorithms. The feature selection results obtained through RFE using five ensemble learning models. Specifically, within each CV training fold, an initial classifier was trained to estimate predicted probabilities. Minority samples located in predefined boundary probability bins were then used to generate synthetic samples by local interpolation with minority neighbors from the same bin. This differs from standard random oversampling and conventional SMOTE because sampling was guided by model-estimated boundary uncertainty rather than only by class membership or feature-space distance. The oversampling ratio was controlled by a global cap to avoid excessive synthetic sample generation. After oversampling, the final model was trained on the resampled training fold and evaluated on the untouched validation fold. This fold-wise design ensured that oversampling was confined to training data and minimized information leakage or optimistic bias in performance estimation. Model development and performance comparison Based on the selected feature subset, the five best-performing models were retrained and evaluated. The results were comparable to those obtained prior to feature selection, with slight performance improvements observed in certain models, indicating the effectiveness of the feature selection process. In addition, for the CatBoost model, we conducted hyperparameter tuning using a grid search strategy combined with stratified cross-validation. The tuning process explored multiple combinations of iterations, learning rate, and tree depth, and the configuration that achieved the highest mean AUC ± standard deviation derived from cross-validation across folds was selected. The final settings were: iterations = 40, learning rate = 0.2, depth = 2, with all remaining parameters kept at their default values. Under this optimized configuration, the CatBoost model demonstrated the best overall performance, achieving an accuracy, precision, recall, and F1 score of 0.88, with a fivefold cross-validated AUC of 0.935 ± 0.016. The performance metrics of all models are summarized in Table 4 and Fig. 3.Table 4Performance comparison of ten models after variable screening.ModelAccuracyPrecisionRecallF1-scoreAUCCatBoost0.920.920.920.920.935 ± 0.016GBM0.880.880.880.870.934 ± 0.018LightGBM0.860.860.860.860.931 ± 0.019Random Forest0.870.870.870.860.924 ± 0.021AdaBoost0.860.850.860.860.904 ± 0.015Fig. 3ROC curve analysis of the five machine learning algorithms for predicting diabetic foot patients in the test data before variable screening. Table 4Performance comparison of ten models after variable screening.ModelAccuracyPrecisionRecallF1-scoreAUCCatBoost0.920.920.920.920.935 ± 0.016GBM0.880.880.880.870.934 ± 0.018LightGBM0.860.860.860.860.931 ± 0.019Random Forest0.870.870.870.860.924 ± 0.021AdaBoost0.860.850.860.860.904 ± 0.015 Performance comparison of ten models after variable screening. ROC curve analysis of the five machine learning algorithms for predicting diabetic foot patients in the test data before variable screening. To further validate the robustness and generalizability of the final predictive model, additional experiments were conducted, including tenfold and 20-fold cross-validation, ROC evaluation on both the training and held-out test sets, and decision curve analysis. As shown in Fig. 4A and B, the CatBoost model consistently achieved high AUC values across all folds in both tenfold and 20-fold validation, with low variance, demonstrating strong model stability. Figure 4C shows that the ROC curves for the training and test sets remain highly discriminative (AUC = 0.959 and 0.934, respectively), indicating minimal overfitting. The decision curve analysis in Fig. 4D further confirms the clinical utility of the model, showing that the model-based strategy yields greater net benefit than both the “treat-all” and “treat-none” strategies across a wide range of threshold probabilities. In addition, the calibration curves presented in Fig. 4E demonstrate good probability calibration for the CatBoost model, with both training and test curves closely following the ideal reference line. The corresponding Brier scores (0.060 for training and 0.087 for testing) further indicate that the model provides reliable probability estimates. This is also supported by the calibration intercept and slope derived from logistic recalibration. In the test set, the intercept was 0.080 and the slope was 1.057, both close to the ideal values of 0 and 1, indicating minimal systematic bias and appropriate probability scaling. In the training set, the intercept was 0.320 and the slope was 1.341. A calibration slope greater than 1 may suggest that the predicted probabilities are somewhat over-dispersed relative to the observed outcomes, which can be consistent with a degree of overfitting in the development data. However, given the stable calibration performance observed in both the independent test set and the external validation cohort, the overall calibration performance of the model was considered acceptable. For classification-based performance metrics, predicted probabilities were dichotomized using the conventional 0.50 threshold for standardized evaluation; however, the model outputs continuous probabilities that permit flexible threshold optimization based on clinical priorities, ROC characteristics, or decision curve analysis. CatBoost was therefore selected as the final predictive model, and the contribution of each selected feature to the overall AUC can be observed in Fig. 5.Fig. 4Overall performance of the final CatBoost model. (A) Ten-fold cross-validation ROC curves. (B) Twenty-fold cross-validation ROC curves. (C) Training and test ROC curves. (D) Decision curve analysis. (E) Calibration curves with Brier scores and calibration intercept/slope.Fig. 5Comparison of the performance derived from CatBoost model constructed with various variable combinations based on variable importance. Overall performance of the final CatBoost model. (A) Ten-fold cross-validation ROC curves. (B) Twenty-fold cross-validation ROC curves. (C) Training and test ROC curves. (D) Decision curve analysis. (E) Calibration curves with Brier scores and calibration intercept/slope. Comparison of the performance derived from CatBoost model constructed with various variable combinations based on variable importance. Comparison with baseline models To comprehensively evaluate the predictive capability of the proposed model, we compared it with two of the most authoritative and widely used diabetic foot screening systems, IWGDF and IDF. All methods were applied to the same test set and underwent identical data preprocessing procedures to ensure a fair comparison. For both IWGDF and IDF, patients with a risk rating of 0 were categorized as non-diabetic foot, whereas those with ratings of 1–3 (ranging from moderate to very high risk) were classified as diabetic foot for binary evaluation. As shown in Table 5, the proposed CatBoost model substantially outperformed both IWGDF and IDF across all evaluation metrics. The CatBoost model achieved the highest accuracy (0.92), precision (0.92), recall (0.92), and F1-score (0.92), demonstrating excellent discriminative ability for identifying diabetic foot. In contrast, both IWGDF and IDF exhibited lower precision (0.57) and F1-scores (0.72), despite achieving perfect recall (1.0), indicating that these rule-based screening systems tend to classify a larger proportion of patients as high-risk, resulting in higher false-positive rates. Notably, CatBoost also showed a substantially higher AUC, whereas AUC values were not applicable to IWGDF and IDF due to their deterministic, non-probabilistic classification nature. These findings highlight the superiority of the proposed machine learning model in providing more accurate and balanced predictions compared with traditional guideline-based screening approaches.Table 5Performance comparison of baseline systems.ModelAccuracyPrecisionRecallF1-scoreAUCCatBoost0.920.920.920.920.935 ± 0.016IWGDF0.880.5710.72–IDF0.880.5710.72– Table 5Performance comparison of baseline systems.ModelAccuracyPrecisionRecallF1-scoreAUCCatBoost0.920.920.920.920.935 ± 0.016IWGDF0.880.5710.72–IDF0.880.5710.72– Performance comparison of baseline systems. Multicenter external validation To further evaluate the generalizability and clinical robustness of the proposed model, an independent external validation cohort comprising 695 individuals was collected from Shanghai Changhai Hospital. Although this cohort was independent from the derivation dataset, it was obtained from a comparable tertiary-care clinical environment with similar diagnostic workflows and data acquisition practices. Therefore, this external validation primarily assesses the reproducibility and robustness of the model in a similar real-world clinical setting, rather than demonstrating broad generalizability across substantially different healthcare systems or populations. All external data were processed using the same preprocessing pipeline as the derivation cohort, including variable standardization, missing value imputation, and feature scaling. No model retraining or recalibration was performed during the external validation phase. The final CatBoost model was directly applied to the external validation cohort to generate predictions. As shown in Fig. 6, the CatBoost model achieved AUC values above 0.90 in both five-fold and ten-fold cross-validation. The model demonstrated stable predictive performance, with accuracy, precision, recall, and F1-score all reaching 0.88, which were consistent with the results observed in the internal test set. These findings indicate that the proposed model maintains strong performance and robustness when applied to an independent cohort collected from a comparable clinical environment. Future studies are warranted to further validate the model across more diverse healthcare settings, geographic regions, and patient populations.Fig. 6External validation of the CatBoost model in the independent Shanghai Changhai Hospital cohort. (A) Five-fold ROC curves. (B) Ten-fold ROC curves. (C) Accuracy, precision, recall, and F1-score. External validation of the CatBoost model in the independent Shanghai Changhai Hospital cohort. (A) Five-fold ROC curves. (B) Ten-fold ROC curves. (C) Accuracy, precision, recall, and F1-score. Model explanation The SHAP algorithm was utilized to interpret the CatBoost model and quantify each feature’s contribution to the model output, helping clinicians better understand and apply the model. Both global and individual case analyses were performed. The global interpretation, shown in Fig. 7A and B, illustrates the importance of each feature and how different feature values are associated with higher or lower model-predicted diabetic foot risk. Individual case analysis, presented in Fig. 8A–E, explains how each feature contributes to the model predictions for specific cases. Figure 8 details the relationship between the normalized values of the sixteen selected features and their contributions. For example, when CRP takes higher normalized values, the SHAP value tends to be positive, indicating a positive contribution toward a higher model-predicted probability of diabetic foot. Conversely, when the normalized duration feature is relatively low, the SHAP value tends to be negative, indicating a contribution toward a non-diabetic foot classification. Importantly, these SHAP patterns reflect the model’s learned associations in the dataset and should not be interpreted as causal effects. The individual case analysis provides an intuitive view of the model’s decision-making process. Figure 8A-D illustrates inference for four sample cases. Figure 8A and B represent diabetic foot cases, where the model starts from a baseline score of −1.309 and accumulates feature contributions, ultimately increasing to 2.983 and 1.903, leading to a diabetic foot classification. Figure 8C and D show non-diabetic foot cases, where the model also starts at -1.309 but decreases to −3.76 and −3.57 due to feature contributions, resulting in a non-diabetic foot classification. Additionally, Fig. 8E employs the SHAP force plot to visualize feature contributions for each sample in the test set. Note that x-axis represents individual samples, while the y-axis represents feature contributions. Red regions indicate features contributing toward a higher model-predicted diabetic foot risk, while blue regions indicate a tendency toward non-diabetic foot (Fig. 9).Fig. 7Global SHAP explanation of the CatBoost model. (A) SHAP summary dot plot showing feature effects across patients. (B) SHAP bar plot showing mean absolute feature importance.Fig. 8Local SHAP explanation. (A–D) Waterfall plots for representative diabetic foot and non-diabetic foot cases. (E) Force plot summarizing feature contributions across the internal validation set.Fig. 9SHAP dependence plots showing how individual feature values are associated with model output. Each dot represents one patient, the x-axis shows the feature value, and the y-axis shows the SHAP value. Global SHAP explanation of the CatBoost model. (A) SHAP summary dot plot showing feature effects across patients. (B) SHAP bar plot showing mean absolute feature importance. Local SHAP explanation. (A–D) Waterfall plots for representative diabetic foot and non-diabetic foot cases. (E) Force plot summarizing feature contributions across the internal validation set. SHAP dependence plots showing how individual feature values are associated with model output. Each dot represents one patient, the x-axis shows the feature value, and the y-axis shows the SHAP value. Development of convenient application The final model was implemented as a research prototype web application to demonstrate potential clinical workflow integration. The application is intended to support clinician-supervised risk classification, screening selection, and interpretation of patient-specific risk factors; it is not intended to provide autonomous diagnosis or to replace clinical judgment. In external testing, as shown in Fig. 10, users manually input feature values, and the model outputs the estimated risk classification together with each feature’s contribution for that case.Fig. 10Convenient application for clinical utility. Research prototype web application for diabetic foot risk classification. Convenient application for clinical utility. Research prototype web application for diabetic foot risk classification. Discussion In this study, we developed and validated a machine learning–based diabetic foot risk classification model that is designed not merely to achieve high statistical performance, but to address a clinically meaningful problem: identifying patients who, at the time of clinical evaluation, present a diabetic foot or high-risk diabetic foot profile and may benefit from intensified preventive care. The model should therefore be interpreted as a cross-sectional screening-support and risk stratification tool, rather than a model for predicting future ulcer occurrence, amputation, or wound-healing outcomes. Using routinely available clinical and biochemical variables, the proposed model provides an interpretable and practical tool that can be integrated into real-world clinical and nursing workflows under clinician supervision. From a clinical perspective, the primary value of this model lies in its ability to support risk stratification and decision-making at the point of care, rather than in its numerical performance alone. Diabetic foot is a multifactorial complication that often progresses silently before overt ulceration occurs, and traditional screening strategies rely heavily on rule-based criteria that may overestimate risk in some patients while failing to identify others who already have substantial underlying risk at the time of assessment. By synthesizing demographic, metabolic, vascular, neurological, and inflammatory information, the proposed model offers a more individualized assessment of risk status, enabling clinicians to distinguish patients who require immediate preventive attention from those who may be managed with standard care. Importantly, the predictors selected by the model are well aligned with established clinical understanding of diabetic foot pathophysiology, which enhances its clinical credibility and acceptability. Markers of vascular impairment, neuropathy, metabolic dysregulation, and systemic inflammation collectively reflect the core mechanisms driving tissue ischemia, loss of protective sensation, impaired wound healing, and chronic inflammation. Rather than introducing opaque or non-actionable predictors, the model reinforces known risk pathways and translates them into a quantitative, patient-specific risk estimate that can inform targeted preventive strategies at the current clinical encounter. A key strength of the proposed approach is its explainability, which is essential for clinical adoption. Through SHAP-based interpretations, clinicians and nurses can visualize how individual factors contribute to a patient’s estimated risk at evaluation. This transparency allows the model to function not as a “black box,” but as a clinical decision-support aid that complements professional judgment. In practice, such explanations can be used to guide clinician–patient communication, helping patients understand how modifiable factors—such as glycemic control, lipid levels, or smoking—contribute to their risk profile, thereby improving engagement and adherence to preventive recommendations. From the perspective of diabetes nursing practice, the model has substantial potential to enhance preventive care pathways. Risk stratification outputs can be directly linked to tiered nursing interventions. Patients identified as high risk at assessment may benefit from intensified foot care education, more frequent foot examinations, closer monitoring of vascular and neurological status, and early referral to multidisciplinary teams involving vascular surgery or neurology. Conversely, patients at lower risk can be managed through community-based nursing programs, routine screenings, and remote monitoring, optimizing the allocation of limited healthcare resources. Embedding the model into electronic health record (EHR) systems could further enable automated alerts and standardized care pathways, supporting a shift from reactive treatment of ulcers to proactive prevention based on real-time risk classification. Despite these strengths, several limitations should be acknowledged. First, the current model is based on static measurements obtained at a single time point and therefore provides a cross-sectional risk classification rather than a true longitudinal classification of future incidence. Because diabetic foot risk evolves dynamically over time, incorporating longitudinal data and temporal modeling approaches may further improve the model’s ability to support continuous risk monitoring and early warning in future work. Second, although class imbalance was addressed during model development, the unequal distribution between diabetic foot and non-diabetic foot cases may still influence the learned decision boundaries and classification stability. Future studies may benefit from exploring more advanced resampling strategies, cost-sensitive learning frameworks, or synthetic data augmentation to further enhance robustness. Third, although the model relies on routinely collected variables, integrating additional modalities—such as imaging or wearable sensor data—may further enhance early risk identification and clinical utility in future iterations. Fourth, the web application developed in this study is currently a research prototype for demonstrating model deployment, clinician-supervised screening selection, and explainable risk communication. It has not yet undergone prospective workflow testing, usability evaluation, regulatory assessment, or clinical-impact evaluation. Therefore, it should be used only as a decision-support aid in research or supervised clinical settings until further prospective validation confirms its safety, usability, and effect on patient outcomes. In conclusion, this study presents an interpretable and clinically oriented machine learning model for diabetic foot risk stratification at the time of clinical evaluation. Beyond demonstrating strong discriminative capability, the proposed approach emphasizes clinical usability, explainability, and integration into nursing and preventive care workflows. By enabling individualized risk classification and supporting timely preventive intervention, this model has the potential to improve preventive care delivery and reduce the burden of diabetic foot. Future work should focus on prospective validation, workflow integration, and evaluation of real-world clinical impact.