## 2 Materials and Methods
### Data Analysis and Feature Extraction  
In accordance with the aim of the study to enable stress detection, meaningful features were extracted from the PPG and GSR data using the NeuroKit2 library [34] to form an input data array for the classification model. Features were extracted from the \"no-stress\" and \"stress\" segments to create input feature vectors to train models for binary classification. To extract the meaningful features from the PPG signal, first, the HRV data were acquired using Shimmer ConsensusyPRO version 1.6.0 software [31]. HRV, which measures the variations of distances between consecutive heartbeats, is an established biomarker widely recognized as a psychophysiological index of psychological stress [35]. Then, the four groups of HRV metrics were calculated, including time domain, frequency domain, geometric, and nonlinear metrics (Tables 1-4). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **Description** & **Unit** \\ \hline HRV\_MeanNN & Mean of all NN intervals & ms \\ \hline HRV\_SDNN & Standard deviation of NN intervals, indicating overall HRV & ms \\ \hline HRV\_RMSSD & Root mean square of successive differences between NN intervals. & ms \\ \hline HRV\_SDSD & Standard deviation of successive differences between NN intervals. & ms \\ \hline HRV\_CVNN & Coefficient of variation for NN intervals. & \% \\ \hline HRV\_CVSD & Coefficient of variation for SDNN. & \% \\ \hline HRV\_MedianNN & Median of NN intervals. & ms \\ \hline HRV\_MadNN & Median absolute deviation of NN intervals. & ms \\ \hline HRV\_pNN50 & Percentage of successive NN intervals differing by more than 50 ms. & \% \\ \hline HRV\_pNN20 & Percentage of successive NN intervals differing by more than 20 ms. & \% \\ \hline HRV\_MinNN & Minimum NN interval. & ms \\ \hline HRV\_MaxNN & Maximum NN interval. & ms \\ \hline \hline \end{tabular}
\end{table} 
Table 1: HRV time-domain features. Figure 4: Skin resistance signal before and after filtering. Regarding the GSR data, as previously mentioned, we utilized resistance measurements. To evaluate electrodermal activity under stress conditions, we computed a set of statistical values as recommended in [36]. In addition, the importance of the width of the resistance peak was investigated. According to [37], they may reflect the duration of the body's response to stimuli, with wider peaks thought to indicate deeper or longer-lasting \begin{table}
\begin{tabular}{c c c} \hline
**Feature** & **Description** & **Unit** \\ \hline HRV\_SD1 & Poincaré plot standard deviation (short-term HRV). & ms \\ \hline HRV\_SD2 & Poincaré plot standard deviation (long-term HRV). & ms \\ \hline HRV\_ApEn & Approximate entropy, reflecting signal irregularity. & Dimensionless \\ \hline HRV\_SampEn & Sample entropy. & Dimensionless \\ \hline HRV\_ShanEn & Shannon entropy. & Dimensionless \\ \hline HRV\_FuzzyEn & Fuzzy entropy & Dimensionless \\ \hline HRV\_MSEn & Multiscale entropy & Dimensionless \\ \hline HRV\_CMSEn & Composite multiscale entropy & Dimensionless \\ \hline HRV\_RCMSEn & Refined composite multiscale entropy. & Dimensionless \\ \hline HRV\_DFA\_alpha1 & Detrended fluctuation analysis metric for short-term scaling. & Dimensionless \\ \hline HRV\_DFA\_alpha2 & Detrended fluctuation analysis metric for long-term scaling. & Dimensionless \\ \hline HRV\_MFDFA\_alpha1 & Multifractal DFA metric (alpha1 scale). & Dimensionless \\ \hline HRV\_MFDFA\_alpha2 & Multifractal DFA metric (alpha2 scale). & Dimensionless \\ \hline HRV\_CD & Correlation dimension & Dimensionless \\ \hline HRV\_HFD & Higuchi fractal dimension & Dimensionless \\ \hline HRV\_KFD & Katz fractal dimension & Dimensionless \\ \hline HRV\_LZC & Lempel–Ziv complexity, a measure of signal complexity & Dimensionless \\ \hline \end{tabular}
\end{table} 
Table 4: HRV nonlinear and complexity features. responses to stimuli, while narrower-width peaks suggest short responses.