Osteoporosis is a significant public health challenge in aging societies, and its diagnosis primarily relies on dual-energy X-ray absorptiometry (DXA), a radiological method. This study aims to develop a non-invasive and rapid machine learning prediction model for osteoporosis. A cross-sectional study design was employed, analyzing data from the Korea National Health and Nutrition Examination Survey (KNHANES) dataset spanning 2008–2011. The T-scores from DXA measurements in the original data were used as outcome indicators, and abnormal DXA results (including osteopenia and osteoporosis) were included in the study. Machine learning models incorporating three algorithms—Gradient Boosting (GradientBoost), Categorical Boosting (CatBoost), and Extreme Gradient Boosting (XGBoost)—were used to predict DXA results. The performance of binary classification models was primarily evaluated using the area under the receiver operating characteristic curve (AUC), while the performance of multi-classification models was compared using accuracy (ACC). A total of 18,179 participants were included in the study (14,747 in the development dataset and 3,432 in the external validation dataset). Among all participants, 11,742 (64.6%) had normal DXA results. After screening, a machine learning model was established incorporating three categories of variables: demographic information, physical examination indicators, and nutritional questionnaire data. The final model achieved an AUC of 0.845 (95% CI: 0.831–0.861) for predicting abnormal DXA results, with a specificity (SPE) of 0.897 (95% CI: 0.893–0.902). In the external validation dataset, the AUC was 0.876 (95% CI: 0.874–0.877), and the specificity was 0.909 (95% CI: 0.906–0.912). In the three-classification model further distinguishing normal, osteopenia, and osteoporosis, the accuracy reached 0.724 (95% CI: 0.717–0.736), with a specificity of 0.803 (95% CI: 0.797–0.813). In the external validation dataset, the accuracy was 0.744 (95% CI: 0.742–0.846), and the specificity was 0.819 (95% CI: 0.818–0.821). This study contributes to early screening for abnormal DXA results, particularly at the community level, reducing unnecessary radiological examinations and supporting subsequent specialized medical care.
