BackgroundTuberculous spondylitis (TS) and brucellar spondylitis (BS) are commonly observed in spinal infectious diseases, which are initially caused by bacteremia. BS is easily misdiagnosed as TS, especially in underdeveloped regions of northwestern China with less sensitive medical equipment. Nevertheless, a rapid and reliable diagnostic tool remains to be developed and a clinical diagnostic model to differentiate TS and BS using machine learning algorithms is of great significance.MethodsA total of 410 patients were included in this study. Independent factors to predict TS were selected by using the least absolute shrinkage and selection operator (LASSO) regression model, permutation feature importance, and multivariate logistic regression analysis. A TS risk prediction model was developed with six different machine learning algorithms. We used several metrics to evaluate the accuracy, calibration capability, and predictability of these models. The performance of the model with the best predictability was further verified with the area under the curve (AUC) of the receiver operating characteristic (ROC) curve and the calibration curve. The clinical performance of the final model was evaluated by decision curve analysis.ResultsSix variables were incorporated in the final model, namely, pain severity, CRP, x-ray intervertebral disc height loss, x-ray endplate sclerosis, CT vertebral destruction, and MRI paravertebral abscess. The analysis of appraising six models revealed that the logistic regression model developed in the current study outperformed other methods in terms of sensitivity (0.88 ± 0.07) and accuracy (0.79 ± 0.07). The AUC of the logistic regression model predicting TS was 0.86 (95% CI, 0.81–0.90) in the training set and 0.86 (95% CI, 0.78–0.92) in the validation set. The decision curve analysis indicated that the logistic regression model displayed a higher clinical efficiency in the differential diagnosis.ConclusionsThe logistic regression model developed in this study outperformed other methods. The logistic regression model demonstrated by a calculator exerts good discrimination and calibration capability and could be applicable in differentiating TS from BS in primary health care diagnosis.