Prediction of Postoperative Pain and Side Effects of Patient-Controlled Analgesia in Pediatric Orthopedic Patients Using Machine Learning: A Retrospective Study
Young-Eun Joe, Nayoung Ha, Woojoo Lee, Hyo-Jin Byon

TL;DR
This study uses machine learning to predict postoperative pain and side effects in children after orthopedic surgery, helping improve pain management strategies.
Contribution
The study introduces machine learning models to forecast pain and complications from PCA in pediatric orthopedic patients.
Findings
Extreme gradient boosting predicted moderate postoperative pain with high accuracy (AUC: 0.85–0.89).
Factors like pain score, opioid infusion, and age were key predictors of pain and complications.
Random forest models effectively predicted side effects in the 24–48-hour post-surgery period (AUC: 0.91).
Abstract
Background/Objectives: Appropriate postoperative management, especially in pediatric patients, can be challenging for anesthesiologists. This retrospective study used machine learning to investigate the effects and complications of patient-controlled analgesia (PCA) in children undergoing orthopedic surgery. Methods: The medical records of children who underwent orthopedic surgery in a single tertiary hospital and received intravenous and epidural PCA were analyzed. Predictive models were developed using machine learning, and various demographic, anesthetic, and surgical factors were investigated to predict postoperative pain and complications associated with PCA. Results: Data from 1968 children were analyzed. Extreme gradient boosting effectively predicted moderate postoperative pain for the 6–24-h (area under curve (AUC): 0.85, accuracy (ACC): 0.79) and 24–48-h (AUC: 0.89, ACC: 0.87)…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAnesthesia and Pain Management · Cardiac, Anesthesia and Surgical Outcomes · Pediatric Pain Management Techniques
1. Introduction
Postoperative pain management for pediatric patients is challenging due to various factors, including limited experience, insufficient assessment tools, variations in pain perception and analgesic needs among individuals, differences in pharmacokinetics and pharmacology between children and adults, and constraints in administering analgesics to children [1]. Inadequate pain management in pediatric patients can lead to sleep disturbances and altered pain responses, potentially contributing to the development of chronic pain [2,3]. Managing postoperative pain in pediatric patients following orthopedic surgery remains problematic [4], with concerns regarding the potential over-prescription of opioids in patients with poorly managed pain [5]. Moreover, individual variability exists in opioid responses [6,7], and effective communication can be challenging in pediatric patients undergoing scoliosis surgery. As a result, PCA often fails to provide adequate analgesia for relieving postoperative pain in children. Moreover, the utilization of PCA in children may be restricted due to apprehensions, such as respiratory depression, excessive sedation, programming errors, patient monitoring challenges, and PCA administration by proxy.
Patient-controlled analgesia (PCA) has been applied to manage postoperative pain in pediatric patients [8,9,10,11,12]. Nevertheless, PCA frequently falls short of delivering adequate analgesia to alleviate postoperative pain in children. The utilization of PCA in children may be restricted due to apprehensions, such as respiratory depression, excessive sedation, programming errors, patient monitoring challenges, and PCA administration by proxy [13]. By predicting the effects of PCA and identifying factors associated with its side effects, PCA can be administered more effectively and safely in pediatric patients undergoing surgery.
Machine learning (ML) holds promise in influencing various aspects of anesthesiology practice, spanning from perioperative assistance to critical care provision and outpatient pain management [14]. ML is employed for prognostic forecasting in pediatric medical domains, particularly in risk assessment among patients in intensive care units [15,16,17]. To our knowledge, there have been no investigations on the application of ML in assessing the effects of PCA for postoperative pain management in pediatric patients.
In pediatric patients, as in adults [18], preoperative risk stratification is crucial. This process necessitates the identification of various risk factors. Therefore, this study aimed to develop an ML-based model that is capable of predicting the effects and complications of PCA and investigating the factors influencing PCA in children undergoing orthopedic surgery.
2. Materials and Methods
2.1. Study Design and Ethics
This study was conducted on patients under 12 years of age who used intravenous PCA following pediatric orthopedic surgery from January 2013 to June 2021. The inclusion criteria involved patients with complete PCA records available for up to 48 h after surgery. Data from patients with height or weight exceeding 2 standard deviations and those who underwent multiple surgeries were excluded from the analysis. Raw PCA data were collected from the electronic medical record system using the Severance Clinical Research Analysis Portal.
This retrospective study was approved by the Institutional Review Board of the Yonsei University Health System, Seoul, Republic of Korea (4-2021-1185, date of approval: 18 October 2021), and the requirement for patient consent was waived.
2.2. Anesthetic Management and PCA Composition
General anesthesia was administered according to the standard institutional protocol. Standard monitoring, including pulse oximetry, electrocardiography, and non-invasive blood pressure measurement, was performed upon the arrival of the patient in the operating room. Anesthesia was induced using propofol (2 mg/kg) and rocuronium (0.6 mg/kg) and maintained using sevoflurane. Depending on the type of surgery, a regional block was performed when necessary.
The intravenous PCA regimen included 10–15 mcg/kg of fentanyl mixed with 100 mL of 0.9% normal saline, based on the surgery type and patient’s age. The basal rate was set at 2 mL per hour, the bolus analgesia for breakthrough pain was set at 0.5 mL, and the lock-out time was set to 15 min. PCA was administered 30 min before the end of the surgery.
The epidural PCA regimen included 0.15% ropivacaine mixed with 500 mL of 0.9% normal saline. The basal rate was set at 0.15 mL/kg per hour (maximum of 6 mL), the bolus analgesia for breakthrough pain was set at 0.1 mL/kg (maximum of 4 mL), and the lockout time was set to 30 min.
2.3. Variables and Outcome Measures
The covariates used in the ML model are provided in Table 1. The variables were divided into patient-, surgery-, anesthesia-, and postoperative-related factors.
We considered four types of binary outcome variables: moderate pain, severe pain, side effects, and nausea/vomiting (N/V). Moderate pain was defined as a pain score of 4–7, and severe pain was defined as a pain score of 7 or more. The Face-Legs-Activity-Cry-Consolability Scale was used for pediatric patients aged 3 years or younger, and the Wong–Baker Faces Scale was used for pediatric patients aged 4 years or older. The side effects evaluated included N/V, oversedation, dizziness, urinary incontinence, headache, pruritis, and respiratory depression. If any side effects occurred during any PCA period, it was classified as an occurrence. The severity of nausea was rated on a scale of 1 to 3, with mild nausea defined as 1, nausea requiring medication as 2, and nausea with vomiting as 3 points. N/V of 2 points or more was considered a side effect. These four outcome variables were measured 6–24 h and 24–48 h after orthopedic surgery, resulting in eight outcome variables for the analysis.
2.4. Statistical Analysis
2.4.1. Machine Learning Methods and Model Selection
We considered the following six ML methods [19] to predict postoperative pain and side effects of PCA after surgery: (i) penalized logistic regression models with least absolute shrinkage and selection operator (LASSO) and ridge penalties, developed using the glmnet R package [20]; (ii) support vector machines (SVMs) with linear and radial basis kernels, created using the kernlab R package [21]; and (iii) random forest (RF) and extreme gradient boosting (XGB), performed using the randomForest and xgboost R packages [22,23]. Each method has tuning parameters (or hyperparameters), and the optimal tuning parameters were selected by stratified five-fold cross-validation (CV) using grid search over various combinations of the hyperparameters that maximized the performance metrics, as shown in Supplementary Table S1. The stratified five-fold CV approach ensures that the proportion of events for each fold is approximately the same, which is recommended for the imbalanced binary outcome variables [24].
The cross-validated area under the curve (AUC) and the cross-validated accuracy (ACC) are computed to evaluate the prediction performance of the six ML methods. We aggregated the predicted outcomes from each hold-out dataset and calculated a single cross-validated AUC value using all the predicted and the observed outcomes simultaneously [25]. The method showing the maximum AUC and ACC was selected as the best result.
2.4.2. Variable Importance
For each outcome, we identified the top 10 most important features from the final model fitted to the full dataset with the optimal tuning parameter. We used the rminer package [26] to measure variable importance for the six ML methods. To explain how the variable importance of is computed, consider the final prediction model , where ) are p-dimensional features. We calculated the average absolute deviation (AAD) for as [26]:
where denotes the mean values for all except . A similar formula applies to other inputs. To make these values lie within [0, 1] for convenience, we reported as the variable importance for .
2.4.3. Descriptive Analysis
Continuous variables are expressed as mean ± standard deviation (SD) or as median (interquartile range) and categorical variables as number (percentage). A p-value of <0.05 was considered statistically significant. All statistical analyses were performed using R version 4.3.3 (https://www.r-project.org/).
3. Results
3.1. Patient Characteristics
The medical records of 2630 patients were obtained from the electronic medical record system and included in this study. However, data from 662 patients were excluded due to missing values, multiple surgeries during a single hospitalization, or discharge on postoperative day 1. Thus, data from a total of 1968 patients aged less than 12 years who underwent orthopedic surgery between 2013 and 2021 were analyzed in this study (Figure 1). The baseline characteristics of all included patients are detailed in Table 2.
3.2. Outcome Measures
3.2.1. Pain Score
Table 3 describes the average pain scores, postoperative pain severity, and occurrence of side effects for each time interval. Within 6–24 h after surgery, 356 patients (18.1%) reported moderate to severe pain, and among them, 50 patients (2.5%) experienced severe pain. Between 24 and 48 h after surgery, 100 patients (10.6%) experienced moderate to severe pain, and 10 patients (1.1%) reported severe pain.
Among the six models assessed, those with high AUC and ACC values were selected. Table 4 shows the top three prediction performances of each ML model. The XGB model emerged as the best performer in predicting moderate pain (AUC: 0.85, ACC: 0.79) and severe pain (AUC: 0.88, ACC: 0.76) during the 6–24-h post-surgery periods. The LASSO model was chosen for predicting moderate pain (AUC 0.89, ACC 0.87) and severe pain (AUC 0.98, ACC 0.96) during 24–48-h periods after surgery.
Variables such as the pain score immediately before the measurement period, total opioid amount until the measurement period, operation time, and patient age were associated with both moderate to severe pain and severe pain within 6–24 h after surgery (Figure 2). The most important variable for predicting moderate and severe pain within 24–48 h post-surgery was the pain score recorded during the 6–24-h period.
3.2.2. Side Effects
The overall occurrence rate of side effects was 16.5%. Specifically, within 6–24 h after surgery, the incidence of side effects was 6.1% (121 patients), and within 24–48 h after surgery, it was 1.7% (33 patients). Nausea and vomiting, a significant side effect, were observed in 90 patients (4.6%) within 6–24 h after surgery and in 23 patients (1.2%) within 24–48 h after surgery (Table 3).
The LASSO model (AUC: 0.75, ACC: 0.64) and the RF model (AUC: 0.91, ACC: 0.87) emerged as the top-performing models for predicting side effects during the 6–24-h and the 24–48-h postoperative periods, respectively. Regarding the prediction of nausea and vomiting, the most prevalent side effect, the Ridge model (AUC: 0.72, ACC: 0.77) was selected for the 6–24-h postoperative period, while the XGB model (AUC: 0.91, ACC: 0.81) was chosen for the 24–48-h postoperative period (Table 4).
For the prediction performances by age (6 years and under, over 6 years), the younger subgroup showed slightly higher AUC and ACC compared to the older subgroup. Overall, both subgroups performed similarly to the whole sample. The details about the top three prediction results are provided in Supplementary Table S5.
The main predictors of side effects included the occurrence of side effects immediately before the measurement period, total opioid infusion amount, and patient age. Additionally, the most significant variable for predicting N/V after surgery was the presence of N/V immediately before the measurement period (Figure 3).
4. Discussion
Our study aimed to predict postoperative pain and side effects in pediatric patients using PCA following orthopedic surgery. We developed an ML-based model that was capable of predicting moderate and severe pain for up to 48 h after surgery. We assessed six ML models, including RF, SVM, XGB, LASSO, and Ridge, and selected those with the highest AUC and ACC values. The chosen models had AUC and ACC values exceeding 0.8 [27], indicating their effectiveness in predicting postoperative pain and side effects. Postoperative pain and adverse effects are influenced by a wide range of factors, including patient characteristics, anesthesia, and surgical variables. Therefore, predicting these outcomes is inherently challenging. Considering these complexities, our models can be evaluated as having strong predictive performance. By applying this model to various patient variables, we can better anticipate and proactively manage postoperative pain and side effects associated with PCA. Additionally, among the predictive factors, prior occurrences of pain and side effects had the highest variable importance, highlighting the need for more active intervention by clinicians. The models predicting pain and side effects varied at each time point. This finding suggests the need to develop an appropriate predictive model tailored to the timing of pain and side effects. Furthermore, ML-based models could be beneficial in predicting pain and preventing the side effects of PCA. For patients expected to experience pain or side effects, a machine learning model can be utilized to predict risk stratification before surgery, allowing for adjustments to the PCA regimen accordingly.
Various variables were used to develop the model for predicting postoperative pain, and the importance of each variable was verified (Figure 2). The main variables that predicted postoperative pain were the pain score during the previous time period, age, sex, BMI, ASA classification, and the total amount of opioids infused. Among them, the ASA classification and BMI are variables identified for the first time in this study [28]. In patients undergoing orthopedic surgeries such as scoliosis correction, severe preoperative pain is associated with increased postoperative pain [29], and more than 50% of patients experience persistent pain after surgery [30,31]. Considering the findings of this study together, proactive pain management before, during, and after surgery is essential. By incorporating these variables into pain prevention and treatment strategies following orthopedic surgery, the outcomes of pediatric patients could be improved.
We also identified factors associated with the side effects of PCA through ML-based modeling. Similar to the model predicting pain, factors such as prior occurrences of side effects, age, BMI, and the type of surgery were associated with the likelihood of side effects. In patients with these clinical risk factors, the amount of antiemetics mixed in PCA should be increased, or the patient should be closely monitored for the need for additional antiemetics and managed accordingly.
Our study has several limitations. First, our study did not consider the pain score and side effects between immediately after surgery and 6 h after surgery. The primary objective of this study was to develop a model to predict the effects and side effects of PCA. Therefore, the decision was made to exclude data from PCA administered 30 min before the end of the surgery, as this period was deemed insufficient to achieve adequate plasma concentrations. Instead, this study focused on evaluating postoperative pain and side effects during the 6–24-h and 24–48-h periods after surgery. However, as pain is most severe immediately after surgery (Table 3), future research is needed to develop predictive models targeting pain and side effects during this immediate postoperative period. Second, our study is retrospective and used data from a single tertiary center. It evaluated a heterogeneous cohort comprising various surgical types and a wide range of pediatric age groups. Additionally, there were no significant variations in the dose of the PCA regimen or the rescue medication administered. Prospective, large-scale, multicenter trials are needed to enhance postoperative pain control in pediatric patients. Third, the class imbalance (e.g., 24–48 h severe pain events) problem is a potential limitation. Although we used a stratified 5-fold CV to address imbalanced binary outcomes, the rare event of severe pain may still affect the model’s performance. Consequently, it is necessary to interpret the results for severe pain during the 24–48 h period carefully. Further research is required to explore more effective methods for dealing with rare events.
5. Conclusions
This retrospective study demonstrated that ML-based models effectively predicted postoperative pain and side effects in children using PCA after orthopedic surgery. The use of ML can potentially improve postoperative pain management in pediatric patients.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Brasher C. Gafsous B. Dugue S. Thiollier A. Kinderf J. Nivoche Y. Grace R. Dahmani S. Postoperative pain management in children and infants: An update Paediatr. Drugs 20141612914010.1007/s 40272-013-0062-024407716 · doi ↗ · pubmed ↗
- 2Taddio A. Katz J. The effects of early pain experience in neonates on pain responses in infancy and childhood Paediatr. Drugs 2005724525710.2165/00148581-200507040-0000416117561 · doi ↗ · pubmed ↗
- 3Fortier M.A. Chou J. Maurer E.L. Kain Z.N. Acute to chronic postoperative pain in children: Preliminary findings J. Pediatr. Surg.2011461700170510.1016/j.jpedsurg.2011.03.07421929977 · doi ↗ · pubmed ↗
- 4Frizzell K.H. Cavanaugh P.K. Herman M.J. Pediatric Perioperative Pain Management Orthop. Clin. North Am.20174846748010.1016/j.ocl.2017.06.00728870306 · doi ↗ · pubmed ↗
- 5Johnson M.A. Andras L.M. Andras L.E. Ellington M.D. Upasani V.V. Shah A.S. What’s New in Pain Management for Pediatric Orthopaedic Surgery J. Pediatr. Orthop.202141 e 923e 92810.1097/BPO.000000000000195634469397 · doi ↗ · pubmed ↗
- 6Tyler D.C. Pomietto M. Womack W. Variation in opioid use during PCA in adolescents Pediatr. Anesth.19966333810.1111/j.1460-9592.1996.tb 00350.x 8839086 · doi ↗ · pubmed ↗
- 7Woodhouse A. Ward E.M. E Mather L. Intra-subject variability in post-operative patient-controlled analgesia (PCA): Is the patient equally satisfied with morphine, pethidine and fentanyl?Pain 19998054555310.1016/S 0304-3959(98)00247-410342416 · doi ↗ · pubmed ↗
- 8Franson H.E. Postoperative patient-controlled analgesia in the pediatric population: A literature review Aana J.20107837437821067084 · pubmed ↗
