Age recognition method, device, equipment and storage medium based on voice

Feature extraction and model training of speech data through deep learning neural networks solve the problem of the complexity and correlation of speech data being ignored in the existing technology, and improve the accuracy of speaker age recognition and the robustness of the model.

CN113889121BActive Publication Date: 2024-10-15PING AN TECH (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111147474.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-28
Publication Date
2024-10-15
Estimated Expiration
2041-09-28

AI Technical Summary

Technical Problem

Existing speaker age recognition models ignore the complexity and contextual relevance of speech data when processing speech data, causing the model to easily match speech in different emotional states to different ages, thus reducing the accuracy of prediction and classification.

Method used

A deep learning neural network is used to extract features from the speech data to be recognized. By constructing a feature matrix including discourse content, pitch, emotion, user personality, gender and age, and using the hybrid loss function value to iteratively update the model, the model can be trained to better An age recognition model that preserves the complexity of speech information.

Benefits of technology

It improves the accuracy of speaker age recognition and improves the feature extraction quality and robustness of the model in practical applications by learning features in multiple dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113889121B_ABST
    Figure CN113889121B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and specifically provides a method, device, equipment and storage medium for age recognition based on speech, wherein the method comprises: obtaining speech data to be recognized based on the user's sample speech; extracting features of the speech data to be recognized through a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix; calculating a mixed loss function value based on the predicted distribution and the label distribution of the speech data to be recognized; iteratively updating the age recognition model based on the mixed loss function value. The embodiments of the present application are conducive to improving the accuracy of speaker age recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of speech classification in artificial intelligence, and in particular to a speech-based age recognition method, device, equipment and storage medium. Background Art

[0002] Speech recognition is an important branch in the field of artificial intelligence, and speaker age estimation is widely considered to be a sub-problem of speech attribute recognition. It determines the gender (male, female) and age range (child, middle-aged, elderly) of the speaker through the received audio data. This technology does not restrict the speech content and language, that is, it only pre-processes the acoustic natural attributes (pitch, intensity, duration, timbre, phonemes, syllables, phonemes, noise) data and extracts them into MFCC (Mel-Frequency Cepstral Coefficients) features to achieve the task objectives. Currently, most commonly used speaker age recognition models focus on how to improve the quality of the feature vector constructed by the model so that the learned feature vector can better eliminate invalid information, but ignore the complexity and context of the speech data itself. The model can easily match speech in different emotional states to different ages, thereby reducing the accuracy of prediction and classification. Summary of the invention

[0003] In response to the above problems, the present application provides a speech-based age recognition method, apparatus, device and storage medium, which are conducive to improving the accuracy of speaker age recognition.

[0004] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present application provides a method for age recognition based on speech, the method comprising:

[0005] Obtaining speech data to be recognized based on a sample speech of the user;

[0006] Extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix;

[0007] Calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0008] The deep learning neural network is iteratively updated according to the mixed loss function value to obtain a trained age recognition model.

[0009] In combination with the first aspect, in a possible implementation manner, calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized includes:

[0010] According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated;

[0011] The hybrid loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficients.

[0012] In combination with the first aspect, in a possible implementation manner, calculating and obtaining the JS divergence includes:

[0013] According to the predicted distribution and the label distribution, the KL loss is calculated using the following formula:

[0014]

[0015] Among them, p i represents the label distribution of the i-th sample speech, q i represents the predicted distribution of the i-th sample speech, L Kl (p i |q i ) represents the KL loss, and X represents a character set;

[0016] According to the KL loss, the JS divergence is calculated using the following formula:

[0017]

[0018] Among them, L Js (p i |q i ) represents the JS divergence.

[0019] In combination with the first aspect, in a possible implementation manner, before calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the method further includes:

[0020] Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age;

[0021] The label distribution is composed of the label probability of the speech data to be recognized in the discourse content dimension, the label probability in the tone dimension, the label probability in the emotion dimension, the label probability in the user personality dimension, the label probability in the gender dimension and the label probability in the age dimension.

[0022] In combination with the first aspect, in a possible implementation manner, the step of acquiring the probability of the speech data to be recognized on the emotion dimension label includes:

[0023] Converting the to-be-recognized speech data into text to be processed;

[0024] Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text;

[0025] Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text;

[0026] The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

[0027] In combination with the first aspect, in a possible implementation, the calculating, based on the shielded text and the replaced text, an importance measure of a word in the to-be-processed text for sentiment classification of the to-be-processed text includes:

[0028] Calling a masked language model to process the masked text to obtain a first prediction result of a word in the text to be processed;

[0029] Calling the masked language model to process the replaced text to obtain a second prediction result of the word in the text to be processed;

[0030] The importance metric is calculated based on the first prediction result and the second prediction result.

[0031] In combination with the first aspect, in a possible implementation manner, the deep learning neural network includes a backbone network and a fully connected layer;

[0032] The feature extraction of the speech data to be recognized by the deep learning neural network is performed to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, including:

[0033] Inputting the speech data to be recognized into the deep learning neural network for convolution processing, and extracting features of the speech data to be recognized after the convolution processing through the backbone network to obtain a feature matrix to be pooled;

[0034] Performing average pooling processing on the feature matrix to be pooled to obtain features after average pooling;

[0035] The average pooled features are classified through the fully connected layer to obtain the feature matrix.

[0036] A second aspect of an embodiment of the present application provides a voice-based age recognition device, the device comprising:

[0037] A preprocessing unit, used to obtain speech data to be recognized based on a sample speech of a user;

[0038] A recognition unit, configured to extract features of the speech data to be recognized by using a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtain a predicted distribution including the user's age based on the feature matrix;

[0039] A calculation unit, configured to calculate a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0040] An adjustment unit is used to iteratively update the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model.

[0041] A third aspect of an embodiment of the present application provides an electronic device, the electronic device comprising an input device and an output device, and further comprising a processor adapted to implement one or more computer programs; and a memory, wherein the memory stores one or more computer programs, wherein the one or more computer programs are adapted to be loaded by the processor and execute the following steps:

[0042] Obtaining speech data to be recognized based on a sample speech of the user;

[0043] Extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix;

[0044] Calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0045] The deep learning neural network is iteratively updated according to the mixed loss function value to obtain a trained age recognition model.

[0046] A fourth aspect of the embodiments of the present application provides a computer storage medium, wherein the computer storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the following steps:

[0047] Obtaining speech data to be recognized based on a sample speech of the user;

[0048] Extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix;

[0049] Calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0050] The deep learning neural network is iteratively updated according to the mixed loss function value to obtain a trained age recognition model.

[0051] The above scheme of the present application includes at least the following beneficial effects: the embodiment of the present application obtains the speech data to be recognized based on the sample speech of the user; extracts features of the speech data to be recognized through a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and obtains a predicted distribution including the user's age based on the feature matrix; calculates the value of the mixed loss function according to the predicted distribution and the label distribution of the speech data to be recognized; iteratively updates the deep learning neural network according to the mixed loss function value to obtain an age recognition model. In this way, the deep learning neural network is trained by pre-constructing the label distribution and the defined mixed loss function, so that the age recognition model can learn the features of multiple dimensions including speech content, pitch, emotion, user personality, gender and age, so as to retain the complexity of the information in the sample speech, thereby improving the quality of the features extracted by the model in practical applications, and thus facilitating the improvement of the accuracy of speaker age recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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.

[0053] Figure 1 A schematic diagram of an application environment provided for an embodiment of the present application;

[0054] Figure 2 A flowchart of a method for age recognition based on speech provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of feature extraction provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of obtaining importance measurement provided in an embodiment of the present application;

[0057] Figure 5 A flowchart of another method for age recognition based on speech provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of a voice-based age recognition device provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to enable those skilled in the art to better understand the solution of the present application, 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 should fall within the scope of protection of the present application.

[0061] The terms "including" and "having" and any variations thereof that appear in the specification, claims and drawings of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In addition, the terms "first", "second" and "third" are used to distinguish different objects, rather than to describe a specific order.

[0062] The present application embodiment provides a method for age recognition based on speech, which can be based on Figure 1 For the application environment implementation shown, see Figure 1, the application environment includes an electronic device and at least one terminal device connected to the electronic device for communication, wherein the terminal device is used to receive the original voice input by the user, such as in the online customer service or online business processing scenario, the terminal device is used to receive the voice input by the user through the microphone, or the terminal device can be a terminal device of the R&D personnel, in the R&D test, the terminal device is used to receive the program instruction of the R&D personnel to retrieve the historical sample voice of the user from the log record, and send the sample voice to the electronic device. After receiving the sample voice (or original voice), the electronic device pre-processes the sample voice (or original voice) to obtain the voice data to be recognized, and then extracts the feature matrix including the speech content, tone, emotion, user personality, gender and age through the age recognition model, and predicts the speaker's age and gender based on the feature matrix. In some scenarios, the seat or robot can find the answer that matches the speaker's age and gender based on the prediction results of the electronic device. In other scenarios, the electronic device can train the age recognition model based on the prediction results and multi-label distribution learning to improve the effect or quality of the model's feature extraction, and finally improve the model's prediction accuracy.

[0063] Among them, the electronic device can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0064] based on Figure 1 The application environment shown is described below in detail with reference to other drawings to illustrate the age recognition method based on speech provided by the embodiment of the present application.

[0065] See also Figure 2 , Figure 2 A flow chart of a method for age recognition based on speech provided in an embodiment of the present application is provided, and the method is applied to electronic devices, such as Figure 2 As shown, steps 201-204 are included:

[0066] 201: Obtaining speech data to be recognized based on the user's sample speech.

[0067] In an embodiment of the present application, for the sample voice of the user provided by the terminal device, the electronic device first performs voice activity detection (VAD) on it, identifies multiple voice segments in the sample voice, removes the pause intervals between adjacent voice segments in the multiple voice segments, and then performs denoising processing on each of the multiple voice segments, splices each denoised voice segment according to the original order of the multiple voice segments to obtain a spliced ​​voice, and then smoothes the splicing of the spliced ​​voice to obtain a smooth and smooth voice, samples the smooth and smooth voice or extracts the smooth and smooth voice as MFCC features to obtain voice data to be recognized.

[0068] 202: Extract features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and obtain a predicted distribution including the user's age based on the feature matrix.

[0069] In the embodiment of the present application, the deep learning neural network adopts the structure of ResNet18 network + classifier. It should be understood that the ResNet18 network includes 17 convolutional layers and 1 fully connected layer, while the pooling layer and the batch layer are unweighted. Except for the first convolutional layer, every two convolutional layers constitute a residual block, and all residual blocks constitute the backbone network of the ResNet18 network. 3*3 convolution is used in the residual block.

[0070] Exemplarily, the feature extraction of the speech data to be recognized by the deep learning neural network is performed to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, including:

[0071] Inputting the speech data to be recognized into the deep learning neural network for convolution processing, and extracting features of the speech data to be recognized after the convolution processing through the backbone network to obtain a feature matrix to be pooled;

[0072] Performing average pooling processing on the feature matrix to be pooled to obtain features after average pooling;

[0073] The average pooled features are classified through the fully connected layer to obtain the feature matrix.

[0074] like Figure 3As shown, the data to be processed first undergoes convolution processing of the first convolution layer of the ResNet18 network, and the convolution kernel size of the first convolution layer is 7*7. After being processed by the first convolution layer, the data is then subjected to feature extraction of the backbone network of ResNet18, that is, after being processed by 8 residual blocks, a feature matrix to be pooled is obtained, and the feature matrix to be pooled is averaged and averaged. The features after average pooling are processed by the fully connected layer to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age. Among them, speech content usually refers to the intention that the user wants to express, which can be understood as semantic information. It should be noted that in this implementation, the maximum pooling is not used after the 7*7 convolution, but only the average pooling is used before the classification of the fully connected layer. The purpose is to postpone the pooling operation and retain the order information of the context of the sample speech as much as possible, so that the features extracted by the age recognition model pay more attention to the contextual association, and after being converted into distribution, it can be closer to the real speech situation.

[0075] Based on the extracted feature matrix, classifiers in conventional age recognition models, such as softmax classifiers and Gaussian mixture models, are used to predict the probability of the user in terms of speech content, tone, emotion, user personality, gender and age, and the probabilities are sequentially organized into a prediction distribution.

[0076] 203: Calculate a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized.

[0077] In the embodiment of the present application, the mixed loss function value is calculated according to the predicted distribution and the label distribution of the speech data to be recognized, including:

[0078] According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated;

[0079] The hybrid loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficients.

[0080] Specifically, the KL loss is calculated using the following formula based on the predicted distribution and label distribution:

[0081]

[0082] Among them, p i represents the label distribution of the i-th sample speech (or speech data to be recognized), q i represents the predicted distribution of the i-th sample speech (or speech data to be recognized), L Kl (p i |q i) represents the KL loss, X represents the character set; wherein, in multi-label distribution learning, KL loss (or KL divergence) is usually used to represent the distance between the predicted distribution and the label distribution to train the model, but considering the asymmetry of KL divergence, the training speed may be unstable and the loss cannot be reduced during the training process, JS divergence is used to represent the distance between the predicted distribution and the label distribution.

[0083] The JS divergence is calculated using the following formula based on the KL loss:

[0084]

[0085] Among them, L Js (p i |q i ) represents the JS divergence.

[0086] The L1 loss is calculated based on the predicted distribution and label distribution using the following formula:

[0087]

[0088] Where n represents the number of sample voices, and L1 loss represents the minimum absolute deviation between the predicted distribution and the label distribution, which is used to minimize the sum of the absolute differences between the predicted distribution and the label distribution.

[0089] The variance loss is calculated based on the predicted distribution and label distribution using the following formula:

[0090]

[0091]

[0092]

[0093] Among them, v i represents the variance of the i-th sample speech (or speech data to be recognized), Q represents the number of label categories in the label distribution, j represents the j-th label category in the label distribution, and q i,j represents the predicted probability that the i-th sample speech belongs to the j-th label category, m o Represents the mean of the i-th sample speech (or speech data to be recognized) in the label distribution.

[0094] Then the mixed loss function is defined as:

[0095] LOSS=λ1*L Js +λ2*L1+λ3*L v ;

[0096] Among them, LOSS represents the mixed loss function, λ1 represents the JS divergence penalty coefficient, λ2 represents the minimum absolute deviation penalty coefficient, and λ3 represents the variance penalty coefficient.

[0097] In this implementation, considering that the asymmetric problem of KL divergence may cause unstable training speed and inability to reduce loss during training, JS divergence is integrated into the hybrid loss function to solve the asymmetric problem of KL divergence and outlier sensitivity, to ensure the stability of the model during training as much as possible, and to avoid model collapse.

[0098] 204: Iteratively update the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model.

[0099] In the embodiment of the present application, based on the value of the hybrid loss function calculated in step 203, a back propagation algorithm is used to iteratively update the parameters of the deep neural network until the loss converges to obtain a trained age recognition model.

[0100] Exemplarily, before calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the method further includes:

[0101] Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age;

[0102] The label distribution is composed of the label probability of the speech data to be recognized in the discourse content dimension, the label probability in the tone dimension, the label probability in the emotion dimension, the label probability in the user personality dimension, the label probability in the gender dimension and the label probability in the age dimension.

[0103] In the embodiment of the present application, a multi-label distribution learning method is adopted. For the above-mentioned speech data to be recognized (or sample speech), q i,jTo represent its probability for a certain label category (, such as the label probability in the dimension of speech content, the label probability in the dimension of tone, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender and the label probability in the dimension of age, wherein the probability of the speech data (or sample speech) to be recognized in a certain label category represents its true value in the label category, and its probability in all label categories constitutes an ordered sample distribution. Exemplarily, the label distribution can be obtained by manually marking the speech data (or sample speech) to be recognized, or by converting the cluster distribution of the speech data (or sample speech) to be recognized by the soft clustering algorithm Fuzzy C-Means, which is not limited in this application. In this implementation, the use of multi-label probabilities to form an ordered probability distribution is conducive to enabling the model to learn more original, complex and diverse features from the sample distribution.

[0104] Exemplarily, the step of obtaining the probability of the speech data to be recognized on the emotion dimension label includes:

[0105] Converting the to-be-recognized speech data into text to be processed;

[0106] Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text;

[0107] Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text;

[0108] The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

[0109] In the embodiment of the present application, speech-to-text technology is used to convert the speech data to be recognized into the text to be processed, and the masked language model (MLM) is used to process the text to be processed, and 15% of the words in the text to be processed are randomly selected, and the tokens are masked by the mask 80% of the time to obtain the masked text, which is actually a sequence composed of tokens and masks, and the tokens of other arbitrary words in the vocabulary are used to replace the tokens of the selected words 10% of the time to obtain the replaced text, which is actually a token sequence, and the original tokens of the selected words are retained 10% of the time. Among them, the vocabulary can be an online consultation vocabulary related to the medical field, an operating instruction vocabulary related to medical equipment, and so on.

[0110] Exemplarily, the calculating, based on the shielded text and the replaced text, an importance measure of words in the to-be-processed text for sentiment classification of the to-be-processed text includes:

[0111] Calling a masked language model to process the masked text to obtain a first prediction result of a word in the text to be processed;

[0112] Calling the masked language model to process the replaced text to obtain a second prediction result of the word in the text to be processed;

[0113] The importance metric is calculated based on the first prediction result and the second prediction result.

[0114] Among them, Figure 4 As shown, the MLM model predicts the masked word with the masked text as input to obtain a first prediction result, wherein the first prediction result indicates the score (or probability, confidence, etc.) that the masked word belongs to a preset word in the vocabulary, and the MLM model predicts the replaced word with the replaced text as input to obtain a second prediction result, wherein the second prediction result indicates the score (or probability, confidence, etc.) that the replaced word belongs to a preset word in the vocabulary, wherein the input of the MLM model also includes the original token of the word, i.e. Figure 4 The prediction results of the original tokens in the text to be processed are not included in the calculation of the importance measure. The importance measure of the words in the text to be processed for the sentiment classification of the text to be processed is calculated based on the first prediction result and the second prediction result using the following formula:

[0115]

[0116] in, Represents the importance measure of word W. For example, the sentiment expressed by "I hate this movie" is dislike, then represents the importance of word W for the sentence to be classified as dislike, S -β \ represents the sequence after replacing the word W, represents the second prediction result of the MLM model after replacing word W, S -β It means to mask out the sequence after word W. It represents the first prediction result of the MLM model after masking the word W. represents the words randomly sampled from the text to be processed, and \ represents the operation of shielding the phrase P from the text to be processed.

[0117] The value range of the importance measure is preset to [0,100]. For words outside this range, the classifier does not output them. For words that the classifier has importance measure outputs, the average of the importance measures of these words is calculated, and the average is normalized to the preset interval of (0,1) to obtain the probability of the speech data to be recognized on the emotional dimension label. In this implementation, the probability of the speech data to be recognized on the emotional dimension label is determined by the importance measure of the word for the emotional classification of the processed text, which is conducive to enabling the model to learn the degree of influence of the data corresponding to each word in the speech data to be recognized on the text sentiment classification, thereby realizing fine-grained feature learning.

[0118] It can be seen that the embodiment of the present application obtains the speech data to be recognized based on the sample speech of the user; extracts features of the speech data to be recognized through a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and obtains a predicted distribution including the user's age based on the feature matrix; calculates the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized; iteratively updates the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model. In this way, the age recognition model is trained by pre-constructing the label distribution and defining the mixed loss function, so that the age recognition model learns features including speech content, pitch, emotion, user personality, gender and age in multiple dimensions, so as to retain the complexity of the information in the sample speech, thereby improving the quality of the features extracted by the model in practical applications, and further facilitating the improvement of the accuracy of speaker age recognition. In addition, since the learned features are complex and diverse, including speech content, pitch, emotion, user personality, gender and age in various dimensions, using such features to train the age recognition model is conducive to improving the robustness of the model.

[0119] See also Figure 5 , Figure 5 A flowchart of another method for age recognition based on speech provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, steps 501-505 are included:

[0120] 501: obtaining speech data to be recognized based on a sample speech of the user;

[0121] 502: extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix;

[0122] 503: Calculate JS divergence, variance loss, and L1 loss according to the predicted distribution and the label distribution of the speech data to be recognized;

[0123] 504: Calculate a mixed loss function value according to the JS divergence, the variance loss, the L1 loss, and corresponding penalty coefficients;

[0124] 505: Iteratively update the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model.

[0125] The specific implementation of steps 501-505 is as follows: Figure 2 The embodiments shown have been described in detail and can achieve the same or similar beneficial effects. To avoid repetition, they will not be described again here.

[0126] Based on the description of the above-mentioned embodiment of the voice-based age recognition method, please refer to Figure 6 , Figure 6 A schematic diagram of a voice-based age recognition device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device includes a preprocessing unit 601, a recognition unit 602, a calculation unit 603 and an adjustment unit 604;

[0127] A preprocessing unit 601 is used to obtain speech data to be recognized based on a sample speech of a user;

[0128] The recognition unit 602 is used to extract features of the speech data to be recognized through a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtain a predicted distribution including the user's age based on the feature matrix;

[0129] A calculation unit 603 is used to calculate a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0130] The adjustment unit 604 is used to iteratively update the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model.

[0131] It can be seen that in Figure 6In the voice-based age recognition device shown, voice data to be recognized is obtained based on the user's sample voice; the voice data to be recognized is subjected to feature extraction through a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and a predicted distribution including the user's age is obtained based on the feature matrix; a mixed loss function value is calculated based on the predicted distribution and the label distribution of the voice data to be recognized; the deep learning neural network is iteratively updated based on the mixed loss function value to obtain a trained age recognition model. In this way, the deep learning neural network is trained by pre-constructing the label distribution and defining the mixed loss function, so that the age recognition model learns features including multiple dimensions such as speech content, pitch, emotion, user personality, gender and age, so as to retain the complexity of the information in the sample voice, thereby improving the quality of the features extracted by the model in practical applications, and further facilitating the improvement of the accuracy of speaker age recognition. In addition, since the learned features are complex and diverse, including various dimensions such as speech content, pitch, emotion, user personality, gender and age, using such features to train the age recognition model is conducive to improving the robustness of the model.

[0132] In a possible implementation manner, in terms of calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the calculation unit 603 is specifically configured to:

[0133] According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated;

[0134] The hybrid loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficients.

[0135] In a possible implementation, in terms of calculating the JS divergence, the calculation unit 603 is specifically used to:

[0136] According to the predicted distribution and the label distribution, the KL loss is calculated using the following formula:

[0137]

[0138] Among them, p i represents the label distribution of the i-th sample speech, q i represents the predicted distribution of the i-th sample speech, L Kl (p i |q i ) represents the KL loss, and X represents a character set;

[0139] According to the KL loss, the JS divergence is calculated using the following formula:

[0140]

[0141] Among them, L Js (p i |q i ) represents the JS divergence.

[0142] In a possible implementation, the identification unit 602 is further configured to:

[0143] Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age;

[0144] The label distribution is composed of the label probability of the speech data to be recognized in the discourse content dimension, the label probability in the tone dimension, the label probability in the emotion dimension, the label probability in the user personality dimension, the label probability in the gender dimension and the label probability in the age dimension.

[0145] In a possible implementation manner, in terms of obtaining the probability of the speech data to be recognized on the emotion dimension label, the recognition unit 602 is specifically configured to:

[0146] Converting the to-be-recognized speech data into text to be processed;

[0147] Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text;

[0148] Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text;

[0149] The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

[0150] In a possible implementation manner, in terms of calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text based on the shielded text and the replaced text, the recognition unit 602 is specifically configured to:

[0151] Calling a masked language model to process the masked text to obtain a first prediction result of a word in the text to be processed;

[0152] Calling the masked language model to process the replaced text to obtain a second prediction result of the word in the text to be processed;

[0153] The importance metric is calculated based on the first prediction result and the second prediction result.

[0154] In a possible implementation, the deep learning neural network includes a backbone network and a fully connected layer; in extracting features of the speech data to be recognized through the deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, the recognition unit 602 is specifically used to:

[0155] Inputting the speech data to be recognized into the deep learning neural network for convolution processing, and extracting features of the speech data to be recognized after the convolution processing through the backbone network to obtain a feature matrix to be pooled;

[0156] Performing average pooling processing on the feature matrix to be pooled to obtain features after average pooling;

[0157] The average pooled features are classified through the fully connected layer to obtain the feature matrix.

[0158] According to one embodiment of the present application, Figure 6 The various units of the voice-based age recognition device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the voice-based age recognition device can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0159] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 5 A computer program (including program code) for each step involved in the corresponding method shown in Figure 6 The device for age recognition based on speech shown in the embodiment of the present application is used to implement the method for age recognition based on speech. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the computing device through the computer-readable recording medium and run therein.

[0160] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides an electronic device. Figure 7 The electronic device at least includes a processor 701, an input device 702, an output device 703 and a memory 704. The processor 701, the input device 702, the output device 703 and the memory 704 in the electronic device may be connected via a bus or other means.

[0161] The computer storage medium may be stored in the memory 704 of the electronic device, the computer storage medium is used to store a computer program, the computer program includes program instructions, and the processor 701 is used to execute the program instructions stored in the computer storage medium 704. The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more computer programs, and is specifically suitable for loading and executing one or more computer programs to implement corresponding method flows or corresponding functions.

[0162] In one embodiment, the processor 701 of the electronic device provided in the embodiment of the present application can be used to perform a series of self-supervision-based data enhancement processes:

[0163] Obtaining speech data to be recognized based on a sample speech of the user;

[0164] Extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix;

[0165] Calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized;

[0166] The deep learning neural network is iteratively updated according to the mixed loss function value to obtain a trained age recognition model.

[0167] It can be seen that in Figure 7In the electronic device shown, speech data to be recognized is obtained based on the user's sample speech; the speech data to be recognized is feature extracted through a deep learning neural network to obtain a feature matrix including speech content, pitch, emotion, user personality, gender and age, and a predicted distribution including the user's age is obtained based on the feature matrix; a mixed loss function value is calculated based on the predicted distribution and the label distribution of the speech data to be recognized; the deep learning neural network is iteratively updated based on the mixed loss function value to obtain a trained age recognition model. In this way, the deep learning neural network is trained through the pre-constructed label distribution and the defined mixed loss function, so that the age recognition model learns features of multiple dimensions including speech content, pitch, emotion, user personality, gender and age, so as to retain the complexity of the information in the sample speech, thereby improving the quality of the features extracted by the model in practical applications, and thus facilitating the improvement of the accuracy of speaker age recognition.

[0168] In another embodiment, the processor 701 calculates a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, including:

[0169] According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated;

[0170] The hybrid loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficients.

[0171] In another embodiment, the processor 701 performs calculation to obtain the JS divergence, including:

[0172] According to the predicted distribution and the label distribution, the KL loss is calculated using the following formula:

[0173]

[0174] Among them, p i represents the label distribution of the i-th sample speech, q i represents the predicted distribution of the i-th sample speech, L Kl (p i |q i ) represents the KL loss, and X represents a character set;

[0175] According to the KL loss, the JS divergence is calculated using the following formula:

[0176]

[0177] Among them, L Js (p i |q i ) represents the JS divergence.

[0178] In yet another embodiment, before calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the processor 701 is further configured to execute:

[0179] Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age;

[0180] The label distribution is composed of the label probability of the speech data to be recognized in the discourse content dimension, the label probability in the tone dimension, the label probability in the emotion dimension, the label probability in the user personality dimension, the label probability in the gender dimension and the label probability in the age dimension.

[0181] In another embodiment, the processor 701 performs a step of acquiring the probability of the speech data to be recognized on the emotion dimension label, including:

[0182] Converting the to-be-recognized speech data into text to be processed;

[0183] Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text;

[0184] Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text;

[0185] The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

[0186] In another embodiment, the processor 701 calculates the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text based on the shielded text and the replaced text, including:

[0187] Calling a masked language model to process the masked text to obtain a first prediction result of a word in the text to be processed;

[0188] Calling the masked language model to process the replaced text to obtain a second prediction result of the word in the text to be processed;

[0189] The importance metric is calculated based on the first prediction result and the second prediction result.

[0190] In another embodiment, the deep learning neural network includes a backbone network and a fully connected layer; the processor 701 performs feature extraction on the speech data to be recognized by the deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, including:

[0191] Inputting the speech data to be recognized into the deep learning neural network for convolution processing, and extracting features of the speech data to be recognized after the convolution processing through the backbone network to obtain a feature matrix to be pooled;

[0192] Performing average pooling processing on the feature matrix to be pooled to obtain features after average pooling;

[0193] The average pooled features are classified through the fully connected layer to obtain the feature matrix.

[0194] Exemplarily, the electronic device includes but is not limited to a processor 701, an input device 702, an output device 703, and a memory 704. It may also include a memory, a power supply, an application client module, etc. The input device 702 may be a keyboard, a touch screen, a radio frequency receiver, etc., and the output device 703 may be a speaker, a display, a radio frequency transmitter, etc. It will be understood by those skilled in the art that the schematic diagram is merely an example of an electronic device and does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or different components.

[0195] It should be noted that, since the processor 701 of the electronic device implements the steps of the above-mentioned voice-based age recognition method when executing a computer program, the embodiments of the above-mentioned voice-based age recognition method are all applicable to the electronic device and can achieve the same or similar beneficial effects.

[0196] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 701 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor 701. In one embodiment, the processor 701 can load and execute one or more computer programs stored in the computer storage medium to implement the corresponding steps of the above-mentioned method for age recognition based on speech.

[0197] Exemplarily, the computer program of the computer storage medium includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0198] It should be noted that, since the computer program of the computer storage medium implements the steps of the above-mentioned voice-based age recognition method when executed by the processor, all embodiments of the above-mentioned voice-based age recognition method are applicable to the computer storage medium and can achieve the same or similar beneficial effects.

[0199] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method of age recognition based on speech, It is characterized in that The method comprises: Obtaining speech data to be recognized based on a sample speech of the user; Extracting features of the speech data to be recognized by a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtaining a predicted distribution including the user's age based on the feature matrix; Calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized; Iteratively updating the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model; The step of calculating a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized includes: According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated; The mixed loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficient; Before calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the method further includes: Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age; The label distribution is formed by combining the label probability of the speech data to be recognized in the dimension of speech content, the label probability of the tone dimension, the label probability of the emotion dimension, the label probability of the user personality dimension, the label probability of the gender dimension and the label probability of the age dimension; The step of obtaining the probability of the speech data to be recognized on the emotion dimension label includes: Converting the to-be-recognized speech data into text to be processed; Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text; Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text; The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

2. The method according to claim 1, It is characterized in that The calculation to obtain the JS divergence includes: According to the predicted distribution and the label distribution, the KL loss is calculated using the following formula: ; in, represents the label distribution of the i-th sample speech, represents the predicted distribution of the i-th sample speech, represents the KL loss, Represents a character set; According to the KL loss, the JS divergence is calculated using the following formula: ; in, represents the JS divergence.

3. The method according to claim 1, It is characterized in that The step of calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text based on the shielded text and the replaced text includes: Calling a masked language model to process the masked text to obtain a first prediction result of a word in the text to be processed; Calling the masked language model to process the replaced text to obtain a second prediction result of the word in the text to be processed; The importance metric is calculated based on the first prediction result and the second prediction result.

4. The method according to claim 1, It is characterized in that The deep learning neural network includes a backbone network and a fully connected layer; The feature extraction of the speech data to be recognized by the deep learning neural network is performed to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, including: Inputting the speech data to be recognized into the deep learning neural network for convolution processing, and extracting features of the speech data to be recognized after the convolution processing through the backbone network to obtain a feature matrix to be pooled; Performing average pooling processing on the feature matrix to be pooled to obtain features after average pooling; The average pooled features are classified through the fully connected layer to obtain the feature matrix.

5. A voice-based age recognition device, It is characterized in that The device comprises: A preprocessing unit, used to obtain speech data to be recognized based on a sample speech of a user; A recognition unit, configured to extract features of the speech data to be recognized by using a deep learning neural network to obtain a feature matrix including speech content, tone, emotion, user personality, gender and age, and obtain a predicted distribution including the user's age based on the feature matrix; A calculation unit, configured to calculate a mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized; An adjustment unit, configured to iteratively update the deep learning neural network according to the mixed loss function value to obtain a trained age recognition model; In terms of calculating the mixed loss function value according to the predicted distribution and the label distribution of the speech data to be recognized, the calculation unit is specifically used for: According to the predicted distribution and the label distribution, JS divergence, variance loss and L1 loss are calculated; The mixed loss function value is calculated according to the JS divergence, the variance loss, the L1 loss and the corresponding penalty coefficient; The identification unit is also used for: Obtaining the label probability of the speech data to be recognized in the dimension of speech content, the label probability in the dimension of pitch, the label probability in the dimension of emotion, the label probability in the dimension of user personality, the label probability in the dimension of gender, and the label probability in the dimension of age; The label distribution is formed by combining the label probability of the speech data to be recognized in the dimension of speech content, the label probability of the tone dimension, the label probability of the emotion dimension, the label probability of the user personality dimension, the label probability of the gender dimension and the label probability of the age dimension; In terms of obtaining the probability of the speech data to be recognized on the emotion dimension label, the recognition unit is specifically used to: Converting the to-be-recognized speech data into text to be processed; Masking the words in the text to be processed to obtain a masked text, and replacing the words in the text to be processed with any words in a vocabulary to obtain a replaced text; Based on the shielded text and the replaced text, calculating the importance measure of the words in the to-be-processed text for the sentiment classification of the to-be-processed text; The importance measure is normalized to a preset interval to obtain the probability of the speech data to be recognized on the emotion dimension label.

6. An electronic device comprising an input device and an output device, It is characterized in that Also includes: a processor adapted to implement one or more computer programs; as well as, A memory storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by the processor and executing the method according to any one of claims 1 to 4.

7. A computer storage medium, It is characterized in that The computer storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • A Semi-Supervised Method for Decomposing Variable Factors of Speech Features

    CN104021373B

  • Intelligent emotion recognition method, intelligent emotion recognition device and computer readable storage medium

    CN111223498A

  • Emotion recognition method and device, computer equipment and storage medium

    CN112949708A

  • Multi-modal sentiment classification method taking text as core

    CN113312530A

  • KR20190133580A