Speech emotion recognition model based on MFAN and construction method thereof
By adopting a MFAN-based model in speech emotion recognition, using discourse-level and multi-scale feature extraction modules combined with fully connected layers, the problem of extracting different granularity features and focusing on time domain information is solved, and better speech emotion recognition performance is achieved.
Patent Information
- Application Number
- CN202410702210.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-01
- Publication Date
- 2024-08-23
AI Technical Summary
Existing speech emotion recognition technology is difficult to extract features of different granularities and focus on the time domain information of speech, resulting in poor recognition results.
Using a speech emotion recognition model based on MFAN, through the discourse-level feature extraction module and multi-scale feature extraction module, the convolution block and multi-scale attention mechanism are used to extract features of different granularities, fuse them, and combine with the fully connected layer for final recognition .
It improves the accuracy and performance of speech emotion recognition, can extract emotion-related information more comprehensively and richly, and obtain better recognition results.
Smart Images

Figure CN118538248A
Abstract
Description
Technical Field
[0001] The present invention relates to a speech emotion recognition model based on MFAN and a construction method thereof. Background Art
[0002] Emotions are an indispensable part of human daily life. Correctly understanding each other's emotions in interpersonal communication is the key to friendly communication, and accurate emotional understanding also plays a vital role in human-computer interaction. For this reason, the field of emotional computing has received great attention in the past decade. In human daily communication, facial expressions, body movements, tone of voice, text, etc. will reflect a person's emotional state. Among them, voice communication not only occupies a considerable part of human daily communication, but also conveys rich emotions, which plays an important role in emotion recognition. Emotional computing based on speech signals is called speech emotion recognition (SER). Speech emotion recognition has been applied in many fields, such as human-computer interaction, mental health analysis, customer service detection, etc. However, due to the variability and ambiguity of speech signals and possible noise interference, it poses a huge obstacle to the correct recognition of emotions in speech.
[0003] Traditional speech emotion recognition usually uses machine learning methods, such as hidden Markov models, naive Bayes models and K-nearest neighbor algorithms. In order to accurately identify the speaker's emotional state, appropriate acoustic features must be extracted from the speech. Common manually extracted features include zero-crossing rate, Mel-frequency cepstral coefficients (MFCC), speech spectrogram, logarithmic Mel-frequency spectrogram, etc.
[0004] With the development of deep learning, researchers have explored various methods to extract high-level emotional embedding representations from these features to improve classification accuracy. For example, using DNN to extract deep learning representations has achieved good results, and using basic CNN to obtain feature information by learning fixed-scale features. However, emotions are expressed through various rhythmic changes in speech, and it is difficult to extract features of different granularities using networks such as CNN and it is impossible to focus on the emotional information in the time domain of speech, making it difficult to obtain good recognition performance.
[0005] In summary, although the above methods have achieved some good results, there are still problems such as being unable to extract features of different granularities and being unable to focus on the time domain information of speech, making it difficult to obtain better recognition effects. Summary of the invention
[0006] The present invention provides a speech emotion recognition model based on MFAN and a construction method thereof, which are used to solve the problem that features of different granularities cannot be extracted and time domain information of speech cannot be paid attention to, and it is difficult to obtain a better recognition effect.
[0007] A speech emotion recognition model based on MFAN and a construction method thereof, comprising:
[0008] Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it;
[0009] Constructing a speech-level feature extraction module, which inputs the log-mel spectrogram into the speech-level feature extraction module and uses a convolutional block to expand the model receptive field to better extract speech-level sentiment features;
[0010] Constructing a multi-scale feature extraction module, wherein the speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales;
[0011] The features of different granularities extracted by the two modules are integrated to obtain competitive sentiment features;
[0012] A fully connected layer is constructed, and the fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
[0013] In a specific implementation, the feature engineering of the input audio comprises the following specific steps:
[0014] The log-mel spectrogram input to the speech-level feature extraction module requires first dividing the audio signal into short time periods. Usually, a window function (such as a Hamming window) is used to split the audio signal into overlapping frames to reduce spectral leakage. Then, a Fourier transform is performed on each frame of the signal to convert the time domain signal into a frequency domain signal to obtain the frequency domain information of each frame. Subsequently, the frequency domain information is passed through the mel filter bank. These filters are evenly distributed on the mel frequency scale. The energy value after filtering by the mel filter bank is logarithmically transformed to obtain a logarithmic mel spectrogram.
[0015] The speech signal input to the multi-scale feature extraction module is not processed by denoising, filtering or pitch shifting, so that the complete emotional information is preserved. By combining these two different inputs, more comprehensive and richer emotion-related information can be extracted.
[0016] In a specific implementation, the construction of the speech-level feature extraction module includes:
[0017] First, three 2D convolution blocks are used. The first two convolution blocks use 3×3 convolution kernels, and the third convolution block uses 2×1 convolution kernels. The convolution blocks are used to reduce the output frequency and time resolution and expand the receptive field of the model. Then the MLP block is used to enable the model to better extract the global features of the speech. Finally, the time mean pooling and the time maximum pooling are used and added together to adapt to the advantages of the average and maximum statistics.
[0018] In a specific embodiment, the construction of a multi-scale feature extraction module includes:
[0019] First, the speech signal is input into a one-dimensional convolution block with a kernel size of 1. Since the length of the speech signal is long, we use the Downsample block to downsample the signal to reduce the network complexity. In the Downsample block, we use a one-dimensional convolution kernel with a kernel size of 5, and then input it into the residual block. We stack 4 Downsample blocks and finally get the output M∈R b×c×l , where b represents the batch size, c represents the number of channels, and l represents the sequence length. In order to obtain emotional information of different scales, we use the multi-scale attention mechanism to extract emotional information of different scales from M. First, we use the field of view expansion block to gradually expand the receptive field. In the field of view expansion block, the input vector M∈R b×c×l Input into the modified residual block to obtain vector Z. The modified residual block formula is as follows:
[0020] Z=h(M)+F1(M,W1)+F2(M,W2)
[0021] Where h(M) = W3M, where W3 represents a one-dimensional convolution with a kernel size of 1.
[0022] F1(M,W1)=LeakyReLU(BN(h1(M)))
[0023] And h1(M)=W1M, W1 represents a one-dimensional convolution with a kernel size of 7, and the F2(M,W2) convolution block is replaced by a convolution block with a kernel size of 1. Compared with the traditional ReLU activation function, the LeakyReLU activation function is used as the activation function here, and the formula is as follows:
[0024] LeakyReLU(x)=max(0,x)+α·min(0,x)
[0025] Where x is the input and α is the parameter. The output vector M1 after the above-mentioned field of view expansion block will continue to be input into the field of view expansion block to obtain M2, and similarly to obtain M3. The output feature vector M i (i=1,2,3,) input to M i After passing through the transformer encoder, we get Y i We will Y i Finally, we get the output F of the multi-scale feature extraction module. M , the formula is as follows:
[0026] F M =concat([Y1,Y2,Y3],dim=1)
[0027] In the multi-scale feature extraction module, audio signals are used as input. More information is retained in the audio, and richer emotional information can be extracted, resulting in better recognition effects.
[0028] In a specific embodiment, the MFAN-based speech emotion recognition model and the construction method thereof are characterized in that the steps of splicing the features of the two modules and constructing a fully connected layer include:
[0029] After using the discourse-level feature extraction module and the multi-scale feature extraction module to extract features of different granularities, the features of the two modules are concatenated and fused. The formula is as follows:
[0030] O = concat([F u ,F M ], dim=1)
[0031] where F u is the output of the utterance-level feature extraction module, F M is the output of the multi-scale feature extraction module. The high-dimensional sentiment features learned by the two modules are concatenated and fused to obtain O.
[0032] The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
[0033] A speech emotion recognition model based on MFAN and a construction method thereof, comprising:
[0034] Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it;
[0035] A speech-level feature extraction module, which inputs the log-mel spectrogram into the speech-level feature extraction module and uses a convolutional block to expand the model receptive field to better extract speech-level sentiment features;
[0036] A multi-scale feature extraction module, wherein the speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales;
[0037] The features of different granularities extracted by the two modules are integrated to obtain competitive sentiment features;
[0038] The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
[0039] In a specific implementation, the feature engineering of the input audio comprises the following specific steps:
[0040] The log-mel spectrogram input to the speech-level feature extraction module requires first dividing the audio signal into short time periods. Usually, a window function (such as a Hamming window) is used to split the audio signal into overlapping frames to reduce spectral leakage. Then, a Fourier transform is performed on each frame of the signal to convert the time domain signal into a frequency domain signal to obtain the frequency domain information of each frame. Subsequently, the frequency domain information is passed through the mel filter bank. These filters are evenly distributed on the mel frequency scale. The energy value after filtering by the mel filter bank is logarithmically transformed to obtain a logarithmic mel spectrogram.
[0041] The speech signal input to the multi-scale feature extraction module is not processed by denoising, filtering or pitch shifting, so that the complete emotional information is preserved. By combining these two different inputs, more comprehensive and richer emotion-related information can be extracted.
[0042] In a specific implementation, the speech-level feature extraction module includes:
[0043] First, three 2D convolution blocks are used. The first two convolution blocks use 3×3 convolution kernels, and the third convolution block uses 2×1 convolution kernels. The convolution blocks are used to reduce the output frequency and time resolution and expand the receptive field of the model. Then the MLP block is used to enable the model to better extract the global features of the speech. Finally, the time mean pooling and the time maximum pooling are used and added together to adapt to the advantages of the average and maximum statistics.
[0044] In a specific implementation, the multi-scale feature extraction module includes:
[0045] First, the speech signal is input into a one-dimensional convolution block with a kernel size of 1. Since the length of the speech signal is long, we use the Downsample block to downsample the signal to reduce the network complexity. In the Downsample block, we use a one-dimensional convolution kernel with a kernel size of 5, and then input it into the residual block. We stack 4 Downsample blocks and finally get the output M∈R b×c×l , where b represents the batch size, c represents the number of channels, and l represents the sequence length. In order to obtain emotional information of different scales, we use the multi-scale attention mechanism to extract emotional information of different scales from M. First, we use the field of view expansion block to gradually expand the receptive field. In the field of view expansion block, the input vector M∈R b×c×l Input into the modified residual block to obtain vector Z. The modified residual block formula is as follows:
[0046] Z=h(M)+F1(M,W1)+F2(M,W2)
[0047] Where h(M) = W3M, where W3 represents a one-dimensional convolution with a kernel size of 1.
[0048] F1(M,W1)=LeakyReLU(BN(h1(M)))
[0049] And h1(M)=W1M, W1 represents a one-dimensional convolution with a kernel size of 7, and the F2(M,W2) convolution block is replaced by a convolution block with a kernel size of 1. Compared with the traditional ReLU activation function, the LeakyReLU activation function is used as the activation function here, and the formula is as follows:
[0050] LeakyReLU(x)=max(0,x)+α·min(0,x)
[0051] Where x is the input and α is the parameter. The output vector M1 after the above-mentioned field of view expansion block will continue to be input into the field of view expansion block to obtain M2, and similarly to obtain M3. The output feature vector M i (i=1,2,3,) input to M i After passing through the transformer encoder, we get Y i We will Y i Finally, we get the output F of the multi-scale feature extraction module. M , the formula is as follows:
[0052] F M =concat([Y1,Y2,Y3],dim=1)
[0053] In the multi-scale feature extraction module, audio signals are used as input. More information is retained in the audio, and richer emotional information can be extracted, resulting in better recognition effects.
[0054] In a specific embodiment, the step of concatenating the features of the two modules and the fully connected layer includes:
[0055] After using the discourse-level feature extraction module and the multi-scale feature extraction module to extract features of different granularities, the features of the two modules are concatenated and fused. The formula is as follows:
[0056] O = concat([F u ,F M ], dim=1)
[0057] where F u is the output of the utterance-level feature extraction module, F Mis the output of the multi-scale feature extraction module. The high-dimensional sentiment features learned by the two modules are concatenated and fused to obtain O.
[0058] The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
[0059] The input audio is feature engineered and the processed audio and log-mel spectrogram are obtained from it. The log-mel spectrogram is a spectrogram using the mel scale, which is a visual representation of the sound intensity or energy of all frequencies in the audio signal changing over time. The log-mel spectrogram is good at analyzing the frequency components and intensity of specific audio signals, simulating the human ear's perception of speech at different frequencies. Combining the two inputs of the log-mel spectrogram and the speech signal can extract more comprehensive and richer emotion-related information. The log-mel spectrogram is input into the speech-level feature extraction module, and the convolution block is used to expand the model's receptive field to better extract speech-level emotional features. The MLP block is used so that the model can better extract the global features of speech. At the same time, the audio is input into the multi-scale feature extraction module to extract emotional features of different scales using the multi-scale attention mechanism. This module extracts emotional information contained in different speech scales. Rich emotional information helps to obtain better recognition performance. The multi-scale design will also bring more redundant data while extracting richer emotional information. In order to avoid the influence of redundant data, a multi-head attention mechanism is introduced in this module to extract effective information. The features of different granularities extracted by the two modules are fused to obtain competitive emotional features. Finally, a fully connected layer is constructed, and the emotion features are input into the fully connected layer to obtain the final emotion recognition result. The speech emotion recognition model provided by the present invention can be used to solve the problem of being unable to extract features of different granularities and unable to pay attention to the time domain information of speech, and the problem of being difficult to obtain better recognition effects, and explores new ideas for obtaining better speech emotion recognition performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flow chart of a method for constructing a speech emotion recognition model based on MFAN provided by the present invention;
[0061] Figure 2 It is a specific data execution flow chart of the speech emotion recognition model based on MFAN provided by the present invention;
[0062] Figure 3 It is a schematic diagram of the overall structure of the speech emotion recognition model based on MFAN provided by the present invention; DETAILED DESCRIPTION
[0063] Embodiment of the method for constructing a speech emotion recognition model based on MFAN:
[0064] This embodiment provides a method for constructing a speech emotion recognition model based on MFAN. The hardware execution subject of the construction method can be a desktop computer, a laptop computer, a server device, an intelligent mobile terminal (tablet computer, smart phone, etc.), etc., which is not limited in this embodiment.
[0065] like Figure 1 As shown, the construction method includes:
[0066] Step 1: Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it:
[0067] The log-mel spectrogram input to the speech-level feature extraction module requires first dividing the audio signal into short time periods. Usually, a window function (such as a Hamming window) is used to split the audio signal into overlapping frames to reduce spectral leakage. Then, a Fourier transform is performed on each frame of the signal to convert the time domain signal into a frequency domain signal to obtain the frequency domain information of each frame. Subsequently, the frequency domain information is passed through the mel filter bank. These filters are evenly distributed on the mel frequency scale. The energy value after filtering by the mel filter bank is logarithmically transformed to obtain a logarithmic mel spectrogram.
[0068] The speech signal input to the multi-scale feature extraction module is not processed by denoising, filtering or pitch shifting, so that the complete emotional information is preserved. By combining these two different inputs, more comprehensive and richer emotion-related information can be extracted.
[0069] Step 2: Construct a discourse-level feature extraction module, which inputs the log-mel spectrogram into the discourse-level feature extraction module and uses convolution blocks to expand the model receptive field to better extract discourse-level sentiment features, including:
[0070] First, three 2D convolution blocks are used. The first two convolution blocks use 3×3 convolution kernels, and the third convolution block uses 2×1 convolution kernels. The convolution blocks are used to reduce the output frequency and time resolution and expand the receptive field of the model. Then the MLP block is used to enable the model to better extract the global features of the speech. Finally, the time mean pooling and the time maximum pooling are used and added together to adapt to the advantages of the average and maximum statistics.
[0071] Step 3: Construct a multi-scale feature extraction module. The speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales.
[0072] First, the speech signal is input into a one-dimensional convolution block with a kernel size of 1. Since the length of the speech signal is long, we use the Downsample block to downsample the signal to reduce the network complexity. In the Downsample block, we use a one-dimensional convolution kernel with a kernel size of 5, and then input it into the residual block. We stack 4 Downsample blocks and finally get the output M∈R b×c×l , where b represents the batch size, c represents the number of channels, and l represents the sequence length. In order to obtain emotional information of different scales, we use the multi-scale attention mechanism to extract emotional information of different scales from M. First, we use the field of view expansion block to gradually expand the receptive field. In the field of view expansion block, the input vector M∈R b×c×l Input into the modified residual block to obtain vector Z. The modified residual block formula is as follows:
[0073] Z=h(M)+F1(M,W1)+F2(M,W2)
[0074] Where h(M) = W3M, where W3 represents a one-dimensional convolution with a kernel size of 1.
[0075] F1(M,W1)=LeakyReLU(BN(h1(M)))
[0076] And h1(M)=W1M, W1 represents a one-dimensional convolution with a kernel size of 7, and the F2(M,W2) convolution block is replaced by a convolution block with a kernel size of 1. Compared with the traditional ReLU activation function, the LeakyReLU activation function is used as the activation function here, and the formula is as follows:
[0077] LeakyReLU(x)=max(0,x)+α·min(0,x)
[0078] Where x is the input and α is the parameter. The output vector M1 after the above-mentioned field of view expansion block will continue to be input into the field of view expansion block to obtain M2, and similarly to obtain M3. The output feature vector M i (i=1,2,3,) input to M i After passing through the transformer encoder, we get Y i We will Y i Finally, we get the output F of the multi-scale feature extraction module. M , the formula is as follows:
[0079] F M =concat([Y1,Y2,Y3],dim=1)
[0080] In the multi-scale feature extraction module, audio signals are used as input. More information is retained in the audio, and richer emotional information can be extracted, resulting in better recognition effects.
[0081] Step 4: Fuse the features of different granularities extracted by the two modules to obtain competitive sentiment features, including:
[0082] After using the discourse-level feature extraction module and the multi-scale feature extraction module to extract features of different granularities, the features of the two modules are concatenated and fused. The formula is as follows:
[0083] O = concat([F u ,F M ], dim=1)
[0084] where F u is the output of the utterance-level feature extraction module, F M is the output of the multi-scale feature extraction module. The high-dimensional sentiment features learned by the two modules are concatenated and fused to obtain O.
[0085] Step 5: construct a fully connected layer, which inputs the emotion features into the fully connected layer to obtain the final emotion recognition result;
[0086] Construct a fully connected layer, use a linear layer to convert the fused feature O into the final classification result dimension G, and output the result. The formula is:
[0087] G=WO
[0088] The model provided by the present invention The speech emotion recognition model provided by the present invention can be used to solve the problems of being unable to extract features of different granularities and being unable to focus on the time domain information of speech, and the problem of difficulty in obtaining better recognition effects, and explores new ideas for obtaining better speech emotion recognition performance.
[0089] MFAN-based speech emotion recognition model implementation example:
[0090] This embodiment provides a speech emotion recognition model based on MFAN, corresponding to the above-mentioned method for constructing a speech emotion recognition model based on MFAN, and the speech emotion recognition model based on MFAN includes:
[0091] Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it;
[0092] A speech-level feature extraction module, which inputs the log-mel spectrogram into the speech-level feature extraction module and uses a convolutional block to expand the model receptive field to better extract speech-level sentiment features;
[0093] A multi-scale feature extraction module, wherein the speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales;
[0094] The features of different granularities extracted by the two modules are integrated to obtain competitive sentiment features;
[0095] The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
[0096] For the specific implementation methods of each process, please refer to the above-mentioned embodiment of the method for constructing a speech emotion recognition model based on MFAN, which will not be repeated here.
[0097] The above embodiment only illustrates the technical solution of the present invention in a specific implementation mode. Any equivalent substitution of the present invention and any modification or partial substitution that does not depart from the spirit and scope of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A speech emotion recognition model based on MFAN and a construction method thereof, characterized in that: include: Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it; Constructing a speech-level feature extraction module, which inputs the log-mel spectrogram into the speech-level feature extraction module and uses a convolutional block to expand the model receptive field to better extract speech-level sentiment features; Constructing a multi-scale feature extraction module, wherein the speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales; The features of different granularities extracted by the two modules are integrated to obtain competitive sentiment features; A fully connected layer is constructed, and the fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
2. The MFAN-based speech emotion recognition model and construction method thereof according to claim 1, characterized in that: The specific steps of performing feature engineering on the input audio include: The log-mel spectrogram input to the speech-level feature extraction module requires first dividing the audio signal into short time periods. Usually, a window function (such as a Hamming window) is used to split the audio signal into overlapping frames to reduce spectral leakage. Then, a Fourier transform is performed on each frame of the signal to convert the time domain signal into a frequency domain signal to obtain the frequency domain information of each frame. Subsequently, the frequency domain information is passed through the mel filter bank. These filters are evenly distributed on the mel frequency scale. The energy value after filtering by the mel filter bank is logarithmically transformed to obtain a logarithmic mel spectrogram. The speech signal input to the multi-scale feature extraction module is not processed by denoising, filtering or pitch shifting, so that the complete emotional information is preserved. By combining these two different inputs, more comprehensive and richer emotion-related information can be extracted.
3. The MFAN-based speech emotion recognition model and construction method thereof according to claim 1, characterized in that: The construction of the speech-level feature extraction module includes: First, three 2D convolution blocks are used. The first two convolution blocks use 3×3 convolution kernels, and the third convolution block uses 2×1 convolution kernels. The convolution blocks are used to reduce the output frequency and time resolution and expand the receptive field of the model. Then the MLP block is used to enable the model to better extract the global features of the speech. Finally, the time mean pooling and the time maximum pooling are used and added together to adapt to the advantages of the average and maximum statistics.
4. The MFAN-based speech emotion recognition model and construction method thereof according to claim 1, characterized in that: The multi-scale feature extraction module is constructed, comprising: First, the speech signal is input into a one-dimensional convolution block with a kernel size of 1. Since the length of the speech signal is long, we use the Downsample block to downsample the signal to reduce the network complexity. In the Downsample block, we use a one-dimensional convolution kernel with a kernel size of 5, and then input it into the residual block. We stack 4 Downsample blocks and finally get the output M∈R b×c×l , where b represents the batch size, c represents the number of channels, and l represents the sequence length. In order to obtain emotional information of different scales, we use the multi-scale attention mechanism to extract emotional information of different scales from M. First, we use the field of view expansion block to gradually expand the receptive field. In the field of view expansion block, the input vector M∈R b×c×l Input into the modified residual block to obtain vector Z. The modified residual block formula is as follows: Z=h(M)+F1(M,W1)+F2(M,W2) Where h(M) = W3M, where W3 represents a one-dimensional convolution with a kernel size of 1. F1(M,W1)=LeakyReLU(BN(h1(M))) And h1(M)=W1M, W1 represents a one-dimensional convolution with a kernel size of 7, and the F2(M,W2) convolution block is replaced by a convolution block with a kernel size of 1. Compared with the traditional ReLU activation function, the LeakyReLU activation function is used as the activation function here, and the formula is as follows: LeakyReLU(x)=max(0,x)+α·min(0,x) Where x is the input and α is the parameter. The output vector M1 after the above-mentioned field of view expansion block will continue to be input into the field of view expansion block to obtain M2, and similarly to obtain M3. The output feature vector M i (i=1,2,3,) input to M i After the transformer encoder, we get Y i We will Y i Finally, we get the output F of the multi-scale feature extraction module. M , the formula is as follows: F M =concat([Y1,Y2,Y3],dim=1) In the multi-scale feature extraction module, audio signals are used as input. More information is retained in the audio, and richer emotional information can be extracted, resulting in better recognition effects.
5. The MFAN-based speech emotion recognition model and construction method thereof according to claim 1, characterized in that: The process of concatenating the features of the two modules and constructing a fully connected layer includes: After using the discourse-level feature extraction module and the multi-scale feature extraction module to extract features of different granularities, the features of the two modules are concatenated and fused. The formula is as follows: O=concat([F u ,F M ],dim=1) where F u is the output of the utterance-level feature extraction module, F M is the output of the multi-scale feature extraction module. The high-dimensional sentiment features learned by the two modules are concatenated and fused to obtain O. The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
6. A speech emotion recognition model based on MFAN and a construction method thereof, characterized in that: include: Perform feature engineering on the input audio and get the processed audio and log-mel spectrogram from it; A speech-level feature extraction module, which inputs the log-mel spectrogram into the speech-level feature extraction module and uses a convolutional block to expand the model receptive field to better extract speech-level sentiment features; A multi-scale feature extraction module, wherein the speech-level feature extraction module inputs the audio into the multi-scale feature extraction module and uses a multi-scale attention mechanism to extract emotional features of different scales; The features of different granularities extracted by the two modules are integrated to obtain competitive sentiment features; The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
7. The MFAN-based speech emotion recognition model and construction method thereof according to claim 6, characterized in that: The specific steps of performing feature engineering on the input audio include: The log-mel spectrogram input to the speech-level feature extraction module requires first dividing the audio signal into short time periods. Usually, a window function (such as a Hamming window) is used to split the audio signal into overlapping frames to reduce spectral leakage. Then, a Fourier transform is performed on each frame of the signal to convert the time domain signal into a frequency domain signal to obtain the frequency domain information of each frame. Subsequently, the frequency domain information is passed through the mel filter bank. These filters are evenly distributed on the mel frequency scale. The energy value after filtering by the mel filter bank is logarithmically transformed to obtain a logarithmic mel spectrogram. The speech signal input to the multi-scale feature extraction module is not processed by denoising, filtering or pitch shifting, so that the complete emotional information is preserved. By combining these two different inputs, more comprehensive and richer emotion-related information can be extracted.
8. The MFAN-based speech emotion recognition model and construction method thereof according to claim 6, characterized in that: The speech-level feature extraction module comprises: First, three 2D convolution blocks are used. The first two convolution blocks use 3×3 convolution kernels, and the third convolution block uses 2×1 convolution kernels. The convolution blocks are used to reduce the output frequency and time resolution and expand the receptive field of the model. Then the MLP block is used to enable the model to better extract the global features of the speech. Finally, the time mean pooling and the time maximum pooling are used and added together to adapt to the advantages of the average and maximum statistics.
9. The MFAN-based speech emotion recognition model and construction method thereof according to claim 6, characterized in that: The multi-scale feature extraction module comprises: First, the speech signal is input into a one-dimensional convolution block with a kernel size of 1. Since the length of the speech signal is long, we use the Downsample block to downsample the signal to reduce the network complexity. In the Downsample block, we use a one-dimensional convolution kernel with a kernel size of 5, and then input it into the residual block. We stack 4 Downsample blocks and finally get the output M∈R b×c×l , where b represents the batch size, c represents the number of channels, and l represents the sequence length. In order to obtain emotional information of different scales, we use the multi-scale attention mechanism to extract emotional information of different scales from M. First, we use the field of view expansion block to gradually expand the receptive field. In the field of view expansion block, the input vector M∈R b×c×l Input into the modified residual block to obtain vector Z. The modified residual block formula is as follows: Z=h(M)+F1(M,W1)+F2(M,W2) Where h(M) = W3M, where W3 represents a one-dimensional convolution with a kernel size of 1. F1(M,W1)=LeakyReLU(BN(h1(M))) And h1(M)=W1M, W1 represents a one-dimensional convolution with a kernel size of 7, and the F2(M,W2) convolution block is replaced by a convolution block with a kernel size of 1. Compared with the traditional ReLU activation function, the LeakyReLU activation function is used as the activation function here, and the formula is as follows: LeakyReLU(x)=max(0,x)+α·min(0,x) Where x is the input and α is the parameter. The output vector M1 after the above-mentioned field of view expansion block will continue to be input into the field of view expansion block to obtain M2, and similarly to obtain M3. The output feature vector M i (i=1,2,3,) input to M i After the transformer encoder, we get Y i We will Y i Finally, we get the output F of the multi-scale feature extraction module. M , the formula is as follows: F M =concat([Y1,Y2,Y3],dim=1) In the multi-scale feature extraction module, audio signals are used as input. More information is retained in the audio, and richer emotional information can be extracted, resulting in better recognition effects.
10. The MFAN-based speech emotion recognition model and construction method thereof according to claim 6, characterized in that: The features of the two modules and the fully connected layer are concatenated, including: After using the discourse-level feature extraction module and the multi-scale feature extraction module to extract features of different granularities, the features of the two modules are concatenated and fused. The formula is as follows: O=concat([F u ,F M ],dim=1) where F u is the output of the utterance-level feature extraction module, F M is the output of the multi-scale feature extraction module. The high-dimensional sentiment features learned by the two modules are concatenated and fused to obtain O. The fully connected layer inputs the emotion features into the fully connected layer to obtain the final emotion recognition result.
