OBJECTIVE: This study aims to develop machine learning (ML) models combined with an explainable method for the prediction of surgical site infection (SSI) after posterior lumbar fusion surgery. METHODS: In this retrospective, single-center study, a total of 1016 consecutive patients who underwent posterior lumbar fusion surgery were included. A comprehensive dataset was established, encompassing demographic variables, comorbidities, preoperative evaluation, details related to diagnosed lumbar disease, preoperative laboratory tests, surgical specifics, and postoperative factors. Utilizing this dataset, 6nullML models were developed to predict the occurrence of SSI. Performance evaluation of the models on the testing set involved several metrics, including the receiver operating characteristic curve, the area under the receiver operating characteristic curve, accuracy, recall, F1 score, and precision. The Shapley Additive Explanations (SHAP) method was employed to generate interpretable predictions, enabling a comprehensive assessment of SSI risk and providing individualized interpretations of the model results. RESULTS: Among the 1016 retrospective cases included in the study, 36 (3.54%) experienced SSI. Out of the six models examined, the Extreme Gradient Boost model demonstrated the highest discriminatory performance on the testing set, achieving the following metrics: precision (0.9000), recall (0.8182), accuracy (0.9902), F1 score (0.8571), and area under the receiver operating characteristic curve (0.9447). By utilizing the SHAP method, several important predictors of SSI were identified, including the duration of indwelling jugular vein catheter, blood urea nitrogen levels, total protein levels, sustained fever, creatinine levels, triglycerides levels, monocyte count, diabetes mellitus, drainage time, white blood cell count, cerebral infarction, estimated blood loss, prealbumin levels, Prognostic Nutritional Index, low back pain, posterior fusion score, and osteoporosis. CONCLUSIONS: ML-based prediction tools can accurately assess the risk of SSI after posterior lumbar fusion surgery. Additionally, ML combined with SHAP could provide a clear interpretation of individualized risk prediction and give physicians an intuitive comprehension of the effects of the model's essential features.