## 4 Experimentation and Results
### Experiment 2: How Well SAFEPA Performs in the Facial Expression Recognition Task
The data were split using a split function, resulting in a total of 291 samples for testing. The evaluation process included the confusion matrix, precision, recall, and F1-Score. The results of the SAFEPA model are presented in Figure 11. Table 5 indicates that SAFEPA achieved high accuracy in predicting the 'Happy' emotion with 100.00%. However, the 'Sad' emotion was the least accurately predicted by SAFEPA model with an accuracy of 53.85%. Notably, the overall accuracy of SAFEPA model on the test set was higher than that of the model designed for the FER task, as described in [25]. These \begin{table}
\begin{tabular}{c c c} \hline \hline  & **HOG [25]** & **SAFEPA** \\ \hline Accuracy & 80.95 & 84.19\% \\ Precision & Not available & 85.69\% \\ Recall & Not available & 83.39\% \\ F1-Score & Not available & 83.54\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The performance obtained by models presented in [25] and running SAFEPA for FER on 70% training and 30% testing of a subset of KDEF with 980 samples. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**The Model** & **Input Size** & \begin{tabular}{c} **Accuracy \%** \\ **KDEF (980)** \\ \end{tabular} & \
\begin{tabular}{c} **Accuracy \%** \\ **KDEF (3920)** \\ \end{tabular} &
\begin{tabular}{c} **Accuracy \%** \\ **KDEF (4900)** \\ \end{tabular} \\ \hline VGG16 [17] & 300 \(\times\) 300 & 98.78 & 73.64 & 74.28 \\ Ensemble [17] & 300 \(\times\) 300 & 98.47 & 82.88 & 92.95 \\ [PERSON], et al. [24] & Not available & 82.71 & Not available & Not available \\ Yaddaden [26] & 128 \(\times\) 128 & 88.88 & Not available & Not available \\ SAFEPA & 150 \(\times\) 150 & 97.94 & 95.51 & 94.29 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The 10-fold cross-validation accuracy of the models presented in [17, 24, 26], running SAFEPA and models in [17] for FER on three different sets of KDEF dataset. results demonstrate the effectiveness of the proposed model in facial emotion recognition on the subset of KDEF (980) dataset. Furthermore, FEAPAS model was trained on JAFFE dataset using an ADAM optimizer and 150 \(\times\) 150 input size and achieved a remarkable accuracy of 96.80% in 10-fold cross-validation, which is a highly competitive result compared to the Ensemble classifier of VGG16 and ResNet50 models used in [17] that achieved an accuracy of 96.40%. Moreover, when trained on 70% training data and 30% testing data using RMSProp optimizer, the FEAPAS achieved an accuracy of 78.13%, outperforming the model in [25] which achieved an accuracy of 76.19%. However, it is important to note that the SAFEPA model cannot be applied to gray scaled images as it was specifically trained on colored images, and hence, no result is provided for the SAFEPA on the JAFFE dataset. Experiment 3: Test in Real-Time: How Well the SAFEPA System Performs with a New Pain Assessment Dataset  
In Experiment 3, we tested the SAFEPA system on unseen data, the BioVid dataset that was collected for pain assessment and contains 6900 videos. Since the BioVid Heat dataset only offers video-level labels, it does not provide frame-level information. To address this, using the SAFEPA system, which is described in Figure 7 and operates on a frame-by-frame basis, we selected the highest-level prediction from all predictions made for the frames belonging to that video. The accuracy of the SAFEPA system on the entire unseen Biovid dataset was 33.28%, which is an improvement over the results reported in [37; 38]. In [37], the authors proposed facial activity descriptors to detect pain and estimate its intensity. Their model was applied on the BioVid dataset and for leave-one-subject-out cross-validation; to recognize five levels of pain, an accuracy of 30.80% was achieved. In [38], [PERSON] and his colleagues proposed a feature selection and inter-subject variability modeling approach for video-based pain level assessment. They utilized lasso regression to  
Figure 11: The confusion matrix of testing SAFEPA on 30% testing data on a subset of KDEF with 980 samples.