1 Introduction

Pain is an urgent problem for patients and can trigger complications [1,2,3,4,5]. The Joint Commission on Accreditation of Health Care Organizations advocates that pain be considered a vital sign that should be recorded and monitored [6]. For example, in the post-anesthesia care unit and patient-controlled analgesia, pain intensity reveals patients’ suffering [7,8,9,10]. If the patient is always in pain and cannot be relieved quickly, the recovery time will be longer. In addition, pain can easily cause anxiety and fear in patients, increase the incidence of complications, and even lead to persistent pain [10,11,12]. Current pain intensity assessment tools are mainly self-reported by patients, such as the visual analog scale or numeric rating scale (NRS). However, these scales cannot reflect patient pain in real-time and increase the workload of the hospital staff, making it difficult to monitor and immediately relieve pain [9, 13].

At present, there are many studies using neural network-like, decision tree, regression analysis, and other methods to establish judgment, classification, and prediction models. Among them, binary logistic regression is used to reflect binary resources, such as the discrimination of “Yes or No” (0 or 1). This is statistically consistent, and a large-sample progressive. This is advantageous for distinguishing nonlinear data and obtaining the probability of two categories simultaneously. Therefore, there have been studies on binary logistic regression analysis for disease prediction and status judgment [11, 12]. According to previous research, heart rate variability (HRV) and photoplethysmography (PPG) can be used to assess sympathetic and parasympathetic activity and are related to pain [14, 15]. In 2017, our group used thermal stimulation to induce pain. We observed changes in the HRV and PPG parameters when pain occurred and plotted the trend curves. This revealed that when participants experienced pain with increasing temperature, heart rate (HR) increased, PPG amplitude (PPGA) decreased, and high frequency (HF), low frequency (LF), and autonomic nervous system state (ANSS) decreased [10]. Thus, a model established using binary logistic regression analysis is suitable for discriminating pain [16, 17]. A binary logistic regression analysis was used to calculate the probability and determine the presence of pain.

The purpose of this study was to continue analyzing the changes in physiological parameters when pain occurs and use the pain classification model by binary logistic regression to calculate pain probability and monitor pain. This model can improve pain assessment and achieve more effective pain monitoring and management.

2 Methods

2.1 Heat Pain Stimulation Experiment

2.1.1 Heat Stimulation System

In our study, we used a heat stimulation system (Fig. 1) to induce pain. The stimulation system included an IC thermostat (SH-958-LC; ISTA-Tzong Yang Aquarium Company, LTD, Tainan City, Taiwan) with a silica glass heater. The temperature of the heater increased at a rate of 1 °C/min inside the tank (yellow line). The water temperature ranged from 37 °C to 47 °C throughout the experiment. A waterfall filter was used to circulate water. The participants were required to place their left hand at the bottom of the tank (black line) [18].

Fig. 1
figure 1

Heat stimulation system

2.1.2 Physiological Signal Recording System

Figure 2 shows the physiological signal recording system. Electrocardiography (ECG) values were recorded using disposable button Ag/AgCl electrodes (F-TC1; Sofmed, Gangwon-do, Korea). The frequency range of the ECG was kept between 0.05 to 250 Hz using an instrumentation amplifier and Butterworth filter, and 60 Hz noise was rejected by the rejection filter. Finally, the signal was amplified 1000 times. PPG values were recorded using a PPG sensor (DS-100A, Nellcor Inc., Pleasanton, CA, USA) and processed using a Butterworth filter. The frequency range was 0.01 to 33 Hz and amplified 330 times. A data acquisition device (NI USB-6341, Micro Precision Test Equipment, Grass Valley, CA, USA) was used to transfer all signals to the computer at a 1000-Hz sample rate.

Fig. 2
figure 2

Physiological signal recording system

2.2 Study Design

2.2.1 Participants

The study was approved by the Institutional Review Board of En Chu Kong Hospital (ECK-IRB No. 1041101). The inclusion criterion was as follows: (1) individuals aged between 20 and 30 years. The exclusion criteria were as follows: (1) a known history of structural cardiac abnormalities or any other illnesses known to affect the autonomic nervous system; (2) an implanted pacemaker; (3) the use of any drug that affects cardiac functions; and (4) alcohol, opioid, or coffee abuse or dependence [19]. All participants provided written informed consent prior to participating in the experiment.

2.2.2 Experimental Procedure

Figure 3 shows the experimental process divided into phases A-D. All participants were asked about their pain levels using the NRS at the end of each phase. Each participant’s ECG and PPG signals were recorded during each phase. In phase A, the participants placed their left hand in the heat stimulation system for 10 min, and the water temperature was maintained at 37 °C. In phase B, the water temperature was increased at a rate of 1 °C/min to produce pain, and it stopped when the participant felt unbearable pain or when the temperature reached 47 °C. In phase C, the temperature was maintained at the end of phase B for 10 min. During phase D, the temperature was decreased to 32 °C for 10 min.

Fig. 3
figure 3

Experimental and verified* procedure. In phase A/A*, participants placed their left hand in the heat stimulation system for 10/5* min, and the water temperature was maintained at 37 °C. In phase B/B*, the water temperature increased at a rate of 1 °C/min to produce pain and stopped when the participant felt unbearable pain or when the temperature reached 47 °C. In phase C/C*, the temperature was maintained at the end of phase D/D* for 10/5* min. During phase D/D*, the temperature decreased to 32 °C for 10/5* min

2.3 Signal Analysis

The HRV and PPG parameters were calculated using LabVIEW (Austin, TX, USA) 2015. First, the R-wave peak of the ECG was detected using a dynamic threshold [20]. The PPG peak (P peak) and valley (P valley) were detected from the pulse–pulse interval of the PPG. Then, the R-R interval (RRI), standard deviation of all normal to normal intervals (SDNN) and HRV parameters (LF, HF, LF/HF) were calculated using the R-wave peak by a sliding window to resample with a basic unit of 5 min and a delay time of 1 min. The PPG parameters, PPGA, baseline (BL), and autonomic nervous system state (ANSS), were calculated from the P peak and P valley by a sliding window to resample with a basic unit of 5 min and a delay time of 1 min. The analyzed parameters were normalized to eliminate differences between individuals.

2.4 Binary Logistic Regression

This study used SPSS version 12.0 (Statistical Package for Social Sciences for Windows 12.0) for statistical analyses. The Shapiro–Wilk test was used to determine the normal distribution of the data. Then, the data were subjected to either t-test for independent samples or Wilcoxon signed-rank test to determine the differences between phases A and C for all parameters. Statistical significance was set at P < 0.05. We then used significantly different parameters for logistic regression to construct a pain classification model using SPSS 12.0. Logistic regression is commonly used for binary responses. Examples include death during surgery or the presence or absence of a particular disease. We performed a binary logistic regression analysis on the parameters of phases A and C and constructed the corresponding pain classification model as follows:

$${S}({X})=\frac{1}{1+{e}^{-X}}$$
(1)

The obtained S(X) represents the probability of pain. If S(X) is less than or equal to 0.5 (S[X] ≤ 0.5), there is no pain. If S(X) is greater than 0.5, there is pain (S[X] > 0.5).

3 Results

3.1 Participants

We included 25 healthy participants (11 men and 14 women). These participants were 22.44 ± 1.85 (mean ± standard deviation) years and 22.29 ± 1.85 kg/m2. At the end of phase B, the mean NRS value was 5.28 ± 1.95 when the mean temperature was 43.66 °C ± 1.66 °C (Table 1). The pain intensity using the mean NRS values significantly differed between phases A (0.16 ± 0.47) and B (P < 0.05).

Table 1 Participants’ characteristics

3.2 Pain Classification Model

All physiological parameters were normalized to eliminate individual differences. From phases A and C, the BL, SDNN, LF/HF value increased and the RRI, LF, HF, ANSS and PPGA values decreased (Table 2). Based on the results of statistical analysis of physiological parameters (P < 0.05), a pain classification model with RRI, LF, HF, BL, ANSS, and PPGA values was developed to classify the presence or absence of pain. The formula was:

Table 2 Normalization of all parameters in phase A and C
$${X }=\left(0.755\times {RRI}\right)+ \left(-1.501\times {LF}\right)+\left(0.266\times {HF}\right)+\left(-0.052\times {BL}\right)+(0.660\times {ANSS})+(-1.105 \times {PPGA})-0.043$$

Finally, this formula was combined with binary logistic regression to construct a pain classification model. The sensitivity and specificity of this model were 60.0% and 72.0%, respectively.

The experimental time was 45 min. After the signal analysis, 40 data samples were obtained. Subsequently, the data samples were inputted into the pain classification model, and the correspondence between the curves and the NRS pain probability curve was determined (Fig. 4). Figure 4 shows the average probability calculated using the pain classification model with 25 participants and the discrimination of the pain production and relief processes in the heat stimulation experiment. The first parameter calculated using the sliding window was the state before the fifth minute, so the first value of the pain probability curve was determined from the fifth minute.

Fig. 4
figure 4

Pain probability in the pain classification model and numeric rating scale curve

In Fig. 4, phase A induced no pain, and the mean NRS value was 0. The probability calculated using the pain classification model was less than 50%, but there were two points greater than 50%. In phase B, the calculated probability gradually increased from less than 50% to more than 50%, and the mean NRS value increased to 5.28. Phase C maintained pain and the probability reduced from greater than 50% to less than 50%, and the mean NRS value decreased to 1.08. In phase D, the probability of pain was less than 50%, and the mean NRS value was 0.

3.3 Verification

To validate the pain classification model and make it closer to real-life situations, the experiment duration differed from that of the previous experiment. In this verification, we conducted heat stimulation experiments with four new participants. Figure 3 shows the verified procedure and divides it into phases A*-D*. The participants were asked to place their left hand in the heat stimulation system. In Phase A*, the water temperature was maintained at 37 °C for 5 min, and the participants were asked about their NRS values. Then, in phase B*, the water was heated at a rate of 1 °C/min. When the temperature rose to the point where the subject felt unbearable pain or when the water temperature reached 47 °C, the heating was stopped and the NRS value was obtained. After maintaining the pain for 5 min, the participants were again asked about their NRS value. Finally, the water temperature was decreased to a temperature where the participants felt no pain, and we asked the NRS value once more.

Figure 5 shows the corresponding curve of the pain probability obtained using the pain classification model and the NRS value. The first value of the pain probability curve was determined from the fifth minute. The fifth minute induced no pain, and the probability calculated by the pain classification model was less than 50%. After entering phase B*, the probability increased from less than 50% to more than 50%, and the NRS value was between four and nine. When the pain was maintained, the probability reduced from greater than 50% to less than 50%. The probability of pain gradually decreased, and the probability of pain relief was < 50%.

Fig. 5
figure 5

Verification of the pain probability of the pain classification model and numeric rating scale curve with four new participants

4 Discussion

It is difficult to accurately classify an individual’s pain state because of different body structures and life experiences, which makes each person's sensitivity to pain stimuli different. The pre-experiment of this research was to measure the physiological signals of healthy participants by adjusting the water temperature to simulate the process from pain generation to relief. The purpose of this research was to construct a pain classification model through a pre-experiment, which could be applied to the pain status of all healthy patients for real-time monitoring and classification. The NRS was used to confirm the actual pain status of healthy participants and classify the pain status according to the physiological signals at the time. In the pre-experiment, we noted the ECG, PPG, and NRS parameters during the pain state under the heat stimulation experiment, and the parameters were extracted using the sliding window method for signal analysis. The parameters were used to construct a pain classification model using logistic regression and NRS.

The pre-experiment of this study simulated the process of pain from the heat stimulation experiment to relief. Phase A involved immersing the left hand in 37 °C water to simulate painlessness. Phase B was to heat to the temperature that caused pain to simulate the pain. Phase C was used to maintain the temperature at the end of phase B to simulate the same intensity of continuous pain. The last phase, D, was used to reduce the temperature to simulate pain relief. The results showed that as the temperature changed, the NRS of the participant also changed because of the pain caused by the temperature change. The literature indicates that the human pain threshold is approximately 43 °C. Experimental results show that at the end of phase B, the average NRS was 5.28 ± 1.95, and the temperature was 43.66 °C ± 1.66 °C. At this time, the patient experienced unbearable pain. These results are consistent with those reported in the literature [21]. However, the mean NRS value at the end of phase C was only 1.08, indicating that the participants did not feel much pain. We considered that when the body suffers repeated pain stimulation, the sensation of pain is strongest in the first minute [22]. After 1 min, the pain sensation gradually subsided. Therefore, the NRS values decreased during phase C.

Selection of physiological parameters is important in the classification model. Irrelevant or incomplete parameters typically decrease the model’s performance. The statistical analysis results of physiological parameters revealed that SDNN and LF/HF increased in the presence of pain but without statistical significance (P = 0.475 and 0.704, respectively). SDNN could help estimate the overall HRV suitable for a long-term record analysis. In the short-term analysis, SDNN has no clinical definition. The autonomic nerve was activated when pain occurred, which complicated HRV and increased SDNN. LF reflected sympathetic and parasympathetic nerve activities, and HF reflected parasympathetic nerve activity. LF/HF represented the sympathetic and parasympathetic balance index. Pain caused sympathetic nerve excitement and parasympathetic nerve inhibition. The increase in LF/HF indicated sympathetic nerve excitement, consistent with previous studies [23, 24]. We used the RRI, LF, HF, BL, ANSS, and PPGA values to construct the pain classification model. Roi Treister et al. compared a combination of multiple autonomic parameters (HF, HR, PPGA, SCL, NSCF) to differentiate the four levels of pain intensity, where all autonomic parameters were found to differentiate between pain and no pain [25]. The sympathetic and parasympathetic nerves have excitatory and inhibitory effects on the sinoatrial node, which increases or decreases the HR. HRV is mainly related to sympathetic and parasympathetic nerves [24]. PPG signal values of the level of infrared light attenuation reflect how the blood volume changes with the heart rate [26]. Therefore, the HRV and PPG parameters can be referred to as the pain index. In another study, researchers observed changes in physiological parameters of ECG and PPG when pain occurred, where HR increased, PPGA and BL decreased, and ANSS increased with the change in pain. Additionally, some of the domain parameters, HF and LF, decreased [18]. The pre-experimental results of this study showed a significant increase in PPGA and ANSS, and a significant decrease in RRI, LF, HF, and BL during the pain generation process (phase A-B). These results are consistent with those of previous studies.

In the pain classification model, the sensitivity and specificity were 60.0% and 72.0%, respectively. Sensitivity was the correct classification rate for painlessness, and specificity was the correct classification rate for pain. Normalized phase A (painless) and phase B (pain) were used to construct the model. We speculate that the standard deviation of painless parameters is large (RRI: 0.19 ± 1.08, LF: 0.25 ± 1.19, HF: 0.19 ± 1.10, BL: -0.04 ± 1.01, ANSS: 0.23 ± 1.10, AM: 0.22 ± 1.09), resulting in an average value deviation. These factors affect the probability of pain and lower sensitivity. The standard deviation of the parameters for pain was smaller, and the values were more concentrated than those of painlessness; therefore, the specificity was higher than the sensitivity. In addition, the current studies using physiological parameters to construct models through binary logistic regression mostly use 70 to 80 participants or more [27]. We speculate that the small number of participants in this study may have led to a lower accuracy of the pain classification model. This can be solved by increasing the number of participants. The results from Fig. 4 show that this pain model could still accurately monitor the changes in pain, and its probability was also consistent with the NRS trend. When pain gradually increased, the probability gradually increased to > 50%. In phase C, the pain sensation gradually decreased because of the body's self-regulation ability. The pain probability of the pain classification model was correspondingly reduced.

In the verification results of the pain classification model in Fig. 5, the probability of pain in phase A* of the four new participants was less than 50%. Due to individual differences, the pain tolerance and the experimental time were different in phase B*. However, the pain classification model could still accurately distinguish the initial pain probability from less than 50% to greater than 50%. With the ability to self-regulate, pain relief in phase C* gradually reduced to 50%. The corresponding NRS values were consistent with each other. The resulting trend of the verification was consistent with that shown in Fig. 5, which proved that the pain classification model is sufficiently robust and adaptable. It can be applied to different participants and can correctly classify pain.

The pain classification model in this study is compared with other existing models, such as support vector machines, artificial neural networks, K-nearest neighbors, and decision trees. The model used can be constructed with a small number of participants and data, compared with other models that require more than a large number of databases. In addition to this study and the model training through the time domain parameters of PPG, the frequency domain parameters were also added to the model training. From the results, it can be seen that the frequency domain parameters have a direct relationship with pain. Compared with other studies, this method can effectively reduce the number of data and increase the success rate by using time-domain parameters. It is also simpler than the other models in terms of model complexity. Therefore, the pain classification model developed in this study can be easily implemented with portable or medical instruments in the future [10, 13].

5 Conclusion

In this study, we constructed a pain classification model by simulating the process of pain generation by heat stimulation, which requires only a few HRV and PPG parameters to be constructed through logistic regression with a sensitivity of 60.0% and a specificity of 72.0%. In the past, it was difficult to classify and monitor pain due to individual differences and different degrees of pain tolerance. This model overcomes these difficulties. It has sufficient robustness and adaptability to classify and monitor pain in different healthy people. The results of this model classification are consistent with those of the NRS. In addition, this model has a simple structure and training method. In the future, it can incorporate the real-time acquisition of physiological signals, shorten the length of the sliding window, and establish a real-time pain monitoring system. The model could improve pain monitoring and management for patients in the postoperative intensive care unit and patient-controlled analgesia. It could record the pain status in real time, assist medical staff in pain assessment, and provide reference to doctors regarding medication.