The association between the Dietary Index for Gut Microbiota (DI-GM) and site-specific osteoporosis risk remains unclear. This study analyzed data from five NHANES cycles (2005–2010, 2013–2014, 2017–2018). Multivariate logistic regression and subgroup analyses were conducted to evaluate the relationship between DI-GM and osteoporosis at specific skeletal sites. Restricted cubic spline (RCS) and threshold effect analyses were used to explore nonlinear associations. Six machine learning models were developed, with SHAP and LIME algorithms applied to enhance interpretability. After adjusting for potential confounders, higher DI-GM scores were significantly associated with a lower risk of osteoporosis at the total femur (adjusted OR = 0.89; 95% CI: 0.80–0.98; p = 0.022). RCS analysis revealed a nonlinear relationship at the femoral neck (p for nonlinearity = 0.028; p for overall trend = 0.005), with a threshold at DI-GM = 3. Below this threshold, DI-GM was positively associated with osteoporosis risk (adjusted OR = 1.455; 95% CI: 1.002–2.221; p = 0.064), while above it, the association was inverse (adjusted OR = 0.904; 95% CI: 0.847–0.963; p = 0.002). Among all models, the random forest algorithm exhibited the best predictive performance for total femur osteoporosis. SHAP analysis identified whole grains (0.0117), coffee (0.0084), red meat (0.0079), and soybeans (0.0051) as the most influential dietary components, all inversely associated with osteoporosis risk. Higher DI-GM scores are associated with reduced osteoporosis risk, particularly at the total femur. The random forest model showed the highest predictive accuracy, and SHAP analysis highlighted whole grains and coffee as key protective contributors. • DI-GM linked to lower osteoporosis risk at total femur in large NHANES cohort. • Nonlinear threshold effect of DI-GM on femoral neck osteoporosis identified. • Random Forest model excellently predicts osteoporosis using dietary components. • Whole grains, coffee, red meat, soybeans are key protective dietary factors. • Combines Boruta feature selection with SHAP for interpretable machine learning.
Zhou et al. (Wed,) studied this question.