Voiceprint model training method and device, computer device and storage medium
By adjusting the angle adjustment value and loss function of the training speech samples, the parameters of the voiceprint model are optimized, which solves the problem of low feature quality in traditional voiceprint recognition and achieves higher feature extraction and recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHAOLIAN CONSUMER FINANCE CO LTD
- Filing Date
- 2022-10-31
- Publication Date
- 2026-08-04
AI Technical Summary
Traditional voiceprint recognition technology fails to effectively consider the differences between samples, resulting in low quality of voiceprint features extracted by the voiceprint model, which in turn affects the recognition effect.
By constructing an angle adjustment value, the angle between the voiceprint features of the training speech samples and the category voiceprint features of the target category is adjusted, the loss function of the voiceprint model is dynamically adjusted, and the model parameters are optimized to improve the accuracy of feature extraction.
It improves the accuracy of voiceprint feature extraction and voiceprint recognition, making voiceprint features of the same category more similar and voiceprint features of different categories more dispersed, thus enhancing the model's classification ability.
Smart Images

Figure CN115762530B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a voiceprint model training method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the development of computer technology, voiceprint recognition technology has emerged, and it is one of the important research directions in the field of speech. Voiceprint recognition technology refers to the use of speech to identify the speaker's identity based on a voiceprint model, and it is widely used in various scenarios.
[0003] In traditional voiceprint recognition technology, voiceprint models are often trained by adding a fixed boundary to the loss function. However, this training method does not take into account the differences between samples, resulting in low quality of voiceprint features extracted by the voiceprint model, which in turn leads to poor voiceprint recognition performance. Summary of the Invention
[0004] Therefore, it is necessary to provide a voiceprint model training method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of voiceprint feature extraction and voiceprint recognition in order to address the above-mentioned technical problems.
[0005] This application provides a method for training a voiceprint model. The method includes:
[0006] Obtain the training set; the training set includes the training speech features and target categories corresponding to multiple training speech samples;
[0007] The training speech features in the training set are input into the initial voiceprint model to obtain the training voiceprint features and voiceprint quality scores corresponding to each training speech sample; the initial voiceprint model includes the category voiceprint features corresponding to multiple candidate categories.
[0008] Construct the angle adjustment value corresponding to the training speech sample based on the speaker quality score of the training speech sample;
[0009] Based on the angle adjustment value corresponding to the same training speech sample, the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature is adjusted to obtain the first angle corresponding to each training speech sample. The feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories is calculated to obtain the second angle corresponding to each training speech sample.
[0010] The target loss is obtained based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample;
[0011] Adjust the model parameters of the initial voiceprint model based on the target loss to obtain the intermediate voiceprint model. Use the intermediate voiceprint model as the initial voiceprint model and return to the step of obtaining the training set until the convergence condition is met to obtain the target voiceprint model.
[0012] This application also provides a voiceprint model training device. The device includes:
[0013] The training set acquisition module is used to acquire the training set; the training set includes training speech features and target categories corresponding to multiple training speech samples;
[0014] The speaker feature and quality score acquisition module is used to input the training speech features in the training set into the initial speaker model to obtain the training speaker features and speaker quality scores corresponding to each training speech sample; the initial speaker model includes the category speaker features corresponding to multiple candidate categories.
[0015] Angle adjustment value determination module is used to construct the angle adjustment value corresponding to the training speech sample based on the voiceprint quality score corresponding to the training speech sample.
[0016] The first and second angle determination module is used to adjust the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature based on the angle adjustment value corresponding to the same training speech sample, so as to obtain the first angle corresponding to each training speech sample, and calculate the feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories, so as to obtain the second angle corresponding to each training speech sample.
[0017] The target loss determination module is used to obtain the target loss based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample;
[0018] The target voiceprint model determination module is used to adjust the model parameters of the initial voiceprint model based on the target loss to obtain an intermediate voiceprint model. The intermediate voiceprint model is then used as the initial voiceprint model, and the step of obtaining the training set is returned to execute until the convergence condition is met, thus obtaining the target voiceprint model.
[0019] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described voiceprint model training method.
[0020] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described voiceprint model training method.
[0021] A computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described voiceprint model training method.
[0022] The aforementioned voiceprint model training method, apparatus, computer equipment, storage medium, and computer program product acquire a training set, which includes training speech features and target categories corresponding to multiple training speech samples. The training speech features from the training set are input into an initial voiceprint model to obtain training voiceprint features and voiceprint quality scores corresponding to each training speech sample. Using speech features extracted from speech samples as input to the voiceprint model improves the efficiency of the voiceprint model's output of voiceprint features. An angle adjustment value is constructed based on the voiceprint quality score corresponding to the training speech sample; this angle adjustment value reflects the voiceprint quality of the training speech sample. The feature angle and angle adjustment value between the training voiceprint features corresponding to the same training speech sample and the category voiceprint features corresponding to the target category are fused to obtain the first angle corresponding to the training speech sample. The purpose of calculating the first angle is to penalize the feature angle. Based on the loss value calculated from the first angle, adjusting the various model parameters can reduce the feature angle between the training voiceprint features extracted by the voiceprint model in the next iteration and the corresponding category voiceprint features of the target category. This makes the voiceprint features corresponding to speech samples belonging to the same category more similar, that is, it makes the voiceprint features belonging to the same category more clustered, i.e., increases the intra-class compactness of the same category. At the same time, it can make the voiceprint features belonging to different categories more dispersed, i.e., increases the inter-class differences between different categories. After the model parameters are adjusted, the extracted training voiceprint features will be more specific and complete than those extracted using a model without parameter adjustment. The more specific the training voiceprint features are, the more detailed the feature information they carry, and thus they can be closer to the corresponding category features, thereby reducing the feature angle between the training voiceprint features and the corresponding category voiceprint features. The initial voiceprint model can dynamically generate an angle adjustment value in the loss function based on the voiceprint quality of each training speech sample, thereby dynamically adjusting the first angle. This ensures that the construction of the initial voiceprint model's loss function fully considers the voiceprint quality of each training speech sample, thus improving the accuracy of the target voiceprint model in extracting voiceprint features. The feature angle between the training voiceprint features and the category voiceprint features corresponding to other candidate categories is calculated to obtain the second angle for each training speech sample. Based on the first angle, second angle, and voiceprint quality score for each training speech sample, the target loss is obtained. Adjusting the model parameters of the initial voiceprint model based on the target loss can improve the accuracy of the voiceprint model in extracting voiceprint features, thereby improving the accuracy of voiceprint recognition. Attached Figure Description
[0023] Figure 1 This is a diagram illustrating the application environment of a voiceprint model training method in one embodiment.
[0024] Figure 2This is a flowchart illustrating a voiceprint model training method in one embodiment;
[0025] Figure 3 This is a flowchart illustrating the process of determining the target loss in one embodiment;
[0026] Figure 4 This is a schematic diagram illustrating the determination of whether a call was answered on behalf of another person in a telephone recording, as shown in one embodiment.
[0027] Figure 5 This is a structural block diagram of a voiceprint model training device in one embodiment;
[0028] Figure 6 This is an internal structural diagram of a computer device in one embodiment;
[0029] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0031] The voiceprint model training method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart TVs, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. Terminal 102 and server 104 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0032] Both the terminal and the server can be used independently to execute the voiceprint model training method provided in the embodiments of this application.
[0033] For example, the terminal acquires a training set, which includes training speech features and target categories corresponding to multiple training speech samples. The terminal inputs the training speech features from the training set into an initial voiceprint model, obtaining training voiceprint features and voiceprint quality scores for each training speech sample. The initial voiceprint model includes category voiceprint features corresponding to multiple candidate categories. Based on the voiceprint quality scores of the training speech samples, the terminal constructs an angle adjustment value for each training speech sample. Based on the angle adjustment value for the same training speech sample, it adjusts the feature angle between the category voiceprint features corresponding to the target category and the training voiceprint features, obtaining a first angle for each training speech sample. It then calculates the feature angle between the training voiceprint features and the category voiceprint features corresponding to other candidate categories, obtaining a second angle for each training speech sample. The terminal obtains the target loss based on the first angle, second angle, and voiceprint quality score for each training speech sample. Based on the target loss, the terminal adjusts the model parameters of the initial voiceprint model to obtain an intermediate voiceprint model. Using the intermediate voiceprint model as the initial voiceprint model, the terminal returns to the step of acquiring the training set until the convergence condition is met, resulting in the target voiceprint model.
[0034] The terminal and server can also be used in conjunction to execute the voiceprint model training method provided in the embodiments of this application.
[0035] For example, the server obtains a training set from the terminal. The training set includes training speech features and target categories corresponding to multiple training speech samples. The server inputs the training speech features from the training set into an initial voiceprint model to obtain training voiceprint features and voiceprint quality scores for each training speech sample. The initial voiceprint model includes category voiceprint features corresponding to multiple candidate categories. The server constructs an angle adjustment value for each training speech sample based on its voiceprint quality score. Based on the angle adjustment value for the same training speech sample, the server adjusts the feature angle between the category voiceprint features corresponding to the target category and the training voiceprint features to obtain the first angle for each training speech sample. The server then calculates the feature angle between the training voiceprint features and the category voiceprint features corresponding to other candidate categories to obtain the second angle for each training speech sample. The server obtains the target loss based on the first angle, the second angle, and the voiceprint quality score for each training speech sample. The server adjusts the model parameters of the initial voiceprint model based on the target loss to obtain an intermediate voiceprint model. The server uses the intermediate voiceprint model as the initial voiceprint model and returns to the step of obtaining the training set until the convergence condition is met, thus obtaining the target voiceprint model. The server can send the target voiceprint model to the terminal, and the terminal can perform voiceprint recognition on the speech based on the target voiceprint model. Alternatively, the server can obtain the speech sent by the terminal, perform voiceprint recognition on the speech based on the target voiceprint model, and send the voiceprint recognition result to the terminal.
[0036] In one embodiment, such as Figure 2 As shown, a voiceprint model training method is provided. Taking the application of this method to a computer device as an example, the computer device can be a terminal or a server. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. The voiceprint model training method includes the following steps:
[0037] Step S202: Obtain the training set; the training set includes training speech features and target categories corresponding to multiple training speech samples.
[0038] The training set refers to a collection of multiple training speech samples and their corresponding categories, used to train the speakerprint model. A training speech sample is a segment of speech with a known category. Speech features refer to the feature information output by the speech feature extraction module after inputting a speech segment; this feature information is used as input to the speakerprint model. The speech feature extraction module refers to speech feature engineering, which extracts distinctive features from speech. Training speech features are the speech features corresponding to the training speech samples. The corresponding category is the category obtained by classifying speech segments based on certain requirements, such as classifying speech segments based on the speaker's name, the speaker's age, etc. The target category is the category corresponding to the training speech samples.
[0039] For example, a computer device obtains a training set locally or from another device, and trains an initial voiceprint model based on the training set to obtain a target voiceprint model.
[0040] Step S204: Input the training speech features from the training set into the initial voiceprint model to obtain the training voiceprint features and voiceprint quality scores corresponding to each training speech sample; the initial voiceprint model includes the category voiceprint features corresponding to multiple candidate categories.
[0041] In this context, a voiceprint model refers to a model used for voiceprint recognition. The input data for a voiceprint model is the speech features corresponding to the speech, and the output data is the voiceprint features and voiceprint quality score. An initial voiceprint model refers to a voiceprint model that has not been trained or is not yet fully trained. Training voiceprint features involves inputting training speech features into the voiceprint model, and the voiceprint features output by the model represent the voiceprint feature information corresponding to the training speech samples. The voiceprint quality score is a score that measures the voiceprint quality of a speech segment. A higher voiceprint quality score indicates that the voiceprint features corresponding to the speech are more specific and comprehensive, containing more voiceprint feature information. Candidate categories refer to the various categories included in the voiceprint model. Category voiceprint features refer to the voiceprint features corresponding to each candidate category, used to represent the feature information corresponding to each candidate category and the position information of each candidate category in the feature space. The feature space refers to the space where voiceprint features exist. Category voiceprint features are a type of model parameter of the voiceprint model, obtained and updated along with the voiceprint model during training. It can be understood that the model parameters are adjusted during model training, thus changing the voiceprint features extracted by the model. The distribution of voiceprint features of each category in the feature space reflects the distribution of voiceprint features of the speech sample sets corresponding to each category in the feature space. After model training, the voiceprint features corresponding to speech samples of different categories are usually located in different regions of the feature space, while the voiceprint features corresponding to speech samples of the same category are usually located in the same region of the feature space. That is, the model has the ability to distinguish features and can effectively classify data. Category voiceprint features can be the statistical centers of the training voiceprint features corresponding to each training speech sample belonging to the same category. The training voiceprint features of the training speech samples are obtained by the model from the speech features of the training speech samples.
[0042] For example, the computer device inputs the training speech features corresponding to each training speech sample in the training set into the initial voiceprint model, and the initial voiceprint model outputs the training voiceprint features and voiceprint quality scores corresponding to each training speech sample.
[0043] Step S206: Construct the angle adjustment value corresponding to the training speech sample based on the voiceprint quality score corresponding to the training speech sample.
[0044] The angle adjustment value refers to the numerical value used to adjust the feature angle between the training voiceprint features of the training speech sample and the category voiceprint features corresponding to the target category of the training speech sample. The angle adjustment value is used to reduce the feature angle between the training voiceprint features of the training speech sample and the corresponding category voiceprint features, that is, to make the voiceprint features output by the voiceprint model for the speech sample closer to the category voiceprint features corresponding to the target category of the speech sample.
[0045] For example, a computer device obtains the voiceprint quality score corresponding to a training speech sample, adjusts the voiceprint quality score to obtain the angle adjustment value corresponding to the training speech sample, and the angle adjustment value is positively correlated with the voiceprint quality score.
[0046] In one embodiment, to ensure that the angle adjustment value can effectively adjust the feature angle between the training voiceprint features corresponding to the same training speech sample and the category voiceprint features corresponding to the target category, that is, to avoid the angle adjustment value and the feature angle being of too large a difference in magnitude, the product of the voiceprint quality score and a preset multiple can be calculated as the angle adjustment value. The value of the preset multiple is negatively correlated with the upper limit of the voiceprint quality score. For example, when the feature angle is 0.5 and the upper limit of the voiceprint quality score is 100, the preset multiple can be set to 0.01. At this time, the angle adjustment value is less than or equal to 1, thereby ensuring that the angle adjustment value and the feature angle are closer in magnitude.
[0047] In one embodiment, to shorten the training time of the voiceprint model, an initial value can be added to the product of the voiceprint quality score and a preset multiple. For example, when the feature angle is 0.5, the upper limit of the voiceprint quality score is 100, and the preset multiple is 0.01, the initial value can be set to 0.1.
[0048] In one embodiment, the included angle adjustment value can be calculated using the following formula:
[0049] m i =0.01*||x i ||+0.1
[0050] Where, m i x is the angle adjustment value corresponding to the i-th training speech sample. i Let ||x| be the training voiceprint feature corresponding to the i-th training speech sample. i || represents the length of the training voiceprint feature corresponding to the i-th training speech sample, which is also the voiceprint quality score, ||x i The value of || is in the range of (0, 100).
[0051] Step S208: Based on the angle adjustment value corresponding to the same training speech sample, adjust the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature to obtain the first angle corresponding to each training speech sample. Calculate the feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories to obtain the second angle corresponding to each training speech sample.
[0052] The feature angle refers to the angle between the training voiceprint features and the category voiceprint features, which can characterize the similarity between them. The first angle is the angle obtained by adjusting the feature angle between the category voiceprint features corresponding to the target category of the training speech sample and the training voiceprint features of the training speech sample, based on the angle adjustment value corresponding to the training speech sample. This angle is used to characterize the similarity between the adjusted training voiceprint features of the training speech sample and the category voiceprint features corresponding to the target category. The second angle is the feature angle between the training voiceprint features of the training speech sample and the category voiceprint features corresponding to other candidate categories. A second angle exists between a training speech sample and each candidate category other than the target category. The second angle can characterize the similarity between the training voiceprint features of the training speech sample and the category voiceprint features corresponding to other candidate categories.
[0053] For example, a computer device calculates the feature angle between the training voiceprint features corresponding to the same training speech sample and the category voiceprint features corresponding to the target category. It then fuses the feature angle and an adjustment value between the training voiceprint features of the same training speech sample and the category voiceprint features of the target category to obtain a first angle for each training speech sample. For instance, the sum of the feature angle and the adjustment value can be used as the first angle; the feature angle and the adjustment value can be weighted and fused to obtain the first angle; and so on. Since the first angle is obtained by fusing the feature angle and the adjustment value, it will be larger than the feature angle. Therefore, the similarity between the training voiceprint features represented by the first angle and the category voiceprint features corresponding to the target category will be smaller than the similarity represented by the feature angle. Consequently, the target loss obtained based on the first angle will be larger than the target loss obtained based on the feature angle. Clearly, after adjusting the model parameters using the target loss calculated from the first angle, inputting training speech sample A into the initial speaker model, the model outputs training speaker features X. After adjusting the model parameters again using the target loss calculated from the feature angle, inputting training speech sample A into the initial speaker model, the model outputs training speaker features Y. The similarity between training speaker features X and the category speaker features corresponding to the target category will be smaller than the similarity between training speaker features Y and the category speaker features corresponding to the target category. Therefore, using the first angle to calculate the target loss allows the speaker features output by the speaker model after adjusting the model parameters based on the target loss to be closer to the category speaker features of the corresponding target category. In other words, the speaker features output by the speaker model will be more specific, carrying more and more detailed feature information, thus reducing the feature angle between the speaker features and the corresponding category speaker features. After obtaining the first angle for each training speech sample, the feature angles between the training speaker features corresponding to the same training speech sample and the category speaker features corresponding to other candidate categories besides the target category are calculated, resulting in the second angles for each training speech sample.
[0054] In one embodiment, the feature angle can be calculated using the following formula:
[0055]
[0056]
[0057]
[0058] θ j,i =arccos(cos(θ) j,i ))
[0059] Among them, W j Let W be the category voiceprint feature corresponding to the j-th candidate category. j|| represents the length of the category voiceprint feature corresponding to the j-th candidate category. For the j-th candidate category, the normalized category voiceprint feature is... Let cos(θ) be the normalized training voiceprint feature corresponding to the i-th training speech sample. j,i θ refers to the cosine similarity between the training voiceprint features corresponding to the i-th training speech sample and the category voiceprint features corresponding to the j-th candidate category. j,i It refers to the feature angle between the training voiceprint feature corresponding to the i-th training speech sample and the category voiceprint feature corresponding to the j-th candidate category.
[0060] Step S210: Target loss is obtained based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample.
[0061] The target loss refers to the loss value calculated by the loss function in the initial voiceprint model after the training set is input into the initial voiceprint model. It can be used to adjust the model parameters in the initial voiceprint model.
[0062] For example, the computer device generates an initial loss for each training speech sample based on the first and second included angles corresponding to each training speech sample, and obtains the target loss based on the initial loss and the speaker quality score for each training speech sample.
[0063] In one embodiment, based on the first and second included angles corresponding to the same training speech sample, anomaly probabilities for the training speech sample in candidate categories other than the target category are generated. Logarithmic processing is applied to the anomaly probabilities corresponding to the training speech samples to obtain the initial loss for each training speech sample. The initial loss and speaker quality score corresponding to the same training speech sample are fused to obtain the intermediate loss for each training speech sample. The intermediate loss for each training speech sample is calculated to obtain the target loss.
[0064] Step S212: Adjust the model parameters of the initial voiceprint model based on the target loss to obtain the intermediate voiceprint model. Use the intermediate voiceprint model as the initial voiceprint model and return to the step of obtaining the training set until the convergence condition is met to obtain the target voiceprint model.
[0065] The intermediate voiceprint model refers to the voiceprint model obtained in the current round by adjusting the model parameters of the initial voiceprint model based on the target loss. The convergence condition refers to the condition for determining whether all model parameters in the initial voiceprint model have converged. Convergence conditions include, but are not limited to, at least one of the following: the target loss is less than a preset threshold, the number of model iterations is greater than a preset number of iterations, etc. The target voiceprint model refers to the voiceprint model that has already been trained.
[0066] For example, the computer device backpropagates the target loss to adjust the model parameters in the initial voiceprint model, obtaining an intermediate voiceprint model. Using the intermediate voiceprint model as the initial voiceprint model, the step of obtaining the training set is returned to perform iterative training of the model until the convergence condition is met, thus obtaining the target voiceprint model.
[0067] In one embodiment, the computer device can adjust the model parameters in the initial voiceprint model using a gradient descent algorithm based on the target loss. In the above voiceprint model training method, a training set is obtained, which includes training speech features and target categories corresponding to multiple training speech samples. The training speech features in the training set are input into the initial voiceprint model to obtain the training voiceprint features and voiceprint quality scores corresponding to each training speech sample. Using the speech features extracted from the speech samples as input to the voiceprint model results in more accurate voiceprint features output by the model. An angle adjustment value is constructed based on the voiceprint quality scores corresponding to the training speech samples; this angle adjustment value reflects the voiceprint quality of the training speech samples. By fusing the feature angle and adjustment value between the training voiceprint features corresponding to the same training speech sample and the category voiceprint features corresponding to the target category, a first angle is obtained for each training speech sample. The purpose of calculating this first angle is to penalize the feature angle, reducing the feature angle between the training voiceprint features corresponding to the same training speech sample and the category voiceprint features corresponding to the target category. This makes the training voiceprint features output by the initial voiceprint model more specific and complete, allowing them to more closely approximate the category voiceprint features of the corresponding target category. Therefore, adjusting the feature angle between the category voiceprint features corresponding to the target category and the training voiceprint features based on the angle adjustment value corresponding to the same training speech sample, and obtaining the first angle for each training speech sample, makes the voiceprint features output by the voiceprint model more specific, carrying more feature information, thereby improving the accuracy of voiceprint recognition. The feature angle between the training voiceprint features and the category voiceprint features corresponding to other candidate categories is calculated to obtain the second angle corresponding to each training speech sample. The target loss is obtained based on the first angle, the second angle and the voiceprint quality score corresponding to each training speech sample. The model parameters of the initial voiceprint model are adjusted based on the target loss, which can make the voiceprint features output by the final target voiceprint model more specific and complete, thereby improving the accuracy of voiceprint recognition.
[0068] In one embodiment, the training speech features from the training set are input into the initial speaker model to obtain the training speaker features and speaker quality scores corresponding to each training speech sample, including:
[0069] The training speech features corresponding to the training speech samples are input into the initial voiceprint model to obtain the training voiceprint features corresponding to the training speech samples; based on the feature length of the training voiceprint features, the voiceprint quality score corresponding to the training speech samples is determined.
[0070] Among them, feature length refers to the length of the voiceprint feature vector corresponding to the voiceprint feature.
[0071] For example, the computer device inputs the training speech features corresponding to each training speech sample in the training set into the initial speaker model to obtain the training speaker features corresponding to each training speech sample. Based on the feature length of the training speaker features corresponding to each training speech sample, a speaker quality score is determined for each training speech sample. For example, the feature length of the training speaker features can be used as the speaker quality score; the product of the feature length of the training speaker features and a preset multiple can be used as the speaker quality score; and so on.
[0072] In the above embodiments, the training speech features extracted from the training speech samples are input into the initial voiceprint model, which can improve the efficiency of the training voiceprint features output by the initial voiceprint model. Since the longer the voiceprint feature is, the more feature information it carries, indirectly reflecting higher voiceprint quality, the voiceprint quality score determined based on the length of the training voiceprint features has high reliability and accuracy, thereby improving the accuracy of voiceprint recognition.
[0073] In one embodiment, such as Figure 3 As shown, the target loss is obtained based on the first included angle, the second included angle, and the speaker quality score corresponding to each training speech sample, including:
[0074] Step S302: Based on the first and second included angles corresponding to the same training speech sample, obtain the target probability of each training speech sample under the corresponding target category.
[0075] Step S304: Based on the angle adjustment value and target probability corresponding to the same training speech sample, obtain the initial loss corresponding to each training speech sample.
[0076] Step S306: Based on the speaker quality score and initial loss corresponding to each training speech sample, the target loss is obtained.
[0077] Here, the target probability refers to the probability that a training speech sample belongs to the corresponding target category. The initial loss is the loss value obtained after adjusting the base loss for each training speech sample with the corresponding loss weights. Each training speech sample has a corresponding initial loss value, which is used to calculate the intermediate loss for each training speech sample.
[0078] For example, the computer device calculates the total similarity of each training speech sample based on the first and second angles corresponding to the same training speech sample. Based on the first angle and the total similarity of the same training speech sample, the target probability of each training speech sample is obtained. Based on the target probability of each training speech sample, the base loss of each training speech sample is obtained. Based on the angle adjustment value and the target probability of the same training speech sample, the base loss of each training speech sample is adjusted to obtain the initial loss of each training speech sample. Based on the speaker quality score of the training speech sample, the initial loss of each training speech sample is adjusted to obtain the intermediate loss of each training speech sample. The intermediate loss of each training speech sample is calculated to obtain the target loss.
[0079] In the above embodiments, since the first angle can characterize the similarity between the training voiceprint features corresponding to the training speech sample and the category voiceprint features corresponding to the target category, and the second angle can characterize the similarity between the training voiceprint features corresponding to the training speech sample and the category voiceprint features corresponding to other candidate categories, and the similarity between features can reflect the closeness between the training voiceprint features and the category voiceprint features, the target probability corresponding to the training speech sample obtained based on the first angle and the second angle has high accuracy. The initial loss corresponding to the training speech sample fully utilizes the angle adjustment value and target probability of each training speech sample. The target loss is obtained based on the initial loss and voiceprint quality score corresponding to each training speech sample. Since the calculation of the target loss fully utilizes the angle adjustment value, target probability, and voiceprint quality score of each training speech sample, and reflects the relationship of mutual influence among the three, it is more effective and accurate to use the target loss to adjust the model parameters in the initial voiceprint model, thereby improving the accuracy of voiceprint recognition.
[0080] In one embodiment, based on the first and second included angles corresponding to the same training speech sample, the target probability of each training speech sample under the corresponding target category is obtained, including:
[0081] Based on the first included angle corresponding to the training speech sample, the positive similarity of the training speech sample is calculated, and based on the second included angle corresponding to the training speech sample, the negative similarity of the training speech sample is calculated. The positive and negative similarities corresponding to the same training speech sample are fused to obtain the total similarity corresponding to each training speech sample. Based on the ratio of the positive similarity corresponding to the same training speech sample to the total similarity, the target probability of each training speech sample under the corresponding target category is obtained.
[0082] Positive similarity refers to the similarity between the training voiceprint features corresponding to the training speech sample and the target category voiceprint features corresponding to the target category, representing the closeness between the training speech sample and the target category. Negative similarity refers to the similarity between the training voiceprint features corresponding to the training speech sample and the category voiceprint features corresponding to other candidate categories. A negative similarity exists between a training speech sample and each candidate category except the target category, representing the closeness between the training speech sample and other candidate categories. Total similarity is the sum of the similarities between the training speech sample and each candidate category, used to calculate the target probability of the training speech sample.
[0083] For example, the computer device calculates the positive similarity of training speech samples based on a first included angle and the negative similarity based on a second included angle. The smaller the included angle, the greater the similarity and the more similar the features. For instance, the cosine value of the first included angle is calculated as the first cosine value, and the positive similarity is obtained based on the first cosine value. The cosine value of the second included angle is calculated as the second cosine value, and the negative similarity is obtained based on the second cosine value. Furthermore, the computer device merges the positive and negative similarities of the same training speech sample to obtain the total similarity. Each training speech sample can then calculate its own total similarity. Finally, the computer device calculates the ratio of the positive similarity to the total similarity of the same training speech sample to obtain the target probability of each training speech sample under its corresponding target category.
[0084] In one embodiment, the target probability can be calculated using the following formula:
[0085]
[0086] Where, p i Let s be the target probability corresponding to the i-th training speech sample, where s can be a preset multiple or a hyperparameter, and y is the candidate category to which the i-th training speech sample belongs. i m i This is the angle adjustment value corresponding to the i-th training speech sample. Let y be the training voiceprint features and candidate category corresponding to the i-th training speech sample. i The angle between the corresponding category voiceprint features Let θ be the first included angle corresponding to the i-th training speech sample. j,i Let be the feature angle between the training speech features corresponding to the i-th training speech sample and the category voiceprint features corresponding to the j-th candidate category, that is, the second angle between the i-th training speech sample and the j-th candidate category. The positive similarity is the value corresponding to the i-th training speech sample. The negative similarity between the i-th training speech sample and the j-th candidate category is... Let be the total similarity corresponding to the i-th training speech sample.
[0087] In the above embodiments, since the first angle can characterize the similarity between the training voiceprint features corresponding to the training speech sample and the category voiceprint features corresponding to the target category, and the second angle can characterize the similarity between the training voiceprint features corresponding to the training speech sample and the category voiceprint features corresponding to other candidate categories, the positive similarity obtained based on the first angle can characterize the closeness between the training speech sample and the target category, and the negative similarity obtained based on the second angle can characterize the closeness between the training speech sample and other candidate categories. By fusing the positive similarity and each negative similarity corresponding to the training speech sample to obtain the total similarity between the training speech sample and each candidate category, the closeness between the training speech sample and each candidate category can be characterized. Therefore, using the ratio of the positive similarity to the total similarity as the target probability, the obtained target probability can accurately reflect the probability that the training speech sample belongs to the target category. Consequently, the target loss obtained based on the target probability will be more accurate, improving the model training effect and making the voiceprint features extracted by the final target voiceprint model more accurate, thereby improving the accuracy of voiceprint recognition.
[0088] In one embodiment, based on the angle adjustment value and target probability corresponding to the same training speech sample, the initial loss corresponding to each training speech sample is obtained, including:
[0089] Logarithmic processing is performed on the target probabilities corresponding to the training speech samples to obtain the base loss; based on the target probabilities and the angle adjustment value corresponding to the training speech samples, the loss weights corresponding to the base loss are obtained; the loss weights are negatively correlated with the target probabilities and the angle adjustment value; based on the loss weights, the base loss is adjusted to obtain the initial loss corresponding to the training speech samples.
[0090] Here, logarithmic processing refers to taking the logarithm of the data. The basic loss is the loss derived from the target probabilities corresponding to the training speech samples, used to calculate the initial loss. Loss weights are the weights assigned to the basic loss when calculating the target loss, used to mitigate class imbalance during model training and ensure that the initial speaker quality score output by the speaker model is as high as possible.
[0091] For example, the computer device performs logarithmic processing on the target probabilities corresponding to the training speech samples to obtain the base loss for each training speech sample. The base loss is negatively correlated with the target probability. Based on the target probability and the angle adjustment value corresponding to the training speech sample, the loss weight corresponding to the base loss is calculated. The base loss and loss weight corresponding to the same training speech sample are then fused to obtain the base loss for that training speech sample. Using the same processing method, each training speech sample can obtain its own corresponding initial loss.
[0092] In one embodiment, the basic loss can be calculated using the following formula:
[0093]
[0094] Among them, L i Let be the base loss corresponding to the i-th training speech sample.
[0095] In one embodiment, the initial loss can be calculated using the following formula:
[0096]
[0097] in, Let g be the initial loss corresponding to the i-th training speech sample, and g be the hyperparameter. Let be the loss weight corresponding to the i-th training speech sample.
[0098] In the above embodiments, the loss weights corresponding to the training speech samples are negatively correlated with the target probability and the angle adjustment value corresponding to the training speech samples. Thus, when there are many training speech samples belonging to the same candidate category in the training set, during model training, the initial voiceprint model will extract voiceprint features from training speech samples of this candidate category better than from other candidate categories. This means the extracted training voiceprint features will be more specific and complete, with longer feature lengths and higher voiceprint quality scores. Furthermore, the base loss obtained by inputting training speech samples belonging to this candidate category into the initial voiceprint model will be smaller, and the target probability corresponding to the training speech sample will be higher. Moreover, since the voiceprint quality score corresponding to the training speech samples of this candidate category is higher, the angle adjustment value obtained based on the voiceprint quality score will also be larger. Since the loss weight is negatively correlated with the target probability and the angle adjustment value, the loss weight corresponding to the training speech samples of this candidate category will be smaller. This means a smaller gradient update is given to the basic loss corresponding to this candidate category. If there are few training speech samples for a candidate category in the training set, the loss weight can give a larger gradient update to the basic loss corresponding to this candidate category, which can alleviate the class imbalance problem during model training and improve the training efficiency of the model. During the initial speaker model training process, the model's ability to extract speaker features will continuously improve, meaning the length of the output training speaker features will continuously increase, and consequently, the corresponding angle adjustment value will continuously increase. Simultaneously, as the model's ability to extract speaker features continuously improves, the target probability corresponding to the training speech samples will also continuously increase, causing the corresponding loss weight to decrease, and thus the initial loss will continuously decrease. Therefore, the loss weight can ensure that the quality score of the initial speaker model output continuously increases, thereby improving the speaker feature extraction effect of the target speaker model on speech segments, and ultimately improving the accuracy of speaker recognition. However, if the angle adjustment value increases too much, the model parameters in the initial voiceprint model will not converge, leading to an increase in the base loss value for each training speech sample and a decrease in the target probability. In this case, even if the angle adjustment value for the training speech sample increases, the initial loss for that training speech sample will also increase. Therefore, the initial loss limits the size of the angle adjustment value to prevent it from increasing continuously. It can be understood that the loss weights and the initial loss based on those weights ensure that the voiceprint quality score output by the initial voiceprint model is as high as possible, that is, that the initial voiceprint model extracts voiceprint features from the training speech samples as effectively as possible. This, in turn, improves the target voiceprint model's ability to extract voiceprint features from speech segments, thereby improving the accuracy of voiceprint recognition.
[0099] In one embodiment, the target loss is obtained based on the speaker quality score and initial loss corresponding to each training speech sample, including:
[0100] Based on the speaker quality score corresponding to the training speech sample, the corresponding initial loss adjustment value is obtained; based on the loss adjustment value, the initial loss is adjusted to obtain the intermediate loss corresponding to the training speech sample; the intermediate loss corresponding to each training speech sample is statistically analyzed to obtain the target loss.
[0101] The loss adjustment value refers to the adjustment value used to adjust the initial loss when calculating the intermediate loss. It ensures that the length of the voiceprint feature vector reflects the true quality of the voiceprint features and that the length of the voiceprint features is as large as possible. The intermediate loss is the loss value obtained after adjusting the initial loss corresponding to the training speech sample with the loss adjustment value. It represents the loss value corresponding to each training speech sample in the training set and is used to calculate the target loss.
[0102] For example, the computer device calculates the loss adjustment value of the initial loss corresponding to the training speech sample based on the voiceprint quality score. When the length of the training voiceprint feature corresponding to the training speech sample does not exceed the upper limit, the loss adjustment value is negatively correlated with the voiceprint quality score; when the length of the training voiceprint feature exceeds the upper limit, the loss adjustment value is positively correlated with the voiceprint quality score. For example, the difference between the upper limit of the voiceprint quality score and the voiceprint quality score is calculated, and the square of this difference is used as the loss adjustment value; the difference between the upper limit of the voiceprint quality score and the voiceprint quality score is calculated, and the product of this difference and a preset multiple is calculated, and the square of this product is used as the loss adjustment value; and so on. The initial loss and loss adjustment value corresponding to the same training speech sample are fused to obtain the intermediate loss corresponding to each training speech sample, and the intermediate loss corresponding to each training speech sample is statistically analyzed to obtain the target loss.
[0103] In one embodiment, the target loss can be calculated using the following formula:
[0104]
[0105] Where Loss is the target loss, N is the number of training speech samples in the training set, and λ is the hyperparameter, λ(1-0.01*||x i ||) 2 ) represents the loss adjustment value corresponding to the i-th training speech sample.
[0106] In the above embodiments, since the loss adjustment value is positively correlated with the voiceprint quality score when the length of the training voiceprint feature exceeds the upper limit, the loss adjustment value can limit the length of the voiceprint feature and prevent the length of the voiceprint feature from increasing continuously. When the length of the training voiceprint feature does not exceed the upper limit, the smaller the voiceprint quality score corresponding to the training voiceprint feature, the larger the corresponding loss adjustment value will be. Therefore, the loss adjustment value can ensure that the training quality score of the training speech sample is increased as much as possible, that is, to ensure that the training voiceprint feature output by the initial voiceprint model is as specific and complete as possible, thereby improving the voiceprint extraction effect of the target voiceprint model on speech segments, and thus improving the accuracy of voiceprint recognition.
[0107] In one embodiment, the voiceprint model training method further includes:
[0108] The process involves acquiring the speech to be recognized, segmenting it into multiple initial speech segments, and obtaining the speech features corresponding to each initial speech segment. Each speech feature is then input into the target voiceprint model to obtain the corresponding voiceprint features and voiceprint quality scores. Based on the voiceprint quality scores, each initial speech segment is filtered to obtain the target speech segments. The voiceprint similarity between the voiceprint features corresponding to each target speech segment is calculated. The voiceprint similarity is then statistically analyzed, and the number of speakers corresponding to the speech to be recognized is determined based on the statistical results.
[0109] In this context, "speech to be recognized" refers to the speech requiring voiceprint recognition. "Initial speech segment" refers to the speech segment obtained by segmenting the speech to be recognized. "Target speech segment" refers to the speech segment obtained after filtering. "Voiceprint similarity" refers to the similarity between the voiceprint features corresponding to two speech segments. It can be used to determine whether the speakers corresponding to the two speech segments are the same person. For example, when the voiceprint similarity between two speech segments is greater than or equal to a preset threshold, it can be determined that the speakers corresponding to the two speech segments are the same; when the voiceprint similarity between two speech segments is less than the preset threshold, it can be determined that the speakers corresponding to the two speech segments are the same. "Number of speakers" refers to the number of speakers corresponding to a segment of speech. For example, if the speech to be recognized has only one person's voice, then the number of speakers corresponding to this segment of speech is 1; if the speech to be recognized has two people's voices, then the number of speakers corresponding to this segment of speech is 2.
[0110] For example, a computer device acquires the speech to be recognized and divides it into multiple initial speech segments according to a preset time length, such as 5 seconds. It acquires the speech features corresponding to each initial speech segment and inputs these features into a target voiceprint model to obtain the voiceprint features and voiceprint quality scores for each initial speech segment. Based on the voiceprint quality scores of each initial speech segment, it filters out initial speech segments with substandard voiceprint quality according to preset screening conditions, and uses the remaining initial speech segments as target speech segments. For example, the preset screening condition could be a minimum voiceprint quality score, considering initial speech samples with voiceprint quality scores below the minimum as substandard initial speech segments; or it could be sorting the initial speech samples by voiceprint quality scores in ascending order and considering the top 30% of initial speech segments as substandard; and so on. It calculates the voiceprint similarity between the voiceprint features corresponding to each target speech segment, statistically analyzes each voiceprint similarity, and determines the number of speakers corresponding to the speech to be recognized based on the statistical results.
[0111] In one embodiment, if the voice segment to be identified is a user's telephone recording, determining the number of speakers corresponding to the voice segment is to determine whether there is any call-for-call behavior in this telephone recording, that is, whether this telephone recording corresponds to only one speaker. First, a preset threshold is set. If the voiceprint similarity is greater than the preset threshold, it means that the speakers in the two voice segments are the same; if the voiceprint similarity is less than the preset threshold, it means that the speakers in the two voice segments are different. For example, the preset threshold can be set to 0.6. Based on the preset threshold, it is determined whether there is any call-for-call behavior in the voice segment to be identified. For example, the voiceprint similarities are sorted in descending order. If the first 30% of the voiceprint similarities are less than the preset threshold, it means that the voice segment to be identified corresponds to at least two speakers, and there is call-for-call behavior; if the first 30% of the voiceprint similarities are not all less than the preset threshold, it means that the voice segment to be identified corresponds to only one speaker, and there is no call-for-call behavior.
[0112] In the above embodiments, the computer device acquires the speech to be recognized, divides the speech into multiple initial speech segments according to a preset time length, and inputs the speech features corresponding to each initial speech segment into a target voiceprint model to obtain the voiceprint features and voiceprint quality scores corresponding to each initial speech segment. The voiceprint features obtained based on the target voiceprint model can more accurately reflect the feature information of the initial speech segments. Based on the voiceprint quality scores corresponding to each initial speech segment, initial speech segments with unqualified voiceprint quality are filtered out to obtain target speech segments. The voiceprint similarity between the voiceprint features corresponding to each target speech segment is calculated, and the number of speakers is determined based on the statistical results. Judging the number of speakers in the speech to be recognized based on the voiceprint similarity between target speech segments with high voiceprint quality will yield more accurate results.
[0113] In one specific embodiment, the voiceprint model training method of this application can be applied to identify whether there is call-calling behavior in a user's recorded telephone conversation, that is, to determine whether there is only one speaker's voice in a recorded telephone conversation. Figure 4 As shown, the user's voice segment is first input into the voice feature extraction module to obtain the corresponding voice features. These voice features are then input into the target voiceprint model to obtain the voiceprint features and voiceprint quality score corresponding to each voice segment. Based on the voiceprint quality score of each voice segment, low-quality voice segments are filtered out according to a set minimum quality score. The feature similarity between the voiceprint features corresponding to the remaining voice segments is calculated. When the similarity is greater than or equal to a preset threshold, the speakers corresponding to the two voice segments are determined to be the same; when the similarity is less than the preset threshold, the speakers corresponding to the two voice segments are determined to be different. Based on the feature similarity between the remaining voice segments, it is determined whether there is any proxy answering behavior in the telephone recording.
[0114] Determining whether a phone call recording contains proxy answering behavior includes the following steps:
[0115] 1. Train the initial voiceprint model to obtain the target voiceprint model.
[0116] The voiceprint recognition system acquires a training set and uses a speech feature extraction module to obtain the speech features corresponding to each speech sample in the training set. The speech features corresponding to each speech sample are input into the initial voiceprint model to obtain the voiceprint features and voiceprint quality scores for each speech sample. Angle adjustment values are constructed based on the voiceprint quality scores of the speech samples. Based on the voiceprint features corresponding to the same speech sample, the feature angles between different categories, and the angle adjustment values, the first and second angles corresponding to the speech sample are calculated. Based on the first and second angles corresponding to the same speech sample, the target probability of each speech sample under the corresponding target category is obtained. The target probability is logarithmically processed to obtain the base loss for the speech sample. Based on the angle adjustment values, target probabilities, base losses, and the length of the voiceprint features for each training speech sample, the target loss is obtained. The model parameters in the initial voiceprint model are adjusted based on the target loss to obtain an intermediate voiceprint model. This intermediate voiceprint model is used as the initial voiceprint model, and the process returns to the step of acquiring the training set until the convergence condition is met, resulting in the target voiceprint model.
[0117] The voiceprint recognition system can calculate the angle adjustment value using the following formula:
[0118] m i =0.01*||x i ||+0.1
[0119] The voiceprint recognition system can calculate the feature angle using the following formula:
[0120]
[0121]
[0122]
[0123] θ j,i =arccos(cos(θ) j,i ))
[0124] The voiceprint recognition system can calculate the basic loss using the following formula:
[0125]
[0126] The voiceprint recognition system can calculate the target loss using the following formula:
[0127]
[0128] 2. Segment the telephone recording to obtain voice segments.
[0129] The voiceprint recognition system obtains the user's recorded phone voice stream and divides the phone recording into multiple voice segments according to a preset time length. For example, if the preset time length is set to 5 seconds, and the phone recording length is 60 seconds, the phone recording will be divided into 12 voice segments.
[0130] 3. Obtain the speech features of each speech segment.
[0131] The voiceprint recognition system inputs each speech segment into the speech feature extraction module to obtain the speech features corresponding to each speech segment.
[0132] 4. Input the speech segment into the target voiceprint model
[0133] The voiceprint recognition system inputs each initial speech segment into the target voiceprint model, and the target voiceprint model outputs the voiceprint feature vector and voiceprint quality score corresponding to each speech segment.
[0134] 5. Filter low-quality audio segments
[0135] The voiceprint recognition system sets a minimum quality score S. min According to the minimum mass fraction S min Filter out low-quality voiceprint features and corresponding speech segments.
[0136] 6. Calculate the feature similarity between the remaining speech segments.
[0137] The voiceprint recognition system calculates the cosine similarity between the voiceprint features corresponding to each remaining speech segment as the feature similarity. When the feature similarity is greater than or equal to a preset threshold, it is determined that the two speech segments belong to the same speaker. For example, the preset threshold can be set to 0.6. When the feature similarity between two speech segments is greater than or equal to 0.6, it is determined that the two speech segments belong to the same speaker; when the feature similarity between two speech segments is less than 0.6, it is determined that the two speech segments belong to different speakers.
[0138] 7. Determine whether call answering was done on behalf of another person in the recorded phone conversation based on the similarity of various features.
[0139] The voiceprint call forwarding identification system calculates the similarity of various features and determines whether call forwarding occurs in a recorded phone call based on criteria for identifying such behavior. For example, the criteria could be to sort feature similarities in ascending order. If the similarity of the top 30% of features is less than a preset threshold, it indicates that the recorded phone call corresponds to at least two speakers, meaning call forwarding exists. If not all of the top 30% of features are less than the threshold, it indicates that the recorded phone call corresponds to only one speaker, and no call forwarding occurs. Once it is determined that no call forwarding occurs, the voiceprint features corresponding to the recorded phone call can be compared with voiceprint features in a voiceprint database to determine if call forwarding occurred. Call transfer refers to the act of answering a call not by the user but by someone else. When the voiceprint call transfer recognition system determines that the call recording corresponds to only one speaker, it is necessary to compare the speaker's voiceprint with the voiceprints in the voiceprint database to determine whether the speaker corresponding to the call recording is the user. If the speaker corresponding to the call recording is the user, there is no call transfer; if the speaker corresponding to the call recording is not the user, then there is a call transfer.
[0140] In the above embodiments, the voiceprint model can output not only the voiceprint features corresponding to the speech but also a voiceprint quality score, which measures the quality of the voiceprint features output by the model. Therefore, in practical applications, no additional speech quality detection module is needed for speech quality detection, reducing the complexity of the system. The voiceprint recognition system can determine whether a speech sample meets the usage requirements through the voiceprint quality score, thereby eliminating low-quality samples and improving the voiceprint recognition effect. For example, in long recording recognition, the long recording can be segmented and recognized, and the best-quality speech segment can be selected for voiceprint comparison based on the quality score, thereby improving the recognition effect. Furthermore, the voiceprint recognition model outputs a score reflecting the voiceprint quality of a speech sample, allowing selection of whether to perform voiceprint recognition and comparison on the speech segment without the need for an additional speech quality detection module. In addition, the results corresponding to different speech segments can be compared based on the voiceprint quality score, thereby selecting the result corresponding to the best-quality speech sample as the final recognition result obtained by the system. In addition, the voiceprint model uses a dynamic boundary loss function for model training. The boundary value (angle adjustment value) in the loss function is dynamically changed based on the quality of the speech sample itself (voiceprint quality score). This allows a dynamic boundary value to be generated for each speech segment, thereby improving the effect of the voiceprint model in extracting voiceprint features.
[0141] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0142] Based on the same inventive concept, this application also provides a voiceprint model training device for implementing the voiceprint model training method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more voiceprint model training device embodiments provided below can be found in the limitations of the voiceprint model training method described above, and will not be repeated here.
[0143] In one embodiment, such as Figure 5As shown, a voiceprint model training device is provided, including: a training set acquisition module 502, a voiceprint feature and quality score acquisition module 504, an angle adjustment value determination module 506, a first angle and a second angle determination module 508, a target loss determination module 510, and a target voiceprint model determination module 512, wherein:
[0144] The training set acquisition module 502 is used to acquire the training set; the training set includes training speech features and target categories corresponding to multiple training speech samples.
[0145] The speaker feature and quality score acquisition module 504 is used to input the training speech features in the training set into the initial speaker model to obtain the training speaker features and speaker quality scores corresponding to each training speech sample; the initial speaker model includes the category speaker features corresponding to multiple candidate categories.
[0146] The angle adjustment value determination module 506 is used to construct the angle adjustment value corresponding to the training speech sample based on the voiceprint quality score corresponding to the training speech sample.
[0147] The first and second angle determination module 508 is used to adjust the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature based on the angle adjustment value corresponding to the same training speech sample, so as to obtain the first angle corresponding to each training speech sample, and calculate the feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories, so as to obtain the second angle corresponding to each training speech sample.
[0148] The target loss determination module 510 is used to obtain the target loss based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample.
[0149] The target voiceprint model determination module 512 is used to adjust the model parameters of the initial voiceprint model based on the target loss to obtain an intermediate voiceprint model. The intermediate voiceprint model is then used as the initial voiceprint model, and the step of obtaining the training set is returned to execute until the convergence condition is met, thus obtaining the target voiceprint model.
[0150] Each module in the aforementioned voiceprint model training device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0151] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as category voiceprint features, training voiceprint features, voiceprint quality scores, and angle adjustment values. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a voiceprint model training method.
[0152] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a voiceprint model training method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0153] Those skilled in the art will understand that Figure 6 , 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0154] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0155] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0156] In one embodiment, a computer program product or computer program is provided, the computer product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above-described method embodiments.
[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0158] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0159] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for training a voiceprint model, characterized in that, The method includes: Obtain a training set; the training set includes training speech features and target categories corresponding to multiple training speech samples; The training speech features from the training set are input into the initial voiceprint model to obtain the training voiceprint features and voiceprint quality scores corresponding to each training speech sample. This includes: inputting the training speech features corresponding to the training speech samples into the initial voiceprint model to obtain the training voiceprint features corresponding to the training speech samples; determining the voiceprint quality score corresponding to the training speech samples based on the feature length of the training voiceprint features; the initial voiceprint model includes category voiceprint features corresponding to multiple candidate categories, and the voiceprint quality score refers to the score that measures the voiceprint quality of a speech segment. Angle adjustment value is constructed based on the voiceprint quality score corresponding to the training speech sample. The product of the voiceprint quality score and a preset multiple is calculated as the angle adjustment value. The value of the preset multiple is negatively correlated with the upper limit of the voiceprint quality score. The angle adjustment value refers to the value used to adjust the feature angle between the training voiceprint features of the training speech sample and the category voiceprint features corresponding to the target category to which the training speech sample belongs. Based on the angle adjustment value corresponding to the same training speech sample, the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature is adjusted to obtain the first angle corresponding to each training speech sample. The feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories is calculated to obtain the second angle corresponding to each training speech sample. The target loss is obtained based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample; Adjust the model parameters of the initial voiceprint model based on the target loss to obtain an intermediate voiceprint model. Use the intermediate voiceprint model as the initial voiceprint model and return to the step of obtaining the training set until the convergence condition is met to obtain the target voiceprint model.
2. The method according to claim 1, characterized in that, The target loss is obtained based on the first included angle, the second included angle, and the speaker quality score corresponding to each training speech sample, including: Based on the first and second included angles corresponding to the same training speech sample, the target probability of each training speech sample under the corresponding target category is obtained. Based on the angle adjustment value and target probability corresponding to the same training speech sample, the initial loss corresponding to each training speech sample is obtained; The target loss is obtained based on the speaker quality score and initial loss corresponding to each training speech sample.
3. The method according to claim 2, characterized in that, The process of obtaining the target probability of each training speech sample under the corresponding target category based on the first and second included angles corresponding to the same training speech sample includes: Based on the first included angle corresponding to the training speech sample, calculate the positive similarity of the training speech sample; based on the second included angle corresponding to the training speech sample, calculate the negative similarity of the training speech sample. By fusing the positive and negative similarities corresponding to the same training speech sample, the total similarity corresponding to each training speech sample is obtained. Based on the ratio of positive similarity to total similarity for the same training speech sample, the target probability of each training speech sample under the corresponding target category is obtained.
4. The method according to claim 2, characterized in that, The initial loss for each training speech sample is obtained based on the angle adjustment value and target probability corresponding to the same training speech sample, including: Logarithmic processing is performed on the target probabilities corresponding to the training speech samples to obtain the basic loss; Based on the target probability and the angle adjustment value corresponding to the training speech samples, the loss weight corresponding to the basic loss is obtained; the loss weight is negatively correlated with the target probability and the angle adjustment value. Based on the loss weights, the basic loss is adjusted to obtain the initial loss corresponding to the training speech samples.
5. The method according to claim 2, characterized in that, The target loss is obtained based on the speaker quality score and initial loss corresponding to each training speech sample, including: Based on the speaker quality score corresponding to the training speech samples, the corresponding loss adjustment value of the initial loss is obtained; Based on the loss adjustment value, the initial loss is adjusted to obtain the intermediate loss corresponding to the training speech samples; The target loss is obtained by statistically analyzing the intermediate losses corresponding to each training speech sample.
6. The method according to claim 1, characterized in that, The method further includes: Acquire the speech to be recognized, divide the speech to be recognized into multiple initial speech segments, and obtain the speech features corresponding to each initial speech segment; Each speech feature is input into the target voiceprint model to obtain the voiceprint feature and voiceprint quality score corresponding to each speech feature; Based on the voiceprint quality score, the initial speech segments are filtered to obtain the target speech segments; Calculate the voiceprint similarity between the voiceprint features corresponding to each target speech segment; The similarity of each voiceprint is statistically analyzed, and the number of speakers corresponding to the speech to be identified is determined based on the statistical results.
7. A voiceprint model training device, characterized in that, The device includes: The training set acquisition module is used to acquire a training set; the training set includes training speech features and target categories corresponding to multiple training speech samples; The voiceprint feature and quality score acquisition module is used to input the training speech features from the training set into the initial voiceprint model to obtain the training voiceprint features and voiceprint quality scores corresponding to each training speech sample. This includes: inputting the training speech features corresponding to the training speech sample into the initial voiceprint model to obtain the training voiceprint features corresponding to the training speech sample; and determining the voiceprint quality score corresponding to the training speech sample based on the feature length of the training voiceprint features. The initial voiceprint model includes category voiceprint features corresponding to multiple candidate categories, and the voiceprint quality score refers to a score that measures the voiceprint quality of a speech segment. The angle adjustment value determination module is used to construct the angle adjustment value corresponding to the training speech sample based on the voiceprint quality score corresponding to the training speech sample. The product of the voiceprint quality score and the preset multiple is used as the angle adjustment value. The value of the preset multiple is negatively correlated with the upper limit of the voiceprint quality score. The angle adjustment value refers to the value of the feature angle between the training voiceprint features of the training speech sample and the category voiceprint features corresponding to the target category to which the training speech sample belongs. The first and second angle determination module is used to adjust the feature angle between the category voiceprint feature corresponding to the target category and the training voiceprint feature based on the angle adjustment value corresponding to the same training speech sample, so as to obtain the first angle corresponding to each training speech sample, and calculate the feature angle between the training voiceprint feature and the category voiceprint feature corresponding to other candidate categories, so as to obtain the second angle corresponding to each training speech sample. The target loss determination module is used to obtain the target loss based on the first included angle, the second included angle, and the voiceprint quality score corresponding to each training speech sample; The target voiceprint model determination module is used to adjust the model parameters of the initial voiceprint model based on the target loss to obtain an intermediate voiceprint model. The intermediate voiceprint model is then used as the initial voiceprint model, and the process returns to the step of obtaining the training set until the convergence condition is met, thus obtaining the target voiceprint model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.