# ML-Based Pain Recognition Model Using Mixup Data Augmentation
## 3 Methodology
### Feature Extraction  
The EDA signal was preprocessed as discussed in the previous section and a cleaned signal was extracted from the EDA signal, Further, we extracted three main components for each windowed segment: the cleaned EDA signal, the Phasic Skin Conductance Response (SCR), and the Tonic Skin Conductance Level (SCL). The phasic component (SCR) represents the fast-changing, stimulus-driven signal, while the tonic component (SCL) reflects the slow-changing, continuous baseline signal. Together, these components offer distinct physiological indicators of arousal related to nociceptive pain. An EDA signal's cleaned, phasic, and tonic components could be pictorially represented, as shown in Figure 5. Each windowed segment of the EDA signal was therefore described as a 1D array of 1152 data points, including all three components, and labeled according to the nociceptive pain level elicited, as provided in the BioVid Heat Pain Database. Thirty-six features, comprising twelve statistical features extracted from each of the three signals mentioned above, were utilized to train the machine learning model. The twelve statistical features are as follows:  
1. Maximum of the signal;
2. Minimum of the signal;
3. Mean value of the signal;
4. Standard deviation of the signal;
5. Variance of the signal;
6. Root Mean Square of the signal (RMS);
7. Peak-to-Peak (maximum of the signal-minimum of the signal);
8. Skewness of the signal;
9. Kurtosis of the signal;
10. Mean value of the first difference;
11. Mean absolute value of the first difference;
12. Mean absolute value of the second difference. As mentioned in [27], the statistical features can be calculated for each of the signal channels in the following way. Let the three EDA signal components, cleaned, phasic, and tonic, be designated by \(X_{i}\), \(i=1,2,3\), respectively. Let \(X_{in}\) represent the value of the \(n\)th sample of the \(i\)th signal, where \(n=1,2,\ldots,N\), with \(N\) in the range of 3840 to 7680. Let \(f_{ij}\) represent the \(j\)th feature of the \(i\)th signal. Figure 4: Data preprocessing. This figure illustrates signal segmentation. The classification experiments were performed on windows of a 4.5 s length, with a temporal shift of 4 s from the onset of elicitation. The mean of the signals: \(f_{i1}\):  
\[\mu_{i}=\frac{1}{N}\sum_{n=1}^{N}X_{in},\quad i=1,2,3 \tag{3}\]  
The standard deviation of the signals: \(f_{i2}\):  
\[\sigma_{i}=\left(\frac{1}{N-1}\sum_{n=1}^{N}(X_{in}-\mu_{i})^{2}\right)^{\frac {1}{2}},\quad i=1,2,3 \tag{4}\]  
The mean of the absolute values of the first differences of the signals: \(f_{i3}\):  
\[\theta_{i1}=\frac{1}{N-1}\sum_{n=1}^{N-1}|X_{in+1}-X_{in}|,\quad i=1,2,3 \tag{5}\]  
The mean of the absolute values of the second differences of the signals: \(f_{i4}\):  
\[\theta_{i2}=\frac{1}{N-2}\sum_{n=1}^{N-2}|X_{in+2}-X_{in}|,\quad i=1,2,3 \tag{6}\]  
The minimum: \(f_{i5}\):  
\[Min=minimum(X_{in}),\quad i=1,2,3 \tag{7}\]  
The maximum: \(f_{i6}\):  
\[Max=maximum(X_{in}),\quad i=1,2,3 \tag{8}\]  
The variance of the signal: \(f_{i7}\):  
\[\left(\sigma_{i}\right)^{2}=\left(\frac{1}{N-1}\sum_{n=1}^{N}(X_{in}-\mu_{i}) ^{2}\right),\quad i=1,2,3 \tag{9}\]  
The root mean square (RMS) of the signal: \(f_{i8}\):  
\[\text{RMS}_{i}=\sqrt{\frac{1}{N}\sum_{n=1}^{N}(X_{in})^{2}},\quad i=1,2,3 \tag{10}\]  
Figure 4:0 EDA processed signal. The peak-to-peak of the signal, also called range of the signal: \(f_{i9}\):  
Figure 4:1  
The skewness of the signal: \(f_{i10}\):  
Figure 4:2  
The kurtosis of the signal: \(f_{i11}\):  
Figure 4:3  
The mean value of the first difference of the signal: \(f_{i12}\):  
Figure 4:4