Multimodal emotion recognition via face and voice Master Thesis submitted to the Faculty of the Escola T`ecnica d’Enginyeria de Telecomunicaci´o de Barcelona Universitat Polit`ecnica de Catalunya by Oriol Griera i Jim´enez In partial fulfillment of the requirements for the master in TELECOMMUNICATIONS ENGINEERING Advisor: Maria de Marsico, Francisco Javier Hernando Pericas Rome and Barcelona, June 2022
Abstract Recent advances in technology have allowed humans to interact with computers in ways previously unimaginable. Despite significant progress, a necessary element for natural interaction is still lacking: emotions. Emotions play an important role in human communication and interaction, allowing people to express themselves beyond the language domain. The purpose of this project is to develop a multimodal system to classify emotions using facial expressions and the voice taken from videos. For face emotion recognition, face images and optical flow frames are used to exploit spatial and temporal information of the videos. Regarding the voice, the model uses speech features extracted from the chunked audio signals to predict the emotion. The combination of the two biometrics with a score-level fusion achieves excellent performance on the RAVDESS and the BAUM-1 datasets. However, the results remark the importance of further investigating the preprocessing techniques applied in this work to “normalize” the datasets to a unified format to improve the cross-dataset performance. 2
Acknowledgements First of all, I would like to express my gratitude to Professor Maria de Marsico for providing me with the opportunity to work on this project and for her support and implication during its development. Also, my advisor at UPC, Professor Javier Hernando Pericas, for his eagerness to help. Moreover, I would like to thank all the people I have met in Rome who have done of this Erasmus an incredible experience. Finally, I would not have been able to get here without the constant support of my family during all my studies. Your support means the world. 3
Contents List of Figures 6 List of Tables 8 1 Introduction 10 1.1 WorkPlan.................................... 11 1.1.1 WorkPackages ............................. 11 1.1.2 Milestones................................ 12 1.1.3 GanttDiagram ............................. 13 1.2 Deviations and incidences . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 State of the art of the technology used or applied in this thesis: 14 2.1 Face Emotion Recognition (FER) . . . . . . . . . . . . . . . . . . . . . . . 14 2.1.1 MTCNN for face detection . . . . . . . . . . . . . . . . . . . . . . . 15 2.2 Speech Emotion Recognition (SER) . . . . . . . . . . . . . . . . . . . . . . 16 2.3 Multimodal Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . 16 2.4 Model performance metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Methodology / Project development 20 3.1 Datasets..................................... 20 3.2 Face Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.1 Framesfiltering............................. 21 3.2.2 Frame preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.3 Optical flow frames . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.2.4 Data augmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.2.5 Model .................................. 26 3.3 Speech Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.1 Audioextraction ............................ 27 3.3.2 Data augmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.3 Audiochunking............................. 28 3.3.4 Features extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.3.5 Model .................................. 30 3.4 Multimodal Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . 31 4 Results 33 4.1 RAVDESS.................................... 33 4.2 BAUM-1..................................... 35 4.3 Cross-dataset .................................. 37 5 Budget 40 6 Conclusions and future development 41 References 42 A Filtered frames examples 45 B Extended results 46 4
B.1 RAVDESS.................................... 46 B.2 BAUM-1..................................... 57 B.3 Cross-datset................................... 68 B.3.1 RAVDESS BAUM-1......................... 68 B.3.2 BAUM-1 RAVDESS......................... 74 C Glossary 82 5
List of Figures 1 Project’s Gantt diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 Deep Belief Network (DBN) architecture . . . . . . . . . . . . . . . . . . . 14 3 Three-staged multi-task deep convolutional networks . . . . . . . . . . . . 15 4 Scheme of the hybrid CNN-RNN model . . . . . . . . . . . . . . . . . . . . 17 5 Multimodal approach with score fusion . . . . . . . . . . . . . . . . . . . . 17 6 Confusion matrix for multi-class classification . . . . . . . . . . . . . . . . 18 7 ExampleofROCcurves ............................ 19 8 Sequence of frames labelled as ”Happy” . . . . . . . . . . . . . . . . . . . . 21 9 Background removal process . . . . . . . . . . . . . . . . . . . . . . . . . . 22 10 Facedetectionprocess ............................. 24 11 Opticalflowframe ............................... 24 12 Image data augmentation techniques . . . . . . . . . . . . . . . . . . . . . 25 13 Face image model architecture . . . . . . . . . . . . . . . . . . . . . . . . . 26 14 Speech data augmentation techniques . . . . . . . . . . . . . . . . . . . . . 27 15 Speechchunkingprocess ............................ 28 16 Speechfeatures ................................. 29 17 Voice model architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 18 Schematic of the multimodal emotion recognition system . . . . . . . . . . 32 19 RAVDESS test confusion matrix . . . . . . . . . . . . . . . . . . . . . . . . 34 20 RAVDESSROCcurves............................. 34 21 BAUM-1 confusion matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 22 RAVDESSROCcurves............................. 36 23 Cross-dataset confusion matrices . . . . . . . . . . . . . . . . . . . . . . . . 38 24 RAVDESS - BAUM-1 ROC curves . . . . . . . . . . . . . . . . . . . . . . 38 25 BAUM-1 - RAVDESS ROC curves . . . . . . . . . . . . . . . . . . . . . . 39 26 Filtered images using the CNN model . . . . . . . . . . . . . . . . . . . . . 45 27 RAVDESS face image model confusion matrices . . . . . . . . . . . . . . . 46 28 RAVDESS optical flow model confusion matrices . . . . . . . . . . . . . . 47 29 RAVDESS voice model confusion matrices . . . . . . . . . . . . . . . . . . 48 30 RAVDESS face multimodal model confusion matrices . . . . . . . . . . . . 49 31 RAVDESS face image model ROC curves . . . . . . . . . . . . . . . . . . . 53 32 RAVDESS optical flow model ROC curves . . . . . . . . . . . . . . . . . . 54 33 RAVDESS voice model ROC curves . . . . . . . . . . . . . . . . . . . . . . 55 34 RAVDESS face multimodal model ROC curves . . . . . . . . . . . . . . . . 56 35 BAUM-1 face image model confusion matrices . . . . . . . . . . . . . . . . 57 36 BAUM-1 optical flow model confusion matrices . . . . . . . . . . . . . . . 58 37 BAUM-1 voice model confusion matrices . . . . . . . . . . . . . . . . . . . 59 38 BAUM-1 face multimodal model confusion matrices . . . . . . . . . . . . . 60 39 BAUM-1 face image model ROC curves . . . . . . . . . . . . . . . . . . . . 64 40 BAUM-1 optical flow model ROC curves . . . . . . . . . . . . . . . . . . . 65 41 BAUM-1 voice model ROC curves . . . . . . . . . . . . . . . . . . . . . . . 66 42 BAUM-1 face multimodal model ROC curves . . . . . . . . . . . . . . . . 67 43 RAVDESS - BAUM-1 face image model confusion matrices . . . . . . . . . 68 44 RAVDESS - BAUM-1 optical flow model confusion matrices . . . . . . . . 68 45 RAVDESS - BAUM-1 voice model confusion matrices . . . . . . . . . . . . 69 46 RAVDESS - BAUM-1 face multimodal model confusion matrices . . . . . . 69 6
47 RAVDESS - BAUM-1 face image model ROC curves . . . . . . . . . . . . 71 48 RAVDESS - BAUM-1 optical flow model ROC curves . . . . . . . . . . . . 72 49 RAVDESS - BAUM-1 voice model ROC curves . . . . . . . . . . . . . . . 73 50 RAVDESS - BAUM-1 face multimodal model ROC curves . . . . . . . . . 73 51 BAUM-1 - RAVDESS face image model confusion matrices . . . . . . . . . 74 52 BAUM-1 - RAVDESS optical flow model confusion matrices . . . . . . . . 75 53 BAUM-1 - RAVDESS voice model confusion matrices . . . . . . . . . . . . 75 54 BAUM-1 - RAVDESS face multimodal model confusion matrices . . . . . . 76 55 BAUM-1 - RAVDESS face image model ROC curves . . . . . . . . . . . . 78 56 BAUM-1 - RAVDESS optical flow model ROC curves . . . . . . . . . . . . 79 57 BAUM-1 - RAVDESS voice model ROC curves . . . . . . . . . . . . . . . 80 58 BAUM-1 - RAVDESS face multimodal model ROC curves . . . . . . . . . 80 7
List of Tables 1 WP1:Literaturereview............................. 11 2 WP2: System development . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 WP3: Results validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4 WP4:Documentation.............................. 12 5 Milestones.................................... 12 6 Number of videos per emotion of the datasets . . . . . . . . . . . . . . . . 20 7 Train, validation, and test number of clips per emotion . . . . . . . . . . . 21 8 Train, validation, and test number of frames per emotion . . . . . . . . . . 22 9 Train set number of frames per emotion after data augmentation . . . . . . 25 10 Train, validation, and test number of audio chunks per emotion . . . . . . 28 11 RAVDESS averaged results . . . . . . . . . . . . . . . . . . . . . . . . . . 33 12 RAVDESS accuracy results comparison . . . . . . . . . . . . . . . . . . . . 35 13 BAUM-1 averaged results . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 14 BAUM-1 accuracy results comparison . . . . . . . . . . . . . . . . . . . . . 37 15 RAVDESS - BAUM-1 averaged results . . . . . . . . . . . . . . . . . . . . 37 16 BAUM-1 - RAVDESS averaged results . . . . . . . . . . . . . . . . . . . . 37 17 RAVDESS - BAUM-1 accuracy results comparison . . . . . . . . . . . . . . 39 18 BAUM-1 - RAVDESS accuracy results comparison . . . . . . . . . . . . . . 39 19 Costsoftheproject............................... 40 20 RAVDESS precision results . . . . . . . . . . . . . . . . . . . . . . . . . . 50 21 RAVDESS recall results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 22 RAVDESS F1-score results . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 23 RAVDESSAUCresults............................. 52 24 BAUM-1 precision results . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 25 BAUM-1recallresults ............................. 62 26 BAUM-1 F1-score results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 27 BAUM-1AUCresults ............................. 63 28 RAVDESS - BAUM-1 precision results . . . . . . . . . . . . . . . . . . . . 70 29 RAVDESS - BAUM-1 recall results . . . . . . . . . . . . . . . . . . . . . . 70 30 RAVDESS - BAUM-1 F1-score results . . . . . . . . . . . . . . . . . . . . 70 31 RAVDESS - BAUM-1 AUC results . . . . . . . . . . . . . . . . . . . . . . 71 32 BAUM-1 - RAVDESS precision results . . . . . . . . . . . . . . . . . . . . 76 33 BAUM-1 - RAVDESS recall results . . . . . . . . . . . . . . . . . . . . . . 76 34 BAUM-1 - RAVDESS F1-score results . . . . . . . . . . . . . . . . . . . . 77 35 BAUM-1 - RAVDESS AUC results . . . . . . . . . . . . . . . . . . . . . . 77 8
Revision history and approval record Revision Date Purpose 0 09/05/2022 Document creation 1 07/06/2022 Document revision 2 23/06/2022 Document revision 3 02/07/2022 Document revision DOCUMENT DISTRIBUTION LIST Name e-mail Oriol Griera Jim´enez
[email protected] Maria de Marsico [email protected] Francisco Javier Hernando Pericas
[email protected] Written by: Reviewed and approved by: Date 09/05/2022 Date 02/07/2022 Name Oriol Griera Jim´enez Name Maria de Marsico, Francisco Javier Hernando Pericas Position Project Author Position Project Supervisor 9
The process of extracting the face starts by resizing the frame to different scales to build an image pyramid, which is the input of the following three-staged cascaded network. Stage 1: The Proposal Network (P-Net) consists of a fully convolutional network (FCN). The difference between a CNN and a FCN is that the second network does not use a dense layer as part of the architecture. Candidate windows and their bounding box regression vectors are obtained using this Proposal Network. Stage 2: The Refine Network receives all candidates from the P-Net. The R-Net decreases the number of candidates, performs calibration with bounding box regression, and merges overlapping candidates using non-maximum suppression (NMS). The R-Net outputs whether the input is a face or not, a 4-element vector which is the bounding box for the face, and a 10-element vector for facial landmark localization. Stage 3: This step is similar to the second stage, but the Output Network’s goal is to describe the face in greater detail and output the positions of the five facial landmarks for the eyes, nose, and mouth. 2.2 Speech Emotion Recognition (SER) In speech emotion recognition challenges, traditional machine learning algorithms such as hidden Markov models (HMMs), support vector machines (SVMs), and decision tree-based methods have been used [11]. Researchers have recently developed several neural network-based architectures to increase speech emotion recognition performance. Deep neural networks (DNNs) were first used by Han et al. to extract high-level characteristics from raw audio data in a study that proved their effectiveness in voice emotion identification [12]. More complex neural-based architectures have been proposed as deep learning approaches have progressed. The information collected from raw audio signals utilizing spectrograms or audio features such as Mel-frequency cepstral coefficients (MFCCs) and low-level descriptors (LLDs) is used to train CNN-based models [13]. 2.3 Multimodal Emotion Recognition Two approaches have been considered for multimodal emotion analysis: feature level fusion and score level fusion. The first refers to the feature union from different recognition systems, and it allows to take advantage of the biometrics synchronism. The other approach combines the scores obtained from each of the classifiers. For the first approach, Ronghe proposes a hybrid CNN-RNN architecture [14] (see Figure 4). First, the model is trained to categorize images into one of seven emotions. The videos are preprocessed and turned into a sequence of feature vectors, which are then used to train an SVM model. Then, a Multilayer Perceptron models the correlation between features of the emotions from the images and speech. The RNN is fed with the extra parameters to classify the emotional reaction to each video frame. 16
Figure 4: Scheme of the hybrid CNN-RNN model proposed by Ronghe et al. [14] Regarding the second approach, it has studied the possibility of combining face and voice by employing two independent models connected by a late fusion strategy [15]. As Figure 5 shows below, the architecture proposed consists of two systems: the speech emotion recognizer and the facial emotion recognizer. The speech emotion recognizer uses two transfer learning approaches to avoid having to train a CNN from scratch, which would require a large quantity of data. Feature extraction and fine-tuning are the methods used. Figure 5: Multimodal approach with score fusion [15] 17
2.4 Model performance metrics Several metrics and graphical techniques are used to assess the performance of a model in a classification problem. A confusion matrix represents the performance of a supervised learning method. A problem with n classes requires a n x n confusion matrix with the rows representing the actual class and the columns representing the class predicted by the model. Figure 6 is an example of a confusion matrix for multi-class classification [16]. Figure 6: Confusion matrix for multi-class classification [16] In general, the confusion matrix provides four types of classification results (each of them coded by a different colour in Figure 6) for a particular class k: True Positives (TP): Both predicted and actual classes are class k. True Negatives (TN): Both predicted and actual classes are not class k. False Positives (FP): Predicted class is class k, but the actual class is not. False Negatives (FN): Predicted class is not k, but the actual class is. From the confusion matrix, it is possible to measure several metrics. The ones used in this work are precision, recall, and F1-score. Precision is the percentage that the model correctly predicts positive when making a decision (see Equation 1). Precision =TP TP +FP (1) Recall, also known as sensitivity, is the percentage of positives correctly identified out of all the existing positives (see Equation 2). Recall =T P TP +FN (2) 18
Accuracy, as defined in Equation 3, is the total number of correct predictions made over the total number of predictions. This metric is useful only when classes are equally distributed on the classification. An alternative metric used in imbalanced datasets is F1-score. The F1-score can be interpreted as a harmonic mean of the precision and recall (see Equation 4). Accuracy =TP +TN TP +TN +FP +FN (3) F1−score = 2 ×P recision ×Recall Precision +Recall (4) A different approach to analysing the results of a model is using the Receiver Operating Characteristic (ROC) curve. The ROC is a graphical representation of the true positive rate (TPR) (Equation 5) against the false positive rate (FPR) (Equation 6). TPR =TP TP +FN (5) FPR =FP TN +FP (6) Figure 7 shows ROC curves for different classifiers. A curve in the top left corner indicates that the classifier is successful, whereas a curve along the diagonal indicates that the classification is random. Figure 7: Example of ROC curves [17] The quantitative value that provides a numerical measure of the ROC is the Area Under the Curve (AUC). The AUC value is between 0.5 (classifier that chooses randomly) and 1. The best value (1) is achieved when the model has an ideal measure of separability, and it is perfectly able to distinguish between the positive class and the negative classes. In this case, FPR is 0 and TPR is 1. 19
3 Methodology / Project development This chapter presents the methodology that has been followed in this thesis. It starts by providing a general overview of the datasets used. It is followed by an explanation of the data preprocessing, the data augmentation, the features extracted, and the model developed for each mode (face expression and voice). Finally, it includes how the two biometrics are combined to obtain the final multimodal model. 3.1 Datasets The datasets used to develop this project are RAVDESS and BAUM-1. While there are numerous datasets of emotions in use currently, the choice of the datasets is based on the aim to compare the results with previous works. Even though the datasets contain videos of various emotions, only those that both datasets have in common have been used: happiness, sadness, anger, fearfulness, and disgust. These emotions are labelled with numbers from 0 to 4. The Ryerson Audio-Visual Database of Emotional Speech and Song (RAVDESS) [18] contains videos collected from 24 professional actors (12 female, 12 male), vocalizing two lexically-matched statements in a neutral North American accent. The Bah¸ce¸sehir University Multimodal Emotional Database (BAUM-1) [19] consists of multimodal facial video clips collected from 31 subjects (14 female, 17 male) who express their ideas and feelings about the images and video clips they have previously watched in an unscripted and unguided way in Turkish. Both datasets contain expressions produced at two levels of emotional intensity: spontaneous/normal or acted/strong. Only the acted ones are considered since there is a major appreciation and comprehension of the emotions intended to express. Table 6 shows the number of clips for each of the five emotions for the two datasets. Happinesss Sadness Anger Fearfulness Disgust Total RAVDESS 96 96 96 96 96 480 BAUM-1 26 37 42 35 34 174 Table 6: Number of videos per emotion of the datasets The objective is to develop an emotion recognition model able to generalize and it is essential that the training data comes from videos of the maximum different people possible, having a database including several videos for each emotion and subject. The videos are divided into three sets: training, validation, and test. The training set contains 60% of the videos and is used to fit the parameters to the model. The validation set consists of 20% of the videos and is used to obtain an unbiased evaluation of the model fitted on the training set while tunning the hyperparameters. The 20% missing is used to test the final model. 20
As seen in Table 6, the RAVDESS dataset contains enough videos to achieve the stated goal. However, in the case of the BAUM-1 dataset, for each emotion there is barely one video per person. The solution adopted is to split the BAUM-1 videos to double the number of videos per subject per emotion. Table 7 presents the number of videos for each set once the BAUM-1 videos are split. Happy Sad Angry Fearful Disgust Total Train 57 58 57 58 58 288 RAVDESS Validation 19 19 20 19 19 96 Test 20 19 19 19 19 96 Train 31 44 42 38 40 195 BAUM-1 Validation 10 15 14 12 14 65 Test 11 15 13 13 13 65 Table 7: Train, validation, and test number of clips per emotion 3.2 Face Emotion Recognition Facial Emotion Recognition (FER) is the technology that analyses facial expressions from static photos and videos to disclose information about a person’s emotional state. 3.2.1 Frames filtering The framework used to extract the frames from the videos is OpenCV. The total number of frames generated is 64114 for the RAVDESS dataset and 21380 and the BAUM-1 dataset. Figure 8: Sequence of frames labelled as ”Happy” One of the challenges of FER is dealing with lower-intensity expressions. Some frames in a video sequence cannot be considered meaningful to the emotion that is supposed to be represented. The figure above shows an example of a sequence of frames extracted from a video labelled as “happy”. It can be observed that some frames express more a neutral emotion rather than happiness. Consequently, the objective is to extract only the high-intensity expression or, in other words, remove the less significant frames. This process is carried out using the CNN model used in Sara Tramonte’s work [20], which is fitted with approximately 600 relevant frames selected “by hand”. Then, the trained model predicts the label of the dataset frames and removes the misleadingly predicted (Appendix A contains examples of removed lowerintensity frames). 21
After applying the filtering process to both datasets, Table 8 summarizes the number of frames per emotion used for training, validation, and testing. Happy Sad Angry Fearful Disgust Total Train 6371 6587 6799 6271 7030 33058 RAVDESS Validation 2139 2150 2390 2072 2411 11162 Test 2318 2131 2219 2105 2334 11107 Train 1161 2804 1518 1037 1376 7896 BAUM-1 Validation 470 1111 588 479 503 3160 Test 417 848 171 410 469 2315 Table 8: Train, validation, and test number of frames per emotion 3.2.2 Frame preprocessing By taking a close look at the frames, it is possible to see differences between the datasets. As these discrepancies result in poor cross-dataset performance, it is imperative to preprocess the frames to “normalize” the images to a common format. This includes removing the background colour, extracting the face region, and resizing the images. First of all, the background is removed using the MediaPipe framework. MediaPipe [21] is a framework for building machine learning pipelines for processing time-series data like video, audio, etc. Selfie Segmentation module segments the prominent humans in the scene. It processes the image and creates a mask with the segmented background. The result is obtained by applying the bit-wise AND operation of the original image and the mask. Figure 9 displays an example of the stated process. (a) Original (b) Mask (c) Result Figure 9: Background removal process Then, faces are detected and extracted from the frames using MTCNN (see a detailed explanation of the model in Section 2.1.1). The model takes the frame as the input and returns the bounding box coordinates and the position of the keypoints (eyes, nose, and mouth). 22
The proposed face region contains irrelevant information that may lead to errors when recognizing emotions, such as parts of the background, ears, neck, or hair. Therefore, this work proposes using the positions of the five facial landmarks for the left eye, right eye, nose, left mouth, and right mouth to crop the region of interest more accurately. The algorithm below details de process. Given the MTCNN bounding box, and the keypoints (identified by a pixel position (x, y)), the algorithm returns the upper-left and the lower-right pixel coordinates that define the updated face region. First, the coordinates are initialized with those proposed by the MTCNN model. For each keypoint detected, the region is modified as follows: Mouth left and Mouth right refer to the landmarks that correspond to the extremes of the mouth. They are used to reduce the distance between the lower edge of the box and the mouth. Left eye and Right eye correspond to the centre of the left and right eye. They are used to reduce the lateral distance between the left and right edges of the box and the eyes. Moreover, they are used to reduce the distance between the upper edge of the box and the eyes. 23
Figure 10 shows the face detection process and the differences between the suggested regions. The final face region lies between the box that perfectly fits the landmarks and the proposed box by the face detector model. Figure 10b displays the distances between the edges of the two regions, which are used to draw the final region. The top edge of the final region is placed in the mediatrix of distance a. The lateral edges are located at 1/3 and 2/3 of distances dand b, respectively. Finally, the bottom edge is positioned at 5/6 of distance c. These proportions are computed to ensure no loss of relevant information about the face. Finally, the frame is resized to 512x512 pixels.. (a) Region proposed by MTCNN (b) Region that perfectly fits the landmarks (c) Final face region Figure 10: Face detection process 3.2.3 Optical flow frames Apart from taking advantage of the spatial information provided by static features (face images), this work uses optical flow to gather temporal information. Two different models have been designed and trained for each type of information: In the first case, the CNN input is the face images and, in the other case, the optical flow frames. Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movement of an object, in the case of this project, face muscles, lips, eyebrows, etc. Optical flow images are computed from optical flow vectors, which are 2D vectors where each vector represents a displacement showing the movement of points from one frame to the following one, with its magnitude and direction. Vectors are then mapped onto colour for better visualization. The optical flow frames are generated from the normalized face images using dense optical flow as implemented in [22] (see example in Figure 11). (a) Previous frame (b) Optical flow (c) Next frame Figure 11: Optical flow frame 24
3.2.4 Data augmentation The quality, quantity, and contextual significance of training data all play a role in the performance of deep learning models. However, one of the most common obstacles in developing deep learning models is the lack of data. The use of transfer learning with VGG-16 or ResNet50 models pre-trained on ImageNet has been considered, but the results were disappointing. Therefore, the models have been trained from scratch also applying data augmentation techniques. Data augmentation is a process of artificially increasing the amount of data by generating new data points from existing data. Its main advantages are contributing to avoiding overfitting and balancing the dataset. The augmented data derive from original images with minor geometric transformations. In this work, the techniques used are mirroring, rotation, histogram equalization, and modifying the brightness(see Figure 12). (a) Original (b) Mirroring (c) Rotation (d) Histogram Equalization (e) Brightness Figure 12: Image data augmentation techniques Mirroring consists of flipping horizontally the given image. Considering that the videos are filmed by cameras and can be placed in different places, it is interesting to have distinct points of view for recognition. Taking into account the fact that, in some videos, the subject moves its head while speaking, rotating the images at a random angle might be helpful. Histogram Equalization increases contrast in images by detecting the distribution of pixel densities in an image and plotting these pixel densities on a histogram. The distribution of this histogram is then analysed and if there are ranges of pixel brightness’s that aren’t currently being utilized, the histogram is then “stretched” to cover those ranges, and then is “back projected” onto the image to increase the overall contrast of the image [23]. As dataset recording conditions differ among them, it is preferred to train the model with images whose brightness has been modified, simulating different light conditions. After balancing the dataset and augmenting the training dataset, the number of frames per class for training is the following: Happy Sad Angry Fearful Disgust Total RAVDESS Face images 13223 13223 13223 13223 13223 66115 Optical flow 10072 10072 10072 10072 10072 50360 BAUM-1 Face images 8412 8412 8412 8412 8412 42060 Optical flow 3964 3964 3964 3964 3964 19820 Table 9: Train set number of frames per emotion after data augmentation 25
Figure 18: Schematic of the multimodal emotion recognition system 32
4 Results This chapter presents the main results obtained in this project for facial, speech, and multimodal emotion recognition. It also includes a comparison of this work with Sara Tramonte’s proposal evaluated on the same datasets, giving an overview of the possible advantages of the techniques applied in this thesis. It details the individual results of the three models and the performance results of the face model (fusion of the face image model and optical flow model) and the multimodal system (three models fused), evaluated for each dataset and cross-dataset. The following sections summarize the most relevant results for each model. They are calculated based on the classification of the individual frames or audio chunks (Ind. column of the tables) or based on the classification of the videos (Vid. column of the tables). The tables below contain the weighted average results for each of the metrics explained in Section 2.4. Weighted average considers how many frames, audio chunks, or videos of each emotion are in its calculation. It means that the impact of a class on the weighted average of each of the metrics is directly proportional to the amount of data it has. While this chapter presents the averaged results, Appendix B contains an extended analysis by emotion. It shows, for each of the models and emotions, the performance metrics, and the ROC curves. In addition, it includes the train, validation, and test confusion matrices of all the classifiers. 4.1 RAVDESS This section aims to show the results obtained when the models are trained and tested with the RAVDESS dataset. Precision Recall F1-score AUC Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 0.99 1.00 0.99 1.00 0.99 1.00 1.00 1.00 Face Image Val 0.88 0.96 0.87 0.96 0.87 0.96 0.98 1.00 Test 0.90 0.97 0.89 0.97 0.89 0.97 0.99 1.00 Train 0.99 1.00 0.99 1.00 0.99 1.00 1.00 1.00 Optical flow Val 0.78 0.90 0.77 0.90 0.77 0.90 0.95 0.99 Test 0.78 0.94 0.78 0.94 0.78 0.94 0.95 1.00 Train 0.88 0.90 0.88 0.90 0.87 0.90 0.97 0.98 Voice Val 0.84 0.85 0.82 0.83 0.83 0.83 0.94 0.94 Test 0.86 0.87 0.86 0.88 0.85 0.87 0.97 0.98 Train - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 0.96 - 0.96 - 0.96 - 1.00 Test - 0.98 - 0.98 - 0.98 - 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 0.98 - 0.98 - 0.98 - 1.00 Test - 0.99 - 0.99 - 0.99 - 1.00 Table 11: RAVDESS averaged results 33
Table 11 outlines the performance of the models tested. The results indicate that the multimodal system can correctly classify the emotion in most videos (99%). Its performance is better than the individual performance of the three models, which means that the three modes can be used to complement each other to generate a more robust model. The results in terms of video classification outperform the ones considering the individual classification of frames or audio chunks. The main reason is that the video score is obtained by averaging the individual scores of the frames, so if the number of misclassified frames is lower than the number of correctly classified frames, the predicted emotion of the video will be correct. Figure 19: RAVDESS test confusion matrix The confusion matrix in Figure 19 shows that just one video of the test dataset has been misleadingly classified by the final model. This emphasizes the outstanding results with the RAVDESS dataset. Figures 20a and 20b display the ROC curves of the system. The average results and the analysis per class reveal an almost perfect classifier, as the curves are plotted in the top-left corner. (a) Averaged (b) Per class Figure 20: RAVDESS ROC curves 34
As stated in the introduction, the objective is to improve the results of previous works. Table 12 compares the accuracies of the models developed in Sara Tramonte’s work with the ones obtained in this project. It can be said that the accuracies of the individual model and the multimodal system have increased. The most relevant improvement is in the optical flow model, which may be caused by computing the optical flow frames once the frames have been precisely cropped to eliminate unnecessary information. Previous work This work Improvement (%) Face Image 0.94 0.97 3.19 Optical flow 0.69 0.94 36.23 Voice 0.86 0.87 1.16 Face + Voice 0.91 0.99 8.79 Table 12: RAVDESS accuracy results comparison 4.2 BAUM-1 This section presents the results obtained when the models’ training and the testing are done on the BAUM-1 dataset. Precision Recall F1-score AUC Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Face Image Val 0.84 0.89 0.84 0.88 0.82 0.88 0.97 0.97 Test 0.81 0.83 0.74 0.82 0.75 0.83 0.95 0.96 Train 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Optical flow Val 0.67 0.71 0.65 0.69 0.65 0.70 0.88 0.88 Test 0.63 0.68 0.54 0.61 0.55 0.60 0.85 0.85 Train 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Voice Val 0.61 0.67 0.60 0.66 0.60 0.66 0.84 0.88 Test 0.73 0.83 0.73 0.81 0.73 0.80 0.90 0.93 Train - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 0.81 - 0.80 - 0.80 - 0.96 Test - 0.78 - 0.77 - 0.77 - 0.94 Train - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 0.87 - 0.86 - 0.86 - 0.99 Test - 0.85 - 0.84 - 0.84 - 0.98 Table 13: BAUM-1 averaged results 35
The table above shows that the results are worse than when using the RAVDESS dataset. One possible explanation is that the quality of the images and the sound of this dataset is lower than the previous one. In addition, comparing the training, validation, and test results it is seen that the models are overfitted. Overfitting occurs when the model fits exactly against the training data and cannot perform accurately against unseen data. However, the models still can distinguish clearly between the five emotions. Figure 21: BAUM-1 confusion matrix Figure 21 details which classes are the most difficult to identify for the multimodal model. In some cases, anger, fear, and disgust are misleadingly confused between them. Moreover, sometimes disgust and fear emotions are predicted as happiness. This fact is corroborated by the ROC curves below, where the red curve representing happiness is the lowest. Likewise, the decrease in performance when using the BAUM-1 dataset is seen by comparing the plots with the ones obtained with the RAVDESS dataset. The curves are no longer in the upper-left corner (ideal case). (a) Averaged (b) Per class Figure 22: BAUM-1 ROC curves The results obtained for the BAUM-1 results are worse than the ones in the previous work. The most significant decline is that of the voice model. Even though adding new speech features have resulted in a better performance for the RAVDESS dataset, in the case of the BAUM-1 dataset, it has not provided discriminant information to the model. 36
Another possible reason for this opposite effect on the BAUM-1 dataset is data augmentation. To compensate for the fact that the dataset contains fewer frames than the RAVDESS dataset, the number of generated images is higher. This fact may have caused the model to learn from redundant features, making it very difficult to generalize to other data. Previous work This work Improvement (%) Face Image 0.86 0.82 -4.65 Optical flow 0.63 0.62 -1.59 Voice 0.94 0.81 -13.83 Face + Voice 0.94 0.84 -10.64 Table 14: BAUM-1 accuracy results comparison 4.3 Cross-dataset It has been stated in the above sections the importance of having a model capable of generalizing and predicting emotions in different people. This section provides the results obtained when the models are trained and tested with different datasets. First, Table 15 and Table 16 show that the cross-dataset results are much worse than the results previously explained. One thing to remark is that the face image model and the optical flow model work better when combined alone than when combined with the voice model. Precision Recall F1-score AUC Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.49 0.55 0.48 0.53 0.45 0.53 0.73 0.78 Optical flow 0.47 0.44 0.38 0.40 0.36 0.40 0.67 0.76 Voice 0.28 0.24 0.23 0.21 0.23 0.21 0.58 0.55 Face - 0.55 - 0.54 - 0.53 - 0.83 Face + Voice - 0.49 - 0.51 - 0.49 - 0.81 Table 15: RAVDESS - BAUM-1 averaged results Precision Recall F1-score AUC Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.37 0.18 0.36 0.34 0.26 0.22 0.72 0.72 Optical flow 0.41 0.60 0.40 0.51 0.38 0.47 0.70 0.76 Voice 0.25 0.24 0.21 0.20 0.21 0.20 0.52 0.52 Face - 0.57 - 0.40 - 0.32 - 0.74 Face + Voice - 0.39 - 0.43 - 0.36 - 0.71 Table 16: BAUM-1 - RAVDESS averaged results 37
The voice model is not able to distinguish among the classes and acts nearly like a random classifier, especially when trained with the BAUM-1 dataset and tested with the RAVDESS dataset (Table 16). One possible cause is that this work tackles voice emotion recognition with a 1-D approach: the mean of the 2D features across the frequency dimension is computed and concatenated to one-dimensional features such as the Zero-Crossing Rate to form the feature vector. This process reduces the complexity and the computational effort with the cost of losing information. In addition, there is the fact that the language spoken in the two datasets is different (American English and Turkish), which may also be an extra source of errors. Regarding the face image model, another explanation for the drop in performance is the difference in resolution between the datasets. Even though the cropped face images are resized, the CNN learns information about the resolution, which differs in each dataset. (a) RAVDESS - BAUM-1 confusion matrix (b) BAUM-1 - RAVDESS confusion matrix Figure 23: Cross-dataset confusion matrices The confusion matrices above show the cross-dataset classification results. As previously seen in the tables, the final model has difficulties to classify the emotions when the dataset used for training and for testing is not the same. (a) Averaged (b) Per class Figure 24: RAVDESS - BAUM-1 ROC curves 38
(a) Averaged (b) Per class Figure 25: BAUM-1 - RAVDESS ROC curves On the one hand, when the model trains with the RAVDESS dataset (Figure 23a), sadness and disgust emotions are often confused between them. That is the main reason why their ROC curves are the lower ones. On the other hand, when the model is trained with BAUM- 1, it tends to predict either happiness or disgust for all of the emotions (Figure 23b). In addition, for this second case, the classifier predicts the fear emotion wrongly as its ROC curve lies in the line with a unitary slope that divides the plot (random classifier). Previous work This work Improvement (%) Face Image 0.39 0.53 35.90 Optical flow 0.22 0.44 100 Voice 0.21 0.21 0 Face + Voice 0.30 0.51 70 Table 17: RAVDESS - BAUM-1 accuracy results comparison Previous work This work Improvement (%) Face Image 0.27 0.34 25.93 Optical flow 0.25 0.51 104 Voice 0.18 0.20 11.11 Face + Voice 0.28 0.43 53.57 Table 18: BAUM-1 - RAVDESS accuracy results comparison Finally, the tables above show the comparison between the cross-dataset results of the previous work and the ones obtained during this project. Although there is an overall improvement in results, it varies depending on the model: the classifier with the best percentage of improvement is the optical flow model (with more than 100%), followed by the face image model and the voice model. The latter shows small improvement due to its poor performance on the BAUM-1 dataset. The key to good cross-dataset performance lies primarily in minimizing the dissimilarities between datasets. The normalization applied to frames and speech signals has had a negative impact on the BAUM-1 dataset results, but these techniques have enhanced both the RAVDESS and the cross-dataset results. Nonetheless, it is worth mentioning that there is still much room for improvement. 39
5 Budget The costs of this project are divided into human resources and the hardware needed. As all the programs used are open source, no fees are related to software. To calculate the budget, it is considered a project duration of 900 hours (equivalent to 30 ECTS). On the one hand, the human resources cost includes the gross salary of a junior employee and social charges. A junior employee is paid 10 ¿ /h worked, which means a total wage of 9000 ¿ . The standard fees are 30% of the gross salary, which represents a cost of 2700 ¿ . On the other hand, the hardware needed to develop the project is a computer with enough capacity to perform the training of the models. To calculate the amortisation, it is considered a computer price of 600 ¿ , a residual value of 60 ¿ , and a life span of 5 years. As a result, the first year’s amortisation cost is 108 ¿ . Concept Cost( ¿ ) Gross salary 9000 Social charges (30%) 2700 Computer amortization 108 TOTAL 11808 Table 19: Costs of the project As can be seen in Table 19, the total cost of the project for one year is 11808 ¿ . 40
6 Conclusions and future development This project has been developed with the intention of improving the cross-dataset results with respect to previous works when classifying emotions with a multimodal system based on facial expressions and voice. To this end, three models (face image, optical flow, and voice) have been trained and fused using score-fusion techniques to complement each other and create a robust final model. After the testing phase, the developed system outperforms the previous related works. It can be concluded that the preprocessing techniques are the main reason of this improvement. Normalizing the frames reduces the differences between the datasets enhancing the cross-dataset performance. Moreover, chunking the audio files and using more voice features has resulted in an increment of discriminative information and, therefore, better classification results. Despite the results being better, there is still a considerable difference between the performance of the models when they are trained and tested with the same dataset and when using cross-datasets. One of the possible causes is that, although there seem to exist similar patterns, there are still variations between individuals, especially when people are from different nationalities. However, the most challenging task is to unify the datasets into a common format. Further investigation into normalizing techniques must be done to deal with this issue. A future line of development can be to decrease the difference in the quality of both datasets, either by reducing the resolution of the dataset with better quality or by applying super-resolution techniques to enhance the worse quality dataset. This project has focused on extracting information directly from the frames of the videos using Convolutional Neural Networks. An alternative that may also help with the normalization challenge is using a geometric approach. Most geometric feature-based approaches use the active appearance model (AAM) or its variations, to track a dense set of facial points. The locations of these facial landmarks are then used in different ways to extract the shape and the movement of facial features, as the expression evolves [34]. Finally, it is worth mentioning that the technologies used in this project do not only have a successful present but a promising future. 41
Voice model: (a) Train (b) Train (c) Validation (d) Validation (e) Test (f) Test Figure 29: RAVDESS voice model confusion matrices based on speech chunks (a)(c)(e) and based on videos (b)(d)(f) 48
Face model (Face image + optical flow): (a) Train (b) Validation (c) Test Figure 30: RAVDESS face multimodal model confusion matrices 49
Performance results Next, it is shown the train, validation, and test performance results (precision, recall, F1-score, AUC) for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks (Ind.) and videos (Vid.). Precision: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 0.99 1.00 0.98 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Face Image Val 0.91 0.95 0.78 0.86 0.86 1.00 0.86 1.00 0.91 1.00 Test 0.89 0.95 0.81 0.95 0.90 0.95 0.92 1.00 0.96 1.00 Train 1.00 1.00 0.99 1.00 1.00 1.00 0.99 1.00 0.99 1.00 Optical flow Val 0.94 1.00 0.69 0.85 0.83 0.94 0.68 0.85 0.77 0.85 Test 0.90 1.00 0.75 0.95 0.74 0.94 0.75 0.89 0.76 0.90 Train 0.94 0.92 0.79 0.85 0.91 0.95 0.86 0.86 0.90 0.92 Voice Val 0.87 0.88 0.72 0.74 0.99 1.00 0.86 0.87 0.75 0.74 Test 0.83 0.79 0.85 0.84 0.90 0.95 0.83 0.85 0.87 0.95 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 0.95 - 0.90 - 1.00 - 0.95 - 1.00 Test - 1.00 - 1.00 - 0.95 - 0.95 - 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 1.00 - 0.90 - 1.00 - 1.00 - 1.00 Test - 1.00 - 1.00 - 1.00 - 1.00 - 0.95 Table 20: RAVDESS precision results 50
Recall: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 1.00 1.00 1.00 1.00 1.00 1.00 0.98 1.00 0.99 1.00 Face Image Val 0.94 1.00 0.94 1.00 0.89 0.95 0.85 1.00 0.73 0.84 Test 0.94 1.00 0.96 1.00 0.93 1.00 0.77 0.89 0.84 0.95 Train 1.00 1.00 0.99 1.00 0.99 1.00 0.99 1.00 1.00 1.00 Optical flow Val 0.86 0.95 0.75 0.89 0.79 0.85 0.73 0.89 0.75 0.89 Test 0.85 1.00 0.77 1.00 0.70 0.84 0.71 0.89 0.83 0.95 Train 0.81 0.92 0.93 0.85 0.94 0.95 0.81 0.86 0.88 0.92 Voice Val 0.76 0.88 0.87 0.74 0.89 1.00 0.71 0.87 0.89 0.74 Test 0.73 0.79 0.83 0.84 0.92 0.95 0.86 0.85 0.95 0.95 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 1.00 - 1.00 - 0.95 - 1.00 - 0.84 Test - 1.00 - 1.00 - 0.95 - 0.95 - 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 1.00 - 1.00 - 1.00 - 1.00 - 0.89 Test - 1.00 - 0.95 - 1.00 - 1.00 - 1.00 Table 21: RAVDESS recall results F1-score: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 1.00 1.00 0.99 1.00 1.00 1.00 0.99 1.00 1.00 1.00 Face Image Val 0.92 0.97 0.85 0.93 0.88 0.97 0.85 1.00 0.83 0.91 Test 0.92 0.98 0.88 0.97 0.91 0.97 0.84 0.94 0.90 0.97 Train 1.00 1.00 0.99 1.00 0.99 1.00 0.99 1.00 0.99 1.00 Optical flow Val 0.90 0.97 0.72 0.87 0.81 0.89 0.70 0.87 0.76 0.87 Test 0.87 1.00 0.76 0.97 0.72 0.89 0.73 0.89 0.79 0.92 Train 0.87 0.87 0.85 0.89 0.93 0.95 0.83 0.84 0.89 0.92 Voice Val 0.81 0.80 0.79 0.81 0.94 0.97 0.77 0.76 0.82 0.81 Test 0.78 0.77 0.84 0.84 0.91 0.95 0.85 0.87 0.91 0.95 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 0.97 - 0.95 - 0.97 - 0.97 - 0.91 Test - 1.00 - 1.00 - 0.95 - 0.95 - 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 1.00 - 0.95 - 1.00 - 1.00 - 0.94 Test - 1.00 - 0.97 - 1.00 - 1.00 - 0.97 Table 22: RAVDESS F1-score results 51
AUC: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Train 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Face Image Val 0.99 1.00 0.99 1.00 0.99 1.00 0.98 1.00 0.95 0.99 Test 0.99 1.00 0.99 1.00 0.99 1.00 0.97 1.00 0.99 1.00 Train 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Optical flow Val 0.98 1.00 0.94 0.99 0.97 1.00 0.93 0.98 0.93 0.99 Test 0.98 1.00 0.94 1.00 0.94 0.99 0.94 0.99 0.95 0.99 Train 0.97 0.98 0.98 0.98 0.99 0.99 0.94 0.95 0.98 0.99 Voice Val 0.94 0.95 0.96 0.96 0.99 1.00 0.85 0.84 0.95 0.95 Test 0.95 0.97 0.95 0.96 0.98 0.98 0.97 0.98 0.99 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face Val - 1.00 - 1.00 - 0.99 - 0.99 - 0.99 Test - 1.00 - 1.00 - 0.99 - 0.99 - 1.00 Train - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Face + Voice Val - 1.00 - 1.00 - 1.00 - 1.00 - 0.99 Test - 1.00 - 1.00 - 1.00 - 1.00 - 1.00 Table 23: RAVDESS AUC results 52
ROC curves Next, it is shown the weighted-average ROC curves and the ROC curves per class for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks and videos. Face image model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 31: RAVDESS face image model ROC curves based on frames (a)(c) and based on videos (b)(d) 53
Optical flow model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 32: RAVDESS face optical flow ROC curves based on frames (a)(c) and based on videos (b)(d) 54
Voice model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 33: RAVDESS voice model ROC curves based on speech chunks (a)(c) and based on videos (b)(d) 55
Face model (Face image + optical flow): (a) Averaged (b) Per class Figure 34: RAVDESS face multimodal model ROC curves based on frames (a) and based on videos (b) Observations The results for the RAVDESS dataset are excellent. The face image and the optical flow model have shown outstanding performances, and when combined, the results are even better. The figures above show that using optical flow separately results in some confusion between sadness, anger, fear, and disgust. Moreover, it can be seen that in some cases, the voice model has misleadingly predicted sadness for videos representing happiness. 56
B.2 BAUM-1 Confusion matrices Next, it is shown the train, validation, and test confusion matrices for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks and videos. Face image model: (a) Train (b) Train (c) Validation (d) Validation (e) Test (f) Test Figure 35: BAUM-1 face image model confusion matrices based on frames (a)(c)(e) and based on videos (b)(d)(f) 57
ROC curves Next, it is shown the weighted-average ROC curves and the ROC curves per class for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks and videos. Face image model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 39: BAUM-1 face image model ROC curves based on frames (a)(c) and based on videos (b)(d) 64
Optical flow model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 40: BAUM-1 face optical flow ROC curves based on frames (a)(c) and based on videos (b)(d) 65
Voice model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 41: BAUM-1 voice model ROC curves based on speech chunks (a)(c) and based on videos (b)(d) 66
Face model (Face image + optical flow): (a) Averaged (b) Per class Figure 42: BAUM-1 face multimodal model ROC curves based on frames (a) and based on videos (b) Observations Despite the results being worse than those obtained with the RAVDESS dataset, there is the same tendency to confuse sadness, anger, and fear. In addition, the voice model struggles when recognizing the disgust emotion. 67
B.3 Cross-datset B.3.1 RAVDESS BAUM-1 The results of this section are obtained by training the models on the RAVDESS dataset and testing on the BAUM-1 dataset. Confusion matrices Next, it is shown the test confusion matrices for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks and videos. Face image model: (a) Test (b) Test Figure 43: RAVDESS - BAUM-1 face image model confusion matrices based on frames (a) and based on videos (b) Optical flow model: (a) Test (b) Test Figure 44: RAVDESS - BAUM-1 optical flow model confusion matrices based on frames (a) and based on videos (b) 68
Voice model: (a) Test (b) Test Figure 45: RAVDESS - BAUM-1 voice model confusion matrices based on speech chunks (a) and based on videos (b) Face model (Face image + optical flow): Figure 46: RAVDESS - BAUM-1 face multimodal model confusion matrices 69
Performance results Next, it is shown the train, validation, and test performance results (precision, recall, F1-score, AUC) for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks (Ind.) and videos (Vid.). Precision: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.66 0.88 0.43 0.36 0.14 0.40 0.46 0.50 0.60 0.64 Optical flow 0.50 0.62 0.60 0.33 0.12 0.25 0.48 0.60 0.33 0.42 Voice 0.12 0.29 0.38 0.18 0.25 0.29 0.40 0.40 0.17 0.10 Face - 0.67 - 0.56 - 0.36 - 0.50 - 0.62 Face + Voice - 0.64 - 0.25 - 0.62 - 0.67 - 0.43 Table 28: RAVDESS - BAUM-1 precision results Recall: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.71 0.64 0.26 0.33 0.42 0.44 0.53 0.70 0.49 0.58 Optical flow 0.45 0.45 0.17 0.07 0.18 0.33 0.61 0.60 0.73 0.83 Voice 0.16 0.18 0.19 0.13 0.26 0.44 0.18 0.20 0.37 0.17 Face - 0.55 - 0.33 - 0.44 - 0.60 - 0.83 Face + Voice - 0.64 - 0.13 - 0.56 - 0.60 - 0.75 Table 29: RAVDESS - BAUM-1 recall results F1-score: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.68 0.74 0.32 0.34 0.21 0.42 0.50 0.58 0.54 0.61 Optical flow 0.47 0.53 0.26 0.11 0.15 0.29 0.53 0.60 0.45 0.56 Voice 0.14 0.22 0.25 0.15 0.26 0.35 0.25 0.27 0.24 0.12 Face - 0.60 - 0.42 - 0.40 - 0.55 - 0.71 Face + Voice - 0.64 - 0.17 - 0.59 - 0.63 - 0.55 Table 30: RAVDESS - BAUM-1 F1-score results 70
AUC: Happy Sad Angry Fearful Disgust Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Ind. Vid. Face Image 0.89 0.95 0.65 0.69 0.66 0.71 0.77 0.79 0.75 0.78 Optical flow 0.66 0.66 0.61 0.68 0.54 0.72 0.88 0.86 0.74 0.91 Voice 0.62 0.59 0.52 0.52 0.68 0.75 0.63 0.45 0.48 0.51 Face - 0.89 - 0.70 - 0.83 - 0.86 - 0.93 Face + Voice - 0.89 - 0.70 - 0.87 - 0.84 - 0.82 Table 31: RAVDESS - BAUM-1 AUC results ROC curves Next, it is shown the weighted-average ROC curves and the ROC curves per class for the face image model, the optical flow model, the voice model, and the face model (face image + optical flow). The results are presented based on frames or audio chunks and videos. Face image model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 47: RAVDESS - BAUM-1 face image model ROC curves based on frames (a)(c) and based on videos (b)(d) 71
Optical flow model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 48: RAVDESS - BAUM-1 face optical flow ROC curves based on frames (a)(c) and based on videos (b)(d) 72
Voice model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 49: RAVDESS - BAUM-1 voice model ROC curves based on speech chunks (a)(c) and based on videos (b)(d) Face model (Face image + Optical flow): (a) Averaged (b) Per class Figure 50: RAVDESS - BAUM-1 face multimodal model ROC curves based on frames (a) and based on videos (b) 73
Voice model: (a) Averaged (b) Averaged (c) Per class (d) Per class Figure 57: BAUM-1 - RAVDESS voice model ROC curves based on speech chunks (a)(c) and based on videos (b)(d) Face model (Face image + Optical flow): (a) Averaged (b) Per class Figure 58: BAUM-1 - RAVDESS face multimodal model ROC curves based on frames (a) and based on videos (b) 80
Observations The results show that the worst performance is achieved when the model is trained with the BAUM-1 dataset and tested with the RAVDESS dataset. The face image model predicts happiness or disgust for almost all the videos. In the case of the optical flow model, also identifies anger emotions. Finally, the voice model predicts almost randomly sadness, anger, and fear emotions. 81
C Glossary UPC Universitat Polit`ecnica de Catalunya AI Artificial Intelligence HCII Human-Computer Intelligent Interaction RAVDESS Ryerson Audio-Visual Database of Emotional Speech and Song BAUM-1 Bahcesehir University Multimodal Emotional Database MTCNN Multi-task Cascaded Convolutional Networks FER Face Emotion Recognition FACS Facial Action Coding System AU Action Unit CNN Convolutional Neural Network DBN Deep Belief Network FCN Fully Convolutional Network SER Speech Emotion Recognition NMS Non-Maximum Supression HMM Hidden Markov Model DNN Deep Neural Network RNN Recurrent Neural Network SVM Support Vector Machine TP True Positive TN True Negative FP False Positive FN False Negative TPR True Positive Rate FPR False Positive Rate ROC Receiver Operating Characteristic AUC Area Under the Curve GWN Gaussian White Noise ZCR Zero-Crossing Rate MFCC Mel Frequency Cepstral Coefficient FFT Fast Fourier Transform 82