1 Introduction

Pain, an unpleasant sensory and emotional experience linked to actual or potential tissue damage, is a common consequence of surgery [1]. Surgical procedures often involve incisions, leading to tissue damage and prompting moderate to severe postoperative pain in many patients [2]. However, pain perception varies greatly due to its subjective nature. This necessitates techniques for quantitative assessment and appropriate management of pain during and after surgery to ensure positive patient outcomes.

Clinicians typically administer analgesics based on experience and weight-based calculations. Yet, even experienced professionals risk under- or over-treatment due to high variability in patients’ physiological characteristics [3, 4]. Efforts to quantify pain are ongoing, with tools like the Surgical Pleth Index (SPI) (GE Healthcare, Helsinki, Finland) developed for intraoperative pain management [5]. However, these features are designed for anesthetized patients and exclude factors like psychological and emotional changes, limiting their use for conscious patients postoperatively [6]. Postoperative pain is often managed with patient-controlled analgesia, allowing self-administration of pain medication. However, this subjective approach can lead to the overuse of analgesics, causing side effects like nausea, vomiting, and respiratory depression [7]. Thus, effective management of both intraoperative and postoperative pain demands quantitative assessment techniques that consider both patients' physiological characteristics and pain sensitivity. Currently, no clinically usable techniques exist for assessing pain severity during and after surgery. While previous studies have developed pain assessment features based on photoplethysmography (PPG), these only focused on pain presence, not multi-stage severity [8, 9]. PPG is a noninvasive biosignal known to estimate autonomic nervous system activity and is already used in tools like the SPI [10].

We aimed to identify PPG features that significantly change in response to surgical stimuli and explore features that can assess pain severity during and after surgery. We achieved this by extracting pain assessment features from PPG measurements taken before, during, and after surgery; selecting features that show significant changes across pain intervals; identifying features with consistent trends in response to both intraoperative and postoperative pain; and validating the selected features for their ability to discriminate between different surgical pain severities.

2 Materials and Methods

2.1 Dataset

The study involved 386 patients aged 20–79 years scheduled for various routine surgeries, including thyroid procedures, abdominal surgeries, and mastectomies. Only patients classified as American Society of Anesthesiologists physical status class I, II, and III were included. To ensure data quality, we excluded patients with autonomic nervous system disorders, arrhythmias, current sedative use, a history of neurosurgery, psychiatric disorders, or neuromuscular diseases causing spontaneous pain. We continuously recorded PPG signals from the start of anesthesia until the end of surgery in the operating room. PPG recordings resumed upon the patient’s awakening in the recovery room. The GE Datex S/5 series monitor (GE Datex Ohmeda, Helsinki, Finland) collected PPG data in the operating room at a sampling frequency of 300 Hz. All data used in this study were approved by the Institutional Review Board of Asan Medical Center (IRB No: 2021-0100).

2.2 Pain Severity Labeling

Intraoperative pain labeling was based on the timing of intubation and skin incision. Periods before these events were considered stable and labeled as “no pain”. Following intubation and incision, pain severity was categorized as “no pain”, “moderate pain”, or “severe pain” using established clinical criteria. “Moderate pain” was defined as a heart rate > 90 beats per minute or a blood pressure increase of 15 mmHg. “Severe pain” was defined as a heart rate > 110 beats per minute or a blood pressure increase of 30 mmHg [11]. All other cases were labeled as “no pain”. Postoperative pain severity was assessed using the numeric rating scale (NRS), which is conventional method for pain assessment that indicates pain on a scale from 0 to 10 [12], and categorized as “no pain”, “moderate pain”, or “severe pain”. “No pain” was assigned for NRS = 0,”moderate pain” for 0 < NRS ≤ 6, and “severe pain” for NRS > 6. For the final analysis, data from 242 patients (117 males, 125 females, average age: 58.4 ± 10.6 years) was included. This data with poor signal quality due to noise, visually indistinguishable waveforms, or missing pain labels were excluded. For the analysis of pain presence during and after surgery, “moderate pain” and “severe pain” were combined into a single “pain” category. All other instances were classified as “no pain”. Table 1 shows pain labeling status for intraoperative and postoperative.

Table 1 Pain labels for each analysis interval

2.3 Analysis Interval

Figure 1 illustrates the data analysis intervals, divided into preoperative, intraoperative, and postoperative periods. The preoperative period starts 2 min before anesthesia administration. The intraoperative period is further segmented into 2-min intervals: before intubation, after intubation, before skin incision, and after skin incision. Finally, the postoperative period begins 2 min after the patient wakes up in the recovery room. Research suggests the average time for a maximum pain response to a stimulus is within 2 min [13]. This finding informed the selection of these specific analysis intervals.

Fig. 1
figure 1

Analysis intervals

2.4 Signal Preprocessing

The PPG signal was first preprocessed using a finite impulse response band-pass filter. This filter isolated the relevant frequency range (0.5–50 Hz) for pain assessment. To extract pain-related features, an adaptive threshold detection algorithm identified the pulse onset and systolic peak of each heartbeat within the filtered PPG signal [14]. Experienced researchers manually corrected any missed or incorrectly detected peaks. Finally, each PPG waveform was segmented into individual pulses, defined as the period between consecutive pulse onsets. All preprocessing steps were performed using Matlab R2022a (MathWorks, Inc., MA, USA).

2.5 PPG-Based Pain Feature Derivation

For pain assessment using PPG, we extracted a total of 180 features based on previous research (Fig. 2) [8, 9]. These features captivate various characteristics of the PPG waveform derived from the detected pulse onset and systolic peak. These features focus on characteristics like pulse interval, amplitude variation, slope, and area. Examples include systolic length (Lsys), diastolic length (Ldia), and peak-to-peak interval (PPIonset) for pulse interval; pulse amplitude based on baseline amplitude (ACAbl), the amplitude difference between adjacent pulse onset amplitudes (PVonset), and pulse width at the specific pulse amplitude (PWx) for amplitude; rising slope (Sr), maximum rising slope (Srmax), and falling slope (Sf) for slope; and systolic area (Asys), diastolic area (Adia), total area (Atotal), and triangular areas calculated between onsets and systolic peak (triangular systolic area [TriAsys], triangular diastolic area [TriAdia], and triangular total area [TriAtotal] for area). Normalized features account for variations caused by baseline heart rate differences by calculating ratios between basic features. To account for individual variability, we extracted the minimum, median, and maximum values for each feature across all pulses measured for each subject. This application of three extraction methods (minimum, median, and maximum) to the 60 basic and normalized features resulted in a total of 180 features used for the final analysis. Table 2 presents these features.

Fig. 2
figure 2

Example of photoplethysmograph waveform features. Filled circle and empty circle indicate systolic peak and pulse onset, respectively. Lsys, systolic length; Ldia, diastolic length; PPIonset, pulse onset peaks interval; ACAbl, AC amplitude from baseline; PVonset, amplitude difference between adjacent pulse onsets; PWx, pulse width at x% of maximum amplitude (x = 30, 50, 70, 90); Sr, rising slope; Srmax, maximum rising slope; Sf, falling slope; Asys, area of a systolic phase; Adia, area of a diastolic phase; Atotal, area of a pulse; TriAsys, triangular area of a systolic phase; TriAdia, triangular area of a diastolic phase; TriAtotal, triangular area of a pulse

Table 2 Photoplethysmogram waveform-based pain-related features

2.6 Pain-Related Feature Analysis

We aimed to identify features that could distinguish between pain and no pain states, as well as assess pain severity. Statistical tests were employed to achieve this goal. For intraoperative pain, we compared features between the “no pain” and “pain” groups for periods before and after endotracheal intubation and skin incision. For postoperative pain, features were compared between “no pain” and “pain” groups before and after surgery.

The criteria for selecting pain-related features differed based on the surgical stage. During surgery, a feature had to show significant differences (p < 0.05) in both pre and postintervention comparisons (intubation and skin incision). In contrast, for postoperative pain, features only needed to show significant differences before and after surgery. The Mann–Whitney U test was employed to assess the presence of pain for both intraoperative and postoperative stages. The data used for pain severity analysis differed based on the surgical stage as well. For intraoperative severity assessment, data from after endotracheal intubation and after skin incision were used. For postoperative severity assessment, data from the postoperative period were utilized.

The Kruskal–Wallis test was performed for each selected feature to identify significant changes in pain severity during and after surgery (p < 0.05). If significant differences were found, Dunn's post-hoc test with Holm correction for multiple comparisons was conducted to differentiate between “no pain vs. moderate pain”, “moderate pain vs. severe pain”, and “no pain vs. severe pain”. Features with significant differences (p < 0.05) in all severity comparisons were considered pain severity-related. Figure 3 illustrates the statistical analysis process for pain presence and severity features. Importantly, analyses were performed separately for intraoperative and postoperative periods; however, the statistical testing methods remained consistent.

Fig. 3
figure 3

Process for deriving features for pain severity assessment

3 Results

3.1 Assessment of the Presence of Surgical Pain

Analysis of pain presence during and after surgery revealed 106 features that exhibited significant differences (p < 0.05) between the “no pain” and “pain” groups. These differences were observed before and after endotracheal intubation and skin incision procedures. Additionally, 124 features showed significant differences (p < 0.05) between the groups before and after surgery. Figure 4 provides boxplots for features that responded significantly (p < 0.05) to pain stimuli during and after surgery.

Fig. 4
figure 4

Boxplots of photoplethysmogram waveform-based features showing significant changes with surgical pain. The terms ‘max’ and ‘min’ indicate the minimum and maximum representative values of the features within analysis interval, respectively. Asys/Adia, ratio of area of a systolic phase to area of a diastolic phase (left); ACAbl, AC amplitude from baseline (right); ***p < 0.001

3.2 Assessment of Intraoperative Pain Severity

Analysis of pain presence during surgery revealed 106 features that distinguished between “no pain” and “pain” groups. Among these, 27 features further differentiated between “no pain”, “moderate pain”, and “severe pain” (p < 0.05). These 27 features included 15 basic features and 12 normalized features. The selected features included seven amplitude features, two slope features, five area features, and one kurtosis feature. Normalized features were ratios of amplitude, slope, and area features. Figure 5 illustrates the post-hoc analysis results of basic features and the post-hoc analysis results of normalized features according to pain severity.

Fig. 5
figure 5

Post-hoc analysis of photoplethysmogram waveform features showing significant changes with intraoperative pain severity. (a) basic features, (b) normalized features. ACAbl, AC amplitude from baseline; ACAonset, AC amplitude from pulse onset; ACVbl, difference between adjacent ACAbl; ACVonset, difference between adjacent ACAonset; Adia, area of a diastolic phase; Asys, area of a systolic phase; Atotal, area of a pulse; Pkur, kurtosis of pulse; PVonset, amplitude difference between adjacent pulse onsets; PVsys, amplitude difference between adjacent systolic peaks; Srmax, maximum rising slope; TriAtotal, triangular area of a pulse; TriAdia, triangular area of a diastolic pulse; TriAsys, triangular area of a systolic phase; The terms ‘min’ and ‘max’ indicates the minimum and maximum representative values of the features within analysis interval, respectively. *p < 0.05, **p < 0.01, ***p < 0.001

Among the amplitude features (min PVsys, min PVonset, max PVonset, min ACAbl, max ACAbl, min ACAonset, max ACVonset), “min PVsys”, “min PVonset”, and “max PVonset” decreased in moderate and severe pain compared to no pain, but the difference between moderate and severe was not clear. In contrast, “min ACAbl”, “max ACAbl”, “min ACAonset”, and “max ACVonset” showed a consistent decrease with increasing pain severity. All minimum values for slope features (min Sr, min Srmax) and area features (min Adia, min Atotal, min TriAtotal, min TriAdia, min TriAsys) decreased with increasing pain severity. The minimum pulse amplitude kurtosis (min Pkur) also decreased with increasing pain severity. Normalized amplitude change features (ACVbl/ACAbl, ACAbl/ACAonset, ACVonset/ACAbl, ACVonset/ACAonset) generally decreased with pain presence but lacked a clear trend between moderate and severe pain. The normalized slope feature (Srmax/Sr) decreased with pain presence. Most normalized area features (Asys/Adia, Asys/Atotal, Adia/Atotal), except for the Adia/Atotal, increased with pain severity. The observed decrease in pulse interval, area, and kurtosis of the PPG waveform suggests that as pain intensity increases, the pulse interval and waveform area decrease, making the waveform smoother compared to its baseline shape.

3.3 Assessment of Postoperative Pain Severity

Postoperative pain assessment identified 122 features that differed significantly (p < 0.05) between the “no pain” and “pain” groups. Among these, 12 features further distinguished between the “no pain vs. moderate”, “no pain vs. severe”, and “moderate vs. severe” groups. Figure 6 showcases boxplots of these 12 selected normalized features, all related to area and amplitude. Area and amplitude features exhibited an increasing trend with increasing pain severity. Statistical analysis revealed that pulse interval (Ldia, Lsys, PPIonset) and baseline-corrected amplitude features (ACAbl) tended to decrease with increasing pain; however, the differences were not statistically significant. In contrast, area-related features (Atotal, Asys, Adia) showed a significant increase (p < 0.05) with increasing pain severity.

Fig. 6
figure 6

Post-hoc analysis of photoplethysmogram waveform features showing significant changes with postoperative pain severity. The terms ‘median’ and ‘max’ indicates represent the median and maximum representative values of the features within analysis interval, respectively. Atotal, area of a pulse; ACAbl, AC amplitude from baseline; Asys, area of systolic phase; Adia, area of diastolic phase; Lsys, systolic length; Ldia, diastolic length; PPIonset, pulse onset peaks interval; *p < 0.05, **p < 0.01, ***p < 0.001

4 Discussion

This study holds significant value as a foundational research effort using PPG to assess pain severity during and after surgery, irrespective of the patient's consciousness. Unlike traditional methods that only assess the presence of pain, the features identified in this study have the potential to evaluate pain severity throughout the perioperative period. This suggests the possibility of a unified approach to pain management, even when patients are conscious. The analysis of pain severity revealed significant reductions in PPG features related to amplitude, rising slope, area, and kurtosis during intraoperative pain assessment. Similar reductions in amplitude, area, and pulse interval were observed in the postoperative pain assessment.

The observed decrease in pulse interval and amplitude can likely be attributed to sympathetic nervous system activation triggered by pain stimuli. This activation leads to increased heart rate, vasoconstriction, and vascular resistance, resulting in reduced PPG amplitude and pulse interval length [15, 16]. Furthermore, the decrease in PPG area and kurtosis suggests that pain stimuli cause the waveform to become smoother and less peaked due to reduced pulse interval and amplitude. However, the analysis of postoperative pain severity showed a trend of increasing PPG area features with higher pain severity. This divergence from the intraoperative findings could be due to individual differences in baseline heart rate, sympathetic response, and pain sensitivity when patients are conscious. This finding highlights the need for further investigation into the mechanisms underlying these observations.

No common features were identified for assessing pain severity in both surgical stages. This suggests that pain responses may vary depending on an individual’s physiological characteristics. Normalizing baseline values or analyzing changes in features before and after anesthesia might be necessary for a more comprehensive assessment. Additionally, this study did not confirm if the proposed features have the sensitivity to accurately differentiate pain severity according to established clinical assessment standards. Future research should evaluate these features across more detailed pain severity levels to verify their applicability in clinical settings. Also, in this study, postoperative pain was only analyzed after the anaesthetic woke up and before analgesia was administered, and observing a reduction in severity with analgesia may be necessary for a more sophisticated analysis.

5 Conclusion

This study paves the way for identifying novel pain features derived from PPG that can assess pain severity during and after surgery, regardless of a patient's consciousness. These features move beyond traditional methods, which solely determine pain presence. Instead, they offer the ability to gauge pain severity, a crucial step towards personalized pain management and the development of effective treatment plans.