Your new experience awaits. Try the new design now and help us make it even better

ORIGINAL RESEARCH article

Front. Endocrinol., 17 October 2025

Sec. Clinical Diabetes

Volume 16 - 2025 | https://doi.org/10.3389/fendo.2025.1689312

This article is part of the Research TopicDigital Technology in the Management and Prevention of Diabetes: Volume IIIView all 7 articles

Explainable artificial intelligence model predicting the risk of all-cause mortality in patients with type 2 diabetes mellitus

  • 1Research Center in Artificial Intelligence, Institute of Information Technologies, Mathematics and Mechanics, Lobachevsky State University, Nizhny Novgorod, Russia
  • 2Institute of Biogerontology, Lobachevsky State University, Nizhny Novgorod, Russia
  • 3Department of Clinical and Molecular Sciences (DISCLIMO), Università Politecnica delle Marche, Ancona, Italy
  • 4Clinic of Laboratory and Precision Medicine, IRCCS INRCA, Ancona, Italy
  • 5Scientific Direction, IRCCS INRCA, Ancona, Italy
  • 6Mriya Life Institute, National Academy of Active Longevity, Moscow, Russia
  • 7Advanced Technology Center for Aging Research, IRCCS INRCA, Ancona, Italy

Background: Type 2 diabetes mellitus (T2DM) is a highly prevalent non-communicable chronic disease that substantially reduces life expectancy. Accurate estimation of all-cause mortality risk in T2DM patients is crucial for personalizing and optimizing treatment strategies.

Methods: This study analyzed a cohort of 554 patients (aged 40–87 years) with diagnosed T2DM over a maximum follow-up period of 16.8 years, during which 202 patients (36%) died. Key survival-associated features were identified, and multiple machine learning (ML) models were trained and validated to predict all-cause mortality risk. To improve model interpretability, Shapley additive explanations (SHAP) was applied to the best-performing model.

Results: The extra survival trees (EST) model, incorporating ten key features, demonstrated the best predictive performance. The model achieved a C-statistic of 0.776, with the area under the receiver operating characteristic curve (AUC) values of 0.86, 0.80, 0.841, and 0.826 for 5-, 10-, 15-, and 16.8-year all-cause mortality predictions, respectively. The SHAP approach was employed to interpret the model’s individual decision-making processes.

Conclusion: The developed model exhibited strong predictive performance for mortality risk assessment. Its clinically interpretable outputs enable potential bedside application, improving the identification of high-risk patients and supporting timely treatment optimization.

1 Introduction

Diabetes mellitus (DM) is a prevalent endocrine-metabolic disorder characterized by chronic hyperglycemia resulting from either impaired insulin secretion or insulin resistance. The global diabetes epidemic continues to escalate at an alarming rate, imposing substantial strain on healthcare systems worldwide. According to International Diabetes Federation estimates, the worldwide prevalence of DM reached 536.6 million cases in 2021, with projections indicating a dramatic rise to approximately 783.2 million cases by 2045 (1). Type 2 diabetes mellitus (T2DM) represents the most prevalent form of diabetes, comprising 90-95% of all diagnosed cases. This metabolic disorder is strongly correlated with obesity and physical inactivity, which are among its primary modifiable risk factors (2). Patients with T2DM exhibit significantly elevated risks of diabetes-related complications (3) and demonstrate higher all-cause and cause-specific mortality rates, particularly from cardiovascular disease, when compared to both the general population and non-diabetic individuals (46). Current evidence indicates that excess mortality in diabetic patients can be effectively reduced through optimal pharmacotherapy and lifestyle interventions (7, 8). Accurate prediction of individual mortality risk in T2DM therefore serves as a critical foundation for developing personalized therapeutic approaches aimed at improving both life expectancy and quality of life.

Current mortality risk assessment in T2DM patients predominantly employs Cox proportional hazards regression models (918). However, the Cox model has several limitations, including its reliance on the proportional hazards assumption, its tendency to capture primarily linear relationships, and its difficulty handling high-dimensional data and complex variable interactions. These shortcomings can restrict its utility with real-world datasets. For this reason, contemporary mortality risk prediction increasingly uses machine learning (ML) and artificial intelligence (AI) approaches (e.g., random survival forests, neural networks), which can process multi-dimensional data with complex, non-linear dependencies. Several studies on T2DM have demonstrated that ML models surpass the traditional Cox model in mortality risk assessment (1921).

Nevertheless, current mortality prediction models suffer from limited transparency and interpretability, frequently functioning as “black boxes” that compromise clinical trust and impede practical implementation. The development of explainable AI (XAI) is becoming increasingly vital for medical prediction (22, 23). Frameworks like Shapley additive explanations (SHAP) bridge the gap between algorithmic output and clinical practice by elucidating a model’s decision-making logic and identifying key predictive features for individual patients and entire cohorts. For any given prediction, SHAP quantifies the magnitude and direction (increased or decreased risk) of each feature’s contribution. This capability is paramount for validating a model’s reasoning, ensuring its alignment with medical knowledge, and empowering clinicians to integrate data-driven insights into personalized patient care with confidence. While SHAP technique has been incorporated into only two diabetes mortality prediction models to date (24, 25) – encompassing both type 1 and type 2 diabetes – these implementations merely explain aggregate model behavior rather than providing patient-specific interpretations. To bridge this critical gap, we sought to develop a novel, interpretable AI system capable of generating individualized explanations for long-term all-cause mortality risk predictions in T2DM patients.

2 Materials and methods

2.1 Study population

The study sample was drawn from a previously established cohort comprising 568 patients diagnosed with T2DM (17, 26). The patients were recruited at the Metabolic Diseases and Diabetology Department of IRCCS INRCA (Ancona, Italy) between May 2003 and November 2006. T2DM was diagnosed according to American Diabetes Association (ADA) criteria, which included any of the following: hemoglobin A1c (HbA1c) level ≥6.5%, fasting blood glucose ≥126 mg/dL, 2-hour blood glucose ≥200 mg/dL during oral glucose tolerance test (OGTT), or random blood glucose ≥200 mg/dL in the presence of severe diabetes symptoms (2). Inclusion criteria for patients with diabetes were age from 40 to 87 years, a body mass index (BMI) <40 kg/m2, ability and willingness to give written informed consent. Exclusion criteria were: diagnosis of diabetes other than T2DM including type 1 diabetes, latent autoimmune diabetes in adults (LADA) or secondary diabetes; pregnancy or lactation at enrollment; severe liver disease defined as cirrhosis, aspartate aminotransferase (AST) or alanine aminotransferase (ALT) levels more than three times the upper limit of normal or total bilirubin >3 mg/dL; active malignancy or malignancy under treatment within the previous 12 months with the exception of treated non-melanoma skin cancers; major acute illness at baseline such as febrile infection or hospitalization within the previous 4 weeks; hematological disorders interfering with HbA1c measurement including known hemoglobinopathies, severe anemia with hemoglobin <8 g/dL, blood transfusion within the previous 3 months or recent treatment with erythropoietin; ongoing or recent systemic immunosuppressive therapy including corticosteroids at a dose ≥5 mg/day prednisolone equivalent for more than one month, biologics, disease-modifying antirheumatic drugs or other immunomodulators within the previous 3 months; conditions precluding the ability to provide informed consent such as severe cognitive impairment. The study was approved by the Institutional Review Board of IRCCS INRCA hospital (Approval no. 34/CdB/03) and conducted in accordance with the principles outlined in the Declaration of Helsinki.

2.2 Outcomes

All-cause mortality data were extracted from medical records spanning enrollment through December 31, 2019. Overall survival time was calculated from enrollment to death. For surviving patients, follow-up duration was censored at their last recorded observation. The maximum follow-up period was 16.8 years (6142 days). Only three patients were lost to follow-up, at 2019, 2594, and 5422 days after baseline examination.

2.3 Covariates

Baseline information collected at enrollment included clinical characteristics such as age, sex, anthropometric parameters, smoking, and medical history (duration of T2DM, presence of comorbidities and complications of diabetes, concurrent treatments). Comorbidities included arterial hypertension and dyslipidemia. Complications of diabetes were diabetic neuropathy, diabetic nephropathy, diabetic retinopathy, atherosclerotic vascular disease, and major adverse cardiovascular events (MACE). Fasting blood samples from all participants were processed to obtain serum and stored at −80 °C. All serum samples were screened for hemolysis prior to analysis. In all participants, standard methods were utilized to assess blood cell counts and biochemical parameters. Serum biomarkers were measured using standardized CE-IVD assays. The serum N-glycomic profile was assessed using a validated method based on IgG purification with protein G, enzymatic release of N-glycans by PNGase F, fluorescent labeling with 2-aminobenzamide (2-AB), and chromatographic separation, as previously described (27).

2.4 Prediction model development

We developed a model to predict the 16.8-year risk of all-cause mortality in patients with T2DM. The dataset was preprocessed before applying ML algorithms. Covariates (variables/features) with >20% missing values were removed, along with samples missing data for age, sex, disease duration, survival information, or categorical features. After filtering, 123 features and 554 patients remained. The dataset was split into training and testing sets at an 80:20 ratio through stratified random sampling based on survival status. Data were then z-normalized using means and standard deviations derived from the training set. Finally, remaining missing values were imputed using the k-nearest neighbors algorithm (k=5), which has been well-established in various studies (28, 29).

We performed feature selection on the training data to remove weakly predictive variables using four approaches: mutual information, spatially uniform reliefF, and minimum redundancy-maximum relevance (each retaining the top 50% of ranked features), plus univariate Cox regression (Benjamini-Hochberg-adjusted p-values <0.05). The final feature set combined the intersection of these methods’ outputs, further refined through model-specific forward selection. To prevent data leakage and overfitting, feature selection was performed exclusively on the training set, with each resulting feature subset evaluated using a 5-fold cross-validation procedure.

Nine ML algorithms were used to predict the risk of all-cause mortality: multivariate Cox proportional hazards model with ridge penalty (CoxPH), random survival forest (RSF), extra survival trees (EST), component-wise gradient boosting (CWGB), gradient-boosted regression trees (GBRT), extreme gradient boosting survival embeddings (XGBSE), and three artificial neural networks – Cox proportional hazards deep neural network (DeepSurv), case-control Cox regression model (CoxCC), and piecewise constant hazard model (PCHazard). Gradient boosting models and neural networks were trained using an early stopping procedure. For training neural networks, the Adam optimization algorithm was applied.

Model hyperparameters were tuned on the training set using a multivariate tree-structured Parzen estimator. The total number of optimization trials was 100. The best trial with the optimal combination of hyperparameters was defined using the 5-fold stratified cross-validation procedure on the training dataset. Key hyperparameters included those that regularize model complexity and counteract overfitting, such as the L2 penalty for Cox regression, tree depth in survival forests, dropout in neural networks, and others. The full list of tunable hyperparameters is provided in Supplementary Table 1. Model performance was evaluated using Harrell’s concordance index (C-index) as the primary metric. We additionally conducted time-dependent receiver operating characteristic curve (ROC) analysis to calculate area under the curve (AUC) values and assessed calibration via the Integrated Brier Score (IBS). Following feature selection and hyperparameter optimization, the best models were trained on the full training set and subsequently used to predict mortality risk scores for individuals in the testing set.

We performed both global and local interpretability analysis of the optimal model using Shapley additive explanations (SHAP), with all surviving patients from the training dataset serving as the background distribution for SHAP value computation. All modeling workflows – including development, evaluation, and interpretation – were implemented in Python 3.11.7 and R 4.3.2.

2.5 Statistical analysis

We compared survival groups (alive vs. deceased) using Mann-Whitney U tests for continuous variables and χ² tests for categorical variables, with statistical significance set at Benjamini-Hochberg-adjusted p-values <0.05 (two-sided). Survival analysis between risk groups (stratified by median predicted risk scores from training data) employed Kaplan-Meier estimation and log-rank testing.

3 Results

3.1 Cohort analysis

After preprocessing, the final dataset included 554 patients (302 male, 252 female) with a median age of 67 years (interquartile range, IQR 61-72) at baseline. The median T2DM duration was 14 years (IQR 7-21, range 1-54). During the 16.8-year follow-up, 202 deaths occurred (40 within 5 years, 94 within 10 years, 178 within 15 years), with deceased patients showing median survival of 10.6 years (IQR 6.3-13.6). Among 352 survivors, only 3 patients were lost to follow-up. Comparative analysis of 123 baseline characteristics revealed 36 statistically significant differences between surviving and deceased patients (see Supplementary Table 2).

3.2 Development of the model for predicting mortality risk

Feature selection identified 16 variables consistently ranked as important across all four methods. Notably, three features – age, N-terminal prohormone of brain natriuretic peptide (NT-proBNP), and high-sensitivity troponin I (hs-cTnI) – overlapped with a previously published Cox model from the same dataset (17). We additionally incorporated three prognostic factors from this model, hemoglobin A1c (HbA1c), C-reactive protein (hs-CRP), and soluble suppression of tumorigenicity 2 (sST2) (17), and obtained an intermediary set of 19 features for ML, Supplementary Table 2.

Then, for each of the nine ML models, we performed forward feature selection to identify the optimal subset from the 19 candidate features. The hyperparameters of each model were fine-tuned for every tested feature subset to maximize C-index. The evaluation results are summarized in Table 1, while an expanded set of performance metrics, along with optimal hyperparameters and selected feature lists, are provided in Supplementary Table 3. Among all models, the EST model demonstrated superior performance in both cross-validation and the test dataset. On the training data, cross-validation yielded a C-index of 0.751 and a 16.8-year AUC of 0.791. When evaluated on the test dataset, the EST model achieved a C-index of 0.776 and a 16.8-year AUC of 0.826, further confirming its robustness. Additionally, IBS of 0.1 indicates good calibration.

Table 1
www.frontiersin.org

Table 1. C-index scores of ML models predicting all-cause mortality in patients with type 2 diabetes.

The optimal EST model was trained using ten key variables: age, number of complications, NT-proBNP, triglycerides, creatinine, hs-CRP, RDW-SD, apolipoprotein A1, disease duration, and the relative abundance of a specific serum N-glycan structure – NA3F, a triantennary, α-1,3 core-fucosylated, branched N-glycan derived from glycoproteins. Survival curves of the high-risk and low-risk groups are shown in Figures 1A, B. In both the training and test datasets, overall survival was significantly longer in the low-risk group, as confirmed by the log-rank test (p-values < 0.05).

Figure 1
Figure with three graphs. Panel A and B are Kaplan-Meier survival curves comparing low-risk (blue) and high-risk (red) groups over time in years, with significant p-values indicating differences. Panel C shows a plot of area under the ROC curve (AUC) over time for cross-validation (green), train (black), and test (red) sets, with a shaded area representing variability.

Figure 1. Analysis of the predictive model for all-cause mortality in patients with type 2 diabetes. (A) and (B) Kaplan–Meier survival curves for the low-risk and high-risk groups in the train and test datasets, respectively. Patients were stratified into risk groups based on the median predicted risk score derived from the training dataset. The log-rank test was used to compare survival between the low- and high-risk groups. (C) Time-dependent AUC over the observation period. The AUC values calculated obtained from cross-validation are presented as the mean (green dots) ± standard deviation (light green area).

The developed prediction model demonstrated robust performance for both medium- and long-term mortality risk predictions, with time-dependent AUC values consistently exceeding 0.8 for forecast periods beyond five years (Figure 1C). Specifically, the test dataset achieved AUCs of 0.86, 0.80, and 0.84 at 5, 10, and 15 years, respectively. However, for time intervals shorter than five years, we observed a notable discrepancy between the test dataset AUC and those derived from both the training dataset and cross-validation. This discrepancy stems from two key factors. First, the model was explicitly optimized for 16.8-year mortality risk prediction, resulting in reduced reliability for short-term forecasts. Second, the dataset contained only 40 patients who died within the first five years of follow-up, leading to overly limited training data and potential bias in early-term predictions.

3.3 Interpretation of a model predicting mortality risk

We analyzed SHAP values to interpret the contribution of the ten selected features in predicting 16.8-year mortality risk among patients with T2DM. This global explainability analysis of the EST model quantified the relative importance of each feature in the model’s predictions. Figure 2A presents the mean absolute SHAP values, representing the average contribution magnitude of each feature to the model’s predictions. Age, number of complications, and disease duration emerged as the strongest predictors of mortality risk, followed by laboratory biomarkers. Figure 2B illustrates the directional effects of these features, where positive SHAP values correspond to increased mortality risk and negative values indicate protective effects. Notably, apolipoprotein A1 showed an inverse relationship with 16.8-year mortality risk, where elevated levels were associated with reduced mortality probability. The remaining nine features demonstrate positive associations with predicted mortality risk. However, it should be emphasized that while SHAP analysis reveals these important feature-prediction relationships, it does not imply causation – it only identifies associations between variables and model outputs.

Figure 2
Bar chart and scatter plot showing SHAP values. Panel A lists variables affecting model output, with age having the highest impact. Panel B displays a scatter plot of SHAP values by feature, using colors to indicate feature value magnitudes from low (blue) to high (pink).

Figure 2. Global explanation of feature contributions to model predictions. (A) Feature importance ranking based on mean absolute SHAP values across all participants. Features are ordered vertically by their relative impact on model predictions, with the most influential at the top. (B) SHAP summary plot showing the directional relationship between feature values and model outputs. Individual points represent SHAP values for each feature-participant combination, with color intensity indicating feature values (red: high, blue: low).

For each feature, we determined thresholds at which SHAP values change sign (Figure 3). In individuals older than 64, the predicted probability of mortality increased. An increase in complication number was associated with an increased probability of mortality. The mortality risk increases when patients have had T2DM for more than 9 years. As for laboratory parameters, the values contributing to an increased risk of mortality included: NT-proBNP >100 ng/L, RDW-SD >42.3 fL, N-glycanNA3F >2.7%, creatinine >1.0 mg/dL, apolipoprotein A1 <160 mg/dL, hs-CRP > 3.6 mg/L, and triglyceride >120 mg/dL. SHAP analysis identifies data-driven associations, not causal relationships. Consequently, the thresholds it produces for predictors reflect changes in the model’s predicted risk and are not substitutes for established clinical guidelines.

Figure 3
Panel of ten scatter plots (A-J) showing the relationship between SHAP values and various factors. Each plot includes a regression line, with variables like age, number of complications, disease duration, NT-proBNP, RDW-SD, N-glycan NA3F, creatinine, apolipoprotein A1, triglycerides, and hs-CRP. Points indicate data distribution, with some panels showing specific value thresholds marked by dashed lines, such as 64 years for age (A) and 120 mg/dL for triglycerides (J).

Figure 3. Dependence of SHAP values on ten features in the model. SHAP dependence scatter plots for (A) age, (B) number of complications, (C) disease duration, (D) NT-proBNP, (E) RDW-SD, (F) N-glycan NA3F, (G) creatinine, (H) apolipoprotein A1, (I) hs-CRP, and (J) triglycerides. The blue curves are constructed using a locally weighted scatterplot smoothing (LOWESS) algorithm. Feature values are presented in their original scale for interpretability, though the model utilized normalized values internally.

SHAP values were also used to explain the model’s decision-making process for individual predictions. Figure 4A displays the local explainability plot for a long-term survivor (alive after 16.8 years) with a favorable predicted mortality probability (20.9%). All ten clinical factors contributed to risk reduction, with most important influences being relatively younger age, absence of diabetic complications, and low RDW-SD and creatinine values. The mirror image emerges in Figure 4B, which explains the prediction for a deceased patient (death occurring 4.4 years post-examination), with a concerning 68.8% mortality risk. All features contributed to an increased risk, the strongest risk drivers were levels of creatinine and NT-proBNP, advanced age, and the burden of four diabetes-related complications.

Figure 4
Four bar charts labeled A, B, C, and D display factors contributing to 16.8-year mortality probability. Each chart lists variables like age, creatinine, and RDW-SD, with corresponding probability shifts. Charts A and D show negative shifts, signified by blue bars, whereas charts B and C show positive shifts with red bars. Each chart indicates an average effect value (E[f(x)]).

Figure 4. Local explanation of individual predictions using SHAP waterfall plots. Four representative cases are shown. (A) A survivor (alive after 16.8 years) with low predicted mortality risk (20.9%), (B) a deceased patient (death occurring 4.4 years post-examination) with high predicted risk (68.8%), (C) a survivor with high predicted risk (60.3%), (D) a deceased patient (death occurring 10.6 years post-examination) with low predicted risk (23.6%). The y-axis displays features ranked by their increasing predictive influence from bottom to top. Feature values are presented in their original scale for interpretability, though the model utilized normalized values internally. The x-axis represents the 16.8-year mortality probability. The prediction originates from the baseline probability E[f(X)] derived from the training set and subsequently modifies based on each feature's contribution. Each colored bar illustrates a feature's directional effect on the model's output: blue bars signify protective (risk-reducing) factors, while red bars denote hazardous (risk-increasing) factors.

Quality metrics demonstrate that our model exhibits strong predictive performance, consistently assigning lower risk scores to survivors and higher risk scores to deceased patients. However, certain cases may show significant prediction errors (either overestimation or underestimation of risk). In these instances, local explanation methods prove valuable for identifying the specific features responsible for these discrepancies. Figure 4C displays the SHAP waterfall plot for a survivor with an unexpectedly high predicted mortality probability (60.3%). The analysis reveals that the elevated risk prediction was primarily driven by advanced age, elevated creatinine levels, presence of two diabetes-related complications, increased RDW-SD and triglyceride values, prolonged disease duration, and higher NT-proBNP concentration. In turn, Figure 4D illustrates the SHAP analysis for a deceased patient (death occurring 10.6 years post-examination) where the model had predicted a low mortality probability (23.6%). The following factors contributed to this underestimation: younger age, shorter disease duration, lack of complications, lower levels of NT-proBNP, N-glycan NA3F, and RDW-SD.

While the precise reasons for these discrepancies remain unclear due to limited patient data, several potential explanations exist. The extended 16.8-year prediction window following baseline measurements introduces numerous unaccounted variables that could influence outcomes, including development of new complications or comorbidities, changes in treatment adherence, lifestyle modifications, and other unreported clinical factors. Nevertheless, the model’s strong performance in long-term predictions suggests these confounding factors have relatively modest effects overall.

4 Discussion

In this study, we developed an explainable AI model using the EST algorithm to predict 16.8-year all-cause mortality risk in patients with T2DM. In the test dataset, our model demonstrated strong predictive performance across all time horizons, with AUC values of 0.86 (5-year), 0.80 (10-year), 0.841 (15-year), and 0.826 (16.8-year) for all-cause mortality prediction. The overall concordance index (C-index) reached 0.776, with excellent calibration (IBS = 0.1). Notably, this represents a significant improvement over the previously developed Cox regression-based nomogram when evaluated on the same dataset (17).

The final model variables incorporated age, number of complications, disease duration, NT-proBNP, RDW-SD, N-glycan NA3F, creatinine, apolipoprotein A1, hs-CRP, and triglycerides. These variables have been previously employed in various combinations across 15 existing mortality prediction studies (921, 24, 25). Age consistently appeared in all 15 models. While no studies directly included number of complications as a variable, several incorporated specific complications (10, 11, 15, 18, 19, 24). Among other predictors, triglycerides featured in seven models (10, 12, 15, 1921, 25), diabetes duration in five (1315, 24, 25), creatinine in three (16, 21, 25), hs-CRP in two (17, 21), and NT-proBNP in one model (17). Notably, sex – which was selected in all studies except one (12), did not in our study.

Our model combines ML-driven accuracy with SHAP-based interpretability, revealing both global feature importance and directional effects on 16.8-year mortality risk. Interpretability has direct clinical implications. Global SHAP profiles clarify which variables consistently drive long-term mortality risk, while local explanations highlight the main contributors for each individual prediction. This information may help physicians identify modifiable factors, prioritize follow-up, and communicate risk more transparently with patients. Recent evidence shows that SHAP-based explanations, particularly when presented in a clinically oriented format, can improve trust, acceptance, and usability in medical decision-making (30). Our results demonstrate that while elevated apolipoprotein A1 decreases predicted risk, the other nine features (e.g., age, creatinine) show positive associations – all consistent with established T2DM mortality relationships.

In older people with diabetes, additional factors such as increased diabetes complications, polypharmacy, physical and mental frailty are present, contributing to an increase in the number of deaths (3133). A higher number of diabetes-related complications significantly correlates with increased mortality risk (34). Similarly, the risk of all-cause mortality and cardiovascular disease mortality significantly increases with T2DM duration (35, 36).

Our model appears to capture dimensions of risk that extend beyond traditional clinical predictors, integrating emerging concepts such as residual inflammatory risk (RIR) (37) and organ-specific ageotyping (38). Elevated hs-CRP levels, which contributed to increased mortality risk in our model, are consistent with the notion of RIR and its clinical relevance in cardiovascular prevention. The SHAP-derived threshold is consistent with previously proposed cut-offs for cardiovascular risk (39), reinforcing the role of low-grade inflammation as a relevant prognostic factor in T2DM. In the context of T2DM, biological aging can be seen as the accelerated decline of organ systems, partly driven by chronic low-grade inflammation, while residual risk refers to the mortality risk that persists despite good control of glucose, lipids, and blood pressure. Large-scale epidemiological evidence confirms that even when all conventional risk factors are within target ranges, patients with T2DM continue to face a substantially higher risk of death and cardiovascular events compared to the general population (40). These concepts are consistent with the theory of inflammaging, where chronic inflammation contributes to the excess risk observed in diabetes and may explain why conventional risk factor management does not fully normalize prognosis (37, 41). The selection of both conventional and non-conventional biomarkers by the model is consistent with this broader perspective. We recognize, however, that these interpretations are conceptual and were not directly tested within our study; they are intended to provide a framework for understanding the potential mechanisms underlying the observed predictive performance.

NT-proBNP, a validated cardiac biomarker, captured the contribution of subclinical myocardial stress in our model. Beyond its role in diagnostics and management of heart failure, elevated levels also reflect chronic hemodynamic strain and myocardial remodeling, indicating cardiac aging, and aligning with our broader hypothesis that progressive cardiac dysfunction may represent an expression of biological aging mechanisms in T2DM (41).

Creatinine, a conventional marker of renal function, may serve as a proxy for biological aging of the kidney. While glomerular filtration rate physiologically declines with age, patients with T2DM experience an accelerated reduction, reflecting premature renal dysfunction (42). This renal trajectory often parallels that of the heart, as the interplay between cardiac and renal aging is well established and clinically recognized in the context of cardiorenal syndromes (43).

Red cell distribution width-standard deviation (RDW-SD), a measure of anisocytosis, also emerged as a relevant predictor. Although traditionally used in the evaluation of anemia, elevated RDW has been associated with cardiovascular events and mortality (44). Chronically elevated RDW is increasingly regarded as a marker of bone marrow stress, potentially reflecting impaired erythropoiesis in the setting of chronic inflammation and immune activation. In this context, it may capture hematopoietic system dysfunction driven by systemic processes common in T2DM and provide prognostic information beyond traditional organ-specific biomarkers, representing a hematopoietic expression of biological aging.

Together, creatinine, NT-proBNP, and RDW-SD represent complementary markers capturing multidimensional risk pathways in T2DM: organ-specific dysfunction (kidney, heart) and systemic inflammation. Elevated levels of these markers identify patients facing a confluence of organ damage and systemic deterioration, which likely contributes to their poorer long-term outcomes.

Lipid-related biomarkers such as triglycerides and apolipoprotein A1 (ApoA1) were also retained in the model and showed opposing associations with mortality risk. Elevated triglyceride levels are a hallmark of insulin resistance and atherogenic dyslipidemia, and their association with cardiovascular and all-cause mortality has been consistently observed in patients with T2DM (45). ApoA1, the main apolipoprotein component of high-density lipoprotein (HDL) particles, was inversely associated with mortality risk in our model. Reduced circulating levels of ApoA1 have been associated with increased risk of incident diabetes (46) as well as with cardiovascular events in large general population cohorts (47), although its prognostic value has not been clearly demonstrated in diabetic populations. In this context, both triglycerides and ApoA1 may act as complementary indicators of residual lipid-related risk, particularly relevant in patients receiving statin therapy, as was the case for the vast majority of our cohort.

N-glycan NA3F was associated with metabolic and inflammatory features in T2DM (27). Although the biological role of this structure remains elusive, its inclusion may reflect broader N-glycan remodeling processes linked to aging, immune regulation, or glycoprotein turnover, underscoring the potential of serum glycomics to capture latent biological signals beyond conventional biomarkers.

Limitations of our study include a moderate sample size, its origin from a single medical center, and Italian ancestry of patients might restrict the generalizability of the findings. Information regarding the specific causes of death and some potential predictors, such as diet and physical exercise was not available. Only one imputation method was used to handle missing data; employing additional methods could potentially improve model quality. Although the model’s performance was assessed through both cross-validation and an independent internal testing dataset, a suitable external validation dataset was unavailable. These limitations should be considered when interpreting the results of our study.

5 Conclusion

In conclusion, this study presents a novel ML model that predicts the risk of 16.8-year all-cause mortality in patients with T2DM, utilizing ten clinical and laboratory parameters. Taken together, the model variables reflect a multidimensional construct of long-term risk in T2DM, incorporating diverse but interconnected processes related to biological aging, residual inflammation, and subclinical organ dysfunction. Their influence on individual patient predictions is disclosed by the local explanation SHAP method, which has not been done previously in existing all-cause mortality prediction models for patients with T2DM. Thus, our explainable model can be potentially used as an additional tool in the examination of patients with T2DM.

Data availability statement

The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Ethics statement

The studies involving humans were approved by the Institutional Review Board of IRCCS INRCA, Ancona, Italy (Approval number: 34/CdB/03). The studies were conducted in accordance with the local legislation and institutional requirements. The participants provided their written informed consent to participate in this study.

Author contributions

OV: Conceptualization, Formal Analysis, Investigation, Methodology, Software, Validation, Visualization, Writing – original draft, Writing – review & editing. JS: Conceptualization, Data curation, Formal Analysis, Investigation, Validation, Writing – original draft, Writing – review & editing. AB: Data curation, Investigation, Writing – review & editing. DC: Data curation, Investigation, Writing – review & editing. AG: Data curation, Investigation, Writing – review & editing. MK: Investigation, Writing – review & editing. AT: Supervision, Writing – review & editing. CF: Conceptualization, Supervision, Writing – review & editing. MI: Conceptualization, Methodology, Supervision, Writing – review & editing. FO: Conceptualization, Data curation, Supervision, Writing – review & editing.

Funding

The author(s) declare financial support was received for the research and/or publication of this article. This work was supported by the Ministry of Economic Development of the Russian Federation (grant No 139-15-2025-004 dated 17.04.2025, agreement identifier 000000C313925P3X0002).

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

The author(s) declared that they were an editorial board member of Frontiers, at the time of submission. This had no impact on the peer review process and the final decision.

Generative AI statement

The author(s) declare that no Generative AI was used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Supplementary material

The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fendo.2025.1689312/full#supplementary-material

References

1. Sun H, Saeedi P, Karuranga S, Pinkepank M, Ogurtsova K, Duncan BB, et al. IDF Diabetes Atlas: Global, regional and country-level diabetes prevalence estimates for 2021 and projections for 2045. Diabetes Res Clin Pract. (2022) 183:109119. doi: 10.1016/j.diabres.2021.109119

PubMed Abstract | Crossref Full Text | Google Scholar

2. American Diabetes Association. Diagnosis and classification of diabetes mellitus. Diabetes Care. (2010) 33:S62–9. doi: 10.2337/dc10-S062

PubMed Abstract | Crossref Full Text | Google Scholar

3. Nathan DM. Long-term complications of diabetes mellitus. N Engl J Med. (1993) 328:1676–85. doi: 10.1056/NEJM199306103282306

PubMed Abstract | Crossref Full Text | Google Scholar

4. Nwaneri C, Cooper H, and Bowen-Jones D. Mortality in type 2 diabetes mellitus: magnitude of the evidence from a systematic review and meta-analysis. Diabetes Vasc Dis. (2013) 13:192–207. doi: 10.1177/1474651413495703

Crossref Full Text | Google Scholar

5. Taylor KS, Heneghan CJ, Farmer AJ, Fuller AM, Adler AI, Aronson JK, et al. All-cause and cardiovascular mortality in middle-aged people with type 2 diabetes compared with people without diabetes in a large U.K. Primary care database. Diabetes Care. (2013) 36:2366–71. doi: 10.2337/dc12-1513

PubMed Abstract | Crossref Full Text | Google Scholar

6. Yang JJ, Yu D, Wen W, Saito E, Rahman S, Shu X-O, et al. Association of diabetes with all-cause and cause-specific mortality in asia: A pooled analysis of more than 1 million participants. JAMA Netw Open. (2019) 2:e192696. doi: 10.1001/jamanetworkopen.2019.2696

PubMed Abstract | Crossref Full Text | Google Scholar

7. Gæde P, Lund-Andersen H, Parving H-H, and Pedersen O. Effect of a multifactorial intervention on mortality in type 2 diabetes. N Engl J Med. (2008) 358:580–91. doi: 10.1056/NEJMoa0706245

PubMed Abstract | Crossref Full Text | Google Scholar

8. Han H, Cao Y, Feng C, Zheng Y, Dhana K, Zhu S, et al. Association of a healthy lifestyle with all-cause and cause-specific mortality among individuals with type 2 diabetes: A prospective study in UK biobank. Diabetes Care. (2022) 45:319–29. doi: 10.2337/dc21-1512

PubMed Abstract | Crossref Full Text | Google Scholar

9. Yang X. Development and validation of an all-cause mortality risk score in type 2 diabetesThe hong kong diabetes registry. Arch Intern Med. (2008) 168:451. doi: 10.1001/archinte.168.5.451

PubMed Abstract | Crossref Full Text | Google Scholar

10. Wells BJ, Jain A, Arrigain S, Yu C, Rosenkrans WA, and Kattan MW. Predicting 6-year mortality risk in patients with type 2 diabetes. Diabetes Care. (2008) 31:2301–6. doi: 10.2337/dc08-1047

PubMed Abstract | Crossref Full Text | Google Scholar

11. McEwen LN, Karter AJ, Waitzfelder BE, Crosson JC, Marrero DG, Mangione CM, et al. Predictors of mortality over 8 years in type 2 diabetic patients. Diabetes Care. (2012) 35:1301–9. doi: 10.2337/dc11-2281

PubMed Abstract | Crossref Full Text | Google Scholar

12. De Cosmo S, Copetti M, Lamacchia O, Fontana A, Massa M, Morini E, et al. Development and validation of a predicting model of all-cause mortality in patients with type 2 diabetes. Diabetes Care. (2013) 36:2830–5. doi: 10.2337/dc12-1906

PubMed Abstract | Crossref Full Text | Google Scholar

13. Robinson TE, Elley CR, Kenealy T, and Drury PL. Development and validation of a predictive risk model for all-cause mortality in type 2 diabetes. Diabetes Res Clin Pract. (2015) 108:482–8. doi: 10.1016/j.diabres.2015.02.015

PubMed Abstract | Crossref Full Text | Google Scholar

14. Wan EYF, Fong DYT, Fung CSC, Yu EYT, Chin WY, Chan AKC, et al. Prediction of five-year all-cause mortality in Chinese patients with type 2 diabetes mellitus – A population-based retrospective cohort study. J Diabetes its Complications. (2017) 31:939–44. doi: 10.1016/j.jdiacomp.2017.01.017

PubMed Abstract | Crossref Full Text | Google Scholar

15. Liu C, Li C, Wang M, Yang S, Li T, and Lin C. Building clinical risk score systems for predicting the all-cause and expanded cardiovascular-specific mortality of patients with type 2 diabetes. Diabetes Obes Metab. (2021) 23:467–79. doi: 10.1111/dom.14240

PubMed Abstract | Crossref Full Text | Google Scholar

16. Chiu SY-H, Chen YI, Lu JR, Ng S-C, and Chen C-H. Developing a prediction model for 7-year and 10-year all-cause mortality risk in type 2 diabetes using a hospital-based prospective cohort study. JCM. (2021) 10:4779. doi: 10.3390/jcm10204779

PubMed Abstract | Crossref Full Text | Google Scholar

17. Sabbatinelli J, Giuliani A, Bonfigli AR, Ramini D, Matacchione G, Campolucci C, et al. Prognostic value of soluble ST2, high-sensitivity cardiac troponin, and NT-proBNP in type 2 diabetes: a 15-year retrospective study. Cardiovasc Diabetol. (2022) 21:180. doi: 10.1186/s12933-022-01616-3

PubMed Abstract | Crossref Full Text | Google Scholar

18. Qi J, He P, Yao H, Xue Y, Sun W, Lu P, et al. Developing a prediction model for all-cause mortality risk among patients with type 2 diabetes mellitus in Shanghai, China. J Diabetes. (2023) 15:27–35. doi: 10.1111/1753-0407.13343

PubMed Abstract | Crossref Full Text | Google Scholar

19. Lee S, Zhou J, Leung KSK, Wu WKK, Wong WT, Liu T, et al. Development of a predictive risk model for all-cause mortality in patients with diabetes in Hong Kong. BMJ Open Diabetes Res Care. (2021) 9:e001950. doi: 10.1136/bmjdrc-2020-001950

PubMed Abstract | Crossref Full Text | Google Scholar

20. Lee S, Zhou J, Wong WT, Liu T, Wu WKK, Wong ICK, et al. Glycemic and lipid variability for predicting complications and mortality in diabetes mellitus using machine learning. BMC Endocr Disord. (2021) 21:94. doi: 10.1186/s12902-021-00751-4

PubMed Abstract | Crossref Full Text | Google Scholar

21. Zhang T, Huang M, Chen L, Xia Y, Min W, and Jiang S. Machine learning and statistical models to predict all-cause mortality in type 2 diabetes: Results from the UK Biobank study. Diabetes Metab Syndrome: Clin Res Rev. (2024) 18:103135. doi: 10.1016/j.dsx.2024.103135

PubMed Abstract | Crossref Full Text | Google Scholar

22. Adadi A and Berrada M. Peeking inside the black-box: A survey on explainable artificial intelligence (XAI). IEEE Access. (2018) 6:52138–60. doi: 10.1109/ACCESS.2018.2870052

Crossref Full Text | Google Scholar

23. Loh HW, Ooi CP, Seoni S, Barua PD, Molinari F, and Acharya UR. Application of explainable artificial intelligence for healthcare: A systematic review of the last decade (2011–2022). Comput Methods Programs Biomedicine. (2022) 226:107161. doi: 10.1016/j.cmpb.2022.107161

PubMed Abstract | Crossref Full Text | Google Scholar

24. Alimbayev A, Zhakhina G, Gusmanov A, Sakko Y, Yerdessov S, Arupzhanov I, et al. Predicting 1-year mortality of patients with diabetes mellitus in Kazakhstan based on administrative health data using machine learning. Sci Rep. (2023) 13:8412. doi: 10.1038/s41598-023-35551-4

PubMed Abstract | Crossref Full Text | Google Scholar

25. Mirea O, Oghli MG, Neagoe O, Berceanu M, Ţieranu E, Moraru L, et al. All-cause mortality prediction in subjects with diabetes mellitus using a machine learning model and shapley values. Diabetology. (2025) 6:5. doi: 10.3390/diabetology6010005

Crossref Full Text | Google Scholar

26. Bonfigli AR, Spazzafumo L, Prattichizzo F, Bonafè M, Mensà E, Micolucci L, et al. Leukocyte telomere length and mortality risk in patients with type 2 diabetes. Oncotarget. (2016) 7:50835–44. doi: 10.18632/oncotarget.10615

PubMed Abstract | Crossref Full Text | Google Scholar

27. Testa R, Vanhooren V, Bonfigli AR, Boemi M, Olivieri F, Ceriello A, et al. N-glycomic changes in serum proteins in type 2 diabetes mellitus correlate with complications and with metabolic syndrome parameters. PloS One. (2015) 10:e0119983. doi: 10.1371/journal.pone.0119983

PubMed Abstract | Crossref Full Text | Google Scholar

28. Jadhav A, Pramod D, and Ramanathan K. Comparison of performance of data imputation methods for numeric dataset. Appl Artif Intell. (2019) 33:913–33. doi: 10.1080/08839514.2019.1637138

Crossref Full Text | Google Scholar

29. Li J, Guo S, Ma R, He J, Zhang X, Rui D, et al. Comparison of the effects of imputation methods for missing data in predictive modelling of cohort study datasets. BMC Med Res Methodol. (2024) 24:41. doi: 10.1186/s12874-024-02173-x

PubMed Abstract | Crossref Full Text | Google Scholar

30. Hur S, Lee Y, Park J, Jeon YJ, Cho JH, Cho D, et al. Comparison of SHAP and clinician friendly explanations reveals effects on clinical decision behaviour. NPJ Digit Med. (2025) 8:578. doi: 10.1038/s41746-025-01958-8

PubMed Abstract | Crossref Full Text | Google Scholar

31. Huang ES, Laiteerapong N, Liu JY, John PM, Moffet HH, and Karter AJ. Rates of complications and mortality in older patients with diabetes mellitus: the diabetes and aging study. JAMA Intern Med. (2014) 174:251. doi: 10.1001/jamainternmed.2013.12956

PubMed Abstract | Crossref Full Text | Google Scholar

32. AL-Musawe L, Martins AP, Raposo JF, and Torre C. The association between polypharmacy and adverse health consequences in elderly type 2 diabetes mellitus patients; a systematic review and meta-analysis. Diabetes Res Clin Pract. (2019) 155:107804. doi: 10.1016/j.diabres.2019.107804

PubMed Abstract | Crossref Full Text | Google Scholar

33. Castro-Rodríguez M, Carnicero JA, Garcia-Garcia FJ, Walter S, Morley JE, Rodríguez-Artalejo F, et al. Frailty as a major factor in the increased risk of death and disability in older people with diabetes. J Am Med Directors Assoc. (2016) 17:949–55. doi: 10.1016/j.jamda.2016.07.013

PubMed Abstract | Crossref Full Text | Google Scholar

34. Young BA, Lin E, Von Korff M, Simon G, Ciechanowski P, Ludman EJ, et al. Diabetes complications severity index and risk of mortality, hospitalization, and healthcare utilization. Am J Manag Care. (2008) 14:15–23.

Google Scholar

35. Spijkerman AMW, Dekker JM, Nijpels G, Jager A, Kostense PJ, Van Hinsbergh VWM, et al. Impact of diabetes duration and cardiovascular risk factors on mortality in type 2 diabetes: the Hoorn Study. Eur J Clin Invest. (2002) 32:924–30. doi: 10.1046/j.1365-2362.2002.01090.x

PubMed Abstract | Crossref Full Text | Google Scholar

36. Fox CS, Sullivan L, D’Agostino RB, and Wilson PWF. The significant effect of diabetes duration on coronary heart disease mortality. Diabetes Care. (2004) 27:704–8. doi: 10.2337/diacare.27.3.704

PubMed Abstract | Crossref Full Text | Google Scholar

37. Prattichizzo F, Giuliani A, Sabbatinelli J, Matacchione G, Ramini D, Bonfigli AR, et al. Prevalence of residual inflammatory risk and associated clinical variables in patients with type 2 diabetes. Diabetes Obes Metab. (2020) 22:1696–700. doi: 10.1111/dom.14081

PubMed Abstract | Crossref Full Text | Google Scholar

38. Prattichizzo F, Frigé C, Pellegrini V, Scisciola L, Santoro A, Monti D, et al. Organ-specific biological clocks: Ageotyping for personalized anti-aging medicine. Ageing Res Rev. (2024) 96:102253. doi: 10.1016/j.arr.2024.102253

PubMed Abstract | Crossref Full Text | Google Scholar

39. Soinio M, Marniemi J, Laakso M, Lehto S, and Rönnemaa T. High-sensitivity C-reactive protein and coronary heart disease mortality in patients with type 2 diabetes. Diabetes Care. (2006) 29:329–33. doi: 10.2337/diacare.29.02.06.dc05-1700

PubMed Abstract | Crossref Full Text | Google Scholar

40. Rawshani A, Rawshani A, Franzén S, Sattar N, Eliasson B, Svensson A-M, et al. Risk factors, mortality, and cardiovascular outcomes in patients with type 2 diabetes. N Engl J Med. (2018) 379:633–44. doi: 10.1056/NEJMoa1800256

PubMed Abstract | Crossref Full Text | Google Scholar

41. Sabbatinelli J, Sbriscia M, Olivieri F, and Giuliani A. Integrating cardiovascular risk biomarkers in the context of inflammaging. Aging. (2024) 16:12670–2. doi: 10.18632/aging.206136

PubMed Abstract | Crossref Full Text | Google Scholar

42. Russo GT, Giandalia A, Lucisano G, Rossi MC, Piscitelli P, Pontremoli R, et al. Prevalence and clinical determinants of rapid eGFR decline among patients with newly diagnosed type 2 diabetes. Eur J Internal Med. (2024) 130:123–9. doi: 10.1016/j.ejim.2024.07.034

PubMed Abstract | Crossref Full Text | Google Scholar

43. Rangaswami J, Bhalla V, Blair JEA, Chang TI, Costa S, Lentine KL, et al. Cardiorenal syndrome: classification, pathophysiology, diagnosis, and treatment strategies: A scientific statement from the american heart association. Circulation. (2019) 139:e840-e878. doi: 10.1161/CIR.0000000000000664

PubMed Abstract | Crossref Full Text | Google Scholar

44. Ji X and Ke W. Red blood cell distribution width and all-cause mortality in congestive heart failure patients: a retrospective cohort study based on the Mimic-III database. Front Cardiovasc Med. (2023) 10:1126718. doi: 10.3389/fcvm.2023.1126718

PubMed Abstract | Crossref Full Text | Google Scholar

45. Sbriscia M, Colombaretti D, Giuliani A, Di Valerio S, Scisciola L, Rusanova I, et al. Triglyceride glucose index predicts long-term mortality and major adverse cardiovascular events in patients with type 2 diabetes. Cardiovasc Diabetol. (2025) 24:115. doi: 10.1186/s12933-025-02671-2

PubMed Abstract | Crossref Full Text | Google Scholar

46. Wu X, Yu Z, Su W, Isquith DA, Neradilek MB, Lu N, et al. Low levels of ApoA1 improve risk prediction of type 2 diabetes mellitus. J Clin Lipidology. (2017) 11:362–8. doi: 10.1016/j.jacl.2017.01.009

PubMed Abstract | Crossref Full Text | Google Scholar

47. Walldius G, De Faire U, Alfredsson L, Leander K, Westerholm P, Malmström H, et al. Long-term risk of a major cardiovascular event by apoB, apoA-1, and the apoB/apoA-1 ratio—Experience from the Swedish AMORIS cohort: A cohort study. PloS Med. (2021) 18:e1003853. doi: 10.1371/journal.pmed.1003853

PubMed Abstract | Crossref Full Text | Google Scholar

Keywords: type 2 diabetes, all-cause mortality risk, predictive model, machine learning, explainable artificial intelligence

Citation: Vershinina O, Sabbatinelli J, Bonfigli AR, Colombaretti D, Giuliani A, Krivonosov M, Trukhanov A, Franceschi C, Ivanchenko M and Olivieri F (2025) Explainable artificial intelligence model predicting the risk of all-cause mortality in patients with type 2 diabetes mellitus. Front. Endocrinol. 16:1689312. doi: 10.3389/fendo.2025.1689312

Received: 20 August 2025; Accepted: 06 October 2025;
Published: 17 October 2025.

Edited by:

Xiantong Zou, Peking University People’s Hospital, China

Reviewed by:

Leandros Stefanopoulos, Northwestern University, United States
Huang Bin, Zhejiang Hospital, China

Copyright © 2025 Vershinina, Sabbatinelli, Bonfigli, Colombaretti, Giuliani, Krivonosov, Trukhanov, Franceschi, Ivanchenko and Olivieri. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Olga Vershinina, b2x5YS52ZXJzaGluaW5hQGl0bW0udW5uLnJ1; Jacopo Sabbatinelli, ai5zYWJiYXRpbmVsbGlAc3RhZmYudW5pdnBtLml0

These authors have contributed equally to this work and share first authorship

These authors have contributed equally to this work and share senior authorship

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.