Voiceprint model training method and device, equipment, medium and product
By randomly generating sample lengths and iteratively segmenting them during speaker model training, the problem of poor recognition performance caused by differences in speech block lengths is solved, and efficient recognition of speech data of different lengths is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2023-04-20
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, the large differences in speech block length lead to poor recognition performance of voiceprint models, affecting the recognition performance of both long and short speech data.
During the training of the voiceprint model, sample lengths within a preset range are randomly generated, and the sample speech data is segmented according to these lengths. The lengths of the sample speech blocks are dynamically adjusted through multiple iterations of training to improve the model's adaptability.
By dynamically setting the length of sample speech blocks, the recognition effect of the speaker model on speech data of different lengths is improved, thus enhancing the accuracy of recognition.
Smart Images

Figure CN116453512B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, medium and product for training a voiceprint model. Background Technology
[0002] Voiceprint recognition is a type of biometric technology. It can be applied to speaker identification scenarios, that is, by processing the speaker's voice data, to confirm whether the speaker is in the recorded set of speakers and to verify the speaker's identity.
[0003] The relevant technology uses a voiceprint model to identify the speaker by recognizing the voiceprint data to be recognized. In the process of training the voiceprint model, the sample speech data is divided into multiple speech blocks of fixed length, and the voiceprint model is trained based on these multiple speech blocks.
[0004] However, if the length is set too small in the above technology, it will affect the recognition effect of the voiceprint model on longer speech data, and if the length is set too large, it will affect the recognition effect of the voiceprint model on shorter speech data. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for training a voiceprint model, in order to solve the problem that the recognition effect of the voiceprint model is poor due to the large difference in the length of the speech blocks in the related art.
[0006] Firstly, this application provides a method for training a voiceprint model, comprising:
[0007] Acquire multiple sample data, each of which includes sample speech data and a corresponding sample speaker identifier;
[0008] In the i-th iteration training of the first voiceprint model, a sample length within a preset length range is randomly generated, and the sample speech data input in the i-th iteration training is segmented according to the sample length to obtain multiple sample speech blocks with a length of the sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1.
[0009] Using the speaker identifier corresponding to each of the sample speech data as supervision data, the first voiceprint model is trained in the i-th iteration based on multiple sample speech blocks corresponding to each of the sample speech data.
[0010] If the first voiceprint model after training satisfies the preset convergence condition, then the first voiceprint model that satisfies the preset convergence condition is determined as the first voiceprint model that has been trained. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
[0011] Secondly, this application provides a training device for a voiceprint model, comprising:
[0012] The acquisition module is used to acquire multiple sample data, each of which includes sample speech data and a corresponding sample speaker identifier;
[0013] The segmentation module is used to randomly generate a sample length within a preset length range in the i-th iteration training of the first voiceprint model, and segment each of the sample speech data input in the i-th iteration training according to the sample length to obtain multiple sample speech blocks with a length of the sample length corresponding to each of the sample speech data, where i is a positive integer greater than or equal to 1.
[0014] The training module is used to train the first voiceprint model for the i-th iteration based on the sample speaker identifier corresponding to each of the sample speech data as supervision data and multiple sample speech blocks corresponding to each of the sample speech data.
[0015] The training module is further configured to determine the first voiceprint model that satisfies the preset convergence condition as the first voiceprint model that has been trained if the first voiceprint model after training satisfies the preset convergence condition. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
[0016] Thirdly, this application provides an electronic device, including: a memory, and a memory communicatively connected to the processor;
[0017] The memory stores computer-executed instructions;
[0018] The processor executes computer execution instructions stored in the memory to implement the voiceprint model training method as described in the first aspect.
[0019] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the training method for the voiceprint model described in the first aspect.
[0020] Fifthly, this application provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the training method for the voiceprint model described in the first aspect.
[0021] The voiceprint model training method, apparatus, device, medium, and product provided in this application acquire multiple sample data, each of which includes sample speech data and a corresponding sample speaker identifier; in the i-th iteration training of the first voiceprint model, a sample length within a preset length range is randomly generated, and each of the sample speech data input in the i-th iteration training is segmented according to the sample length to obtain multiple sample speech blocks of the same length corresponding to each of the sample speech data, where i is a positive integer greater than or equal to 1; using the sample speaker identifier corresponding to each of the sample speech data as supervision data, the first voiceprint model is trained in the i-th iteration based on the multiple sample speech blocks corresponding to each of the sample speech data; if the trained first voiceprint model satisfies a preset convergence condition, the first voiceprint model that satisfies the preset convergence condition is determined as the trained first voiceprint model, and the trained first voiceprint model is used to perform voiceprint recognition on the input speech data. In training the first voiceprint model, this application randomly generates a sample length within a preset length range for the current i-th iteration of training. Then, the sample speech signal in the sample data is segmented according to the sample length to obtain multiple sample speech blocks of the same length. Since each iteration of training randomly generates a sample length from the preset length range, the first voiceprint model can learn for sample speech blocks of different lengths in multiple iterations of training. By dynamically setting the length of the sample speech blocks, the adaptive ability of the first voiceprint model to the length of the speech blocks is improved, resulting in a better voiceprint recognition effect of the trained first voiceprint model. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0023] Figure 1 A schematic diagram illustrating one application scenario provided in this application;
[0024] Figure 2 Flowchart of the training method for the voiceprint model provided in this application Figure 1 ;
[0025] Figure 3 Flowchart of the training method for the voiceprint model provided in this application Figure 2 ;
[0026] Figure 4 A flowchart illustrating the voiceprint recognition process provided in this application. Figure 1 ;
[0027] Figure 5 A flowchart illustrating the voiceprint recognition process provided in this application. Figure 2;
[0028] Figure 6 A schematic diagram of the structure of the training device for the voiceprint model provided in this application;
[0029] Figure 7 A schematic diagram of the structure of the electronic device provided in this application.
[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0032] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.
[0033] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0034] First, let me explain the terms used in this application:
[0035] Voiceprint recognition: Voiceprint recognition converts sound signals into electrical signals, which are then identified by a computer. It includes speaker identification, speaker confirmation, and speaker logging.
[0036] Speaker identification: A technique that analyzes and processes a speaker's speech signal to confirm whether the speaker is in the recorded set of speakers and to identify the speaker's identity.
[0037] Speech blocks: During the training of the voiceprint model, the input speech is cut into speech blocks of a specified length, and then features are extracted for model training.
[0038] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.
[0039] Voiceprint recognition is a type of biometric technology, also known as speaker identification, which includes speaker recognition and speaker verification. Speaker recognition involves processing the speaker's voice data to confirm whether the speaker is in the recorded speaker set and to verify the speaker's identity. Speaker verification, on the other hand, involves processing the speaker's voice data to confirm whether the speaker is indeed the recorded speaker.
[0040] Related technologies train a voiceprint model, which is then used to identify the speaker's identity from the speech data to be recognized. In training the voiceprint model, fixed-length speech blocks are typically used. For example, the sample speech data used for training is divided into multiple fixed-length speech blocks, and the voiceprint model is trained based on these fixed-length speech blocks.
[0041] However, the length of the speech block in the above-mentioned technology has a significant impact on the recognition performance of the speaker model. If the speech block length is set too short, it will affect the speaker model's recognition performance for longer speech data; if the speech block length is set too long, it will affect the speaker model's recognition performance for shorter speech data.
[0042] To address the technical problem of poor speaker recognition performance caused by excessively large differences in the length of speech blocks in existing technologies, the inventors discovered in their research that, in order to solve this problem, a random sample length can be generated during speaker model training to avoid setting the speech block length to a fixed length. Considering that both excessively long and excessively short speech blocks will affect the recognition performance of the speaker model, a preset length range can be set, thereby randomly generating sample lengths within the preset length range. Furthermore, considering that the training process of the speaker model includes multiple iterations, and that each iteration requires segmenting the sample speech data, a sample length within the preset length range can be randomly generated during each iteration.
[0043] Specifically, when training the first voiceprint model, this application randomly generates a sample length within a preset length range for the current i-th iteration of training. Then, the sample speech signal in the sample data is segmented according to the sample length to obtain multiple sample speech blocks of the same length. Since each iteration of training randomly generates a sample length from the preset length range, the first voiceprint model can learn for sample speech blocks of different lengths in multiple iterations of training. By dynamically setting the length of the sample speech blocks, the adaptive ability of the first voiceprint model to the length of the speech blocks is improved, resulting in a better voiceprint recognition effect of the trained first voiceprint model.
[0044] The following describes the application scenarios of the voiceprint model training method provided in the embodiments of this application.
[0045] Figure 1 This is a schematic diagram illustrating one application scenario provided by this application. For example... Figure 1 As shown, the application scenario includes: electronic device 1. Electronic device 1 is the device for training the first voiceprint model. In this embodiment, during each iteration of training the first voiceprint model, electronic device 1 randomly generates a sample length within a preset length range, and then segments the sample speech signal in the sample data according to this sample length to obtain multiple sample speech blocks of the same length. Using the sample speaker identifier corresponding to the sample speech data as supervision data, the first voiceprint model is iteratively trained based on these multiple sample speech blocks until the trained first voiceprint model is obtained.
[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0047] Figure 2 Flowchart of the training method for the voiceprint model provided in this application Figure 1 The voiceprint model training method provided in this application is implemented by a voiceprint model training device, which is integrated into an electronic device. For example... Figure 2 As shown, the training method for the voiceprint model provided in this embodiment includes the following steps:
[0048] Step S101: Obtain multiple sample data, each sample data including sample speech data and corresponding sample speaker identifier.
[0049] The sample data is used to train the first voiceprint model. The number of sample data can be set as needed, and this embodiment does not limit it. For example, the number of sample data can be 1000, 10000, etc.
[0050] The sample speech data is collected by the speaker using their device. This sample speech data contains the speaker's output speech signal; for example, it might be an audio clip containing the phrase "open the door lock." The sample speaker identifier corresponding to the sample speech data identifies the speaker in the sample speech data. Different sample speaker identifiers represent different speaker identities, and there is a one-to-one correspondence between the sample speaker identifier and the speaker's identity, allowing the sample speaker identifier to uniquely identify the corresponding speaker. The representation method of the sample speaker identifier can be set as needed; this embodiment does not limit this. For example, if the speaker's identity is A, B, and C, the corresponding sample speaker identifiers would be 1, 2, and 3, respectively. Optionally, the sample speaker identifiers corresponding to the sample speech data are obtained through manual annotation. In this embodiment, technicians collect the sample speech data in advance and annotate it with sample speaker identifiers. The length of the sample speech data can be set as needed; this embodiment does not limit this. For example, the length of the sample speech data could be 5 seconds, 10 seconds, or 15 seconds, etc.
[0051] Step S102: In the i-th iteration training of the first voiceprint model, a sample length within a preset length range is randomly generated, and the input sample speech data of the i-th iteration training is segmented according to the sample length to obtain multiple sample speech blocks with a length of sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1.
[0052] The training process of the first voiceprint model includes multiple iterative training iterations. This step uses the i-th iteration as an example for explanation, where i is less than or equal to the total number of iterations in the first voiceprint model training. The preset length range can be set as needed; this embodiment does not limit this, for example, the preset length range can be 0.5 seconds to 2 seconds. It should be noted that although the preset length range is a single length range, it contains multiple preset lengths, and the difference between any two adjacent preset lengths is fixed. Optionally, the method for randomly generating a sample length within the preset length range includes: randomly selecting one preset length from among the preset lengths within the preset length range, and using the selected preset length as the sample length. The probability corresponding to each preset length within the preset length range, i.e., the probability of each preset length being selected, can be set as needed, for example, the probabilities corresponding to each preset length can be the same.
[0053] Step S103: Using the speaker identifiers corresponding to each sample speech data as supervision data, the first voiceprint model is trained for the i-th iteration based on multiple sample speech blocks corresponding to each sample speech data.
[0054] In this embodiment, both the sample speech data and the sample speech blocks are speech signals. Speech signals can be directly used as model input data. However, in some cases, such as when data is insufficient or computational power is limited, the speech signal can first be converted from a time-domain signal to a frequency-domain signal. Then, by referencing the processing mechanism of the human ear, feature extraction is performed on the speech signal to obtain speech features, which are then used as model input data. Speech features make the speech information contained in the speech signal easier to expose, greatly reducing the pressure of algorithm optimization and, to some extent, achieving dimensionality reduction and improving computational efficiency. Based on this, after obtaining multiple sample speech blocks corresponding to the sample speech data, this embodiment performs feature extraction on each sample speech block to obtain multiple sample speech features corresponding to the sample speech data. Correspondingly, the input data of the first voiceprint model is the multiple sample speech features corresponding to the sample speech data. For example, Mel Frequency Cepstral Coefficient (MFCC) features or Mel Filter Bank (FBANK) features are extracted from the sample speech blocks to obtain their corresponding sample speech features.
[0055] During the training of the first voiceprint model, multiple preset speaker identities are set, each representing a category. The speaker identity referred to by the speaker identifier corresponding to each sample speech data obtained in step S101 falls within these multiple preset speaker identities. Accordingly, the output data of the first voiceprint model is the voiceprint recognition result corresponding to the sample speech data. This voiceprint recognition result is a predicted probability sequence, which includes the predicted probability corresponding to each preset speaker identity. The predicted probability corresponding to a preset speaker identity represents the probability that the first voiceprint model predicts the speaker identity corresponding to the sample speech data to be that preset speaker identity. The higher the predicted probability corresponding to a preset speaker identity, the more likely the speaker identity corresponding to the sample speech data is that preset speaker identity; conversely, the lower the predicted probability corresponding to a preset speaker identity, the less likely the speaker identity corresponding to the sample speech data is that preset speaker identity.
[0056] Step S104: If the trained first voiceprint model satisfies the preset convergence condition, then the first voiceprint model that satisfies the preset convergence condition is determined as the trained first voiceprint model. The trained first voiceprint model is used to perform voiceprint recognition on the input speech data.
[0057] The preset convergence conditions can be set as needed, and this embodiment does not limit them. For example, the training convergence conditions can be that the number of training sessions reaches a preset number or the loss value is lower than the loss value threshold. The preset number of training sessions and the loss value threshold can both be set as needed.
[0058] In training the first voiceprint model, this application randomly generates a sample length within a preset length range for the current i-th iteration of training. Then, the sample speech signal in the sample data is segmented according to the sample length to obtain multiple sample speech blocks of the same length. Since each iteration of training randomly generates a sample length from the preset length range, the first voiceprint model can learn for sample speech blocks of different lengths in multiple iterations of training. By dynamically setting the length of the sample speech blocks, the adaptive ability of the first voiceprint model to the length of the speech blocks is improved, resulting in a better voiceprint recognition effect of the trained first voiceprint model.
[0059] Figure 3 Flowchart of the training method for the voiceprint model provided in this application Figure 2 ,like Figure 3 As shown, this embodiment provides a specific training process for a voiceprint model. The training method for the voiceprint model provided in this embodiment includes the following steps:
[0060] Step S201: Obtain multiple sample data, each sample data including sample speech data and corresponding sample speaker identifier.
[0061] In this embodiment, the implementation of step S201 is the same as that of step S101 in the previous embodiment, and will not be described again here.
[0062] Step S202: In the i-th iteration training of the first voiceprint model, a sample length within a preset length range is randomly generated, and the input sample speech data of the i-th iteration training is segmented according to the sample length to obtain multiple sample speech blocks with a length of sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1.
[0063] In this embodiment, the implementation of step S202 is the same as that of step S102 in the previous embodiment, and will not be described again here.
[0064] Step S203: Using the speaker identifiers corresponding to each sample speech data as supervision data, the first voiceprint model is trained in the i-th iteration based on multiple sample speech blocks corresponding to each sample speech data.
[0065] In this embodiment, the implementation of step S203 is the same as that of step S103 in the previous embodiment, and will not be described again here.
[0066] Optionally, the first voiceprint model includes a feature extraction network and a classification network; correspondingly, the implementation method of training the first voiceprint model for the i-th iteration based on multiple sample speech blocks corresponding to each sample speech data, using the sample speaker identifiers corresponding to each sample speech data as supervision data, includes the following steps S2031-S2033:
[0067] Step S2031: For each sample speech data, a feature extraction network is used to extract features from multiple sample speech blocks corresponding to the sample speech data to obtain the sample voiceprint features corresponding to the sample speech data; a classification network is used to determine the voiceprint recognition result corresponding to the sample speech data based on the sample voiceprint features.
[0068] The voiceprint recognition result includes the predicted probability corresponding to the sample speech data. The predicted probability represents the probability that the sample speech data belongs to the speaker identity referred to by the sample speaker identifier. This voiceprint recognition result is a predicted probability sequence, which includes the predicted probability corresponding to each preset speaker identity. The predicted probability corresponding to each preset speaker identity represents the probability that the first voiceprint model predicts the speaker identity corresponding to the sample speech data to be that preset speaker identity. Optionally, the implementation method of determining the voiceprint recognition result corresponding to the sample speech data based on the sample voiceprint features through a classification network includes: inputting the sample voiceprint features into a classification network, and using the classification network to map the sample voiceprint features into a one-dimensional vector, which is also the predicted probability sequence. The sum of multiple predicted probabilities included in the predicted probability sequence is 1.
[0069] Step S2032: Based on the predicted probability and speaker identifier of each sample speech data, determine the i-th loss value of the first voiceprint model.
[0070] In this model, the sample speaker identifier refers to the real speaker's identity, and the predicted probability corresponding to the sample speech data represents the probability of predicting that the sample speech data belongs to that speaker's identity. If the sample speaker identifier is represented in probability form, it can be represented as 1. The difference between 1 and the predicted probability can be regarded as the training error of the first voiceprint model, and the loss value can be calculated based on this training error. The method of calculating the loss value can be set as needed, and this embodiment does not limit it. For example, the loss value can be calculated using the cross-entropy loss function.
[0071] Step S2033: Adjust the model parameters of the first voiceprint model based on the i-th loss value to obtain the first voiceprint model after the i-th iteration training.
[0072] In this embodiment, after each iteration of training, the model parameters of the first voiceprint model are adjusted by backpropagation based on the determined loss value.
[0073] The above implementation provides a specific training method for the first voiceprint model. It extracts sample voiceprint features through a feature extraction network and classifies sample speech data based on the sample voiceprint features through a classification network to determine the predicted probability of the sample speaker identity. This allows for the determination of the loss value used to represent the training error of the first voiceprint model in the i-th iteration of training. Based on this loss value, the model parameters of the first voiceprint model can be adjusted, resulting in a more accurate first voiceprint model and achieving the training objective.
[0074] In this embodiment, if the first voiceprint model after the i-th iteration of training satisfies the preset convergence condition, it indicates that the accuracy of the first voiceprint model is high enough, the first voiceprint model can be used to perform voiceprint recognition on speech data, and the voiceprint recognition effect is good, then step S204 is executed. If the first voiceprint model after the i-th iteration of training does not satisfy the preset convergence condition, it indicates that the first voiceprint model needs further training, then step S205 is executed.
[0075] Step S204: The first voiceprint model that meets the preset convergence condition is determined as the first voiceprint model that has been trained. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
[0076] If the accuracy of the first voiceprint model that meets the preset convergence condition is high enough, then training of the first voiceprint model will stop.
[0077] Step S205: Perform the (i+1)th iteration training based on the first voiceprint model trained in the i-th iteration.
[0078] The training of the (i+1)th iteration of the first voiceprint model is the same as the training of the ith iteration, and will not be repeated here.
[0079] This embodiment provides a simple and effective method for training a voiceprint model, which allows the first voiceprint model to be trained dynamically using sample speech blocks of different lengths during the training process, thereby improving the first voiceprint model's ability to recognize speech data of different lengths.
[0080] In one optional implementation of the above embodiments, the first voiceprint model includes a feature extraction network and a classification network. The feature extraction network is used to extract voiceprint features, while the classification network is used to determine the corresponding predicted probability sequence based on the voiceprint features. The purpose of training the first voiceprint model is to train the feature extraction capability of the feature extraction network. The higher the feature extraction capability, the more accurate the voiceprint features. Accordingly, in some embodiments, the feature extraction network in the trained first voiceprint model is determined as the second voiceprint model.
[0081] In this embodiment, the feature extraction network in the trained first voiceprint model has a high feature extraction capability and can extract voiceprint features with high accuracy. By determining this feature extraction network as the second voiceprint model, the second voiceprint model is used to extract voiceprint features separately, thereby providing more accurate data support for subsequent voiceprint recognition.
[0082] Accordingly, based on any of the above embodiments, this application also provides a scheme for voiceprint recognition using a second voiceprint model. Figure 4 A flowchart illustrating the voiceprint recognition process provided in this application. Figure 1 ,like Figure 4 As shown, the process includes the following steps:
[0083] Step S301: Obtain the target speech data to be recognized.
[0084] The target speech data includes the speech signal output by the speaker, such as an audio message containing the phrase "open the photo album". The speaker's identity corresponding to this target speech data is to be identified. Optionally, the speaker collects the target speech data through a device they are using and triggers the device to send the target speech data to an electronic device. Accordingly, the electronic device receives the target speech data, executes the voiceprint recognition process provided in this embodiment, and performs voiceprint recognition on the target speech data to confirm the speaker's identity.
[0085] Step S302: Use the second voiceprint model to determine the target voiceprint features corresponding to the target speech data.
[0086] After acquiring the target speech data to be identified, a second voiceprint model is used to determine the target voiceprint features corresponding to the target speech data. Optionally, the implementation of using the second voiceprint model to determine the target voiceprint features corresponding to the target speech data includes the following steps S3021-S3022:
[0087] Step S3021: The target speech data is segmented to obtain multiple target speech blocks.
[0088] Optionally, the target speech data can be segmented to obtain multiple target speech blocks, including the following two implementation methods:
[0089] The first implementation method involves determining the target speech data's length from multiple preset speech length ranges; determining the preset speech block length corresponding to the preset speech length range; and segmenting the target speech data according to the preset speech block length to obtain multiple target speech blocks with a length equal to the preset speech block length. The preset speech length range and the corresponding preset speech block length can be set as needed, and this embodiment does not limit them. For example, if the preset speech length range is 5 to 10 seconds, the corresponding preset speech block length is 1.5 seconds; if the preset speech length range is 11 to 15 seconds, the corresponding preset speech block length is 2 seconds.
[0090] In the above implementation, considering that the lengths of different target speech data may vary, when segmenting the target speech data, the target speech data can be segmented according to the preset speech block length corresponding to the preset speech length range to which the length of the target speech data belongs, so that the length of the target speech block is appropriate.
[0091] The second implementation method involves segmenting the target speech data according to the default speech block length, resulting in multiple target speech blocks of the same length. The default speech block length can be set as needed; this embodiment does not impose any limitation on it, for example, the default speech block length can be 1 second.
[0092] In the above implementation method, the target language data is directly segmented according to the default speech block length, which is simple and efficient.
[0093] Step S3022: Input multiple target speech blocks into the second voiceprint model, and use the second voiceprint model to extract features from the multiple target speech blocks to obtain target voiceprint features.
[0094] In this embodiment, the second voiceprint model is the feature extraction network within the trained first voiceprint model. By inputting multiple target speech blocks into the second voiceprint model, corresponding target voiceprint features can be extracted. Optionally, after obtaining multiple target speech blocks corresponding to the target speech data, this embodiment performs feature extraction on each target speech block to obtain multiple target speech features corresponding to the target speech data. Accordingly, the input data for the second voiceprint model is the multiple target speech features corresponding to the target speech data.
[0095] In the above implementation, the target speech data is segmented, and then a second voiceprint model is used to extract features from the segmented speech blocks to obtain features that represent the speaker's voiceprint information in the target speech data.
[0096] In some embodiments, before segmenting the target speech data to obtain multiple target speech blocks, the method further includes: performing speech activity detection on the target speech data to obtain detected target speech data, wherein the detected target speech data includes speech data when the speaker is speaking but does not include speech data when the speaker is not speaking; correspondingly, the implementation of segmenting the target speech data to obtain multiple target speech blocks includes: segmenting the detected target speech data to obtain multiple target speech blocks.
[0097] Voice Activity Detection (VAD) is used to identify and eliminate speech data in target speech data that does not occur when the speaker is not present.
[0098] In the above implementation, considering that the target speech data may include not only the speech data when the speaker is speaking, but also the speech data when the speaker is not speaking, and the speech data when the speaker is not speaking is not helpful for voiceprint recognition, the target speech data is first subjected to speech activity detection, which enables the detected target speech data to be segmented, reducing the invalid data in the target speech data, providing more concise and effective data for voiceprint recognition, and thus enhancing the recognition capability of the second voiceprint model.
[0099] Step S303: Determine the similarity between the target voiceprint feature and each preset voiceprint feature in the corpus.
[0100] The corpus stores multiple pre-defined voiceprint features, each corresponding to a speaker. The similarity between the target voiceprint feature and each pre-defined voiceprint feature indicates the likelihood that the target voiceprint feature belongs to the corresponding speaker. Each pre-defined voiceprint feature in the corpus is stored in correspondence with a pre-defined speaker identifier, which indicates the identity of the speaker to which the corresponding pre-defined voiceprint feature belongs.
[0101] Step S304: The preset speaker identifier corresponding to the preset voiceprint feature to which the maximum similarity is determined is identified as the target speaker identifier corresponding to the target speech data, and the maximum similarity is greater than the preset similarity threshold.
[0102] The greater the similarity between the target voiceprint feature and the preset voiceprint feature, the more likely the speaker of the target speech data corresponding to the target voiceprint feature is to be the speaker corresponding to the preset voiceprint feature. Therefore, the speaker identified by the preset speaker identifier corresponding to the preset voiceprint feature with the highest similarity is most likely the speaker of the target speech data, and this preset speaker identifier can be determined as the target speaker identifier corresponding to the target speech data. The preset similarity threshold can be set as needed, and this embodiment does not limit it.
[0103] After identifying the target speaker, a first prompt message carrying that speaker's identifier can be output to prompt the user to check. It should be noted that if all determined similarities are less than or equal to a preset similarity threshold, a second prompt message is output. This second prompt message indicates that the speaker's identity to which the target voice data belongs has not been identified.
[0104] For example, Figure 5 A flowchart illustrating the voiceprint recognition process provided in this application. Figure 2 See Figure 5 For the target speech data, speech activity detection is performed first, then the second voiceprint model is used to determine the target voiceprint features, and then speaker identification is performed, i.e., steps S303-S304, to obtain the recognition result, i.e., the target speaker identifier.
[0105] This embodiment provides a scheme for voiceprint recognition of target speech data using a second voiceprint model. The target voiceprint features determined by the second voiceprint model have high accuracy. By determining the similarity between the target voiceprint features and each preset voiceprint feature in the corpus, the target speaker identifier corresponding to the target speech data can be located based on the determined multiple similarities, thereby determining the speaker's identity. This scheme has high accuracy.
[0106] Figure 6 A schematic diagram of the structure of the training device for the voiceprint model provided in this application is shown below. Figure 6 As shown, in this embodiment, the voiceprint model training device 400 can be installed in an electronic device, and the voiceprint model training device 400 includes:
[0107] The acquisition module 401 is used to acquire multiple sample data, each sample data including sample speech data and the corresponding sample speaker identifier;
[0108] The segmentation module 402 is used to randomly generate a sample length within a preset length range in the i-th iteration training of the first voiceprint model, and segment each sample speech data input in the i-th iteration training according to the sample length to obtain multiple sample speech blocks with a length of sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1.
[0109] Training module 403 is used to train the first voiceprint model for the i-th iteration based on multiple sample speech blocks corresponding to each sample speech data, using the sample speaker identifiers corresponding to each sample speech data as supervision data.
[0110] The training module 403 is also used to determine the first voiceprint model that satisfies the preset convergence condition as the first voiceprint model that has been trained if the first voiceprint model after training satisfies the preset convergence condition. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
[0111] Optionally, the first voiceprint model includes a feature extraction network and a classification network; training module 403 is used for:
[0112] For each sample of speech data:
[0113] The feature extraction network is used to extract features from multiple sample speech blocks corresponding to the sample speech data in order to obtain the sample speaker features corresponding to the sample speech data.
[0114] By using a classification network, the voiceprint recognition result corresponding to the sample speech data is determined based on the sample voiceprint features. The voiceprint recognition result includes the predicted probability corresponding to the sample speech data. The predicted probability represents the probability that the sample speech data belongs to the speaker identity referred to by the sample speaker identifier.
[0115] Based on the predicted probability and speaker identifier of each sample speech data, the i-th loss value of the first voiceprint model is determined.
[0116] The model parameters of the first voiceprint model are adjusted based on the i-th loss value to obtain the first voiceprint model after the i-th iteration of training.
[0117] The training module 403 is also used to perform the (i+1)th iteration training based on the first voiceprint model after the i-th iteration training if the first voiceprint model after the i-th iteration training does not meet the preset convergence condition.
[0118] Optionally, the device 400 further includes:
[0119] The training module is also used to identify the feature extraction network in the first voiceprint model after training as the second voiceprint model.
[0120] Optionally, the device 400 further includes:
[0121] The acquisition module 401 is also used to acquire the target speech data to be recognized;
[0122] The determination module is used to determine the target voiceprint features corresponding to the target speech data using the second voiceprint model; determine the similarity between the target voiceprint features and each preset voiceprint feature in the corpus; and determine the preset speaker identifier corresponding to the preset voiceprint feature with the highest similarity as the target speaker identifier corresponding to the target speech data, where the highest similarity is greater than the preset similarity threshold.
[0123] Optionally, a determining module is used to segment the target speech data to obtain multiple target speech blocks; input the multiple target speech blocks into a second voiceprint model, and use the second voiceprint model to extract features from the multiple target speech blocks to obtain target voiceprint features.
[0124] Optionally, the device 400 further includes:
[0125] The detection module is used to perform voice activity detection on the target voice data to obtain the detected target voice data. The detected target voice data includes the voice data when the speaker is speaking but does not include the voice data when the speaker is not speaking.
[0126] The determination module is used to segment the detected target speech data to obtain multiple target speech blocks.
[0127] Optionally, the determining module is used to determine the preset speech length range to which the length of the target speech data belongs from multiple preset speech length ranges; determine the preset speech block length corresponding to the preset speech length range; and segment the target speech data according to the preset speech block length to obtain multiple target speech blocks with a length of the preset speech block length.
[0128] Optionally, a determination module is used to segment the target speech data according to the default speech block length to obtain multiple target speech blocks with the same length as the default speech block.
[0129] The voiceprint model training device provided in this embodiment can execute... Figure 2 , Figure 3 or Figure 4 The technical solution of the method embodiment shown has the same implementation principle and technical effect as... Figure 2 , Figure 3 or Figure 4 The methods and embodiments shown are similar and will not be described in detail here.
[0130] This application also provides an electronic device. The electronic device is intended for various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
[0131] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. For example... Figure 7 As shown, the electronic device 50 includes a processor 501 and a memory 502 that is communicatively connected to the processor 501.
[0132] The memory 502 stores computer-executable instructions, and the processor 501 executes the computer-executable instructions stored in the memory 502 to implement the voiceprint model training method provided in this application.
[0133] In this embodiment, the memory 502 and the processor 501 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0134] The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein. The various components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required.
[0135] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores computer-executable instructions that, when executed by a processor, are used to implement the above-described voiceprint model training method. For example, the computer-readable storage medium may be a memory for storing computer-executable instructions, such as a read-only memory (ROM), a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, or an optical data storage device.
[0136] In an exemplary embodiment, a computer program product is also provided, including computer execution instructions, which, when executed by a processor, implement the training method for the voiceprint model provided in this application.
[0137] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0138] It should be further noted that although the steps in the flowchart 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 flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0139] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0140] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0141] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, an AI processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, storage units can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0142] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory, random access memory, portable hard drives, magnetic disks, or optical disks.
[0143] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0144] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0145] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for training a voiceprint model, characterized in that, include: Acquire multiple sample data, each of which includes sample speech data and a corresponding sample speaker identifier; In the i-th iteration training of the first voiceprint model, a preset length is randomly selected from each preset length within a preset length range. The selected preset length is used as the sample length, and the sample speech data input in the i-th iteration training is segmented according to the sample length to obtain multiple sample speech blocks with the sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1. Using the speaker identifier corresponding to each of the sample speech data as supervision data, the first voiceprint model is trained in the i-th iteration based on multiple sample speech blocks corresponding to each of the sample speech data. The first voiceprint model includes a feature extraction network and a classification network; the speaker identifier corresponding to each of the sample speech data is used as supervision data; Based on the multiple sample speech blocks corresponding to each of the sample speech data, the first voiceprint model is trained in its i-th iteration, including: Regarding the sample speech data mentioned above: The feature extraction network is used to extract features from multiple sample speech blocks corresponding to the sample speech data to obtain sample voiceprint features corresponding to the sample speech data. Through the classification network, based on the sample voiceprint features, the voiceprint recognition result corresponding to the sample speech data is determined. The voiceprint recognition result includes the predicted probability corresponding to the sample speech data. The predicted probability represents the probability that the sample speech data belongs to the speaker identity referred to by the sample speaker identifier. Based on the predicted probability corresponding to each sample speech data and the speaker identifier of the sample, the i-th loss value of the first voiceprint model is determined. The model parameters of the first voiceprint model are adjusted based on the i-th loss value to obtain the first voiceprint model after the i-th iteration of training. If the first voiceprint model after training satisfies the preset convergence condition, then the first voiceprint model that satisfies the preset convergence condition is determined as the first voiceprint model that has been trained. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
2. The method of claim 1, wherein, The method further includes: The feature extraction network in the first voiceprint model that has been trained is identified as the second voiceprint model.
3. The method of claim 2, wherein, The method further includes: Acquire the target speech data to be recognized; The target voiceprint features corresponding to the target speech data are determined using the second voiceprint model; Determine the similarity between the target voiceprint feature and each preset voiceprint feature in the corpus; The preset speaker identifier corresponding to the preset voiceprint feature to which the maximum similarity is determined is identified as the target speaker identifier corresponding to the target speech data, wherein the maximum similarity is greater than the preset similarity threshold.
4. The method of claim 3, wherein, The step of determining the target voiceprint features corresponding to the target speech data using the second voiceprint model includes: The target speech data is segmented to obtain multiple target speech blocks; Multiple target speech blocks are input into the second voiceprint model, and the second voiceprint model is used to extract features from the multiple target speech blocks to obtain the target voiceprint features.
5. The method of claim 4, wherein, Before segmenting the target speech data to obtain multiple target speech blocks, the method further includes: Speech activity detection is performed on the target speech data to obtain the detected target speech data, which includes speech data when the speaker is speaking but does not include speech data when the speaker is not speaking. The target speech data is segmented to obtain multiple target speech blocks, including: The detected target speech data is segmented to obtain multiple target speech blocks.
6. The method of claim 4, wherein, The target speech data is segmented to obtain multiple target speech blocks, including: From multiple preset speech length ranges, determine the preset speech length range to which the length of the target speech data belongs; Determine the preset speech block length corresponding to the preset speech length range; The target speech data is segmented according to the preset speech block length to obtain multiple target speech blocks with the same length as the preset speech block.
7. The method of claim 4, wherein, The target speech data is segmented to obtain multiple target speech blocks, including: The target speech data is segmented according to the default speech block length to obtain multiple target speech blocks with the same length as the default speech block.
8. An apparatus for training a voiceprint model, the apparatus comprising: include: The acquisition module is used to acquire multiple sample data, each of which includes sample speech data and a corresponding sample speaker identifier; The segmentation module is used to randomly select a preset length from each preset length within a preset length range during the i-th iteration training of the first voiceprint model, use the selected preset length as the sample length, and segment each sample speech data input in the i-th iteration training according to the sample length to obtain multiple sample speech blocks with the sample length corresponding to each sample speech data, where i is a positive integer greater than or equal to 1. The training module is used to train the first voiceprint model for the i-th iteration based on the sample speaker identifier corresponding to each of the sample speech data as supervision data and multiple sample speech blocks corresponding to each of the sample speech data. The first voiceprint model includes a feature extraction network and a classification network; the speaker identifier corresponding to each of the sample speech data is used as supervision data; The training module is also used for: Regarding the sample speech data mentioned above: The feature extraction network is used to extract features from multiple sample speech blocks corresponding to the sample speech data to obtain sample voiceprint features corresponding to the sample speech data. Through the classification network, based on the sample voiceprint features, the voiceprint recognition result corresponding to the sample speech data is determined. The voiceprint recognition result includes the predicted probability corresponding to the sample speech data. The predicted probability represents the probability that the sample speech data belongs to the speaker identity referred to by the sample speaker identifier. Based on the predicted probability corresponding to each sample speech data and the speaker identifier of the sample, the i-th loss value of the first voiceprint model is determined. The model parameters of the first voiceprint model are adjusted based on the i-th loss value to obtain the first voiceprint model after the i-th iteration of training. The training module is further configured to determine the first voiceprint model that satisfies the preset convergence condition as the first voiceprint model that has been trained if the first voiceprint model after training satisfies the preset convergence condition. The first voiceprint model that has been trained is used to perform voiceprint recognition on the input speech data.
9. An electronic device, comprising: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the voiceprint model training method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the training method for the voiceprint model as described in any one of claims 1 to 7.
11. A computer program product, comprising computer-executable instructions, characterized in that, When the computer execution instructions are executed by the processor, the training method for the voiceprint model as described in any one of claims 1 to 7 is implemented.