Lower back pain (LBP) is a leading global cause of disability with complex, multifactorial determinants spanning demographic, lifestyle, and structural spinal findings. Lumbar magnetic resonance imaging (MRI) is widely used to characterize disc pathology and has been integrated into machine learning (ML) research to identify imaging biomarkers associated with pain and disability. Tree-based ML algorithms such as Random Forest (RF) and XGBoost are well suited to handle nonlinear relationships and correlated predictors typical of MRI-derived datasets, while XGBoost additionally supports SHAP values for model interpretability. The present analysis addresses a gap in Saudi Arabian LBP research by combining MRI structural variables with lifestyle and demographic data in ML models to predict dichotomized pain intensity.
The primary aim was to predict factors contributing to pain intensity in adults with LBP using RF and XGBoost models. The study dichotomized pain intensity measured by the Numerical Rating Scale (NRS) into strong (7–8) versus very strong (9–10) and evaluated the relative importance of clinical, imaging, and lifestyle predictors for classifying these categories.
This was a cross-sectional descriptive study conducted at King Fahad Specialist Hospital, Tabuk, Saudi Arabia. Data were collected between November 2025 and January 2026. Of 127 adults initially screened for lumbar MRI, 61 patients met inclusion criteria (NRS ≥ 7, MRI-confirmed disc pathology, no prior spinal surgery, complete data) and comprised the final analytic sample. The authors note that n = 61 is below conventional machine learning thresholds (commonly n ≥ 200) and therefore performed a post-hoc learning-curve analysis to assess model stability.
Participants completed a pretested structured questionnaire covering demographics, anthropometrics, exercise frequency/duration, sitting time, diet, pain history, and clinical symptoms. Pain intensity used the 11-point NRS and was dichotomized as described. Lumbar MRI was performed on a Siemens Espree 1.5 T system with standardized sagittal and axial sequences. Two consultant radiologists independently reviewed scans; inter-rater agreement was substantial to almost perfect for disc level classification (κ = 0.748) and pathology type (κ = 0.839). Recorded MRI features included pathology type (bulge, protrusion, extrusion, spondylosis), affected spinal levels (L1–S1), and number of affected discs.
Predictors comprised demographics (age, sex, body mass index), MRI variables (disc location, number of affected levels, pathology type), and lifestyle factors (exercise time, sitting hours). Categorical variables were one-hot encoded; ordinal and continuous variables were treated appropriately for tree-based models. Multicollinearity assessment showed VIF < 3 for all predictors. Data were split into training (70%) and testing (30%) sets under a fixed random seed (42). Hyperparameters were selected via grid search with 5-fold cross-validation: RF used 500 trees with mtry = √p and minimum node size 1; XGBoost used 100 boosting rounds, max depth 5, learning rate 0.1, subsample 0.7, column subsampling 0.7, and gamma as selected.
RF test-set performance: accuracy = 0.579 (95% CI 0.334–0.800), AUC = 0.607 (0.340–0.875), specificity = 0.917, sensitivity = 0.000. Feature importance measures for RF identified the number of affected disc levels as the strongest predictor (MDG = 0.62), followed by L4–L5 disc location (MDA = 0.48), age (0.31), and exercise time (0.28).
XGBoost achieved 66.67% accuracy on the test set but demonstrated low sensitivity (0.33), a limitation attributed to severe class imbalance (72.1% of the sample categorized as very strong pain) and the small sample size. XGBoost models were interpreted using SHAP values to provide complementary, patient-level insights into predictor influence.
The models identified structural MRI variables (number of affected levels, L4–L5 involvement) and non-imaging factors (age, exercise time) as influential predictors of higher pain intensity categories. Despite identifying meaningful predictors, RF’s predictive performance and XGBoost’s limited sensitivity indicate current models are insufficient for clinical decision making. The authors suggest ML can serve as a decision-support approach for risk stratification when models are developed and validated on larger, more balanced datasets.
Key limitations reported include the small sample size (n = 61), single-center design, and class imbalance favoring the very strong pain category, all of which constrain model convergence and generalizability. The authors recommend multi-center studies with larger samples (n ≥ 200), prospective designs, and methods to address class imbalance before considering clinical translation. Data underlying the study are not publicly available owing to institutional data-sharing restrictions.
Integrating lumbar MRI variables with demographic and lifestyle factors in ML models highlighted plausible predictors of stronger pain intensity in LBP, with number of affected discs and L4–L5 involvement among the top contributors. However, model performance—particularly sensitivity—was limited in this small, imbalanced sample. Further research with larger, multi-center cohorts and rigorous handling of class imbalance is required before these ML approaches can inform clinical practice.