A method for speech emotion recognition based on supervised contrastive learning
By adopting a supervised contrast learning method in speech emotion recognition technology, a model including emotional anchor generation, discourse emotion representation and contrast learning modules is constructed, which solves the problem of indistinguishable similar emotions in the existing technology, and significantly improves the emotional recognition Accuracy and generalization ability.
Patent Information
- Application Number
- CN202411669786.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Existing speech emotion recognition technology is difficult to effectively distinguish similar emotions, resulting in limited generalization ability of the model in complex emotional scenarios.
Using a method based on supervised contrast learning, the speech emotion recognition model is constructed, including the emotional anchor generation module, the discourse emotion representation module, the contrast learning module and the emotional anchor adaptive module, fully utilize the semantic information of the emotional labels to improve the model's matching The ability to distinguish similar emotions.
It significantly improves the accuracy and generalization ability of speech emotion recognition, allowing the model to capture subtle emotional differences more accurately, adapt to different emotional categories and speech input, and has higher robustness and generalization ability.
Smart Images

Figure CN119207385B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of speech emotion recognition, and in particular relates to a speech emotion recognition method based on supervised contrastive learning. Background Art
[0002] Emotion recognition refers to identifying a person's emotional state by analyzing information such as facial expressions, voices, language, gestures, and physiological signals, thereby giving computers the ability to recognize and understand human emotions. Voice is one of the most direct and convenient ways for people to communicate with each other. Voice signals not only contain clear speech content, but also contain rich paralinguistic information, such as pitch, rhythm, intonation and other rhythmic features. As people often say, "words cannot express the meaning", which shows the importance of paralinguistic information carried by voice. Paralinguistic information can often convey the emotional information behind the words. This information not only helps to understand the content of the speech, but also provides an important basis for the recognition and interaction of emotions. Therefore, with the help of voice, emotional information can be effectively supplemented, thereby significantly improving the performance of the emotion recognition system.
[0003] However, due to the complexity and diversity of emotional expression, many emotions have a high degree of semantic similarity, such as "frustrated" and "sad" or "happy" and "excited", which makes speech emotion recognition face great challenges. For example, the same sentence "I am tired" can be expressed in a frustrated or sad way, and the difference between these similar emotions is more reflected in the difference in speech rhythm. Existing emotion recognition methods, such as graph-based models (such as DialogueGCN) or sequence-based models (such as CoMPM) and methods combined with pre-trained language models (such as SPCL), have improved the accuracy of emotion recognition to a certain extent, but still perform poorly in distinguishing similar emotions, that is, it is easy to confuse speech with similar emotions, resulting in limited generalization ability of the model in complex emotional scenarios. Summary of the invention
[0004] In order to make up for the shortcomings of the prior art, the present invention provides a speech emotion recognition method based on supervised contrastive learning. For input of any speech data containing emotion, the semantic information of the emotion label can be fully utilized to improve the model's ability to distinguish similar emotions, thereby improving the accuracy and generalization ability of speech emotion recognition.
[0005] The method for speech emotion recognition based on supervised contrastive learning comprises the following steps:
[0006] Step 1: Obtain a large-scale speech data set containing multiple emotion categories, perform systematic preprocessing and emotion annotation on the speech data to build a high-quality training data set;
[0007] Step 2: construct a speech emotion recognition model based on an emotion anchor point generation module, a discourse emotion representation module, a contrastive learning module and an emotion anchor point adaptation module;
[0008] Step 3: training the emotion recognition model using the data set constructed in step 1;
[0009] Step 4: Input the target speech to be recognized into the trained model, and calculate the similarity between the emotion representation of the speech and the closest emotion anchor point to obtain the final emotion prediction result.
[0010] Furthermore, the preprocessing in step 1 includes denoising, normalization and emotion labeling of speech data. Through the above processing, a labeled data set covering multiple emotion categories is constructed, providing a solid foundation for the training of the emotion recognition model in the subsequent steps.
[0011] Furthermore, the emotion anchor point generation module in step 2 generates emotion anchor points based on predefined emotion tags. Each emotion anchor point is a high-dimensional vector representing an emotion category. It captures the subtle differences between different emotion categories by encoding multiple emotion features, ensuring that the distribution of emotion categories in the feature space has good separability. The expression is:
[0012] ,
[0013] ,
[0014] in, is the input sentiment label text, , each row represents an emotional anchor point (Anchor), s represents the number of emotions, and d represents the vector dimension of the emotional anchor point representation.
[0015] Furthermore, the emotion anchor generation module uses a pre-trained language model to encode the emotion label to generate emotion anchors. During the model training process, the emotion anchors are made more dispersed in the representation space of contrastive learning by calculating the anchor angle loss, thereby distinguishing similar emotions. This enables the model to have a higher ability to distinguish when dealing with similar emotion categories. The formula can be expressed as:
[0016] ,
[0017] in, Represents the representation of the i-th emotional anchor point in A; is the vector inner product of two emotional anchor points, which is used to calculate their cosine similarity. The higher the cosine similarity, the more similar the emotional anchor points are, and the smaller their pair angles are. , making the minimum angle (i.e. the angle between the most similar anchor points) as large as possible, thereby reducing The value of .
[0018] Furthermore, the speech emotion representation module in step 2 includes a speech encoder, a speech projection layer, a speech mapping layer, a text embedding layer and a language model. The model receives sample audio data and text prompts as inputs, and encodes them through the speech projection, speech mapping layer and text embedding layer respectively. The encoded audio and text are used to prompt the language model to generate output. The prefix expression formed by splicing the two embedded sequences is:
[0019] ,
[0020] Where k is the prefix size, Represents the audio embedding sequence obtained by converting the sample audio through the speech encoder and speech mapper, Represents the text embedding sequence obtained by converting the text prompt prompt through the text embedding layer and the text mapping layer. The language model is based on the prefix Generate a sequence of sentiment tags, and the calculation formula of cross-entropy loss is as follows:
[0021] ,
[0022] Among them, θ represents the trainable parameters of the model, including the speech projection layer, speech mapping layer, and text mapping layer; Indicates the true emotional label of the utterance, Represents the previously generated text tags, encodes the generated text tags, and obtains the final discourse sentiment representation .
[0023] Furthermore, the contrastive learning module in step 2 calculates the contrastive learning loss based on the emotion anchor point to maximize the similarity between samples with the same emotion and the corresponding emotion anchor point, while minimizing the similarity between different emotion categories, thereby forming a clear emotion boundary in the feature space and improving the accuracy and generalization ability of emotion recognition. The calculation formula of the supervised contrastive loss is as follows:
[0024] ,
[0025] ,
[0026] In the formula, , which consists of all discourse emotion representations and emotion anchors; Representation and Discourse The set of utterances or anchor representations with the same label, represents the number of positive samples; sim represents the similarity function, is the temperature hyperparameter of the contrastive loss; express and Similarity measure between ; It means mapping the similarity of two vectors, usually in the range of [-1, 1], to a non-negative probability space; represents the sum of similarity scores of all positive examples, Represents the sum of the similarity scores of all samples, and the final loss It is based on the log probability calculated for each sample, and optimizes the model by maximizing the similarity of positive examples and minimizing the similarity of negative examples.
[0027] Furthermore, the total loss obtained by combining the emotion anchor point generation module and the discourse emotion representation module in the contrastive learning module in step 2 is a weighted average of the cross entropy loss, the anchor point angle loss and the supervised contrast loss, and the calculation formula is as follows:
[0028] ,
[0029] in, and is used to balance the supervised contrast loss , Anchor Angle Loss And the cross entropy loss The hyperparameters of Represents the total loss of the Representation Learning stage.
[0030] Furthermore, the emotion anchor point adaptation module in step 2 is used to fine-tune the position of the emotion anchor point after the contrastive learning is completed. The fine-tuning process optimizes the position of the anchor point by minimizing the classification error, so that each anchor point can more accurately represent its corresponding emotion category and enhance the model's discrimination of different emotion categories. The loss function calculation formula for emotion anchor point adaptation is as follows:
[0031] ,
[0032] ,
[0033] in, Indicates Emotional representation of utterances and the jth emotional anchor point The adjusted cosine similarity between is the temperature hyperparameter in the previous stage, It is an adaptation loss function based on classification, for the real label and predicted labels Perform log-likelihood calculation.
[0034] Furthermore, the model training in step 3 includes two stages:
[0035] The first stage: Generate distinguishable speech emotion representations through supervised contrastive learning, so that speech samples with the same emotion are close in feature space, while samples with different emotions are far away, so as to form a clear emotion distinction boundary;
[0036] The second stage: Through the emotional anchor adaptation module, the anchor point position is further adjusted to improve the classification effect of the model. Specifically, when the emotional representation of the discourse is fixed, the position of the anchor point is optimized to make the emotional anchor point more matched with its corresponding discourse representation.
[0037] Furthermore, when the target speech is input into the trained model in step 4, the model predicts the emotion category by matching the emotion feature representation of the speech with the closest emotion anchor point; the matching process includes calculating the similarity between the emotion feature of the target speech and all emotion anchor points, and selecting the anchor point with the highest similarity as the final emotion prediction result, thereby realizing emotion recognition and efficient classification of the target speech.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] (1) The present invention adopts the supervised contrastive learning (SCL) method. By combining the deep semantic information of the pre-trained language model and the contrastive learning strategy, it guides the generation of discourse sentiment representation while making full use of the label semantic information, thereby solving the problem of similar emotions being difficult to distinguish in the prior art. By maximizing the similarity between samples with the same emotion and minimizing the similarity between samples with different emotions, the model can more accurately capture subtle emotional differences, thereby significantly improving the accuracy of emotion recognition.
[0040] (2) The emotion anchor point adaptive module proposed in the present invention fine-tunes the position of the emotion anchor points by minimizing the classification error, so that each anchor point can better represent its corresponding emotion category, further enhancing the performance of the model in complex and diverse emotional scenes, and enabling the model to adapt to different voice inputs and emotional expressions, with higher robustness and generalization ability, thereby better adapting to actual classification needs.
[0041] (3) While improving the accuracy of emotion recognition, the present invention also enhances the generalization ability of the model, enabling it to maintain efficient emotion recognition capabilities under different emotion categories and voice inputs, and can be widely used in various human-computer interaction scenarios, such as intelligent customer service, mental health monitoring, and virtual assistants; in addition, the present invention can also be combined with other modal emotion recognition technologies (such as facial expression recognition, text sentiment analysis) to construct a multimodal emotion recognition system to comprehensively analyze the user's emotional state from multiple perspectives. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of a method for speech emotion recognition based on supervised contrastive learning according to the present invention;
[0043] Figure 2 A schematic diagram of the structure of the speech emotion recognition model constructed for the present invention;
[0044] Figure 3 This is a schematic diagram of the structure of the emotion anchor point generation module of the present invention;
[0045] Figure 4 Schematic diagram of the structure of the speech emotion representation module of the present invention;
[0046] Figure 5 Schematic diagram of the flow of the emotion anchor point adaptive module of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0048] like Figure 1 As shown, a speech emotion recognition method based on supervised contrastive learning includes the following steps:
[0049] Step 1: Obtain a large-scale speech dataset containing multiple emotion categories, and perform systematic preprocessing and emotion labeling on the speech data to build a high-quality training dataset.
[0050] This embodiment obtains a speech dataset containing multiple emotion categories from a public speech emotion database (such as IEMOCAP, MELD, etc.) or through a self-built data collection system. The dataset should cover different emotion categories (for example, neutral, happy, excited, sad, depressed, angry, etc.) and include as many diverse speakers as possible to improve the generalization ability of the model.
[0051] The collected speech data is systematically preprocessed by denoising and normalization to ensure the consistency and reliability of data quality. The preprocessed speech data is emotionally annotated, and each speech segment is associated with the corresponding emotion category to build a supervised learning dataset with high-quality annotations covering multiple emotion categories, providing a solid foundation for the training of the emotion recognition model in the subsequent steps.
[0052] Step 2: Construct a speech emotion recognition model based on the emotion anchor point generation module, discourse emotion representation module, contrastive learning module and emotion anchor point adaptation module.
[0053] like Figure 2 As shown, it is a schematic diagram of the structure of the speech emotion recognition model constructed by the present invention, whose input is the emotion label text and sample audio data, and the output is the result of emotion classification. The emotion anchor point generation module is responsible for generating representative anchor points of each emotion category as reference points in the learning process; the discourse emotion representation module is used to encode the input speech data into a high-dimensional emotion feature representation; the contrastive learning module maximizes the similarity between samples with the same emotion and minimizes the similarity between samples with different emotions to enhance the model's distinguishing ability; the emotion anchor point adaptation module is used to fine-tune the position of the anchor point during the training process to enhance the representativeness and distinguishability of the anchor point. Through the synergistic effect of these modules, the model can effectively learn and capture subtle emotional differences in speech signals.
[0054] like Figure 3 The figure shows the emotion anchor generation module, which generates emotion anchors based on predefined emotion labels. Each emotion anchor is a high-dimensional vector representing an emotion category. It captures the subtle differences between different emotion categories by encoding multiple emotion features, ensuring that the distribution of emotion categories in the feature space has good separability.
[0055] This example uses the RoBERTa (Robustly Optimized BERT Approach, a pre-training method for optimizing BERT) provided by the paper "SimCSE: Simple Contrastive Learning of Sentence Embeddings" as a pre-trained language model, takes the text of the emotion label as the input of the language model, encodes the emotion label, and generates the emotion anchor point. The pre-trained language model captures the deep semantic information of the emotion label through training on a large-scale corpus, thereby generating an emotion anchor point with strong distinguishing ability, which is expressed as:
[0056] ,
[0057] ,
[0058] in, is the input sentiment label text, , each row represents an emotional anchor, s represents the number of emotions, and d represents the vector dimension of the emotional anchor representation. In order to ensure a stable anchor representation, It is frozen.
[0059] In order to further solve the similarity problem, the emotion anchor generation module uses a pre-trained language model to encode the emotion label to generate emotion anchors. During the model training process, the emotion anchors are made more dispersed in the representation space of contrastive learning by calculating the anchor angle loss, so as to distinguish similar emotions. This enables the model to have a higher ability to distinguish when dealing with similar emotion categories. The formula can be expressed as:
[0060] ,
[0061] in, represents the representation of the i-th sentiment anchor point in A, is the vector inner product of two emotional anchor points, which is used to calculate their cosine similarity. The higher the cosine similarity, the more similar the emotional anchor points are, and the smaller their pair angles are. , making the minimum angle (i.e. the angle between the most similar anchor points) as large as possible, thereby reducing The value of . The goal is to minimize the maximum cosine similarity between all emotion anchor points, which is equivalent to maximizing the minimum pairwise angle. The more dispersed the emotion anchor points are, the stronger their ability to identify similar emotions is, making the model have a higher ability to distinguish when dealing with situations where the emotion categories are relatively similar.
[0062] like Figure 4 The figure shows the speech emotion representation module, which includes a speech encoder, a speech projection layer, a speech mapping layer, a text embedding layer, and a language model. The model receives sample audio data and text prompts as input, and encodes them through the speech projection, speech mapping layer, and text embedding layer respectively. The encoded audio and text are used to prompt the language model to generate output.
[0063] In this embodiment, the speech encoder uses Wav2Vec2 as a frozen audio feature extractor to extract dense emotion representations from the sample audio; the speech projection layer includes two learnable linear layers, with the GELU (Gaussian Error Linear Unit) activation function used between them to perform nonlinear transformations on the intermediate features of the Wav2Vec2 hidden layer, and this transformed representation is passed to the speech mapping layer; the speech mapping layer includes a sequence mapper and a Transformer layer, the sequence mapper is a linear layer followed by a reshape operation that converts a single embedding into a set of fixed continuous embeddings; the sequence is passed to a Transformer layer with self-attention, which learns to map the sequence generated from the audio to the latent space of the language model. The text embedding layer includes a word segmenter and embedding lookup of the language model, which are used to convert the tokens of the language model into continuous embeddings; the text mapping layer includes a learnable Transformer layer for converting text embeddings to the latent space of the language model.
[0064] In this embodiment, the speech sentiment representation module uses GPT2 as the language model, and sets the size of the audio and text prefixes to 10. The prefix expression formed by concatenating the two embedded sequences obtained by the above process is:
[0065] ,
[0066] Where k is the prefix size, ( ) represents the audio embedding sequence obtained by converting the sample audio through the speech encoder and speech mapper, ( ) represents the text embedding sequence obtained by converting the text prompt prompt through the text embedding layer and the text mapping layer.
[0067] The language model is based on the prefix Generate sentiment tag sequence, the model uses autoregression to and previous tokens to train on predicting the next text token. The formula for calculating the cross-entropy loss is as follows:
[0068] ,
[0069] Among them, θ represents the trainable parameters of the model, including the speech projection layer, speech mapping layer, and text mapping layer; Indicates the true emotional label of the utterance, Represents the previously generated text token. During the training process, Wav2Vec2, the text embedding layer, and the language model remain frozen, and the generated text tokens are encoded to obtain the final discourse sentiment representation. .
[0070] In this embodiment, the contrastive learning module calculates the contrastive learning loss based on the emotion anchor point to use the semantic information of the emotion tag for better representation learning. By maximizing the similarity between samples with the same emotion and the corresponding emotion anchor point, while minimizing the similarity between different emotion categories, a clear emotion boundary is formed in the feature space, thereby improving the accuracy and generalization ability of emotion recognition. The calculation formula of the supervised contrastive loss is as follows:
[0071] ,
[0072] ,
[0073] In the formula, , which consists of all discourse emotion representations and emotion anchors; Representation and Discourse The set of utterances or anchor representations with the same label, represents the number of positive samples; sim represents the similarity function, and this embodiment uses cosine similarity for calculation. is the temperature hyperparameter of the contrastive loss; express and Similarity measure between ; It means mapping the similarity of two vectors (usually in the range of [-1, 1]) to a non-negative probability space; represents the sum of similarity scores of all positive examples, Represents the sum of the similarity scores of all samples (including positive and negative examples), and the final loss It is based on the log probability calculated for each sample, and optimizes the model by maximizing the similarity of positive examples and minimizing the similarity of negative examples.
[0074] In the process of contrastive learning loss calculation, representations with the same label are pulled closer, while representations with different labels are pushed away. The interaction between representations can be divided into three parts: utterance-utterance, anchor-utterance, and anchor-anchor. The utterance-utterance interaction is similar to traditional contrastive learning, the anchor-utterance interaction represents anchor-guided utterance representation learning, and the anchor-anchor interaction ensures better distinction between different emotions.
[0075] The total loss obtained by combining the above-mentioned emotional anchor point generation module and discourse emotional representation module is the weighted average of cross entropy loss, anchor point angle loss and supervised contrast loss, and the calculation formula is as follows:
[0076] ,
[0077] in, and is used to balance the supervised contrast loss , Anchor Angle Loss And the cross entropy loss The hyperparameters of Represents the total loss of the Representation Learning stage.
[0078] like Figure 5 The figure shows the emotion anchor point adaptation module provided by the present invention. After the comparative learning stage, the emotion anchor point adaptation module further optimizes the position of the emotion anchor point to improve the classification effect of the model. The module adjusts the position of the anchor point by minimizing the classification error so that each anchor point can more accurately represent its corresponding emotion category. In this embodiment, in order to ensure that the emotion anchor point can be located at the most representative discourse representation position of each category, the module freezes the parameters of the language model and transfers the emotion anchor point inherited from the previous stage to the original position. Set as a trainable parameter, and adapt the emotion anchor point through a small number of training cycles to adjust the decision boundary. Specifically, the loss function calculation formula for emotion anchor point adaptation is as follows:
[0079] ,
[0080] ,
[0081] in, Indicates Emotional representation of utterances and the jth emotional anchor point The adjusted cosine similarity between is the temperature hyperparameter in the previous stage, It is an adaptation loss function based on classification, for the real label and predicted labels Perform log-likelihood calculation.
[0082] Step 3: Use the data set constructed in step 1 to train the emotion recognition model.
[0083] According to the emotion recognition model constructed in step 2, model training includes two stages:
[0084] The first stage: Generate distinguishable speech emotion representations through supervised contrastive learning, so that speech samples with the same emotion are closer in the feature space, while samples with different emotions are farther away, so as to form a clear emotion distinction boundary.
[0085] The second stage: Through the emotional anchor point adaptation module, the anchor point position is further adjusted to improve the classification effect of the model. Specifically, when the emotional representation of the discourse is fixed, the position of the anchor point is optimized to make the emotional anchor point more matched with its corresponding discourse representation, thereby improving the accuracy and stability of emotional classification.
[0086] Step 4: Input the target speech to be recognized into the trained model, and calculate the similarity between the emotion representation of the speech and the closest emotion anchor point to obtain the final emotion prediction result.
[0087] In the inference stage, the matching process includes calculating the similarity between the target speech emotional features and all emotional anchor points, and selecting the anchor point with the highest similarity as the final emotional prediction result, thereby achieving emotional recognition and efficient classification of the target speech. The expression is:
[0088] .
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for speech emotion recognition based on supervised contrastive learning, characterized in that: The following steps are involved: Step 1: Obtain a large-scale speech data set containing multiple emotion categories, preprocess and emotion annotate the speech data to construct a training data set; Step 2: construct a speech emotion recognition model based on an emotion anchor point generation module, a discourse emotion representation module, a contrastive learning module, and an emotion anchor point adaptation module; Step 3: training the emotion recognition model using the data set constructed in step 1; Step 4: Input the target speech to be recognized into the trained model, and calculate the similarity between the speech emotion representation and the closest emotion anchor point to obtain the final emotion prediction result; The emotion anchor generation module uses a pre-trained language model to encode emotion tags and generate emotion anchors. During the model training process, the angle loss of the anchors is calculated to make the emotion anchors more dispersed in the representation space of contrastive learning, thereby distinguishing similar emotions. The formula can be expressed as: Among them, a i Represents the representation of the i-th emotional anchor point in A; i ,a j > is the vector inner product of two emotional anchor points, which is used to calculate their cosine similarity. The higher the cosine similarity, the more similar the emotional anchor points are and the smaller their pair angles are. The speech emotion representation module includes a speech encoder, a speech projection layer, a speech mapping layer, a text embedding layer and a language model. The model receives sample audio data and text prompts as input, and encodes them through the speech projection, speech mapping layer and text embedding layer respectively. The encoded audio and text are used to prompt the language model to generate output. The prefix expression formed by splicing the two embedded sequences is: Where k is the prefix size, Represents the audio embedding sequence obtained by converting the sample audio through the speech encoder and speech mapper, Represents the text embedding sequence obtained by converting the text prompt prompt through the text embedding layer and the text mapping layer. The language model is based on the prefix z i Generate a sequence of sentiment tags, and the calculation formula of the cross entropy loss is as follows: Among them, θ represents the trainable parameters of the model, including the speech projection layer, speech mapping layer, and text mapping layer; Indicates the true emotional label of the utterance, Represents the previously generated text tags, encodes the generated text tags, and obtains the final discourse sentiment representation r i ; The contrastive learning module calculates the contrastive learning loss based on the emotion anchor point to maximize the similarity between samples with the same emotion and the corresponding emotion anchor point, while minimizing the similarity between different emotion categories. The calculation formula of the supervised contrastive loss is as follows: Where V = {v1,v2,…,v b+s }, which consists of all discourse emotion representations and emotion anchors; Representation and Discourse i The set of utterances or anchor representations with the same label, represents the number of positive samples; sim represents the similarity function, τ is the temperature hyperparameter of the contrast loss; c ij Indicates v i and v j Similarity measure between ; Indicates mapping the similarity of two vectors to a non-negative probability space; represents the sum of similarity scores of all positive examples, Represents the sum of the similarity scores of all samples, and the final loss is L sup It is based on the log probability calculated for each sample, optimizing the model by maximizing the similarity of positive examples and minimizing the similarity of negative examples; The total loss obtained by combining the emotional anchor point generation module and the discourse emotion representation module in the contrastive learning module is the weighted average of the cross entropy loss, the anchor point angle loss, and the supervised contrast loss. The calculation formula is as follows: L RL =λ1(L sup +λ2L angle )+(1-λ1)L CE , Among them, λ1 and λ2 are used to balance the supervision contrast loss L sup , Anchor point angle loss L angle And the cross entropy loss L CE The hyperparameter, L RL represents the total loss during the representation learning phase.
2. A method for speech emotion recognition based on supervised contrastive learning according to claim 1, characterized in that: The preprocessing in step 1 includes denoising, normalization and emotion labeling of speech data. Through the above processing, a labeled data set covering multiple emotion categories is constructed for training the emotion recognition model in the subsequent steps.
3. The method for speech emotion recognition based on supervised contrastive learning according to claim 1, characterized in that: The emotion anchor point generation module in step 2 generates emotion anchor points based on predefined emotion tags. Each emotion anchor point is a high-dimensional vector representing an emotion category. It captures the subtle differences between different emotion categories by encoding multiple emotion features to ensure that the distribution of emotion categories in the feature space has good separability. The expression is: Z emotion =Encoder(E), A=MLP cl (WITH emotion ), Where E = {e1, e2, …, e s } is the input sentiment label text, A∈R s×d , each row represents a sentiment anchor point, s represents the number of sentiments, and d represents the vector dimension of the sentiment anchor point representation.
4. The method for speech emotion recognition based on supervised contrastive learning according to claim 1, characterized in that: The emotion anchor point adaptation module in step 2 is used to fine-tune the position of the emotion anchor point after the contrastive learning is completed. The fine-tuning process optimizes the position of the anchor point by minimizing the classification error, so that each anchor point can more accurately represent its corresponding emotion category and enhance the model's discrimination of different emotion categories. The loss function calculation formula for emotion anchor point adaptation is as follows: Among them, c ij represents the sentiment representation of the i-th utterance r i and the jth emotional anchor point a j The adjusted cosine similarity between them, τ is the temperature hyperparameter in the previous stage, and L ada is the adaptation loss function based on classification, for the true label y ij and predicted labels Perform log-likelihood calculation.
5. The method for speech emotion recognition based on supervised contrastive learning according to claim 1, characterized in that: The model training in step 3 includes two stages: The first stage: Generate distinguishable speech emotion representations through supervised contrastive learning, so that speech samples with the same emotion are close in feature space, while samples with different emotions are far away, so as to form a clear emotion distinction boundary; The second stage: Through the emotional anchor adaptation module, the anchor point position is further adjusted to improve the classification effect of the model. Specifically, when the emotional representation of the discourse is fixed, the position of the anchor point is optimized to make the emotional anchor point more matched with its corresponding discourse representation.
6. The method for speech emotion recognition based on supervised contrastive learning according to claim 1, characterized in that: When the target speech is input into the trained model in step 4, the model predicts the emotion category by matching the emotion feature representation of the speech with the closest emotion anchor point; the matching process includes calculating the similarity between the emotion feature of the target speech and all emotion anchor points, and selecting the anchor point with the highest similarity as the final emotion prediction result.
Citation Information
Patent Citations
Speech classification network training method and device, computing equipment and storage medium
CN113593611A