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

ORIGINAL RESEARCH article

Front. Endocrinol.

Sec. Bone Research

Volume 16 - 2025 | doi: 10.3389/fendo.2025.1611499

Development and Validation of an Explainable Machine Learning Model for Predicting Osteoporosis in Patients with Type 2 Diabetes Mellitus

Provisionally accepted
Qipeng  WeiQipeng Wei1Jinxiang  ZhanJinxiang Zhan1Xiaofeng  ChenXiaofeng Chen1Hao  LiHao Li1Weijun  GuoWeijun Guo1Qingyan  HuangQingyan Huang1Zihao  LiuZihao Liu2Shiji  ChenShiji Chen2Dongling  CaiDongling Cai1,2*
  • 1Department of Orthopedics, Panyu Hospital of Chinese Medicine, Guangzhou, China
  • 2Panyu Hospital of Chinese Medicine, Guangzhou University of Chinese Medicine, Guangzhou, China

The final, formatted version of the article will be published soon.

Osteoporosis is a common complication in patients with type 2 diabetes mellitus (T2DM), yet its screening rate remains low. This study aimed to develop and validate a cost-effective and interpretable machine learning (ML) model to predict the risk of osteoporosis in patients with T2DM.This retrospective study included 1560 inpatients who underwent dual-energy X-ray absorptiometry (DXA) between January 2022 and December 2023 at Panyu Hospital of Chinese Medicine. Demographic information and laboratory test results obtained within 24 hours of hospital admission were collected. Potential predictive features were identified using univariate analysis, least absolute shrinkage and selection operator (LASSO) regression, and the Boruta algorithm. Eight supervised ML algorithms were applied to construct predictive models. Model performance was evaluated based on the area under the receiver operating characteristic curve (AUC), calibration plots, decision curve analysis (DCA), accuracy, sensitivity, specificity, and F1 score. The SHapley Additive exPlanations (SHAP) method was used to interpret the model and visualize feature importance.Ten predictive features were selected based on the intersection of the three feature selection methods. Among the tested models, logistic regression achieved the best overall performance, with an AUC of 0.812, an accuracy of 0.762, a sensitivity of 0.809, a specificity of 0.761, and an F1 score of 0.771 in the validation set. Calibration plots and DCA curves demonstrated good agreement and the highest net clinical benefit. SHAP analysis identified age, sex, alkaline phosphatase, uric acid, hemoglobin, and neutrophil count as the six most influential features. An easy-to-use, web-based risk calculator was developed based on the logistic model and is available at: https://t2dm.shinyapps.io/t2dm-osteoporosis/.We developed an interpretable and accessible ML-based online tool that enables preliminary screening of osteoporosis risk in patients with T2DM using routine blood indicators. This tool may assist clinicians in early risk identification and reduce the underdiagnosis of osteoporosis.

Keywords: Osteoporosis, type 2 diabetes mellitus, Explainable Machine Learning, predictive model, Risk Assessment

Received: 14 Apr 2025; Accepted: 15 Jul 2025.

Copyright: © 2025 Wei, Zhan, Chen, Li, Guo, Huang, Liu, Chen and Cai. 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) or licensor 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: Dongling Cai, Department of Orthopedics, Panyu Hospital of Chinese Medicine, Guangzhou, China

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.