The embodiments relate generally to systems and methods for facial expression recognition.
Facial expression recognition (FER) has received considerable attention in computer vision. Recognizing dynamic facial expressions in videos is generally considered a more practical and reliable approach than still images. However, the dynamic FER problem in videos has challenges in terms of both data acquisition and the structural aspects of the learning model. In particular, video frames that deviate from the target facial expression class can significantly degrade the performance of dynamic FER. Therefore, there is a need for improved systems and methods for dynamic facial expression recognition.
Facial expression recognition (FER) has received considerable attention in computer vision. Recognizing dynamic facial expressions in videos is generally considered a more practical and reliable approach than still images. However, the dynamic FER problem in videos has challenges in terms of both data acquisition and the structural aspects of the learning model. In particular, video frames that deviate from the target facial expression class can significantly degrade the performance of dynamic FER. For example, a sequence of frames in a video may include irrelevant frames to the target emotion of the video clip as well as occluded facial features and non-frontal poses. In an example, a video demonstrating a “happy” expression may include frames that individually contain another facial expression such as disgust that are not related to happiness. Frames may also include multiple facial expressions with different emotions that are more closely related to the target emotion label because of facial changes resulting from conversation or eye blinking
In view of the need for improved systems and methods for facial expression recognition, embodiments herein describe an improved framework for facial expression recognition (FER). Embodiments herein include a dynamic FER model that utilizes a hierarchical emotion grouping approach while reducing a loss of emotion information in the process of extracting features from facial expressions. Embodiments herein describe an affectivity extraction network (AEN) for dynamic FER that uses emotion grouping learning.
Embodiments described herein include an AEN that combines features of different semantic levels for a hierarchical emotion grouping approach. AEN as described herein may consist of two branches with 2D convolutional neural network (CNN), temporal transformers, semantic-to-affective converters (S2ACs), and classifiers.
The bottom-up branch learns facial expressions at the different semantic levels and outputs probabilities for a facial expression class for each frame using a 2D FER model. Feature maps extracted from convolution layers in CNN have different semantic levels, and the feature map of higher semantic levels is extracted at deeper layers. While feature maps at lower semantic levels are spatially fine but semantically weak, those at higher semantic levels are spatially coarse but semantically strong. In a two-level hierarchical emotion grouping model, a high affective level increases the granularity of emotions, and in order to recognize the fine-grained emotion categories well, the combining of a low-level semantic feature map with a high-level semantic feature map may be utilized.
The top-down branch learns discriminative feature representation by combining feature vectors of each semantic level and a high semantic level for recognizing facial expressions at the corresponding affective level. To generate effectively combined feature vectors, an attention-based semantic-to-affective converter may be utilized. To reduce the loss of emotional information in AEN, a two frame-level emotion-guided loss function may be used, guided by the emotional probabilities of each frame. The frame-level emotion-guided loss functions consist of a temporal affectivity extraction loss and a global affectivity extraction loss. The temporal affectivity extraction loss function allows the temporal transformer to maintain emotional feature representation corresponding to the target emotion while compressing the changes in facial expression. The global affectivity extraction loss function aims that the emotional probability of each affective level follows that of each semantic level. The two loss functions allow AEN to understand what emotions are included in the video clip.
Embodiments described herein provide a number of benefits. For example, The AEN method provides more accurate facial expression recognition than alternative methods. By performing analysis at multiple affective layers and combining the results, the model is more robust to subtle changes in facial expression across frames of a video.
The feature maps 104, 106, and 108 at each semantic level are transformed to feature vectors 114, 116, and 118 respectively. Feature vectors may be represented as IS∈RT×Cs, s=0, 1, 2. Feature maps 104, 106, and 108 may be transformed using a squeeze operation, which consists of point-wise convolution and flattening to produce feature vectors 114, 116, and 118. Feature vectors 114, 116, and 118 are forwarded into corresponding temporal transformer encoders 124, 126, and 128 respectively. In some embodiments, multiple frames (e.g., 16) are input to the CNN, thereby generating a multiple feature maps at each semantic level, and multiple feature vectors at each semantic level. Transformer encoders 124, 126, and 128 may receive as input multiple (e.g., 16) feature vectors, each representing a different frame 102. Transformer encoders 124, 126, and 128 calculate correlations between frames as represented by feature vectors 114, 116, and 118 to capture temporal correlation. The output of temporal transformer encoders 124, 126, and 128 at their respective semantic levels may be represented as Vs∈RCs×1, s=0, 1, 2. The output of temporal transformer encoders 124, 126, and 128 (Vs) represent spatio-temporal feature vectors representing each semantic level.
A top-down branch including two semantic to affective converters, S2AC 134 and S2Ac 136. The top-down branch also includes three classifiers: local classifiers 144 and 146, and global classifier 148. The outputs of transformer encoders 124 and 126 (Vs) are forwarded respectively to S2ACs 134 and 136. The high semantic information V2 from transformer encoder 128 is forwarded to the global classifier 148. S2AC 134 also receives features from S2AC 136, and similarly S2AC 136 receives features from transformer encoder 128, thereby providing a fusion of low-level features with high-level features. The fusion of low-level features with high-level semantic information increases the granularity of emotions. Through S2ACs 134 and 136, the feature representation is converted to be interpretable at the affective level. The outputs of S2ACs 134 and 136 may be represented as Fa, where F2 is the output of S2AC 134, and F1 is the output of S2AC 136, where the subscript a denotes the affective level. Since affective level of F2 is higher than F1, F2 is useful to determine specific emotion categories. Combined features F1 and F2 are forwarded to each local classifier, respectively. The function and structure of S2ACs 134 and 136 are further described in
A pretrained model 152 may also be utilized to generate emotion predictions 156 of T input facial images/frames. Pretrained model 152 may be a CNN model that is pretrained on a facial expression recognition dataset of 2D images. Pretrained model 152 may be, for example, another ResNet18 network. Pretrained model 152 may include, for example, similar layers to that of the backbone CNN, and a classifier 154 that generates the final emotion prediction 156 based on the final feature map of the CNN model. In some embodiments, pretrained model 152 is frozen after pre-training and is not trained with the remainder of the model. At inference, pretrained model 152 may not be used. Emotion predictions 156 may be used as pseudo labels as described below. In some embodiments, pretrained model 152 is trained on a dataset that includes static facial expressions, and is not trained on a dynamic facial expression recognition dataset (i.e., individual images rather than frames of a video).
The high semantic vector 202 may be of a lower dimensionality that low semantic vector 204. To compensate for this difference, high semantic vector 202 may be fed to a linear layer 206, and the number of dimensions may be expanded to match the dimensions of low semantic vector 204. The modified high semantic vector 202 may be combined (e.g., via multiplication) with low semantic vector 204. The combined output may be input to a softmax 208. Softmax 208 helps quantify the correlation between the two input vectors 202 and 204. By multiplying those together, we the resulting feature vector is enhanced with low semantic level strongly related to feature vector with high semantic level. All element-wise dependencies may be discovered between features at the neighboring affective level. For affective level α, S2AC 200 may be formulated as:
where W1 and W2 are weights of linear layers 206 and 210 respectively, ρ denotes row-wise softmax function (i.e., softmax 208), Fa-1 is the high semantic vector 202, and V2-a is the low semantic vector 204. F0 is set to V2 (e.g., the output of transformer encoder 128). A fusion of low-level features with high-level semantic information increases the granularity of emotions. Through S2AC 200, feature representation is converted to be interpretable at the affective level. Since affective level of F2 is higher than F1, F2 is useful to determine specific emotion categories. Affective vector output 212 represents the combined features of low semantic vector 204 and high semantic vector 202 (e.g., F1 and F2). Affective vector output 212 is forwarded to a local classifier, (e.g., local classifiers 144 and 146 respectively for S2AC 134 and 136).
Returning to the discussion of
where Hα means the number of affective levels. |Ki| is the number of emotion groups at affective level α, and Ykα denotes the ground truth value of the emotion class belonging to the affective level. POα refers to the overall prediction at each affective level and is defined as
where PLα and PGα are the outputs of the local classifiers 144 and 146 and the global classifier 148, respectively. α is a fusion parameter, which controls the relative importance between PL and PG. The local classifier prediction at each level is output by a separate local classifier (i.e., 144 or 146). The global classifier directly outputs a global prediction at the highest affective level, and global predictions for other affective levels may be computed. For example, a global prediction for group j at α−1, ρ(PG,jα−1) may be acquired by summing the global probability of all sub-categories k at a of group j at α−1, ρ(PG,jα−1)=Σk∈jρ(PG,jα). In Equations (2) and (3), the multi-class loss is the cross entropy between a one-hot distribution Ykα and estimated probability ρ(PO,kα). By minimizing Lmc, AEN is simultaneously optimized to learn discriminative feature representations at each affective level, i.e., an image is classified as “positive” at a=1 and is classified as “happy” at a=2. The illustrated example in
Additional loss functions may be utilized together with Lmc to improve model performance. In dynamic FER, there are several problems, which cause performance degradation but may be helped by including additional loss functions. The temporal transformer encoders 124, 126, and 128 play the role of converting spatio-temporal information into the discriminant feature vector. However, it is difficult for the temporal transformer encoders 124, 126, or 128 to convert feature maps at each semantic level into discriminant feature vectors without frame-level guide information since compressed semantic information is used as input. Also, if the video input data contains frames 102 different from the emotion of the video clip, the temporal transformer encoders 124, 126, and 128 cannot guarantee the acquisition of the discriminant feature vector. That is, if only the cross-entropy loss function is used in model training, there is a limit to extracting discriminant features for emotion recognition because cross-entropy does not consider the ambiguity that comes from video data actually containing multiple emotions. To address this issue, frame-level emotion-guided loss functions induced by the emotional probabilities of each frame may be used. Specifically, a temporal affectivity extraction loss and/or a global affectivity extraction loss.
The pre-trained model 152 may be used as a guide network for pseudo-label generation. As illustrated, emotion predictions 156 may be used as pseudo-labels S2. Emotion predictions 156 may be at the highest affective level (Affective level 2 in the illustrated example, or affective level 303 in
where S2YH
To apply a global affectivity extraction loss function, each output of local-classifiers 144 and 146 (PLα) may be independently translated into the range 0-1 using the sigmoid (σ) function. The output of sigmoid may be interpreted as the emotional probability of the input video. The emotional probability of each affective level in AEN may follow that of each semantic level. Accordingly, a global affectivity extraction loss may also be used that encourages AEN to predict emotional distribution at each local classifier as follows:
where βi represents weights of loss corresponding to affective level, 1∈RT×1 denotes a one-vector that all elements are one, and frame-level emotional probabilities at each affective level can be represented as Sj,α−1=Σk∈jSk,α according to emotion grouping. PLα is the output of local classifier at affective level α, and it is transformed between 0 and 1 using sigmoid function σ·ρ(SαT1) represents the mean of frame-level probabilities for the emotion class in each affective level. Lgα is the difference between the output of local classifier and pseudo probabilities generated by frame-level emotional probabilities. AEN may be trained with the following total loss function:
where λ1 and λ2 are regularization parameters. Loss 150 may be the loss function in equation (6). In some embodiments, loss 150 is used to update parameters of (i.e., train via backpropagation) the backbone CNN, transformer encoders 124, 126, 128, S2ACs 134, 136, global classifier 148, and/or local classifiers 144, 146.
Memory 420 may be used to store software executed by computing device 400 and/or one or more data structures used during operation of computing device 400. Memory 420 may include one or more types of transitory or non-transitory machine-readable media (e.g., computer-readable media). Some common forms of machine-readable media may include floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic medium, CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or cartridge, and/or any other medium from which a processor or computer is adapted to read.
Processor 410 and/or memory 420 may be arranged in any suitable physical arrangement. In some embodiments, processor 410 and/or memory 420 may be implemented on a same board, in a same package (e.g., system-in-package), on a same chip (e.g., system-on-chip), and/or the like. In some embodiments, processor 410 and/or memory 420 may include distributed, virtualized, and/or containerized computing resources. Consistent with such embodiments, processor 410 and/or memory 420 may be located in one or more data centers and/or cloud computing facilities.
In some examples, memory 420 may include non-transitory, tangible, machine readable media that includes executable code that when run by one or more processors (e.g., processor 410) may cause the one or more processors to perform the methods described in further detail herein. For example, as shown, memory 420 includes instructions for FER module 430 that may be used to implement and/or emulate the systems and models, and/or to implement any of the methods described further herein.
FER module 430 may receive input 440 such as a video comprising multiple frames with a face and generate an output 450 such as an emotion prediction. For example, FER module 430 may be configured to predict the emotion of a face based on a neural network based model. FER module 430 may be further configured to train the neural network based model based on the predictions.
The data interface 415 may comprise a communication interface, a user interface (such as a voice input interface, a graphical user interface, and/or the like). For example, the computing device 400 may receive the input 440 from a networked device via a communication interface. Or the computing device 400 may receive the input 440, such as video images, from a user via the user interface.
Some examples of computing devices, such as computing device 400 may include non-transitory, tangible, machine readable media that include executable code that when run by one or more processors (e.g., processor 410) may cause the one or more processors to perform the processes of method. Some common forms of machine-readable media that may include the processes of method are, for example, floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic medium, CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or cartridge, and/or any other medium from which a processor or computer is adapted to read.
For example, the neural network architecture may comprise an input layer 541, one or more hidden layers 542 and an output layer 543. Each layer may comprise a plurality of neurons, and neurons between layers are interconnected according to a specific topology of the neural network topology. The input layer 541 receives the input data such as training data, user input data, vectors representing latent features, etc. The number of nodes (neurons) in the input layer 541 may be determined by the dimensionality of the input data (e.g., the length of a vector of the input). Each node in the input layer represents a feature or attribute of the input.
The hidden layers 542 are intermediate layers between the input and output layers of a neural network. It is noted that two hidden layers 542 are shown in
For example, as discussed in
The output layer 543 is the final layer of the neural network structure. It produces the network's output or prediction based on the computations performed in the preceding layers (e.g., 541, 542). The number of nodes in the output layer depends on the nature of the task being addressed. For example, in a binary classification problem, the output layer may consist of a single node representing the probability of belonging to one class. In a multi-class classification problem, the output layer may have multiple nodes, each representing the probability of belonging to a specific class.
Therefore, the FER module 430 may comprise the transformative neural network structure of layers of neurons, and weights and activation functions describing the non-linear transformation at each neuron. Such a neural network structure is often implemented on one or more hardware processors 410, such as a graphics processing unit (GPU).
In one embodiment, the FER module 430 may be implemented by hardware, software and/or a combination thereof. For example, the FER module 430 may comprise a specific neural network structure implemented and run on various hardware platforms 560, such as but not limited to CPUs (central processing units), GPUs (graphics processing units), FPGAs (field-programmable gate arrays), Application-Specific Integrated Circuits (ASICs), dedicated AI accelerators like TPUs (tensor processing units), and specialized hardware accelerators designed specifically for the neural network computations described herein, and/or the like. Example specific hardware for neural network structures may include, but not limited to Google Edge TPU, Deep Learning Accelerator (DLA), NVIDIA AI-focused GPUs, and/or the like. The hardware 560 used to implement the neural network structure is specifically configured based on factors such as the complexity of the neural network, the scale of the tasks (e.g., training time, input data scale, size of training dataset, etc.), and the desired performance.
In one embodiment, the neural network based FER module 430 may be trained by iteratively updating the underlying parameters (e.g., weights 551, 552, etc., bias parameters and/or coefficients in the activation functions 561, 562 associated with neurons) of the neural network based on a loss function. For example, during forward propagation, the training data such as video data with emotion labels are fed into the neural network. The data flows through the network's layers 541, 542, with each layer performing computations based on its weights, biases, and activation functions until the output layer 543 produces the network's output 550. In some embodiments, output layer 543 produces an intermediate output on which the network's output 550 is based.
The output generated by the output layer 543 is compared to the expected output (e.g., a “ground-truth” such as the corresponding emotion) from the training data (and/or from generated pseudo-labels), to compute a loss function that measures the discrepancy between the predicted output and the expected output. Given a loss function, the negative gradient of the loss function is computed with respect to each weight of each layer individually. Such negative gradient is computed one layer at a time, iteratively backward from the last layer 543 to the input layer 541 of the neural network. These gradients quantify the sensitivity of the network's output to changes in the parameters. The chain rule of calculus is applied to efficiently calculate these gradients by propagating the gradients backward from the output layer 543 to the input layer 541.
Parameters of the neural network are updated backwardly from the last layer to the input layer (backpropagating) based on the computed negative gradient using an optimization algorithm to minimize the loss. The backpropagation from the last layer 543 to the input layer 541 may be conducted for a number of training samples in a number of iterative training epochs. In this way, parameters of the neural network may be gradually updated in a direction to result in a lesser or minimized loss, indicating the neural network has been trained to generate a predicted output value closer to the target output value with improved prediction accuracy. Training may continue until a stopping criterion is met, such as reaching a maximum number of epochs or achieving satisfactory performance on the validation data. At this point, the trained network can be used to make predictions on new, unseen data, such as new video with a different face.
Neural network parameters may be trained over multiple stages. For example, initial training (e.g., pre-training) may be performed on one set of training data, and then an additional training stage (e.g., fine-tuning) may be performed using a different set of training data. In some embodiments, all or a portion of parameters of one or more neural-network model being used together may be frozen, such that the “frozen” parameters are not updated during that training phase. This may allow, for example, a smaller subset of the parameters to be trained without the computing cost of updating all of the parameters.
The neural network illustrated in
Through the training process, the neural network is “updated” into a trained neural network with updated parameters such as weights and biases. The trained neural network may be used in inference to perform the tasks described herein, for example those performed by module 430. The trained neural network thus improves neural network technology in FER.
User device 610, data server 670, and model server 640 may each include one or more processors, memories, and other appropriate components for executing instructions such as program code and/or data stored on one or more computer readable mediums to implement the various applications, data, and steps described herein. For example, such instructions may be stored in one or more computer readable media such as memories or data storage devices internal and/or external to various components of system 600, and/or accessible over network 660. User device 610, data server 670, and/or model server 640 may be a computing device 400 (or similar) as described herein.
In some embodiments, all or a subset of the actions described herein may be performed solely by user device 610. In some embodiments, all or a subset of the actions described herein may be performed in a distributed fashion by various network devices, for example as described herein.
User device 610 may be implemented as a communication device that may utilize appropriate hardware and software configured for wired and/or wireless communication with data server 670 and/or the model server 640. For example, in one embodiment, user device 610 may be implemented as an autonomous driving vehicle, a personal computer (PC), a smart phone, laptop/tablet computer, wristwatch with appropriate computer hardware resources, eyeglasses with appropriate computer hardware (e.g., GOOGLE GLASS®), other type of wearable computing device, implantable communication devices, and/or other types of computing devices capable of transmitting and/or receiving data, such as an IPAD® from APPLE®. Although only one communication device is shown, a plurality of communication devices may function similarly.
User device 610 of
In various embodiments, user device 610 includes other applications as may be desired in particular embodiments to provide features to user device 610. For example, other applications may include security applications for implementing client-side security features, programmatic client applications for interfacing with appropriate application programming interfaces (APIs) over network 660, or other types of applications. Other applications may also include communication applications, such as email, texting, voice, social networking, and IM applications that allow a user to send and receive emails, calls, texts, and other notifications through network 660.
Network 660 may be a network which is internal to an organization, such that information may be contained within secure boundaries. In some embodiments, network 660 may be a wide area network such as the internet. In some embodiments, network 660 may be comprised of direct physical connections between the devices. In some embodiments, network 660 may represent communication between different portions of a single device (e.g., a communication bus on a motherboard of a computation device).
Network 660 may be implemented as a single network or a combination of multiple networks. For example, in various embodiments, network 660 may include the Internet or one or more intranets, landline networks, wireless networks, and/or other appropriate types of networks. Thus, network 660 may correspond to small scale communication networks, such as a private or local area network, or a larger scale network, such as a wide area network or the Internet, accessible by the various components of system 600.
User device 610 may further include database 618 stored in a transitory and/or non-transitory memory of user device 610, which may store various applications and data (e.g., model parameters) and be utilized during execution of various modules of user device 610. Database 618 may store images, predictions, etc. In some embodiments, database 618 may be local to user device 610. However, in other embodiments, database 618 may be external to user device 610 and accessible by user device 610, including cloud storage systems and/or databases that are accessible over network 660 (e.g., on data server 670).
User device 610 may include at least one network interface component 617 adapted to communicate with data server 670 and/or model server 640. In various embodiments, network interface component 617 may include a DSL (e.g., Digital Subscriber Line) modem, a PSTN (Public Switched Telephone Network) modem, an Ethernet device, a broadband device, a satellite device and/or various other types of wired and/or wireless network communication devices including microwave, radio frequency, infrared, Bluetooth, and near field communication devices.
Data Server 670 may perform some of the functions described herein. For example, data server 670 may store a training dataset including video, emotion labels, etc. Data server 670 may provide data to user device 610 and/or model server 640. For example, training data may be stored on data server 670 and that training data may be retrieved by model server 640 while training a model stored on model server 640.
Model server 640 may be a server that hosts models described herein. Model server 640 may provide an interface via network 660 such that user device 610 may perform functions relating to the models as described herein (e.g., analyze video from user device 610 to make emotion predictions). Model server 640 may communicate outputs of the models to user device 610 via network 660. User device 610 may display model outputs, or information based on model outputs, via a user interface to user 650.
As illustrated, the method 700 includes a number of enumerated steps, but aspects of the method 700 may include additional steps before, after, and in between the enumerated steps. In some aspects, one or more of the enumerated steps may be omitted or performed in a different order.
At step 701, a system (e.g., computing device 400, user device 610, model server 640, device 800, or device 815) receives (e.g., via a data interface 415, network interface 617, or an interface to a camera) a plurality of images of a video (e.g., frames 102), the plurality of images including a face. The received images may include images in which the face is partially or fully occluded, at different angles, etc.
At step 702, the system generates, by a convolutional neural network (CNN), a plurality of feature maps (e.g., feature maps 104, 106, and 108) at a plurality of semantic levels based on the plurality of images, the plurality of semantic levels including a lowest semantic level and a highest semantic level.
At step 703, the system generates, by a first classifier (e.g., global classifier 148) based on a first feature map (e.g., feature map 108) of the plurality of feature maps associated with the highest semantic level, a first emotion prediction (e.g., PG2) associated with the face over a first set of emotions of a first affective level. For example, the first set of emotions may be the predefined emotions associated with affective level 2. In some embodiments, the first set of emotions includes happiness, sadness, neutral, anger, surprise, disgust, and fear.
In some embodiments, the system generates, via a plurality of transformer encoders (e.g., transformer encoders 124, 126, and 128) based on an input based on a respective feature map of the plurality of feature maps, a plurality of vector representations, wherein the generating the first emotion prediction is based on a first vector representation (e.g., V2) of the plurality of vector representations based on the first feature map
In some embodiments, the input based on the respective feature map includes a respective feature vector (e.g., feature vector 118) based on a 1×1 convolution and a flattening operation performed on the respective feature map of the plurality of feature maps.
At step 704, the system generates, by a second classifier (e.g., local classifier 144) based on the plurality of feature maps, a second emotion prediction (e.g., PL2) associated with the face over the first set of emotions. In some embodiments, the generating the second emotion prediction is based on a combination of the plurality of vector representations. The combination of the plurality of vector representations may be generated via a plurality of S2ACs (e.g., S2AC 134 and 136).
Specifically, in some embodiments, the system may generate, via a plurality of S2ACs, a plurality of modified vector representations (e.g., F1 and F2) based on the plurality of vector representations. Each S2AC of the plurality of S2ACs may generate a respective modified vector representation of the plurality of modified vector representations based on a first input and a second input. The first input may include a first respective vector representation of the plurality of vector representations (e.g., V0 or V1). The second input may include at least one of a second respective vector representation of the plurality of vector representations different from the first respective vector representation (e.g., V2), or a modified vector representation from a different S2AC (e.g., F1). The combination of the plurality of vector representations on which the second emotion prediction is based may be a first modified vector representation of the plurality of modified vector representations (e.g., F2).
At step 705, the system generates a fine-grain emotion prediction (e.g., PO2) based on the first emotion prediction and the second emotion prediction. For example, the emotion prediction may be in the form of a probability associated with each emotion in the first set of emotions. The fine-train emotion prediction may be used to display a predicted emotion (e.g., the emotion with the highest probability) via a user interface. For example, a user interface device may display the video and the predicted emotion related to the video. In some embodiments, the fine-grain emotion prediction may be used to determine the emotion of a speaker that is interacting with a virtual avatar system such as device 800 or 815. The determined emotion of the speaker may be used by the system to adjust a response based on the emotion. For example, the same statement may be interpreted differently or require a different response when the related emotion is happiness compared to if the related emotion is disgust.
In some embodiments, the system may also generate a coarse-grain emotion prediction. For example, the system may generate, by a third classifier (e.g., local classifier 146) based on a second modified vector representation of the plurality of modified vector representations (e.g. F1), a third emotion prediction (e.g., PL1) associated with the face over a second set of emotions different from the first set of emotions. For example, the second set of emotions may be emotions at affective level 1. In some embodiments, the emotions at affective level 1 include positive, negative, and neutral. The system may compute, via an averaging operation based on the first emotion prediction, a fourth emotion prediction (e.g., PG1) associated with the face over the second set of emotions. The system may then generate the coarse-grain emotion prediction (e.g., PO1) based on the third emotion prediction and the fourth emotion prediction.
In some embodiments, aspects of the system may include parameters (e.g., weights and biases, convolution kernels, embedding lookup tables, etc.) that may be updated via a training process via backpropagation based on one or more loss functions. In some embodiments, the system may update parameters of at least one of the CNN, the first classifier, the second classifier, the third classifier, the plurality of transformer encoders, or the plurality of S2ACs based on a first loss function based on the fine-grain emotion prediction and the coarse-grain emotion prediction. For example, the first loss function may be the multi-class loss described in equation (2).
The first loss function may be further based on a comparison of the fine-grain emotion prediction to a ground truth singular emotion label associated with the plurality of images (e.g., Y).
In some embodiments, the system may generate, via a pretrained prediction model (e.g., pretrained model 152), a fifth emotion prediction (e.g., emotion prediction 156, S2) over the first set of emotions based on individual images of the plurality of images. Note that at least in some embodiments predictions by local classifiers 144 and 146 and global classifier 148 are based on multiple images from a video, while emotion prediction 156 is a prediction associated with a single image.
In some embodiments, training may be performed further based on one or more additional loss functions, which may be used in weighted combination. For example, a second loss function may be based on a comparison of the plurality of vector representations to a modified fifth emotion prediction. In some embodiments, the second loss function may be a temporal affectivity extraction loss as described in equation (4). For example, the fifth emotion prediction may be S2 (the emotion prediction 156 of pretrained model 152), and the modified fifth emotion prediction may be S2 as modified in equation (4), specifically, ITiS2YH
Device 800 may include one or more microphones, and one or more image-capture devices (not shown) for user interaction. Device 800 may be connected to a network (e.g., network 660). Digital Avatar 810 may be controlled via local software and/or through software that is at a central server accessed via a network. For example, an AI model may be used to control the behavior of digital avatar 810, and that AI model may be run remotely. In some embodiments, device 800 may be configured to perform functions described herein (e.g., via digital avatar 810). For example, device 800 may perform one or more of the functions as described with reference to computing device 400 or user device 610. For example, it may make emotion predictions based on facial expressions.
Digital avatar 835 may interact with a user via digitally synthesized gestures, digitally synthesized voice, etc. In some embodiments, device 815 may be configured to perform functions described herein (e.g., via digital avatar 835). For example, device 815 may perform one or more of the functions as described with reference to computing device 400 or user device 610. For example, it may make emotion predictions as described herein, and may based avatar 835 behavior based on the predictions.
As shown in
Metrics used in the charts include an unweighted average recall (UAR) and the weighted average recall (WAR). UAR is an unweighted average recall and denotes the accuracy per class divided by the number of classes without consideration of instances per class. WAR is weighted average recall and means general accuracy. accuracy was evaluated for a 3-emotion and 7-emotion category to validate the model on both fine-grain emotion classification and coarse-grain emotion classification. The accuracy for a 7-emotion category is calculated by considering it as the correct answer when selecting the emotion class of the same group as the label in the 7 specific classes. High accuracy for 3 emotions denotes that the model reduces the hierarchy violation. Embodiments of the methods described herein are indicated in the charts as “AEN”.
The devices described above may be implemented by one or more hardware components, software components, and/or a combination of the hardware components and the software components. For example, the device and the components described in the exemplary embodiments may be implemented, for example, using one or more general purpose computers or special purpose computers such as a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a programmable logic unit (PLU), a microprocessor, or any other device which executes or responds instructions. The processing device may perform an operating system (OS) and one or more software applications which are performed on the operating system. Further, the processing device may access, store, manipulate, process, and generate data in response to the execution of the software. For ease of understanding, it may be described that a single processing device is used, but those skilled in the art may understand that the processing device includes a plurality of processing elements and/or a plurality of types of the processing element. For example, the processing device may include a plurality of processors or include one processor and one controller. Further, another processing configuration such as a parallel processor may be implemented.
The software may include a computer program, a code, an instruction, or a combination of one or more of them, which configure the processing device to be operated as desired or independently or collectively command the processing device. The software and/or data may be interpreted by a processing device or embodied in any tangible machines, components, physical devices, computer storage media, or devices to provide an instruction or data to the processing device. The software may be distributed on a computer system connected through a network to be stored or executed in a distributed manner The software and data may be stored in one or more computer readable recording media.
The method according to the exemplary embodiment may be implemented as a program instruction which may be executed by various computers to be recorded in a computer readable medium. At this time, the medium may continuously store a computer executable program or temporarily store it to execute or download the program. Further, the medium may be various recording means or storage means to which a single or a plurality of hardware is coupled and the medium is not limited to a medium which is directly connected to any computer system, but may be distributed on the network. Examples of the medium may include magnetic media such as hard disk, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, magneto-optical media such as optical disks, and ROMs, RAMS, and flash memories to be specifically configured to store program instructions. Further, an example of another medium may include a recording medium or a storage medium which is managed by an app store which distributes application, a site and servers which supply or distribute various software, or the like.
Although the exemplary embodiments have been described above by a limited embodiment and the drawings, various modifications and changes can be made from the above description by those skilled in the art. For example, even when the above-described techniques are performed by different order from the described method and/or components such as systems, structures, devices, or circuits described above are coupled or combined in a different manner from the described method or replaced or substituted with other components or equivalents, the appropriate results can be achieved. It will be understood that many additional changes in the details, materials, steps and arrangement of parts, which have been herein described and illustrated to explain the nature of the subject matter, may be made by those skilled in the art within the principle and scope of the invention as expressed in the appended claims.
The instant application is a nonprovisional of and claim priority under 35 U.S.C. 119 to U.S. provisional application No. 63/457,534, filed Apr. 6, 2023, which is hereby expressly incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
63457534 | Apr 2023 | US |