## 3 Methodology
### Temporal Convolutional Network Model with Channel Attention
#### 3.1.4 Model Analysis
When conceptualizing models, researchers can orchestrate complex neural network layers, define key parameters such as kernel size and stride for convolutional layers, and sidestep computationally intensive convolutional kernel computations and complete backpropagation calculations across all layers, streamlining the process of evaluating model performance. In the third phase, the entire neural network is trained, requiring substantial computational resources and repeated iterations. Parameters within the network architecture and loss function are adjusted to enhance performance. Notable parameters include using a cross-entropy loss function with a stochastic gradient descent optimizer (momentum: 0.9, weight decay: \(1\times 10^{-4}\)), employing an L2 regularizer for PPG data, setting the initial learning rate to 0.001, conducting 1000 training iterations (epochs) without pre-trained weights, using a batch size of 16, and implementing a learning rate decay strategy for faster convergence. A five-fold cross-validation is performed, dividing the preprocessed data into five equal subsets, where four are for training and one for validation only. The average accuracy from these iterations serves as the final emotion recognition accuracy. Table 2 displays the different experimental configurations and their corresponding accuracy in emotion recognition. HRV signifies the use of heart rate variability feature data, CWT indicates data processed via CWT, and STFT signifies data processed through short-time Fourier transform. The notation 1D-CNN denotes a one-dimensional CNN, while AS denotes the scale dimension attention compression module. The experiment initiates with a bandpass filter applied to the raw PPG signal within a 0.8 to 4 Hz bandwidth. Subsequently, the filtered PPG signal is processed using the HeartPy library in Python to compute the heart rate variability (HRV) characteristics of the signal. These HRV features are then classified using several machine learning algorithms, with Random Forest and Gradient Boosting Decision Tree (GBDT) being tested. Following hyperparameter grid search optimization, Random Forest demonstrates the highest classification accuracy, as shown in Table 2, achieving a rate of 47.12%. The Random Forest model's primary parameters include a total of 13 trees (n_estimators = 13); minimum leaf node samples of 5 (min_samples_leaf = 5); maximum features considered during split selection of 5 (max_features = 5); and a maximum tree depth of 10 (max_depth = 10). Figure 3: Proposed PPG signal preprocessing flowchart. As depicted in Figure 4, the emotions encoded by 0, 1, and 2 correspond to Interest, Neutral, and Bored, respectively. The classification outcomes for the Bored category starkly contrast with those of the other two categories, with the Bored category achieving a low recognition accuracy of 28.81%, and a higher proportion of instances being misclassified as Neutral. This indicates that conventional manual features and machine learning classifiers are inadequate for effective Bored category recognition. This experiment highlights the inefficiency of traditional manual features, which necessitate processing libraries and substantial computational time without meeting classification goals. Subsequent research focused on using raw data and implementing deep learning techniques. The 1D-CNN model, as indicated in Table 2, achieved a recognition accuracy of 52.36%. When analyzing raw data, a comparison was conducted between the recurrent network model and the 1D-CNN. Training a shallow recurrent network demands significant memory resources, resulting in lower accuracy compared to the 1D-CNN. The key advantage of deep learning over manual features is its ability to independently learn and extract features, reducing experimental time and offering improved performance. Spectrograms resulting from these analyses are presented in Figures 5 and 6, where Figure 5 shows the spectrogram derived from the STFT (short-time Fourier transform) and Figure 6 from CWT.