MACHINE learning could help identify patients with non-alcoholic fatty liver disease (NAFLD) who are at increased risk of developing type 2 diabetes (T2D), according to new research involving two independent Chinese hospital cohorts.
Researchers developed and externally validated a predictive model using five routinely available clinical variables, achieving an area under the receiver operating characteristic curve (AUC) of 0.89 in an independent validation cohort. The findings suggest that artificial intelligence could support more personalised risk assessment in patients with NAFLD, although further prospective validation is needed before clinical implementation.
Identifying Diabetes Risk in Fatty Liver Disease
NAFLD, increasingly discussed within the framework of metabolic dysfunction-associated steatotic liver disease (MASLD), is closely associated with metabolic abnormalities and an increased likelihood of developing T2D.
Identifying patients at greatest risk of developing diabetes could support earlier monitoring and preventive interventions.
However, predicting which individuals with NAFLD will subsequently develop T2D remains challenging, particularly when multiple metabolic and inflammatory factors contribute to disease risk.
To investigate whether machine learning could improve risk stratification, researchers retrospectively analysed patients with histologically confirmed NAFLD from two tertiary hospitals in China.
The date of histological diagnosis was used as baseline, with patients followed until their first documented T2D diagnosis or their last available clinical record.
Researchers developed seven predictive models, including logistic regression, decision tree, random forest, XGBoost, LightGBM, support vector machine, and artificial neural network (ANN).
Model performance was evaluated using discrimination, calibration, clinical decision analysis, and external validation.
Five Clinical Predictors Identified
Using least absolute shrinkage and selection operator (LASSO) regression, researchers identified five variables associated with subsequent T2D development.
These included waist circumference, fasting plasma glucose, triglyceride levels, family history of diabetes, and neutrophil-to-lymphocyte ratio.
The selected predictors represent a combination of metabolic characteristics, hereditary risk, and a marker of systemic inflammation.
Fasting plasma glucose provides information about existing glycaemic status, while waist circumference and triglyceride levels reflect metabolic characteristics relevant to diabetes risk.
Family history captures an established dimension of susceptibility, whereas the neutrophil-to-lymphocyte ratio provides an accessible measure of inflammatory status.
Importantly, all five variables can be obtained through routine clinical assessments, potentially making the model more accessible than approaches requiring specialised investigations.
The researchers emphasised that the model’s potential value lies in combining established clinical variables into an integrated risk assessment rather than identifying entirely new diabetes predictors.
XGBoost Demonstrates Strong External Performance
Among the seven algorithms evaluated, the ANN model demonstrated the strongest performance in the internal validation dataset.
However, when researchers assessed all seven models in an independent external cohort, XGBoost demonstrated the best overall performance.
The XGBoost model achieved an AUC of 0.99 in the training dataset and 0.89 in the external validation cohort.
The difference between training and external validation performance highlights the importance of evaluating predictive models in independent populations rather than relying exclusively on their performance during development.
XGBoost was selected as the final model based primarily on external validation results, calibration, and decision curve analysis.
Researchers also conducted several sensitivity analyses to account for differences in follow-up duration, including Cox proportional hazards regression, time-dependent receiver operating characteristic analysis, follow-up-adjusted logistic regression, and a three-year landmark analysis.
These analyses produced findings that were materially consistent with the primary results, supporting the robustness of the model’s overall predictive performance.
To improve interpretability, the researchers used Shapley Additive Explanations (SHAP) analysis to assess how individual variables contributed to predictions.
This confirmed the importance of fasting plasma glucose, waist circumference, triglycerides, family history of diabetes, and neutrophil-to-lymphocyte ratio in determining individualised risk estimates.
Potential for Earlier Diabetes Risk Stratification
The findings suggest that machine-learning models incorporating routinely available clinical information could help identify patients with NAFLD who may benefit from closer metabolic monitoring.
Such approaches could potentially support more targeted preventive strategies, particularly among patients with multiple metabolic risk factors.
However, the researchers emphasised several limitations.
The retrospective study included patients with biopsy-confirmed NAFLD from two tertiary hospitals, potentially limiting generalisability to broader populations diagnosed using non-invasive methods.
Furthermore, the model predicted diabetes occurrence during the available follow-up period rather than providing absolute risk estimates at fixed intervals, such as one, three, or five years.
Consequently, its performance should not be interpreted as evidence that it can accurately predict diabetes development within a specific timeframe.
Although external validation demonstrated promising discrimination, the model has not yet been shown to improve clinical decisions or patient outcomes.
The researchers concluded that an interpretable machine-learning framework based on five routinely available variables may support medium-term diabetes risk stratification in patients with NAFLD.
Further prospective, multicentre studies with standardised follow-up periods and predefined prediction horizons are required before the approach can be incorporated into routine clinical practice.
Reference
Lei, K., Wu, Y., Xing, Y. et al. Medium-term risk prediction for incident type 2 diabetes in patients with histologically confirmed NAFLD using machine learning: insights from two cohorts. Diabetol Metab Syndr (2026). https://doi.org/10.1186/s13098-026-02302-0


