## 2 Related Works  
Recent studies in Facial Expressions Recognition (FER) and Pain Assessment have introduced multiple cutting-edge models that achieve an acceptable performance. These models have tackled various challenges related to performance improvement by leveraging state-of-the-art Convolutional Neural Networks (CNN) [17; 18] or by adopting Long Short-Term Memory (LSTM) [19]. Moreover, researchers have explored the impact of various techniques such as augmentation [20] and batch normalization [21]. Recent studies turned to fusion models of two [5; 9; 22] or more CNNs [23]. Furthermore, a recent study implemented IoT in the FER system [24]. Despite this progress, some researchers continue to use handcrafted feature descriptor algorithms such as the Histogram of Oriented Gradient (HOG) [25; 26] and the Local Binary Pattern (LBP) [26; 27] in their work due to their simplicity and efficiency. While most studies focus on improving recognition accuracy, challenges such as poses, occlusion, and illumination demand further investigation and more efficient solutions. In order to compare the SAFEPA with the state-of-the-art, we have selected four recent studies [17; 24; 25; 26] that use CNN, HOG, and LBP for FER on the same datasets as our study. Additionally, we included three more recent studies that focus on facial expression-based pain assessment [3; 22; 23]. In [17], [PERSON] and his colleagues have developed an advanced facial-expression-classifier using two of the most common deep learning models: VGG16 and ResNet50, to extract features. Their model employs a multilayer perceptron (MLP) classifier for the extracted features by VGG16, ResNet50, or both (Ensemble). The team conducted testing on the Extended Cohn-Kanade (CK+), JAFFE, and 980-images subset of KDEF dataset (frontal view). In [24], [PERSON] and his colleagues developed a facial expression recognition system based on a social IoT solution. To detect the face region, they applied the tree-structured model. To extract the features, they applied several different texture descriptors such as LBP and HOG. To extract more discriminating and distinctive features, they used a sparse representation technique, followed by the Spatial Pyramid Mapping technique. Finally, they used SVM for the classification task. The performance of the proposed system is tested on KDEF and GENK4K datasets. In [25], [PERSON] and his colleagues proposed a model for the FER. Their model utilizes HOG to extract features from multiple cells in the image after detecting and cropping the face, followed by a support vector machine (SVM) for classification. This approach was applied to a subset of 980 images from KDEF dataset, focusing on images with frontal faces excluding other poses. Additionally, they utilized the Japanese Female Facial Expression (JAFFE) [28] database. [PERSON] in his work [26] combined LBP and HOG to extract features from the image then he used SVM to classify the emotions. The model has been evaluated on JAFFE, KDEE, and Radboud Faces Database (RaFD). In [3], the authors proposed a computer-aided pain assessment system based on facial expressions with a satisfactory accuracy to reduce the computational work. The proposed model consisted of two shallow neural networks: spatial appearance network (SANET) to extract spatial appearance-based features from RGB image, and a shape descriptors network (SDNET) to extract spatial facial appearance-related features from the landmarksinput, then the two outputs are concatenated to obtain the expected shape of the two different inputs and is sent to joint feature learning to learn from the entire fusion network. In [22], [PERSON] and his colleagues developed an ensemble deep learning model (EDLM) for pain intensity detection. Their model consists of two phases: the early fusion and the late fusion. In the early fusion, the features are extracted through a combination of pre-trained CNN and linear Principal Component Analysis (PCA).