Virtual environment interaction system based on multi-modal emotion recognition
The multi-modal emotion recognition system combines BiGRU, BERT-BiLSTM and STFT-CNN models to extract and fuse image, voice and text features, which solves the problem of traditional single-modal emotion analysis being susceptible to noise and improves the accuracy of the virtual environment. Immersion and interactivity enable more accurate emotion recognition and natural feedback.
Patent Information
- Application Number
- CN202410906714.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional sentiment analysis methods are mainly based on single-modal data, are easily affected by modal noise, have limited recognition effects, and are difficult to improve the immersion and interactivity of virtual environments.
Using a multi-modal emotion recognition system, through the UGUI image interface module, face detection module, voice content display module and emotional state display module, combined with BiGRU, BERT-BiLSTM and STFT-CNN models, image, voice and text feature extraction and Fusion, using attention mechanism and bidirectional network structure to enhance feature representation and achieve multi-modal sentiment analysis.
It improves the accuracy of emotion recognition and the immersion and interactivity of the virtual environment, reducing external interference. The virtual character can provide natural feedback based on the emotional state, enhancing the user experience.
Smart Images

Figure CN118860152A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of virtual reality, and in particular to a virtual environment interaction system based on multimodal emotion recognition. Background Art
[0002] Virtual Reality (VR) is a new technology in the next generation of human-computer interaction. It uses computers to generate realistic three-dimensional virtual environments, which makes people feel immersed in the virtual environment. With the development of technologies such as virtual reality (VR) and augmented reality (AR), people are constantly exploring new human-computer interaction technologies and real "immersion". In order to improve user experience, it is crucial to identify the user's emotional state and enable the system to respond accordingly based on the user's emotions.
[0003] In the field of sentiment analysis research, emotional expression can come from data of different modalities such as text, vision, and speech. However, traditional sentiment analysis methods are generally based on single-modal data, and the recognition effect is easily affected by modal noise, which has certain limitations. Summary of the invention
[0004] The purpose of the present invention is to provide a virtual environment interaction system based on multimodal emotion recognition, which obtains emotion information from multiple dimensions, improves the accuracy of emotion recognition, and improves the immersion and interactivity of the system.
[0005] In order to achieve the above-mentioned purpose, the technical methods adopted by the present invention are as follows:
[0006] A virtual environment interaction system based on multimodal emotion recognition, comprising:
[0007] UGUI graphical interface module, used to build a virtual environment and provide a graphical interface for users to interact with the system;
[0008] The face detection module is used to detect faces in the input video in real time and display them on the UGUI image interface module;
[0009] The voice content display module is used to receive the voice input by the user, convert the voice into text, and display it on the UGUI image interface module;
[0010] The emotional state display module is used to analyze the face image output by the face detection module, as well as the voice and text output by the voice content display module, identify the user's current emotional state, and display it in the UGUI image interface module;
[0011] A virtual character module is used to build a virtual character. According to different recognition results in the emotional state display module, the virtual character makes corresponding feedback and displays it on the UGUI image interface module;
[0012] Among them, the emotional state display module includes a feature extraction unit, a feature fusion unit, a feature enhancement unit and an emotional prediction unit. The feature extraction unit is used to extract the unimodal features of images, voices and texts respectively; the feature fusion unit is used to perform multimodal fusion on the three unimodal features extracted by the feature extraction unit and output multimodal fusion features; the feature enhancement unit is used to enhance the multimodal fusion features and output new feature representations; the emotional prediction unit is used to output emotional recognition results according to the new feature representations.
[0013] As a limitation: the feature extraction unit performs preliminary feature extraction on text, image and speech, and uses the BiGRU neural network to extract features from text, image and speech respectively. After passing through the fully connected layer and tanh activation layer in turn, they are multiplied by a mask matrix and then selectively discarded. The results are used as text features, speech features, and image features respectively. Finally, the BERT-BiLSTM model is used to further extract text features to obtain text unimodal features, a double-layer stacked convolutional neural network is used to further extract image features to obtain image unimodal features, and the STFT-CNN model is used to further extract speech features to obtain speech unimodal features.
[0014] As a further qualification: BiGRU is a neural network composed of two gated recurrent unit layers in different directions, one of which reads the input sequence from front to back, which is the forward GRU layer, and the other reads the input sequence from back to front, which is the backward GRU layer. Each GRU layer contains a reset gate, an update gate and a hidden state. The BiGRU neural network concatenates the forward and backward outputs to form the final output vector representation; each time step in the BiGRU neural network is calculated using the following formula:
[0015] Forward GRU layer:
[0016]
[0017] The calculation formula of the backward GRU layer is the same as that of the forward GRU layer. In the formula, σ is the sigmoid function, tanh is the hyperbolic tangent activation function, ⊙ is the multiplication of the corresponding positions, and x t is the vector representation of the tth time step of the input sequence, represents the output of the update gate at the tth time step, represents the weight matrix input to the update gate, represents the weight matrix of the hidden state in the update gate, represents the bias vector in the update gate, is the output of the hidden state at the t-1th time step, represents the output of the reset gate at the tth time step, represents the weight matrix input to the reset gate, represents the weight matrix of the hidden state in the reset gate, represents the bias vector in the reset gate, represents the output of the candidate hidden state at the tth time step, represents the weight matrix of the input in the candidate hidden state, represents the weight matrix of the hidden state in the candidate hidden state, represents the bias vector in the candidate hidden state, represents the output of the hidden state at the tth time step, Represents the output of the update gate at the t-1th time step; in the BiGRU model, the parameters of the forward GRU layer and the backward GRU layer are independent, and they each have a set of input weight matrices, hidden state weight matrices, and bias vectors.
[0018] As a further limitation: the BERT-BiLSTM model is used to further extract text features, specifically:
[0019] Text feature set U txt = {u1 txt , u2 txt ,…,u i txt ,…,u n txt},First, use the pre-trained model BERT to train the text feature set U txt Each text u in i txt For vectorized representation, the formula is:
[0020]
[0021] Get the text vector representation set U txt’ = {u1 txt’ ,u2 txt’ ,…,u i txt’ ,…,u n txt’}, where M is the sentence length and d is the vector dimension;
[0022] Then use the different gating mechanisms of the BiLSTM model to learn the bidirectional sequence representation of the text. The formula is:
[0023]
[0024] Among them, t i is the text feature output by the BiLSTM model, h i-1 is the hidden layer state of the previous text vector, ci-1 is the memory cell state of the previous text vector;
[0025] Finally, t i Input into a fully connected layer to obtain the normalized text unimodal feature F mapped to the sample tag space txt , the formula is:
[0026] F txt =W txt t i +b txt ,
[0027] Among them, W txt Represents the weight matrix of text features, b txt The bias term representing the text feature.
[0028] As a further limitation: a double-layer stacked convolutional neural network is used to further extract image features, specifically:
[0029] First, the feature map containing the image features is sent to the convolution layer through the input layer. The convolution layer performs convolution operation on the image by sliding the convolution kernel, and then passes through the pooling layer for dimensionality reduction, extracts the image modal features and flattens them. Finally, the image features p output by the pooling layer are i Input into a fully connected layer to obtain the normalized image unimodal feature F mapped to the sample label space img , the formula is:
[0030] F img =W img p i +b img ,
[0031] Among them, W img The weight matrix representing the image features, p i represents the image features output by the pooling layer, b img A bias term representing image features.
[0032] As a further limitation: the STFT-CNN model is used to further extract the speech features, specifically: first, the speech features are processed by frame division, and the speech feature set In the example, for a given frame length l and number of frames n, each speech feature Divide into fixed-length overlapping feature sequences Secondly, each frame is windowed, and the speech feature f(τ) at each moment is multiplied by the window function h(τ-t) to obtain a slice of the speech feature near the analysis time point t. The formula is:
[0033]
[0034] In the formula, e -j2πgτ is the kernel function of Fourier transform, g represents frequency;
[0035] Then use the STFT algorithm to perform Fourier transform, integrate the slices over the time τ to obtain the spectrum of the speech signal f i ′;
[0036] Finally, the spectrum graph f i ′ is input into a fully connected layer to obtain the normalized speech unimodal feature F mapped to the sample tag space aud , the formula is:
[0037] F aud =W aud f i ′+b aud ,
[0038] Among them, W aud The weight matrix representing the speech features, b aud A bias term representing speech features.
[0039] As another limitation: the attention mechanism is used in the feature fusion unit for multimodal fusion. First, the text unimodal features, speech unimodal features and image unimodal features are spliced together by column, and the spliced features are output; then the spliced features of each sentence are processed cyclically, and the spliced features of each sentence are passed through a fully connected layer, and then activated through a tanh layer. The activation value of the tanh layer is matrix multiplied with a matrix with a dimension of (100, 1) that obeys a normal distribution with a standard deviation of 0.01. The multiplication result is passed through a softmax layer to obtain an attention weight vector. The attention weight vector is matrix multiplied with the splicing feature to obtain the multimodal fusion feature of each sentence. The calculation formula is:
[0040] P F =tanh(W F B),
[0041]
[0042] F=B·α T ,
[0043] In the formula, B is the splicing feature, W F is the weight matrix of the fully connected layer, W F ∈R d×d , is a matrix that obeys the normal distribution, ω F ∈R d , α is the attention weight vector in the feature fusion unit, F is the multimodal fusion feature, F∈Rd .
[0044] As a further limitation: the feature enhancement unit adopts an attention-based bidirectional network structure for feature enhancement, and the attention-based bidirectional network structure is composed of an attention mechanism and a BiGRU neural network; the N multimodal fusion features F outputted from the feature fusion unit are inputted into the BiGRU neural network of the feature enhancement unit, and the context-aware representation feature H is obtained according to the multimodal fusion features, where H = [h1, h2, …, h ζ ,…,h N ],H∈R 2d×N ,h ζ ∈R 2d , represents the feature H and the attention weight vector α ζ Multiply the corresponding positions, assign the attention weight to the representation feature, and finally assign the representation feature r ζ and the original representation feature h ζ Multiply them by the weight matrix respectively and then add the matrices to output the new feature representation The formula is:
[0045] P ζ =tanh(W h [ζ]·H),
[0046] ζ=softmax(ω[ζ] T ·P ζ ),
[0047]
[0048] Where P ζ ∈R 2d×N ,ζ∈R N , r ζ ∈R 2d ,W h ∈R N×2h×2d ,ω∈R N×d ,W h and ω is the weight matrix, W h [ζ] and ω[ζ] are used by the ζth attention model of the attention mechanism, ζ∈[1,N], H is the representation feature of the BiGRU neural network output of the feature enhancement unit, r ζ is the discourse representation feature given attention weight, α ζ is the attention weight vector in the feature enhancement unit, W p ∈R N×2d×2d ,W x ∈R N×2d×2d ,W p and W x is the weight matrix that needs to be learned during training, Represents the new feature representation output by the feature enhancement unit.
[0049] As a further limitation: the emotion prediction unit receives each output in the feature enhancement module and performs emotion classification. The classification network consists of 3 fully connected layers of size 200 and 1 fully connected layer of the same size as the number of emotion types expressed in the input video. Finally, a softmax layer is connected for classification and the prediction result is output. A loss function is set for the last connected softmax layer, and a loss function L of a batch of category features is output for the fully connected layer. softmax The calculation formula is:
[0050]
[0051] Where m is the number of batches output by the fully connected layer, |C| is the number of category features in a batch, and z θ is the category feature of the current output of the fully connected layer with the same size as the number of emotional categories expressed in the input video, z k The first to last category features output by the fully connected layer are the same size as the number of emotional categories expressed in the input video;
[0052] Secondly, the L2 norm is used to calculate the error of each trainable parameter to prevent overfitting. The calculation formula is as follows:
[0053]
[0054] In the formula, S is a trainable parameter, sum is a summation function, and A output For the result;
[0055] The total loss function L Loss The calculation formula is:
[0056]
[0057] Where λ is a hyperparameter, M is the total number of utterances in a batch, and K is the total number of trainable parameters.
[0058] As a final limitation: the system also includes a speech waveform visualization module, which displays the changes in waveform amplitude on the UGUI image interface module based on the input speech signal.
[0059] Due to the adoption of the above scheme, the present invention has the following beneficial effects compared with the prior art:
[0060] (1) The virtual environment interaction system based on multimodal emotion recognition provided by the present invention combines the multimodal emotion recognition algorithm with the virtual environment natural interaction technology, which can better complete the emotional interaction process, increase the immersion and interactivity of the virtual environment interaction system, and improve the user experience; in addition, compared with single modality, multimodal emotion recognition can utilize the complementarity between different modalities and fully explore the complementary information between modalities. While improving the emotion recognition rate, it can also largely make up for the weakness of single modality that is easily disturbed by the external environment. At the same time, the virtual character can present corresponding expressions and body movements according to different emotional states;
[0061] (2) The virtual environment interaction system based on multimodal emotion recognition provided by the present invention performs multimodal emotion analysis in a virtual environment, which can fully capture the interaction between text, image, and audio modalities, and at the same time reduce redundant information in model training; in the feature fusion unit, based on attention fusion, a multimodal fusion feature with good performance can be obtained; in the feature enhancement unit, the attention mechanism is combined with the bidirectional recurrent network BiGRU, which can fully capture the context information of the multimodal fusion feature and obtain a new representation with richer and more comprehensive information; multimodal fusion is used to obtain emotion information from multiple dimensions, and the accuracy of emotion recognition is improved by integrating information from multiple perceptual modalities;
[0062] (3) The virtual environment interaction system based on multimodal emotion recognition provided by the present invention adopts BiGRU network for feature extraction and feature enhancement. Compared with LSTM / BiLSTM, BiGRU has a simpler gating mechanism, higher computational efficiency, can provide more comprehensive context information, capture long-distance dependencies, and help improve the performance of emotion recognition. It has faster training speed and better robustness than traditional RNN models.
[0063] (4) The virtual environment interaction system based on multimodal emotion recognition provided by the present invention further extracts speech features through the STFT-CNN model. STFT converts the audio signal of the speech into a frequency domain representation, which can reduce the feature dimension, make the model lighter, and improve the computational efficiency; STFT can compress the audio signal information, retain the key time-frequency features of the audio, help reduce redundant information, and improve the generalization ability of the model; STFT can effectively capture the time-frequency information of the audio signal and extract discriminative features, thereby enhancing the performance of speech emotion recognition; the speech feature extraction method based on STFT-CNN has the same input dimension as the text and image feature representation method, which is conducive to improving the multimodal fusion effect and the accuracy of multimodal emotion recognition.
[0064] The present invention is applicable to virtual environment interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0066] Figure 1 A structural block diagram of a virtual environment interaction system based on multimodal emotion recognition according to an embodiment of the present invention;
[0067] Figure 2 This is a structural block diagram of the emotional state display module of an embodiment of the present invention;
[0068] Figure 3 The present invention is a schematic diagram of the process of performing preliminary feature extraction on text, image and speech. DETAILED DESCRIPTION
[0069] The present invention is further described below in conjunction with embodiments, but those skilled in the art should understand that the present invention is not limited to the following embodiments, and any improvements and equivalent changes made based on the specific embodiments of the present invention are within the scope of protection of the claims of the present invention.
[0070] Embodiment A virtual environment interaction system based on multimodal emotion recognition
[0071] A virtual environment interaction system based on multimodal emotion recognition, its structural block diagram is as follows Figure 1 As shown, including:
[0072] UGUI graphical interface module uses Unity3D technology to build a virtual environment and provide a graphical interface for users to interact with the system;
[0073] The face detection module is used to detect faces in the input video in real time and display them on the UGUI image interface module;
[0074] The voice content display module is used to receive the voice input by the user, convert the voice into text, and display it on the UGUI image interface module;
[0075] The emotional state display module is used to analyze the face image output by the face detection module, as well as the voice and text output by the voice content display module, to identify the user's current emotional state and recognition rate, which mainly includes the three emotional states of happiness, anger and sadness. When the user's emotional state is identified, the corresponding emotional category and recognition rate will be displayed on the interface through the UGUI image interface module;
[0076] The virtual character module is used to build the virtual character. This module is associated with the recognition results in the emotional state display module. According to different recognition results, the virtual character makes corresponding feedback and displays it on the UGUI image interface module to deepen the vividness, interaction and autonomy of the natural interaction in the virtual environment. The face of the virtual character is modeled by a deformer to complete the expression display of different emotional states. The actions of the virtual character are mainly realized by the behavior control script, which will intuitively display the corresponding emotional state through the overall mental outlook of the virtual character based on different emotion recognition results.
[0077] The speech waveform visualization module is used to display the changes in waveform amplitude on the UGUI image interface module according to the input speech signal, vividly showing the changing process of the waveform and deepening the presence of the speech signal.
[0078] The structure diagram of the emotional state display module in this embodiment is as follows Figure 2 As shown, it includes a feature extraction unit, a feature fusion unit, a feature enhancement unit and an emotion prediction unit. The feature extraction unit is used to extract the unimodal features of the image, speech and text respectively; the feature fusion unit is used to perform multimodal fusion on the three unimodal features extracted by the feature extraction unit and output the multimodal fusion feature; the feature enhancement unit is used to enhance the multimodal fusion feature and output a new feature representation; the emotion prediction unit is used to output the emotion recognition result according to the new feature representation.
[0079] The data processing process in the feature extraction unit is as follows:
[0080] Perform preliminary feature extraction on text, images and speech, such as Figure 3 As shown in the figure, the BiGRU neural network is used to extract features from text, image and speech respectively. After passing through a fully connected layer of size 100, it passes through a tanh activation layer and is multiplied by a mask matrix. Then, it is selectively discarded and the dimensions of the obtained results are adjusted to be consistent, which are used as text features, speech features and image features respectively.
[0081] BiGRU is a neural network composed of two gated recurrent unit layers in different directions, one of which reads the input sequence from front to back, which is the forward GRU layer, and the other reads the input sequence from back to front, which is the backward GRU layer. Each GRU layer contains a reset gate, an update gate and a hidden state. The BiGRU neural network concatenates the forward and backward outputs to form the final output vector representation; each time step in the BiGRU neural network is calculated using the following formula:
[0082] Forward GRU layer:
[0083]
[0084] The calculation formula of the backward GRU layer is the same as that of the forward GRU layer. In the formula, σ is the sigmoid function, tanh is the hyperbolic tangent activation function, ⊙ is the multiplication of the corresponding positions, and x t is the vector representation of the tth time step of the input sequence, represents the output of the update gate at the tth time step, represents the weight matrix input to the update gate, represents the weight matrix of the hidden state in the update gate, represents the bias vector in the update gate, is the output of the hidden state at the t-1th time step, represents the output of the reset gate at the tth time step, represents the weight matrix input to the reset gate, represents the weight matrix of the hidden state in the reset gate, represents the bias vector in the reset gate, represents the output of the candidate hidden state at the tth time step, represents the weight matrix of the input in the candidate hidden state, represents the weight matrix of the hidden state in the candidate hidden state, represents the bias vector in the candidate hidden state, represents the output of the hidden state at the tth time step, Represents the output of the update gate at the t-1th time step; in the BiGRU model, the parameters of the forward GRU layer and the backward GRU layer are independent, and they each have a set of input weight matrices, hidden state weight matrices, and bias vectors;
[0085] Finally, the BERT-BiLSTM model is used to further extract text features to obtain text unimodal features, a double-layer stacked convolutional neural network is used to further extract image features to obtain image unimodal features, and the STFT-CNN model is used to further extract speech features to obtain speech unimodal features.
[0086] The BERT-BiLSTM model is used to further extract text features, specifically:
[0087] Text feature set U txt = {u1 txt , u2 txt ,…,u i txt ,…,u n txt},First, use the pre-trained model BERT to train the text feature set U txt Each text u in i txt For vectorized representation, the formula is:
[0088]
[0089] Get the text vector representation set U txt’ = {u1 txt’ ,u2 txt’ ,…,u i txt’ ,…,u n txt’}, where M is the sentence length and d is the vector dimension;
[0090] Then use the different gating mechanisms of the BiLSTM model to learn the bidirectional sequence representation of the text. The formula is:
[0091]
[0092] Among them, t i is the text feature output by the BiLSTM model, h i-1 is the hidden layer state of the previous text vector, c i-1 is the memory cell state of the previous text vector;
[0093] Finally, t i Input into a fully connected layer to obtain the normalized text unimodal feature F mapped to the sample tag space txt , the formula is:
[0094] F txt =W txt t i +b txt ,
[0095] Among them, W txt Represents the weight matrix of text features, b txt The bias term representing the text feature.
[0096] A double-layer stacked convolutional neural network is used to further extract image features. The double-layer stacked convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer, specifically:
[0097] First, the feature map containing the image features is sent to the convolution layer through the input layer. The convolution layer performs convolution operation on the image by sliding the convolution kernel, and then passes through the pooling layer for dimensionality reduction, extracts the image modal features and flattens them. Finally, the image features p output by the pooling layer are i Input into a fully connected layer to obtain the normalized image unimodal feature F mapped to the sample label space img , the formula is:
[0098] F img =W img p i+b img ,
[0099] Among them, W img The weight matrix representing the image features, p i represents the image features output by the pooling layer, b img A bias term representing image features.
[0100] The STFT-CNN model is used to further extract speech features, specifically:
[0101] First, the speech features are framed and processed. In the example, for a given frame length l and number of frames n, each speech feature Divide into fixed-length overlapping feature sequences Secondly, each frame is windowed, and the speech feature f(τ) at each moment is multiplied by the window function h(τ-t) to obtain a slice of the speech feature near the analysis time point t. The formula is:
[0102]
[0103] In the formula, e -j2πgτ is the kernel function of Fourier transform, g represents frequency;
[0104] Then use the STFT algorithm to perform Fourier transform, integrate the slices over the time τ to obtain the spectrum of the speech signal f i ';
[0105] Finally, the spectrum f i 'Input into a fully connected layer to obtain the normalized speech unimodal feature F mapped to the sample tag space aud , the formula is:
[0106] F aud =W aud f i ′+b aud ,
[0107] Among them, W aud The weight matrix representing the speech features, b aud A bias term representing speech features.
[0108] The data processing process in the feature fusion unit is as follows:
[0109] The attention mechanism is used for multimodal fusion. First, the text unimodal features, speech unimodal features and image unimodal features are spliced together by column to output the spliced features. Then, the spliced features of each sentence are processed cyclically. The spliced features of each sentence are passed through a fully connected layer and then activated through a tanh layer. The activation value of the tanh layer is matrix-multiplied with a matrix with a dimension of (100, 1) and a normal distribution with a standard deviation of 0.01. The multiplication result is passed through a softmax layer to obtain an attention weight vector. The matrix multiplication of the attention weight vector and the splicing feature is the multimodal fusion feature of each sentence. The calculation formula is:
[0110] P F =tanh(W F B),
[0111]
[0112] F=B·α T ,
[0113] In the formula, B is the splicing feature, W F is the weight matrix of the fully connected layer, W F ∈R d×d , is a matrix that obeys the normal distribution, ω F ∈R d , α is the attention weight vector in the feature fusion unit, F is the multimodal fusion feature, F∈R d .
[0114] The data processing process in the feature enhancement unit is as follows:
[0115] The attention-based bidirectional network structure is used for feature enhancement. The attention-based bidirectional network structure consists of an attention mechanism and a BiGRU neural network. The N multimodal fusion features F output from the feature fusion unit are input into the BiGRU neural network of the feature enhancement unit. The context-aware representation feature H is obtained based on the multimodal fusion features. H = [h1, h2, …, h ζ ,…,h N ],H∈R 2d×N ,h ζ ∈R 2d , represents the feature H and the attention weight vector α ζ Multiply the corresponding positions, assign the attention weight to the representation feature, and finally assign the representation feature r ζ and the original representation feature h ζ Multiply them by the weight matrix respectively and then add the matrices to output the new feature representation The formula is:
[0116] P ζ =tanh(W h [ζ]·H),
[0117] α ζ =softmax(ω[ζ] T ·P ζ ),
[0118]
[0119]
[0120] Where P ζ ∈R 2d×N , α ζ ∈R N , r ζ ∈R 2d ,W h ∈R N×2h×2d ,ω∈R N×d ,W h and ω is the weight matrix, W h [ζ] and ω[ζ] are used by the ζth attention model of the attention mechanism, ζ∈[1,N], H is the representation feature of the BiGRU neural network output of the feature enhancement unit, r ζ is the discourse representation feature given attention weight, α ζ is the attention weight vector in the feature enhancement unit, W p ∈R N×2d×2d ,W x ∈R N×2d×2d ,W p and W x is the weight matrix that needs to be learned during training, Represents the new feature representation output by the feature enhancement unit.
[0121] The data processing process in the emotion prediction unit is as follows:
[0122] The emotion prediction unit receives each output from the feature enhancement module and performs emotion classification. The classification network consists of three fully connected layers of size 200 and one fully connected layer of the same size as the number of emotion types expressed in the input video. Finally, a softmax layer is connected for classification and the prediction result is output. The loss function is set for the last connected softmax layer, and the loss function L of a batch category feature is output for the fully connected layer. softmax The calculation formula is:
[0123]
[0124] Where m is the number of batches output by the fully connected layer, |C| is the number of category features in a batch, and z θ is the category feature of the current output of the fully connected layer with the same size as the number of emotional categories expressed in the input video, z k The first to last category features output by the fully connected layer are the same size as the number of emotional categories expressed in the input video;
[0125] Secondly, the L2 norm is used to calculate the error of each trainable parameter to prevent overfitting. The calculation formula is as follows:
[0126]
[0127] In the formula, S is a trainable parameter, sum is a summation function, and A output For the result;
[0128] The total loss function L Loss The calculation formula is:
[0129]
[0130] In the formula, λ is a hyperparameter, M is the total number of utterances in a batch, and K is the total number of trainable parameters. During the optimization process, the loss function minimizes the difference between the predicted probabilities of different categories and the true labels, encouraging the model to better distinguish different categories in the probability output, helping the model to better learn the boundaries and feature differences between categories, and improving the accuracy of classification. In addition, when calculating the loss, the loss function automatically considers the relationship between multiple categories, converts the original scores into probability distributions through the Softmax function, and ensures that the sum of the probabilities of all categories is 1, which helps to solve the ambiguity and uncertainty in the classification problem and makes the model output more reasonable and explainable.
Claims
1. A virtual environment interaction system based on multimodal emotion recognition, characterized in that: include: UGUI graphical interface module, used to build a virtual environment and provide a graphical interface for users to interact with the system; The face detection module is used to detect faces in the input video in real time and display them on the UGUI image interface module; The voice content display module is used to receive the voice input by the user, convert the voice into text, and display it on the UGUI image interface module; The emotional state display module is used to analyze the face image output by the face detection module, as well as the voice and text output by the voice content display module, identify the user's current emotional state, and display it in the UGUI image interface module; A virtual character module is used to build a virtual character. According to different recognition results in the emotional state display module, the virtual character makes corresponding feedback and displays it on the UGUI image interface module; Among them, the emotional state display module includes a feature extraction unit, a feature fusion unit, a feature enhancement unit and an emotional prediction unit. The feature extraction unit is used to extract the unimodal features of images, voices and texts respectively; the feature fusion unit is used to perform multimodal fusion on the three unimodal features extracted by the feature extraction unit and output multimodal fusion features; the feature enhancement unit is used to enhance the multimodal fusion features and output new feature representations; the emotional prediction unit is used to output emotional recognition results according to the new feature representations.
2. The virtual environment interaction system based on multimodal emotion recognition according to claim 1, characterized in that: The feature extraction unit performs preliminary feature extraction on text, image and speech, and uses the BiGRU neural network to extract features from text, image and speech respectively. After passing through the fully connected layer and tanh activation layer in turn, they are multiplied by a mask matrix and then selectively discarded. The results are used as text features, speech features and image features respectively. Finally, the BERT-BiLSTM model is used to further extract text features to obtain text unimodal features, and a double-layer stacked convolutional neural network is used to further extract image features to obtain image unimodal features. The STFT-CNN model is used to further extract speech features to obtain speech unimodal features.
3. The virtual environment interaction system based on multimodal emotion recognition according to claim 2, characterized in that: BiGRU is a neural network composed of two gated recurrent unit layers in different directions, one of which reads the input sequence from front to back, which is the forward GRU layer, and the other reads the input sequence from back to front, which is the backward GRU layer. Each GRU layer contains a reset gate, an update gate and a hidden state. The BiGRU neural network concatenates the forward and backward outputs to form the final output vector representation; each time step in the BiGRU neural network is calculated using the following formula: Forward GRU layer: The calculation formula of the backward GRU layer is the same as that of the forward GRU layer. In the formula, σ is the sigmoid function, tanh is the hyperbolic tangent activation function, ⊙ is the multiplication of the corresponding positions, and x t is the vector representation of the tth time step of the input sequence, represents the output of the update gate at the tth time step, represents the weight matrix input to the update gate, represents the weight matrix of the hidden state in the update gate, represents the bias vector in the update gate, is the output of the hidden state at the t-1th time step, represents the output of the reset gate at the tth time step, represents the weight matrix input to the reset gate, represents the weight matrix of the hidden state in the reset gate, represents the bias vector in the reset gate, represents the output of the candidate hidden state at the tth time step, represents the weight matrix of the input in the candidate hidden state, represents the weight matrix of the hidden state in the candidate hidden state, represents the bias vector in the candidate hidden state, represents the output of the hidden state at the tth time step, Represents the output of the update gate at the t-1th time step; in the BiGRU model, the parameters of the forward GRU layer and the backward GRU layer are independent, and they each have a set of input weight matrices, hidden state weight matrices, and bias vectors.
4. A virtual environment interaction system based on multimodal emotion recognition according to claim 2 or 3, characterized in that: The BERT-BiLSTM model is used to further extract text features, specifically: Text feature set U txt = {u1 txt , u2 txt ,…,u i txt ,…,u n txt },First, use the pre-trained model BERT to train the text feature set U txt Each text u in i txt For vectorized representation, the formula is: Get the text vector representation set U txt’ = {u1 txt’ ,u2 txt’ ,…,u i txt’ ,…,u n txt’ }, where M is the sentence length and d is the vector dimension; Then use the different gating mechanisms of the BiLSTM model to learn the bidirectional sequence representation of the text. The formula is: Among them, t i is the text feature output by the BiLSTM model, h i-1 is the hidden layer state of the previous text vector, c i-1 is the memory cell state of the previous text vector; Finally, t i Input into a fully connected layer to obtain the normalized text unimodal feature F mapped to the sample tag space txt , the formula is: F txt =W txt t i +b txt , Among them, W txt Represents the weight matrix of text features, b txt The bias term representing the text feature.
5. A virtual environment interaction system based on multimodal emotion recognition according to claim 2 or 3, characterized in that: A double-layer stacked convolutional neural network is used to further extract image features, specifically: First, the feature map containing the image features is sent to the convolution layer through the input layer. The convolution layer performs convolution operation on the image by sliding the convolution kernel, and then passes through the pooling layer for dimensionality reduction, extracts the image modal features and flattens them. Finally, the image feature p output by the pooling layer is i Input into a fully connected layer to obtain the normalized image unimodal feature F mapped to the sample label space img , the formula is: F img =W img p i +b img , Among them, W img The weight matrix representing the image features, p i represents the image features output by the pooling layer, b img A bias term representing image features.
6. A virtual environment interaction system based on multimodal emotion recognition according to claim 2 or 3, characterized in that: The STFT-CNN model is used to further extract speech features, specifically: First, the speech features are framed and processed. In the example, for a given frame length l and number of frames n, each speech feature is Divide into fixed-length overlapping feature sequences Secondly, each frame is windowed, and the speech feature f(τ) at each moment is multiplied by the window function h(τ-t) to obtain a slice of the speech feature near the analysis time point t. The formula is: In the formula, e -j2πgτ is the kernel function of Fourier transform, g represents frequency; Then use the STFT algorithm to perform Fourier transform, integrate the slices over the time τ to obtain the spectrum f′ of the speech signal i ; Finally, the spectrum graph f i ′ is input into a fully connected layer to obtain the normalized speech unimodal feature F mapped to the sample tag space aud , the formula is: F aud =W aud f′ i +b aud , Among them, W aud The weight matrix representing the speech features, b aud A bias term representing speech features.
7. The virtual environment interaction system based on multimodal emotion recognition according to claim 1, characterized in that: The feature fusion unit uses the attention mechanism for multimodal fusion. First, the text unimodal features, speech unimodal features, and image unimodal features are concatenated together by column, and the concatenated features are output; Then, the concatenated features of each sentence are processed cyclically, and the concatenated features of each sentence are passed through a fully connected layer, and then activated through a tanh layer. The activation value of the tanh layer is matrix-multiplied with a matrix of dimension (100, 1) with a standard deviation of 0.01 and a normal distribution. The multiplication result is passed through a softmax layer to obtain an attention weight vector. The matrix multiplication of the attention weight vector and the concatenated features is the multimodal fusion feature of each sentence. The calculation formula is: P F =tanh(W F ·B), F=B·a T , In the formula, B is the splicing feature, W F is the weight matrix of the fully connected layer, W F ∈R d×d , is a matrix that obeys the normal distribution, ω F ∈R d , α is the attention weight vector in the feature fusion unit, F is the multimodal fusion feature, F∈R d .
8. The virtual environment interaction system based on multimodal emotion recognition according to claim 7, characterized in that: The feature enhancement unit uses an attention-based bidirectional network structure for feature enhancement. The attention-based bidirectional network structure consists of an attention mechanism and a BiGRU neural network. The N multimodal fusion features F output from the feature fusion unit are input into the BiGRU neural network of the feature enhancement unit. According to the multimodal fusion features, the context-aware representation feature H is obtained, where H = [h1, h2, …, h ζ ,…,h N ],H∈R 2d×N ,h ζ ∈R 2d , represents the feature H and the attention weight vector α ζ Multiply the corresponding positions, assign the attention weight to the representation feature, and finally assign the representation feature r ζ and the original representation feature h ζ Multiply them by the weight matrix respectively and then add the matrices to output the new feature representation The formula is: P ζ =tanh(W h [ζ]·H), a ζ =softmax(ω[ζ] T ·P ζ ), Where P ζ ∈R 2d×N , α ζ ∈R N , r ζ ∈R 2d ,W h ∈R N×2h×2d ,ω∈R N×d ,W h and ω is the weight matrix, W h [ζ] and ω[ζ] are used by the ζth attention model of the attention mechanism, ζ∈[1,N], H is the representation feature of the BiGRU neural network output of the feature enhancement unit, r ζ is the discourse representation feature given attention weight, α ζ is the attention weight vector in the feature enhancement unit, W p ∈R N×2d×2d ,W x ∈R N×2d×2d ,W p and W x is the weight matrix that needs to be learned during training, Represents the new feature representation output by the feature enhancement unit.
9. The virtual environment interaction system based on multimodal emotion recognition according to claim 8, characterized in that: The emotion prediction unit receives each output from the feature enhancement module and performs emotion classification. The classification network consists of three fully connected layers of size 200 and one fully connected layer of the same size as the number of emotion types expressed in the input video. Finally, a softmax layer is connected for classification and the prediction result is output. The loss function is set for the last connected softmax layer, and the loss function L of a batch category feature is output for the fully connected layer. softmax The calculation formula is: Where m is the number of batches output by the fully connected layer, |C| is the number of category features in a batch, and z θ is the category feature of the current output of the fully connected layer with the same size as the number of emotional categories expressed in the input video, z k The first to last category features output by the fully connected layer are the same size as the number of emotional categories expressed in the input video; Secondly, the L2 norm is used to calculate the error of each trainable parameter to prevent overfitting. The calculation formula is as follows: In the formula, S is a trainable parameter, sum is a summation function, and A output For the result; The total loss function L Loss The calculation formula is: Where λ is a hyperparameter, M is the total number of utterances in a batch, and K is the total number of trainable parameters.
10. The virtual environment interaction system based on multimodal emotion recognition according to claim 1, characterized in that: It also includes a speech waveform visualization module, which displays the changes in waveform amplitude on the UGUI image interface module according to the input speech signal.
Citation Information
Cited By
Dynamic image fusion method for big data and artificial intelligence virtual human panoramic live broadcast
CN119299746A
