Abstract
BACKGROUND: Effective management of postoperative pain remains a significant challenge in obstetric care due to the variability in pain perception and response influenced by physical, medical, and psychosocial factors. Current standardized pain management protocols often fail to accommodate this variability, necessitating more tailored approaches. OBJECTIVE: This study aims to improve postoperative pain management following cesarean sections by developing personalized protocols using machine learning (ML) models. METHOD: The study analyzed the efficacy of eight ML models, including XGBoost, Random Forest, and Neural Networks, using data from two distinct hospital cohorts. Performance metrics such as Root Mean Squared Error (RMSE) and Coefficient of Determination (R²) were evaluated through internal and external validations. SHAP value analysis was used to identify key predictors influencing pain management outcomes. RESULTS: The XGBoost model demonstrated superior performance, achieving the lowest RMSE and highest R². Key factors impacting pain management included esketamine use, anesthesia method, and anesthetic drug type, with esketamine significantly delaying the first activation of patient-controlled intravenous analgesia (PCIA). CONCLUSIONS: The study highlights the potential of machine learning to refine postoperative pain management strategies in obstetric care, suggesting that personalized approaches, particularly incorporating esketamine and specific anesthesia methods, could enhance patient outcomes. TRIAL REGISTRATION: Not applicable.