## 5 Conclusions and Future Works  
The combination of sparse autoencoders (SAE) and concurrent CNNs, as implemented in the SAFEPA system, has demonstrated remarkable efficacy in overcoming the limitations of face detection algorithms that can hinder model performance in certain poses. By leveraging the SAE to reconstruct the upper part of the face, the proposed model can operate on different poses without relying on a face detection algorithm. Our experiments, which utilized the KDEF dataset for facial expression recognition and the UNBC-McMaster and BioVid datasets for pain assessment, have validated the efficacy and versatility of the SAFEPA system. Notably, the SAFEPA model achieved a 98.93% accuracy in 10-fold cross-validation for pain assessment recognition and an 84.06% accuracy for unseen subjects when applied to a subset of the UNBC-McMaster dataset. Moreover, its competitive performance compared to state-of-the-art studies in facial expression recognition confirms its efficiency in handling such tasks. Importantly, when other systems relying on face detection algorithms like the FEAPAS failed to work properly in samples with full left and right poses, the SAFEPA model was able to work smoothly and achieve high accuracy. Finally, the performance of the SAFEPA system on the BioVid dataset, as demonstrated \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**The Model** & **UNBC-McMaster** & **UNBC-McMaster** & **KDEF (980-Frontal)** & **KDEF (9920-Excluding Frontal)** & **KDEF (4900-Entire Dataset)** \\ \hline
**Cross-Validation** & **10-Fold** & **Unseen Subject** & **10-Fold** & **10-Fold** & **10-Fold** \\ \hline Basic & 98.67\% & 82.69\% & 98.35\% & 92.02 & 91.74\% \\ FEAPAS & 99.10\% & 90.56\% & 98.66\% & Not available & Not available \\ SAFEPA & 98.93\% & 84.06\% & 97.94\% & 95.51 & 94.29 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The performance of SAFEPA components. Figure 12: SAFEPA components. by its accuracy and processing time, highlights its generality and potential for real-world applications. These findings underscore the potential of the SAFEPA to accurately recognize pain assessment and facial expressions, process video data efficiently, and benefit various domains such as healthcare, education, and entertainment. Furthermore, considering the significant potential of augmented reality [40], our work holds promising implications in this area. Our future plan is to explore additional scenarios, such as when only partial facial information is available or when the input images may include non-facial images. Additionally, we aim to investigate the integration of voice analysis as an auxiliary component to enhance pain detection capabilities. Conceptualization, T.A. and G.A. ; methodology, T.A. ; software, T.A. ; validation, T.A. and G.A. ; formal analysis, T.A. ; investigation, T.A. ; resources, T.A. and G.A. ; data curation, T.A. ; writing--original draft preparation, T.A. ; writing--review and editing, G.A. ; visualization, T.A. ; PhD supervision, G.A. All authors have read and agreed to the published version of the manuscript. This research received no external funding. All utilized datasets in this study have been obtained with the necessary permissions and are publicly available. We have obtained explicit permission to use these datasets in our research. In this study, we utilized four distinct datasets, each contributing valuable insights to our research on \"SAFEPA: An expandable multi-pose facial expressions pain assessment Method\". Prior to their inclusion, appropriate consent was obtained from the respective dataset providers to ensure compliance with ethical guidelines and data usage permissions. The datasets used in this study include the UNBC-McMaster shoulder pain expression archive, the KDEF dataset, the JAFFE dataset, and the BioVid dataset. The permission was granted to use image AK064 from the UNBC-McMaster shoulder pain expression archive with copyright notice by @[PERSON], and image AF01 from the KDEF dataset with the corresponding image ID.