Speech emotion recognition method and device, equipment and storage medium

Through pre-trained feature extractors and local prototype mapping networks, frame-level features of speech signals are extracted and aggregated, which solves the problem of difficulty in effectively representing complex emotions in the existing technology and improves the accuracy and robustness of speech emotion recognition.

CN118645124AInactive Publication Date: 2024-09-13UNIV OF SCI & TECH OF CHINA

Patent Information

Application Number
CN202411089230.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-09-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing speech emotion recognition methods based on self-supervised pre-training are difficult to make full use of the rich local information extracted by the model, and simple feature representation methods are difficult to effectively represent complex and diverse emotional information.

Method used

A pre-trained feature extractor is used to extract frame-level features, and a prototype set is obtained through online prototype learning. Frame-level mapping and segment-level embedding aggregation are performed. The pre-trained emotion classifier is combined with the pre-trained emotion classifier for emotion category recognition. The local prototype mapping network is used to Local statistical information depicting speech emotion without adding additional annotation burden.

Benefits of technology

It improves the accuracy, real-time and robustness of speech emotion recognition, can more effectively capture emotional changes in speech signals, and is suitable for the field of human-computer interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118645124A
    Figure CN118645124A
Patent Text Reader

Abstract

The invention provides a speech emotion recognition method, device and equipment and a storage medium, and relates to the technical field of speech signal processing, and the method comprises the steps: firstly, employing a pre-trained speech recognition self-supervision pre-training model to extract frame-level features, thereby relieving the problem of insufficient emotion data annotation data volume; secondly, using a local prototype mapping network to model frame-level features on a frame-level layer through an unsupervised prototype learning method under the condition of not increasing extra annotation burden, effectively depicting local statistical information changes caused by speech emotion complexity, and mapping the local statistical information changes to corresponding speech segment representations; in conclusion, according to the method, by combining the pre-trained speech recognition self-supervised pre-training model and the local prototype mapping network, remarkable beneficial effects are brought to speech emotion analysis, the accuracy and efficiency of emotion analysis are improved, and the robustness and generalization ability are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speech signal processing technology, and in particular to a speech emotion recognition method, device, equipment and storage medium. Background Art

[0002] Speech Emotion Recognition (SER) refers to the use of computer technology to deeply analyze human speech and identify the emotions contained in it. This technology is of great significance in promoting the naturalness and depth of human-computer interaction (HCI). As a complex psychological phenomenon, the expression of emotion is often not limited to a single, static segment-level label. People's emotional expressions are often continuous, diverse, and dynamic. These characteristics make traditional analysis methods based on segment-level emotion labels challenging. In addition, the emotional information in speech signals is often hidden in subtle speech features, such as pitch, speaking speed, sound quality, etc. The capture and analysis of these features are crucial to improving the accuracy of emotion recognition.

[0003] In order to overcome these challenges, existing technologies have adopted speech emotion recognition methods based on self-supervised pre-training. Self-supervised learning is a technology that uses a large amount of unlabeled data to pre-train models. By designing appropriate pre-training tasks, the model can learn the inherent structure and regularity of speech signals, thereby extracting richer and more effective feature representations. This method can not only improve the model's generalization ability for speech signals, but also provide strong support for subsequent speech emotion recognition tasks.

[0004] However, there are still some problems in the current research on speech emotion recognition based on self-supervised pre-training. On the one hand, most studies still use simple segment-level analysis methods to process the features extracted by the model, which cannot fully utilize the rich local information extracted by the model. On the other hand, due to the complexity and diversity of emotions, simple feature representation methods often have difficulty in effectively representing complex and diverse emotional information. Summary of the invention

[0005] In view of the above problems, this application provides a speech emotion recognition method, including the following contents: In a first aspect, the present application provides a method for speech emotion recognition, the method comprising: The acquired segment-level target sample data is input into the pre-trained feature extractor to extract frame-level features, thereby obtaining multiple frame-level features; Performing online prototype learning on the multiple frame-level features to obtain a prototype set, wherein the prototype set includes K prototypes, and each prototype represents a typical local feature; Based on the prototype set, a frame-level mapping set is obtained, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype; Aggregating each frame-level feature in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes a maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data; The segment-level embedding is input into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

[0006] Optionally, the pre-trained feature extractor is pre-trained by a self-supervised learning model based on a preset training amount of unlabeled speech data, and the pre-trained feature extractor includes: Waveform encoder and BERT encoder; After the segment-level target sample data is processed by the waveform encoder and the BERT encoder, the multiple frame-level features are obtained.

[0007] Optionally, the BERT encoder comprises 24 Transformer encoder layers; When training the pre-trained feature extractor, adjusting an 18th Transformer encoder layer and a 19th Transformer encoder layer of the BERT encoder to ensure the performance of the feature extractor; When outputting frame-level features, the 19th Transformer encoder layer is used to output the multiple frame-level features.

[0008] Optionally, performing online prototype learning on the multiple frame-level features to obtain a prototype set includes: The K prototypes are randomly initialized, the K prototypes have the same dimension as the frame-level features, and the multiple frame-level features and the K prototypes are optimized using a prototype loss function to obtain a prototype set.

[0009] Optionally, obtaining a frame-level mapping set based on the prototype set includes: Calculate the cosine similarity value between each frame-level feature and each prototype in the prototype set respectively; Calculating the probability value of each frame-level feature belonging to the prototype based on the cosine similarity value; Using the probability value of each frame-level feature belonging to the prototype as the frame-level mapping of the prototype; A frame-level mapping is calculated for each prototype in the prototype set, and the frame-level mapping set is obtained by combining them.

[0010] Optionally, the method further includes: According to the corresponding emotion type in the emotion recognition task, the first K' prototypes most relevant to the emotion type are selected from the K prototypes, where K' is less than or equal to K; Use the screened K' prototypes to obtain a new frame-level mapping set; Perform frame-level feature aggregation based on the new frame-level mapping set to obtain a new segment-level embedding; The sentiment classifier is retrained using the new segment-level embeddings.

[0011] In a second aspect, the present application provides a speech emotion recognition device, the device comprising: An extraction unit, used for inputting the acquired segment-level target sample data into a pre-trained feature extractor to extract frame-level features, thereby obtaining a plurality of frame-level features; A first processing unit is used to perform online prototype learning on the multiple frame-level features to obtain a prototype set, where the prototype set includes K prototypes, and each prototype represents a typical local feature; A second processing unit is configured to obtain a frame-level mapping set based on the prototype set, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype; an aggregation unit, configured to aggregate each frame-level feature in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes a maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data; The third processing unit is used to input the segment-level embedding into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

[0012] Optionally, the device further comprises: A training unit, used to train the pre-trained feature extractor using a self-supervised learning model based on a preset training amount of unlabeled speech data, wherein the pre-trained feature extractor comprises: Waveform encoder and BERT encoder; After the segment-level target sample data is processed by the waveform encoder and the BERT encoder, the multiple frame-level features are obtained.

[0013] Optionally, the above BERT encoder contains 24 Transformer encoder layers; When training the pre-trained feature extractor, adjusting an 18th Transformer encoder layer and a 19th Transformer encoder layer of the BERT encoder to ensure the performance of the feature extractor; When outputting frame-level features, the 19th Transformer encoder layer is used to output the multiple frame-level features.

[0014] Optionally, the first processing unit is used to randomly initialize the K prototypes, where the K prototypes have the same dimension as the frame-level features, and optimize the multiple frame-level features and the K prototypes using a prototype loss function to obtain a prototype set.

[0015] Optionally, the second processing unit is used to respectively calculate the cosine similarity value between each frame-level feature and each prototype in the prototype set; Calculating the probability value of each frame-level feature belonging to the prototype based on the cosine similarity value; Using the probability value of each frame-level feature belonging to the prototype as the frame-level mapping of the prototype; A frame-level mapping is calculated for each prototype in the prototype set, and the frame-level mapping set is obtained by combining them.

[0016] Optionally, the device further includes a fifth processing unit, configured to select, according to the corresponding emotion type in the emotion recognition task, the first K' prototypes most relevant to the emotion type from the K prototypes, wherein K' is less than or equal to K; Use the screened K' prototypes to obtain a new frame-level mapping set; Perform frame-level feature aggregation based on the new frame-level mapping set to obtain a new segment-level embedding; The sentiment classifier is retrained using the new segment-level embeddings.

[0017] In a third aspect, the present application provides a computing device, comprising a memory and a processor, the memory being used to store instructions or codes, and the processor being used to execute the instructions or codes so that the device performs the speech emotion recognition method introduced in any implementation of the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium, in which a code is stored. When the code is executed, the device executing the code implements the speech emotion recognition method introduced in any implementation manner of the first aspect.

[0019] This application provides a method for speech emotion recognition. The method first uses a pre-trained speech recognition self-supervised pre-training model to extract frame-level features, thereby alleviating the problem of insufficient emotional data annotation data; secondly, the local prototype mapping network is used to model frame-level features at the frame level through an unsupervised prototype learning method without adding additional annotation burden, effectively characterizing the changes in local statistical information caused by the complexity of speech emotions and mapping them to the corresponding speech segment representation; finally, in the post-processing stage, the local prototypes related to specific emotion recognition tasks are adaptively screened out through feature unconvolution, further improving the accuracy, real-time and robustness of emotional speech recognition, and bringing more possibilities and opportunities to the field of human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A flow chart of a method for speech emotion recognition provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a local prototype mapping network provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a speech emotion recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0023] Figure 1 A flowchart of a speech emotion recognition method provided in an embodiment of the present application. Figure 1 As shown, the speech emotion recognition method provided by the embodiment of the present application may include: S101. Input the acquired segment-level target sample data into a pre-trained feature extractor to extract frame-level features, and obtain multiple frame-level features.

[0024] A speech segment that needs to be analyzed for sentiment category is obtained as target sample data, and the speech segment contains continuous time information.

[0025] A pre-trained feature extractor is a trained model that can automatically extract useful features from raw data. These feature extractors are usually trained on large amounts of data. In the method described in the embodiments of the present application, the pre-trained feature extractor uses a HuBERT-large network, which is divided into two parts: a waveform encoder and a BERT encoder. HuBERT-large is an audio model based on unsupervised pre-training. It uses a large amount of unlabeled audio data (such as Libri-Light 60k) for pre-training to learn the structure and patterns in audio signals. The "H" in HuBERT stands for Hidden Unit BERT, which means that it draws on the architecture of BERT (Bidirectional Encoder Representationsfrom Transformers) but applies it to audio data.

[0026] The role of the waveform encoder in the HuBERT model is to convert the input raw waveform signal (i.e. the raw audio data) into a feature form that is easier to process and analyze later. It uses a multi-layer convolutional neural network (CNN) to extract local and global features in the audio. These features usually contain information such as frequency and time in the audio signal, and can describe the basic structure and characteristics of the audio signal. The waveform encoder contains a seven-layer convolutional neural network with step sizes of (5, 2, 2, 2, 2, 2, 2), convolution kernel sizes of (10, 3, 3, 3, 3, 2, 2), and the number of channels is 512.

[0027] In the HuBERT model, the features output by the waveform encoder are further fed into the BERT encoder for higher-level processing and feature abstraction. By combining the waveform encoder and the BERT encoder, HuBERT can achieve a comprehensive understanding and analysis of audio signals, providing strong support for subsequent tasks such as emotion recognition. The BERT encoder contains a total of 24 Transformer layers, of which 16 attention heads are used and the feature dimension is 1024. Through the processing of the BERT encoder, the input waveform signal is converted into a frame-level feature X, , where C is the feature dimension and T is the number of frame-level features contained in the sample.

[0028] When training a pre-trained feature extractor, especially when optimizing for a specific task (such as emotion recognition), it is usually necessary to fine-tune the pre-trained model. Fine-tuning refers to adjusting the parameters of certain parts of the pre-trained model using new task data to make it better suited to the new task. Since the number of parameters of the entire HuBERT network is large (about 317M) and the data set is limited, fine-tuning the entire network may lead to overfitting and excessive consumption of computing resources. Therefore, the last two Transformer layers in the BERT encoder (i.e., the 18th and 19th layers) are selected for fine-tuning in this application. The benefits of doing this are: Can reduce the risk of overfitting: Since only some parameters of the model are fine-tuned, the number of variables that need to be optimized is reduced, thereby reducing the risk of overfitting.

[0029] Preserve general knowledge: The early layers of the pre-trained model (such as the waveform encoder and the first few layers of the BERT encoder) have learned general structures and patterns in audio signals, which are still useful for new tasks. Adapt to specific tasks: By fine-tuning the last two layers, the model is able to learn patterns and features that are unique to the emotion recognition task, thereby improving performance on new tasks.

[0030] After fine-tuning, the output of the 19th Transformer encoder layer is selected as the frame-level features in this application. This is because experiments show that the features of this layer perform best on emotion recognition tasks. The output features of the 19th layer contain enough semantic information and retain enough details to distinguish different emotions. These frame-level features can then be used in downstream tasks such as emotion recognition.

[0031] The following introduces the emotion recognition effect of the baseline system when fine-tuning different network layers through Table 1. As shown in Table 1, Table 1 shows the performance comparison of the baseline system obtained by fine-tuning different network layers when using the pre-trained HuBERT-large network for emotion recognition.

[0032] Fine-tuning scheme: This column lists different fine-tuning strategies for the model. These include fixing the feature extractor (i.e., no fine-tuning), fine-tuning the 19th Transformer layer, and fine-tuning the 18th and 19th Transformer layers. WA(%): WeightedAccuracy, which takes into account the distribution of samples of different categories in the dataset and assigns different weights to each category, thereby more accurately reflecting the performance of the model on all categories. UA(%): Unweighted Accuracy, which is a simple accuracy that does not consider category weights and only calculates the proportion of correctly classified samples among all samples. F1-score(%): The F1 score is the harmonic mean of precision and recall, and is used to evaluate the comprehensive performance of the model on classification tasks. In emotion recognition, it can help understand the balanced performance of the model in identifying various types of emotions.

[0033] Fixed Feature Extractor: This row shows the performance of the baseline system on the emotion recognition task when the parameters of the feature extractor (i.e., HuBERT-large network) remain unchanged. In this case, the model only uses pre-trained features without any task-specific fine-tuning.

[0034] Fine-tuning the 19th Transformer layer: This row shows the change in performance of the baseline system on the emotion recognition task when fine-tuning only the 19th Transformer layer of the BERT encoder. Fine-tuning this layer can help the model better adapt to the emotion recognition task.

[0035] Fine-tuning the 18th and 19th Transformer layers: This row shows the performance of the baseline system on the emotion recognition task when fine-tuning the 18th and 19th Transformer layers of the BERT encoder. Since both layers are fine-tuned at the same time, the model has more freedom to adapt to the emotion recognition task, which may lead to a larger performance improvement.

[0036] Table 1 Emotion recognition performance of the baseline system when fine-tuning different network layers

[0037] This approach allows us to fully leverage the advantages of pre-trained models while fine-tuning them for specific tasks to achieve better performance.

[0038] After obtaining the frame-level features, the frame-level features are processed by a local prototype mapping network. The local prototype mapping network in the embodiment of the present application includes three parts, namely online prototype learning, local prototype mapping and segment-level aggregation. Figure 2 As shown, Figure 2A structural schematic diagram of a local prototype mapping network provided for an embodiment of the present application shows a process of obtaining a prototype set through online prototype learning of frame-level features, and completing the mapping of frame-level features and segment-level aggregation based on the prototype set. This process is described in detail below in conjunction with steps S102-S104.

[0039] S102, performing online prototype learning on the multiple frame-level features to obtain a prototype set, wherein the prototype set includes K prototypes, and each prototype represents a typical local feature.

[0040] In the embodiment of the present application, the online prototype learning process is implemented based on clustering of frame-level features. By drawing on the codebook learning idea in VQ-VAE (Vector Quantized-Variational AutoEncoder), a prototype set P with K prototypes is obtained through an iterative optimization process, where .

[0041] Specifically, we first randomly select K data points from the frame-level features as initial prototypes. These initial prototypes may not completely accurately represent typical local features, but they provide a starting point for the subsequent learning process.

[0042] In order to perform clustering and optimize the prototype set, a loss function needs to be defined to measure the similarity or difference between the frame-level features and the prototype. In one implementation of the embodiment of the present application, the loss function is used. To optimize:

[0043] Among them, p j is the closest to x in the codebook i The prototype, Indicates stopping the gradient operation.

[0044] Through the loss function design, the frame-level features of the same emotion category can be as close to their corresponding prototypes as possible, while the frame-level features of different emotion categories can be as far away from the prototypes as possible. Using the prototype loss function, the system clusters the frame-level features and prototypes. The position of the prototype is updated by minimizing the loss function. In each iteration, the system calculates the distance or similarity between each frame-level feature and all prototypes, and assigns the frame-level feature to the prototype that is most similar to it. Then, based on the frame-level features assigned to each prototype, the position of the prototype is updated (for example, by calculating the mean or weighted mean of these frame-level features).

[0045] After multiple iterations, the prototype set gradually converges to a stable state, where each prototype represents an emotion well. During the iteration process, the system may use various optimization algorithms (such as gradient descent) to accelerate the updating process of the prototype.

[0046] S103. Obtain a frame-level mapping set based on the prototype set, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype.

[0047] For each frame-level feature x i (where i represents the i-th frame-level feature), and calculates the cosine similarity value between it and each prototype in the prototype set. For example, calculate the frame-level features x1, x2…x i The cosine similarity score between the prototype p1 and the frame-level features x1, x2…x are calculated respectively. i The cosine similarity score between p1 and prototype p2 is calculated by analogy, and each prototype in the prototype set is calculated once with each frame-level feature.

[0048] After completing the cosine similarity scores of each frame-level feature and prototype, the cosine similarity values ​​are converted into probability values ​​using the softmax function (or other appropriate normalization methods). The softmax function can convert any real-valued score into a probability distribution.

[0049]

[0050] Where S i,j Represents the frame-level feature x i and the jth prototype p j The cosine similarity value between i , p j ) is S i,j The softmax value of x i The probability of belonging to the target concept j. Here τ is a temperature hyperparameter, which is usually used to control the "smoothness" of the softmax output and is set to τ=1.0 by default.

[0051] Each frame-level feature x is calculated i Belongs to each prototype p j The probability value of is used as the frame-level mapping of the frame-level feature. This mapping is a vector, in which each element represents the probability that the frame-level feature belongs to a prototype.

[0052] Repeat the above steps for all frame-level features to generate a frame-level mapping for each frame-level feature, as shown in the above formula i, expressing the similarity between the i-th frame-level feature and each frame-level in the prototype set. All frame-level mappings are combined to form a frame-level mapping set. This set contains the frame-level mappings of all frame-level features, and each mapping is a probability vector, indicating the probability distribution of the frame-level feature belonging to each prototype in the prototype set.

[0053] S104, aggregating each frame-level feature in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes the maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data.

[0054] A global maximum pooling layer is used to aggregate the frame-level features in the frame-level mapping set. The global maximum pooling layer is used to maximize the score values ​​of all frame-level mappings on a certain prototype as the score value of the prototype on the segment-level target sample. The global maximum pooling layer is a special pooling operation that does not consider local windows or regions, but operates on the entire sequence (or feature map). In an embodiment of the present application, the global maximum pooling layer is used to aggregate the score values ​​of the frame-level mapping.

[0055] Specifically, for each prototype, the global max pooling layer finds the maximum score value of the prototype over all frame-level maps. This maximum value reflects the highest match or strongest representation of the prototype over the entire sequence (or segment-level target sample data).

[0056] Specifically, the maximum pooling layer is used to pool the frame-level features d i Aggregate and get the segment-level embedding Y, Y=max pool(d1,d2,…d T ).

[0057] S105 , inputting the segment-level embedding into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

[0058] The segment-level embeddings are used as input and classified using a pre-trained sentiment classifier. This classifier may be a machine learning model (such as support vector machine, random forest, neural network, etc.), which outputs a sentiment category label based on the input score value.

[0059] Assume that the sentiment classifier is a neural network model that is trained to recognize four emotions: "happy", "sad", "angry", and "neutral". When the segment-level embedding is input into this model, the model outputs the sentiment category label "happy", indicating that the sentiment expressed by the target sample in that time period is "happy".

[0060] The above introduces the specific implementation process of the speech emotion recognition method in the present application. It can be understood that in the emotion recognition task, optimizing the prototype set and the classifier according to the specific emotion type can further improve the recognition accuracy.

[0061] Specifically, firstly, an emotion recognition task is obtained, which includes some emotion types, such as "happiness", "sadness", "anger", etc.

[0062] When performing prototype training based on frame-level features in the above step S102, the classification loss L for each prototype parameter is calculated. CE The gradient of , we get the Fisher information matrix:

[0063] Among them, B and T represent the batch size and the number of local features in each sample, respectively, and y i is the sentiment label. In each iteration, the sentiment label is used to synchronously calculate F(p j During the training process, F(p j ) is an estimated value.

[0064] After the training stops, the K prototypes are screened. For a specific emotion recognition task, F(p j ) is used as the estimated importance metric of each prototype to select the first K' prototypes, where K' is equal to K. The first K' prototypes are used for a new local prototype mapping and segment-level aggregation to obtain K'-dimensional segment-level features. Finally, a new sentiment classifier with randomly initialized parameters is retrained.

[0065] The above embodiment introduces a speech emotion recognition method provided by the present application. In order to prove the effectiveness of the present solution, the present application also introduces a specific experimental process to prove the effectiveness of the present solution: (1) Experimental setup The experiment was conducted on the Interactive Emotion Motion Capture Database (IEMOCAP) and the Multimodal Emotion Recognition Challenge 2023 (MER2023) datasets to evaluate the effectiveness of the proposed method. The IEMOCAP dataset contains about 12 hours of English audio-visual data. The database is divided into 5 parts, each containing one male and one female actor. Depending on the recording scene, it can be further subdivided into improvisational dialogue or scripted dialogue parts. Each utterance is annotated with 8 emotion tags by multiple annotators. In order to make a fair comparison with previous work, 4 emotion types (i.e., neutral, happy, angry, and sad) were selected in the experiment. A 5-fold cross-validation strategy was used to evaluate the dataset, with 4 parts of sentences in each fold for training and the remaining parts for validation and testing. The MER2023 dataset provides 3373 Chinese speech data with a total length of nearly 4 hours. Each audio segment is annotated with six categories (neutral, angry, happy, sad, worried, and surprised), and is accompanied by a one-dimensional numerical valence to evaluate the positive or negative degree of emotion. Following the benchmark set in the Multimodal Emotion Recognition Challenge 2023 (MER2023) dataset, the dataset is randomly split into five parts and a 5-fold cross validation is performed to evaluate the performance.

[0066] All systems are implemented using the PyTorch deep learning framework. The Adam optimizer is used, and the mini-batch size is set to 128. For the IEMOCAP dataset, the system is trained for 50 cycles, and the initial learning rate is set to 0.0001. For the MER2023 dataset, the system is trained for 100 cycles, and the initial learning rate is also 0.0001.

[0067] (2) Evaluation indicators For the IEMOCAP dataset, the following metrics were used to evaluate the results of four-category emotion recognition.

[0068] Weighted Accuracy (WA): This is a method of calculating the accuracy by taking into account the number of samples in each category. The calculation formula is:

[0069] Where N i represents the number of samples of category i, A i Represents the accuracy of the category, and N represents the total number of samples. This calculation method makes the contribution of each category's error to the overall accuracy correspond to its proportion in the data set.

[0070] Unweighted Accuracy (UA): The average accuracy calculated for each emotion category, that is, the number of correctly predicted instances in a category divided by the total number of instances in that category, and then the accuracy of all categories is averaged. The calculation formula is:

[0071] in Indicates category The accuracy, N classes Indicates the number of categories.

[0072] F1-Score: The harmonic mean of precision and recall, calculated as:

[0073] Where precision represents the accuracy and recall represents the recall rate.

[0074] For the MER2023 dataset, the six-category emotion recognition was evaluated using the F1-Score, and the one-dimensional numerical Valence was evaluated using the mean square error (MSE).

[0075] (2) Experimental results Table 2 shows the effect of different numbers of prototypes on emotion recognition before feature unwrapping. The number of prototypes ranges from 128 to 2048, marked as "LPMN-". "Baseline-AP" and "Baseline-MP" do not use the local prototype mapping network, and instead use ordinary average pooling layers and maximum pooling layers to process frame-level features.

[0076] Table 2 The impact of different numbers of prototypes on emotion recognition before feature unrolling.

[0077] The indicators are WA, UA, F1-S and MSE

[0078] Experimental results show that the proposed local prototype mapping network significantly improves the performance of emotion recognition on the IEMOCAP and MER2023 datasets. On the IEMOCAP dataset, the WA index increased by about 2.8%, the UA increased by about 6.7%, and the F1-score increased by about 4%. On the MER2023 dataset, the F1-score increased by about 4%. At the same time, different numbers of prototypes have a great impact on the performance. Except for the "MSE" indicator, the maximum values ​​of all evaluation indicators are reached when the number of prototypes K is 1024. This may be because this number is relatively close to the diversity of frame-level features.

[0079] Table 3 shows the performance after feature unrolling. The experiment selected the K' prototypes most relevant to the task from the previous best-performing "LPMN-1024" training results to eliminate the bias caused by irrelevant factors, labeled "LPMN-ps-K'". The experimental results show that even if most of the learned prototypes are discarded, the performance can still be improved, and each indicator can be improved by about 1%. This may be due to the complexity of emotions and the limitation of the dataset size.

[0080] Table 3. The effect of different prototype screening numbers on emotion recognition effect after feature unrolling of “LPMN-1024”

[0081] Table 4 Comparison between this application and some existing best methods

[0082] The method in this application is compared with some of the best existing methods in Table 4. With the help of frame-level emotion modeling, significant improvements are achieved in performance over the listed systems.

[0083] In general, this application proposes a local prototype mapping network (LPMN) based on unsupervised pre-trained features for speech emotion recognition. It aims to model the frame-level features of speech signals through unsupervised prototype analysis. The network models the frame-level features obtained from the pre-trained feature extractor by online learning a prototype codebook. With the help of these prototypes, the most emotion-related mapping can be selected based on the similarity measure between the frame-level features and the prototypes. In addition, during the training process, the importance measure of each prototype for speech emotion recognition is estimated to perform feature unconvolution. Experiments on the IEMOCAP and MER2023 datasets have shown that this method significantly improves the effect of speech emotion recognition.

[0084] The speech recognition method proposed in this application is based on the pre-trained feature Local Prototypical Mapping Network (LPMN), which aims to optimize the self-supervised learning features and improve the performance of speech emotion recognition. It has at least the following beneficial effects: (1) The features of the output of different layers of the pre-trained HuBERT-large model are studied to find the most suitable features and fine-tuning methods for emotion recognition, laying the foundation for subsequent emotion recognition research based on pre-trained features. (2) LPMN cleverly uses prototypes to model local feature distribution without relying on any additional annotation information. This method can give full play to the advantages of self-supervised learning features, effectively capture emotional changes in speech, and accurately express these changes. (3) In view of the particularity of the speech emotion recognition task, LPMN has developed a unique feature unrolling scheme to adaptively select prototypes closely related to emotion recognition, reduce the impact of irrelevant information on emotion recognition performance, and thus improve recognition accuracy. (4) In order to verify the effectiveness of LPMN, a large number of experiments were carried out on two public datasets, IEMOCAP and MER2023. Experimental results show that LPMN significantly improves the performance of speech emotion recognition based on self-supervised learning features, demonstrating the superiority and practicality of this method in the field of speech emotion recognition.

[0085] The above are some specific implementations of a speech emotion recognition method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.

[0086] Figure 3 A schematic diagram of the structure of a speech emotion recognition device provided in an embodiment of the present application. Figure 3 As shown, the speech emotion recognition device 300 provided in the embodiment of the present application includes: An extraction unit 310 is used to input the acquired segment-level target sample data into a pre-trained feature extractor to extract frame-level features, thereby obtaining a plurality of frame-level features; A first processing unit 320 is configured to perform online prototype learning on the plurality of frame-level features to obtain a prototype set, wherein the prototype set includes K prototypes, and each prototype represents a typical local feature; A second processing unit 330 is configured to obtain a frame-level mapping set based on the prototype set, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype; an aggregation unit 340, configured to aggregate the frame-level features in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes a maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data; The third processing unit 350 is used to input the segment-level embedding into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

[0087] In one implementation of the embodiment of the present application, the device further includes: A training unit, used to train the pre-trained feature extractor using a self-supervised learning model based on a preset training amount of unlabeled speech data, wherein the pre-trained feature extractor comprises: Waveform encoder and BERT encoder; After the segment-level target sample data is processed by the waveform encoder and the BERT encoder, the multiple frame-level features are obtained.

[0088] In one implementation of the embodiment of the present application, the BERT encoder includes 24 Transformer encoder layers; When training the pre-trained feature extractor, adjusting an 18th Transformer encoder layer and a 19th Transformer encoder layer of the BERT encoder to ensure the performance of the feature extractor; When outputting frame-level features, the 19th Transformer encoder layer is used to output the multiple frame-level features.

[0089] In one implementation of the embodiment of the present application, the first processing unit is used to randomly initialize the K prototypes, where the K prototypes have the same dimension as the frame-level features, and optimize the multiple frame-level features and the K prototypes using a prototype loss function to obtain a prototype set.

[0090] In an implementation of the embodiment of the present application, the second processing unit is used to respectively calculate the cosine similarity value between each frame-level feature and each prototype in the prototype set; Calculating the probability value of each frame-level feature belonging to the prototype based on the cosine similarity value; Using the probability value of each frame-level feature belonging to the prototype as the frame-level mapping of the prototype; A frame-level mapping is calculated for each prototype in the prototype set, and the frame-level mapping set is obtained by combining them.

[0091] In an implementation of the embodiment of the present application, the device further includes a fifth processing unit, which is used to select the first K' prototypes most relevant to the emotion type from the K prototypes according to the emotion type corresponding to the emotion recognition task, where K' is less than or equal to K; Use the screened K' prototypes to obtain a new frame-level mapping set; Perform frame-level feature aggregation based on the new frame-level mapping set to obtain a new segment-level embedding; The sentiment classifier is retrained using the new segment-level embeddings.

[0092] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.

[0093] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the method described in any embodiment of the present application.

[0094] The computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the method described in any embodiment of the present application.

[0095] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0096] It should be noted that, in this application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0097] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and apparatus embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0098] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A speech emotion recognition method, characterized in that: The method comprises: The acquired segment-level target sample data is input into the pre-trained feature extractor to extract frame-level features, thereby obtaining multiple frame-level features; Performing online prototype learning on the multiple frame-level features to obtain a prototype set, wherein the prototype set includes K prototypes, and each prototype represents a typical local feature; Based on the prototype set, a frame-level mapping set is obtained, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype; Aggregating each frame-level feature in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes a maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data; The segment-level embedding is input into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

2. The method according to claim 1, characterized in that The pre-trained feature extractor is pre-trained by a self-supervised learning model based on a preset number of unlabeled speech data, and the pre-trained feature extractor includes: Waveform encoder and BERT encoder; After the segment-level target sample data is processed by the waveform encoder and the BERT encoder, the multiple frame-level features are obtained.

3. The method according to claim 2, characterized in that The BERT encoder contains 24 Transformer encoder layers; When training the pre-trained feature extractor, adjusting an 18th Transformer encoder layer and a 19th Transformer encoder layer of the BERT encoder to ensure the performance of the feature extractor; When outputting frame-level features, the 19th Transformer encoder layer is used to output the multiple frame-level features.

4. The method according to claim 1, characterized in that: The performing online prototype learning on the multiple frame-level features to obtain a prototype set includes: The K prototypes are randomly initialized, the K prototypes have the same dimension as the frame-level features, and the multiple frame-level features and the K prototypes are optimized using a prototype loss function to obtain a prototype set.

5. The method according to claim 1, characterized in that The obtaining of a frame-level mapping set based on the prototype set comprises: Calculate the cosine similarity value between each frame-level feature and each prototype in the prototype set respectively; Calculating the probability value of each frame-level feature belonging to the prototype based on the cosine similarity value; Using the probability value of each frame-level feature belonging to the prototype as the frame-level mapping of the prototype; A frame-level mapping is calculated for each prototype in the prototype set, and the frame-level mapping set is obtained by combining them.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: According to the corresponding emotion type in the emotion recognition task, the first K' prototypes most relevant to the emotion type are selected from the K prototypes, where K' is less than or equal to K; Use the screened K' prototypes to obtain a new frame-level mapping set; Perform frame-level feature aggregation based on the new frame-level mapping set to obtain a new segment-level embedding; The sentiment classifier is retrained using the new segment-level embeddings.

7. A speech emotion recognition device, characterized in that: The device comprises: An extraction unit, used for inputting the acquired segment-level target sample data into a pre-trained feature extractor to extract frame-level features, thereby obtaining a plurality of frame-level features; A first processing unit is used to perform online prototype learning on the multiple frame-level features to obtain a prototype set, where the prototype set includes K prototypes, and each prototype represents a typical local feature; A second processing unit is configured to obtain a frame-level mapping set based on the prototype set, wherein the frame-level mapping set includes K frame-level mappings, wherein a frame-level mapping includes a similarity value between each frame-level feature and the same prototype; an aggregation unit, configured to aggregate each frame-level feature in the frame-level mapping set to obtain a segment-level embedding, wherein the segment-level embedding includes a maximum similarity score between each prototype and all frame-level features included in the segment-level target sample data; The third processing unit is used to input the segment-level embedding into a pre-trained sentiment classifier to obtain the sentiment category of the segment-level target sample data.

8. The device according to claim 7, characterized in that The device also includes: A training unit, used to train the pre-trained feature extractor using a self-supervised learning model based on a preset training amount of unlabeled speech data, wherein the pre-trained feature extractor comprises: Waveform encoder and BERT encoder; After the segment-level target sample data is processed by the waveform encoder and the BERT encoder, the multiple frame-level features are obtained.

9. A computing device, characterized in that The computing device includes: a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Pre-training optimization method and device for emotion prediction model, equipment and medium

    CN115457982A

  • Speech emotion recognition method and device, storage medium and electronic equipment

    CN116434787A

  • Audio-driven facial animation with emotion support using machine learning

    US20240013462A1

Cited By

  • Local attribute learning method and device for speech emotion recognition

    CN119229903A

  • Local Attribute Learning Method and Device for Speech Emotion Recognition

    CN119229903B

  • Speech emotion recognition method based on diffusion enhancement and multi-granularity feature fusion

    CN119296588A

  • Speech emotion recognition method and device, electronic equipment and computer storage medium

    CN119905115A

  • Emotion recognition method and device in film and television play dubbing

    CN120319273A