Voiceprint recognition method and device, terminal equipment and computer readable storage medium

By training the voiceprint feature extraction model using a loss function based on metric learning, the problem of high resource consumption in existing technologies is solved, achieving more efficient and accurate voiceprint recognition.

CN114765028BActive Publication Date: 2026-11-27TCL TECHNOLOGY GROUP CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110055451.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2026-11-27
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

Existing voiceprint recognition technology requires significant computing power and video memory during training, resulting in high resource consumption, high training complexity, and high cost.

Method used

The speaker feature extraction model is trained using a loss function based on metric learning. By learning the similarity between similar speech samples and the differences between dissimilar speech samples, the dependence on feature dimensions is reduced, thus lowering the requirements for computing resources and GPU memory.

Benefits of technology

It significantly reduces the computing resources and GPU memory required for training, improves training efficiency, and enhances the accuracy of voiceprint feature extraction and recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114765028B_ABST
    Figure CN114765028B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of computers, and provides a voiceprint recognition method and device, terminal equipment and computer readable storage medium. The method comprises the following steps: obtaining to-be-recognized voice information; inputting the to-be-recognized voice information into a voiceprint feature extraction model for processing, and outputting a voiceprint feature vector; wherein the voiceprint feature extraction model is obtained according to a loss function, and the loss function belongs to a metric learning function; and determining a speaker corresponding to the to-be-recognized voice information based on the voiceprint feature vector. The method provided in the application can reduce the computing resource and GPU display memory required for model training, reduce the complexity of model training, reduce the cost of model training, and improve the efficiency of model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and in particular relates to a voiceprint recognition method, device, terminal equipment and computer-readable storage medium. Background Technology

[0002] Voiceprint recognition is a type of biometric technology, also known as speaker recognition, which includes speaker identification and speaker verification. Voiceprint recognition has received widespread attention from all sectors of society due to its ease of use, low cost, and high user acceptance.

[0003] In related technologies, voiceprint recognition is mainly performed using models trained on Convolutional Neural Networks (CNNs). These models convert audio into images and input them into the CNN for training. A pre-defined softmax loss function is used to adjust the model so that its output matches the target.

[0004] However, models based on the softmax loss function require significant computing power and GPU memory during training. Summary of the Invention

[0005] This application provides a voiceprint recognition method, apparatus, terminal device, and computer-readable storage medium, which can solve the problem of requiring large computing resources and video memory during the training process.

[0006] In a first aspect, embodiments of this application provide a voiceprint recognition method, including:

[0007] Obtain the speech information to be recognized;

[0008] The speech information to be recognized is input into the voiceprint feature extraction model for processing, and the voiceprint feature vector is output; wherein, the voiceprint feature extraction model is trained according to a loss function, and the loss function is a metric learning function;

[0009] The speaker corresponding to the speech information to be identified is determined based on the voiceprint feature vector.

[0010] Secondly, embodiments of this application provide a voiceprint recognition device, including:

[0011] The voice information acquisition module is used to acquire the voice information to be recognized;

[0012] The feature extraction module is used to input the speech information to be recognized into the voiceprint feature extraction model for processing and output a voiceprint feature vector; wherein, the voiceprint feature extraction model is trained according to a loss function, and the loss function is a metric learning function;

[0013] The recognition module is used to determine the speaker corresponding to the voice information to be recognized based on the voiceprint feature vector.

[0014] Thirdly, embodiments of this application provide a terminal device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the voiceprint recognition method of any one of the first aspects described above.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the voiceprint recognition method of any one of the first aspects described above.

[0016] The aforementioned voiceprint recognition method, device, terminal equipment, and computer-readable storage medium employ a loss function based on metric learning for model training. This allows the voiceprint feature extraction model to learn the similarity between similar speech samples and the differences between dissimilar speech samples, thereby achieving classification through the similarity between speech samples. In this way, the voiceprint feature extraction model does not need to perform a classification task, and therefore does not need to map feature vectors with the same feature dimension as the number of speakers in the training sample set. This significantly reduces the computational resources and GPU memory required for training, greatly reducing the complexity and cost of model training and improving training efficiency. Furthermore, using a loss function based on metric learning for model training, learning the similarity between similar speech samples and the differences between dissimilar speech samples, makes the resulting voiceprint feature extraction model more accurate in extracting voiceprint features from different speakers, leading to more accurate voiceprint recognition in subsequent stages. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the terminal device structure provided in an embodiment of this application;

[0019] Figure 2 This is a flowchart illustrating the training method for a voiceprint feature extraction model provided in an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of the structure of a voiceprint feature extraction model provided in an embodiment of this application;

[0021] Figure 4This is a schematic flowchart of a voiceprint recognition method provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the voiceprint extraction device provided in one embodiment of this application. Detailed Implementation

[0023] 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.

[0024] It is understood that the terms “first,” “second,” “third,” “fourth,” etc. (if present) in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0025] It is understood that the term “and / or” as used in this application refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes such combinations.

[0026] The voiceprint recognition method provided in this application can be applied to voiceprint recognition scenarios for speaker identification, including speaker recognition and speaker confirmation. For example, the method provided in this application can be applied to smart home products to identify speakers and activate corresponding voice operation permissions based on the recognition results. For instance, the method provided in this application can be applied to speaker identification and verification tasks under near-field remote control recording or far-field microphone array recording conditions of smart TVs. Specifically, the method provided in this application can be applied to text-independent voiceprint recognition. Optionally, this method can be used for voiceprint recognition of long audio files or short audio files, where long audio files refer to audio files longer than 3 seconds and short audio files refer to audio files shorter than 3 seconds.

[0027] The voiceprint recognition method provided in this application can be applied to terminal devices. For example, Figure 1 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 1 As shown, the terminal device may include: a processor 10, a memory 11, and a computer program 12 stored in the memory 11 and executable on the processor 10. When the processor 10 executes the computer program 12, it can implement the voiceprint feature extraction model training method and the voiceprint recognition method provided in the embodiments of this application. The embodiments of this application do not limit the number or type of the processor 10 and the memory 11.

[0028] In this application embodiment, the type of terminal device 1 is not limited. For example, it can be a desktop computer, laptop, handheld computer, cloud server, or other computing device.

[0029] The technical solutions in this application will now be described in detail with reference to the accompanying drawings. It should be noted that, where there is no conflict, different technical features in this application can be combined with each other.

[0030] For ease of description, the following embodiments first describe the training method of the voiceprint feature extraction model with reference to the accompanying drawings, and then describe the method of voiceprint recognition using the voiceprint feature extraction model.

[0031] Figure 2 A schematic flowchart illustrating the training method for the voiceprint feature extraction model provided in this application is shown. Figure 2 As shown, the voiceprint feature extraction model training method provided in this embodiment may include:

[0032] S201. Obtain a set of speech samples, which includes speech samples corresponding to at least two speakers.

[0033] The speech sample set includes multiple speech samples. Optionally, multiple speech samples can be obtained by preprocessing the audio recordings of multiple speakers, thus forming the speech sample set. The acquisition of speech audio can be achieved by recording the voices of different speakers; for example, multiple sentences can be randomly recorded from each speaker, resulting in multiple audio segments. Speech audio can also be obtained by truncating multiple long audio segments from multiple speakers. Preprocessing of the speech audio can include, but is not limited to, removing silence, audio filtering, and audio truncating. For example, silence can be removed from each audio segment, and the silence-removed audio can be filtered to eliminate audio segments with a valid duration of less than 1 second. For audio segments longer than 3 seconds, only the first 3 seconds are extracted. This yields multiple audio segments with durations of 1 to 3 seconds, generating the aforementioned speech sample set.

[0034] Each speech sample in the speech sample set corresponds to one speaker, and each speaker can correspond to multiple speech samples. Two speech samples can correspond to the same speaker or different speakers. In other words, the multiple speech samples include samples with the same speaker and samples with different speakers. The correspondence between speech samples and speakers can be pre-labeled. For example, speech sample number 1 corresponds to speaker number A, speech sample number 2 corresponds to speaker number A, speech sample number 3 corresponds to speaker number B, and so on. This is equivalent to classifying the speech samples in the speech sample set: speech samples with the same speaker belong to the same category, and speech samples with different speakers belong to different categories.

[0035] It should be noted that the speech sample set is used for model training, but the speech sample set is not the same as the training sample set. The training sample set can include multiple speech sample sets.

[0036] S202. Based on the speech sample set and the pre-established loss function, the initial voiceprint feature extraction model is trained to obtain the voiceprint feature extraction model; where the loss function belongs to the metric learning function.

[0037] The initial voiceprint feature extraction model is used to extract voiceprint feature vectors from speech samples. Optionally, speech samples from the speech sample set can be directly input into the initial voiceprint feature extraction model to output the corresponding voiceprint feature vectors. Alternatively, the speech samples can be preprocessed before being input into the initial voiceprint feature extraction model to obtain the corresponding voiceprint feature vectors. For example, Mel Frequency Cepstral Coefficients (MFCC) can be extracted from the speech samples to obtain MFCC feature maps, which are then input into the initial voiceprint feature extraction model for processing. In a specific embodiment, for each speech sample, a 64-dimensional MFCC feature map can be extracted using a sampling rate of 1.6 kHz, a frame length of 25 ms, a step size of 10 ms, and a Mel frequency dimension of 128. For a speech sample with a duration of 3 seconds, a 300*64 feature map is obtained after MFCC extraction; for speech samples with a duration of less than 3 seconds, the feature map can be padded with zeros to obtain a 300*64 feature map. In this way, a feature map of 300*64 can be obtained, which is the same number as the number of speech samples.

[0038] Based on the voiceprint feature vector corresponding to each speech sample in the speech sample set and a pre-established loss function, the parameters of the initial voiceprint feature vector are adjusted to obtain the voiceprint feature vector. In this embodiment, the loss function of the model adopts a metric learning function. The metric learning function is also called a distance metric learning (DML) function or a similarity learning function. The goal of the metric learning-based loss function is to make the similarity of the voiceprint feature vectors of similar speech samples greater and the similarity between dissimilar speech samples smaller, that is, to make the differences between dissimilar speech samples greater, thereby facilitating the classification of the trained model in later stages.

[0039] Typically, traditional voiceprint feature extraction model training methods use softmax-type loss functions. During training, voiceprint features need to be mapped to feature vectors with the same feature dimension as the number of speakers in the training sample set. For example, if the training set includes voice samples from 10,000 people, then the model needs to map each voice sample to a feature vector with 10,000 dimensions. Training the model requires significant computing power and GPU memory.

[0040] In this embodiment, a loss function based on metric learning is used for model training. This allows the voiceprint feature extraction model to learn the similarity between similar speech samples and the differences between dissimilar speech samples, thereby achieving the classification task through the similarity between speech samples. In this way, the voiceprint feature extraction model does not need to perform a classification task, and therefore does not need to map feature vectors with the same feature dimension as the number of speakers in the training sample set. This significantly reduces the computing resources and GPU memory required for training, greatly reducing the complexity and cost of model training and improving training efficiency. Furthermore, using a loss function based on metric learning to learn the similarity between similar speech samples and the differences between dissimilar speech samples makes the resulting voiceprint feature extraction model more accurate in extracting voiceprint features from different speakers, leading to more accurate voiceprint recognition in subsequent stages.

[0041] It should be noted that this embodiment provides a process for training an initial voiceprint feature extraction model based on a set of speech samples. It is understood that in some specific embodiments, multiple speech sample sets in the training sample set can be processed sequentially, repeating steps S201 and S202 above, to adjust the initial voiceprint feature extraction model multiple times until the model converges, resulting in the final voiceprint feature extraction model. The number of speech samples in each speech sample set can be determined based on model parameters and convergence speed. As an example, and not a limitation, each speech sample set may include 64 speech samples, comprising 4 samples from each of 16 speakers. This configuration of the speech sample set allows the model to not only meet convergence requirements but also saves a significant amount of speech samples, reducing training data requirements and lowering model training costs.

[0042] Optionally, when training the initial voiceprint feature extraction model based on multiple speech sample sets, the model can be optimized using the stochastic gradient descent algorithm. The stochastic gradient descent algorithm can employ warmup learning rate adjustment, with the learning rate changing as follows:

[0043] lr = flr × 10 0.5 ×min(step×10 -1.5 ,step-0.5 )

[0044] Where lr represents the current learning rate, flr represents the coefficient (which can be set to 0.01), min(x,y) represents taking the minimum value of x and y, and step represents the current step number.

[0045] As an optional implementation, step S202, which involves training the initial voiceprint feature extraction model based on multiple speech samples and a pre-established loss function to obtain the voiceprint feature extraction model, can be implemented in the following way, S202 including:

[0046] The speech samples in the speech sample set are input into the initial voiceprint feature extraction model for processing, and the voiceprint feature vector corresponding to each speech sample is output. The training loss is determined based on the voiceprint feature vector corresponding to each speech sample and the loss function. The parameters of the initial voiceprint feature extraction model are adjusted according to the training loss to obtain the voiceprint feature extraction model.

[0047] As described in the above embodiments, when the training samples include multiple sets of speech samples, the multiple sets of speech samples can be input into the initial voiceprint feature extraction model respectively. Combined with the loss function, multiple training losses are determined. Based on the multiple training losses, the parameters of the initial voiceprint feature extraction model are adjusted multiple times until the model converges.

[0048] The method provided by this implementation extracts voiceprint features from voice samples in a voice sample set, determines the training loss based on the extracted voiceprint feature vector and the loss function based on metric learning, and adjusts the parameters of the initial voiceprint feature extraction model according to the training loss, so that the model gradually learns the similarity between similar voice samples and the difference between dissimilar voice samples, thereby achieving the classification task through the similarity between voice samples, reducing the computing power resources and GPU memory required for training.

[0049] Optionally, based on the speaker feature vector and loss function corresponding to each speech sample, the training loss can be determined in the following way:

[0050] For each speech sample in the speech sample set, determine the maximum cosine similarity (hereinafter referred to as the maximum value) between the corresponding voiceprint feature vector and the voiceprint feature vectors of multiple out-of-class samples; determine the mean cosine similarity (hereinafter referred to as the mean) between the corresponding voiceprint feature vector and the voiceprint feature vectors of multiple intra-class samples. Out-of-class samples refer to speech samples in the speech sample set belonging to a different speaker than the given speech sample, and intra-class samples refer to speech samples in the speech sample set belonging to the same speaker as the given speech sample. Then, based on the maximum value and mean value for each speech sample in the speech sample set, determine the training loss using a loss function.

[0051] Optionally, in this embodiment, the training loss can be directly determined based on the maximum and mean values ​​corresponding to each speech sample using a loss function. Alternatively, an initial training loss can be determined first based on the maximum and mean values ​​corresponding to each speech sample using a loss function, and then generalized to obtain the final training loss. Generalization prevents overfitting and enhances the generalization ability of the final voiceprint feature extraction model. Optionally, L2 generalization can be applied to the initial training loss. Correspondingly, the training loss can be determined using the following formula:

[0052] loss R =loss + L2

[0053] Where, loss R Let represent the training loss, where loss represents the initial training loss, and L2 represents the L2 norm.

[0054] Assuming the speech sample set includes speech samples from N speakers, with each speaker corresponding to M speech samples, the initial training loss can optionally be calculated using the following formula:

[0055]

[0056] Where loss represents the initial training loss, N represents the number of speakers, M represents the number of speech samples corresponding to each speaker, i represents the speaker index, j represents the speech sample index corresponding to each speaker, and SO ij SI represents the maximum value corresponding to the j-th speech sample of the i-th speaker. ij Let th1 represent the mean value corresponding to the j-th speech sample of the i-th speaker, and let th2 represent the first threshold and the second threshold.

[0057] As an example, and not a limitation, the maximum value for each speech sample can be determined by the following formula:

[0058]

[0059] Where p represents the speaker's sequence number, q represents the sequence number of the speech sample corresponding to the p-th speaker, and v ij v represents the voiceprint feature vector corresponding to the j-th speech sample of the i-th speaker; pq Let represent the voiceprint feature vector corresponding to the qth speech sample of the pth speaker; sim[] represents the cosine similarity function.

[0060] As an example, and not a limitation, the mean of each speech sample can be determined using the following formula:

[0061]

[0062] Where k represents the sequence number of the speech sample corresponding to the i-th speaker, v ik This represents the voiceprint feature vector corresponding to the k-th speech sample of the i-th speaker.

[0063] Specifically, based on the above formula, the training loss corresponding to each set of speech samples in the training samples is determined. Through optimization methods such as stochastic gradient descent, the model parameters are adjusted and the model is optimized so that the training loss continues to decrease. As a result, the model gradually deviates from the target set by the loss function during the training process, and finally, a voiceprint feature extraction model that meets the expectations is obtained.

[0064] In this embodiment, the main motivation for the loss function based on metric learning is to ensure that the cosine similarity between the voiceprint feature vector corresponding to any voice sample in the same class and the class center is greater than a first threshold, while simultaneously ensuring that the maximum similarity between the voiceprint feature vector corresponding to any voice sample and any out-of-class voice sample is less than a second threshold. Thus, by adjusting the first and second thresholds, the voiceprint feature extraction model can meet the main objective, and the intra-class and out-of-class similarity can be balanced, preventing one similarity from becoming too dominant and affecting the optimization of the other, thereby improving the model's optimization performance.

[0065] The following examples further illustrate the structure of the voiceprint feature extraction model and the specific process of voiceprint feature extraction:

[0066] Figure 3 This is a schematic diagram of the structure of a voiceprint feature extraction model in one embodiment. For example... Figure 3 As shown, the voiceprint feature extraction model includes a convolutional neural network sub-model, a gated recurrent unit (GRU) sub-model, and fully connected (FC) layers. GRU is a variant of the recurrent neural network (RNN). It can be understood that the initial voiceprint feature extraction model has the same structure as the standard voiceprint feature extraction model, differing only in parameters. This embodiment only uses the voiceprint feature extraction model as an example for illustration. During model training, the working process of each layer of the initial voiceprint feature extraction model is similar and will not be repeated here.

[0067] For example, the voiceprint feature extraction model is illustrated in Table 1.

[0068] Table 1

[0069] Model structure layer Output data dimensions Reshape-1 [64,300,64,1] Conv-1: [5*5]*16, stride: 2, activation function: ReLU [64,150,32,16] Conv-2: [5*5]*32, stride: 2, activation function: ReLU [64,75,16,32] Conv-3: [5*5]*64, stride: 2, activation function: ReLU [64,38,8,64] Reshape-2 [64,38,512] GRU: 128 cells [64,128] FC: 512, Activation function: tanh, L2 generalization [64,512]

[0070] As shown in Table 1, the convolutional neural network sub-model may include a first reconstruction layer (Reshape-1), a first convolutional layer (Conv-1), a second convolutional layer (Conv-2), a third convolutional layer (Conv-3), and a second reconstruction layer (Reshape-2). Optionally, the convolutional kernels of the first, second, and third convolutional layers are all 5*5. Using 5*5 kernels, compared to excessively small kernels such as 3*3 kernels, allows for the extraction of voiceprint features over a larger time dimension. Compared to excessively large kernels, it effectively reduces the number of model parameters, achieving model lightweighting, improving model computation speed, and reducing computational requirements. Optionally, the stride of the first, second, and third convolutional layers is all 2. A stride of 2 effectively compresses features, further reducing the number of model parameters, decreasing model complexity, achieving model lightweighting, and thus improving model computation speed. Optionally, the gated recurrent unit sub-model includes 128 hidden neural units.

[0071] Here, taking a speech sample set containing 64 speech samples as an example, the process of extracting voiceprint features is explained using a voiceprint feature extraction model:

[0072] 1) Preprocess the 64 audio recordings to obtain 64 audio samples, and then further preprocess these 64 audio samples (MFCC parameter extraction) to obtain 64 300*64 MFCC feature maps. The preprocessing steps for the audio recordings and audio samples are described in the above embodiment and will not be repeated here.

[0073] 2) Input 64 300*64 MFCC feature maps into the first reconstruction layer for reconstruction processing to obtain 64 300*64*1 feature maps.

[0074] 3) Input 64 feature maps of 300*64*1 pixels into the first convolutional layer, using ReLU as the activation function to extract voiceprint features. Specifically, the first convolutional layer has a 5*5 kernel, a stride of 2, and 16 channels. This layer outputs 64 feature maps of 150*32*16 pixels.

[0075] 4) Input 64 150*32*16 feature maps into the second convolutional layer, using ReLU as the activation function, to further compress and refine the voiceprint features. Specifically, the second convolutional layer has a 5*5 kernel, a stride of 2, and 32 channels. This layer outputs 64 75*16*32 feature maps.

[0076] 5) Input 64 feature maps of 75*16*32 pixels into the third convolutional layer, using ReLU as the activation function, to further compress and refine the voiceprint features. Specifically, the third convolutional layer has a 5*5 kernel, a stride of 2, and 64 channels. This layer outputs 64 feature maps of 38*8*64 pixels.

[0077] 6) Input the 64 38*8*64 feature maps into the second reconstruction layer for reconstruction processing to obtain 64 38*512 feature maps.

[0078] 7) Input 64 38*512 feature maps into a gated recurrent unit sub-model with 128 hidden neural units. The gated recurrent unit sub-model extracts voiceprint features with time-series characteristics, which are sentence-level features.

[0079] 8) By connecting the tanh activation function through a fully connected layer, the voiceprint features with time-series characteristics are mapped into 64 preliminary voiceprint feature vectors of 512 dimensions. Each preliminary voiceprint feature vector is then subjected to L2 generalization to obtain a voiceprint feature vector that can distinguish the speaker.

[0080] It is evident that when using the structure provided in this embodiment as the initial feature extraction model for model training, any speech sample input into the initial feature extraction model only requires the voiceprint feature extraction model to map the voiceprint features into a 512-dimensional voiceprint feature vector. The similarity of the voiceprint feature vectors corresponding to each speech sample is calculated using a loss function based on metric learning to complete the classification. This eliminates the need to map the voiceprint features into feature vectors with the same feature dimension as the number of speakers in the training set, thereby significantly reducing the computing resources and GPU memory required for training, simplifying the training process, and improving the training speed.

[0081] The voiceprint recognition method provided in this application will be described in detail below with reference to the accompanying drawings.

[0082] Figure 4 A schematic flowchart of the voiceprint recognition method provided in this application is shown. Figure 4 As shown, the voiceprint recognition method provided in this embodiment may include:

[0083] S401. Obtain the speech information to be recognized.

[0084] S402. Input the speech information to be recognized into the voiceprint feature extraction model for processing, and output the voiceprint feature vector; wherein, the voiceprint feature extraction model is trained according to a loss function, and the loss function is a metric learning function.

[0085] S403. Determine the speaker corresponding to the speech information to be identified based on the voiceprint feature vector.

[0086] The voiceprint feature extraction model in this embodiment is trained using the voiceprint feature extraction model training method provided in the above embodiments. The specific process of the voiceprint feature extraction model processing the speech information to be recognized and extracting voiceprint feature vectors is described in the above embodiments and will not be repeated here.

[0087] Optionally, a voiceprint model library can be pre-established, storing multiple registered voiceprints. These registered voiceprints represent the voiceprints of speakers who have been identified and recorded. By calculating the similarity between the voiceprint feature vector corresponding to the speech information to be identified and each registered voiceprint in the voiceprint model library, the speaker corresponding to the voiceprint with the highest similarity can be identified as the speaker corresponding to the speech information to be identified.

[0088] The voiceprint recognition method provided in this embodiment processes voiceprint features using a voiceprint feature extraction model to extract voiceprint feature vectors. This model is trained using a loss function based on metric learning, enabling it to learn the similarity between similar speech samples and the differences between dissimilar speech samples, thus achieving classification based on the similarity between speech samples. The voiceprint feature extraction model trained using a loss function based on metric learning achieves high accuracy in voiceprint feature extraction, thereby making speaker recognition more accurate.

[0089] The following describes the training method for the voiceprint feature extraction model and the detection and experimental verification process of the voiceprint recognition method provided in the embodiments of this application.

[0090] 1) Dataset

[0091] The datasets used in the experiment included: near-field remote control recording dataset and far-field TV microphone array recording dataset.

[0092] The data in the two datasets were processed by removing silence, filtering, and truncating audio, resulting in multiple audio samples ranging from 1 to 3 seconds in length. The processed datasets were named the near-field sample set and the far-field sample set. The near-field sample set contains 412,000 speech samples from 8,031 speakers, while the far-field sample set contains 223,000 speech samples from 7,224 speakers. The speech samples in the near-field sample set were randomly divided, with 7,500 speakers used as the training set and the remaining 531 speakers used as the test set. Similarly, the speech samples in the far-field sample set were randomly divided, with 6,700 speakers used as the training set and the remaining 524 speakers used as the test set. In the experiments, the near-field and far-field sample sets were tested separately, without overlap.

[0093] 2) Computing resources

[0094] During model training, each speech sample set includes 64 speech samples, meaning 64 data points are processed per batch, requiring approximately 778MB of GPU memory for training. Training was performed using a single-threaded NVIDIA Tesla P100PCI-E 16GB GPU, achieving initial convergence in about 72 hours and near-complete convergence in about 168 hours. Continuing training for another week after near-complete convergence improved accuracy by approximately 1%.

[0095] 3) Recognition Results

[0096] This experiment uses two evaluation metrics: recognition accuracy and equal error rate (EER). Recognition accuracy simulates a real-world application scenario, with each user registering three sentences and entering one sentence for recognition each time. In each round of testing, six speakers from the test set are selected (e.g., in a family scenario, this could include grandparents, parents, and children). Each speaker delivers four sentences for the recognition test. In each round, three of the four sentences are used as the registered audio, and the remaining sentence is used as the query audio. During recognition, the speaker category of the registered audio most similar to the query audio is selected as the predicted speaker category, and this is used to calculate the recognition accuracy. Multiple rounds of testing are randomly selected from the test set, and the average recognition accuracy obtained from these rounds is calculated to obtain a relatively stable and accurate recognition accuracy. In the experiment, 2305 rounds of experiments were conducted on the near-field sample set, yielding an average accuracy of 0.98; 1304 rounds of experiments were conducted on the far-field sample set, yielding an average accuracy of 0.969.

[0097] In addition, to further test the model's generalization performance on the number of classifications, 50 speakers were selected for testing in each round. The near-field sample set was tested for 276 rounds, and the mean accuracy was 0.907. The far-field sample set was tested for 156 rounds, and the mean accuracy was 0.854.

[0098] In this experiment, the model EER measured on the near-field sample set was approximately 0.034, and the model EER measured on the far-field sample set was approximately 0.038.

[0099] 4) Model speed

[0100] The voiceprint recognition method provided in this application, when performing voiceprint recognition, primarily affects the model speed through data preprocessing and the process of calculating voiceprint feature vectors using the voiceprint feature extraction model. The data preprocessing process includes preprocessing the original audio to generate speech samples, and preprocessing the speech samples to generate MFCCs, etc. The duration of the original audio and the duration of the speech samples generated after preprocessing both affect the speed of the preprocessing process. Furthermore, the state and configuration of the terminal device on which the voiceprint recognition method runs are also important factors affecting the preprocessing process and the calculation of voiceprint feature vectors.

[0101] This experiment tested the model speed on a terminal device with an Intel i5-8400 CPU. The speech samples ranged in length from 1 to 3 seconds, with an average preprocessing time of approximately 0.04 seconds per sample. The process of the voiceprint feature extraction model calculating voiceprint feature vectors involved inputting 6*2 MFCC feature maps into the model for each batch, resulting in 12 voiceprint feature vectors. The time consumed by the voiceprint feature extraction model to process one batch of data was recorded. This was repeated 100 times. After removing the maximum and minimum time values, the average of the remaining 98 time values ​​was calculated and divided by 12 to obtain the inference time for the voiceprint feature extraction model to process each MFCC feature map, which was approximately 0.0025 seconds.

[0102] 5) Analogy with other voiceprint feature extraction models

[0103] A 2018 paper published by a company described a voiceprint feature extraction model whose text-independent training data consisted of 36 million speech samples from 18,000 speakers. According to the paper, its EER (Effective Errata) was 0.0355. Experimental analysis revealed that training this model with batch sizes of 64 and audio samples up to 3 seconds in length required at least 12GB of GPU memory. Using longer training samples necessitated even more GPU memory.

[0104] A 2020 paper published by a university on voiceprint feature extraction used data from 6,000 speakers and a total of 1 million speech samples to train the model. According to the paper, the model's EER ranged from 0.02 to 0.05. Experimental analysis revealed that if the model was trained using audio samples with a batch size of 64 and a maximum duration of 3 seconds, it would require more than 9GB of GPU memory.

[0105] It is worth noting that due to differences in audio duration, sound quality, noise, and data distribution in the test sets used in the aforementioned papers, the EERs of the several models cannot be directly compared. However, by comparing the GPU memory required for model training with the same number of speech samples, it is clear that the speaker feature extraction model training method and speaker feature recognition method provided in this application can significantly reduce the computing resources and GPU memory required for training, while maintaining comparable model performance. Furthermore, it can save a large number of speech samples, reduce training data requirements, and lower model training costs.

[0106] Figure 5 A structural block diagram of the voiceprint recognition device provided in an embodiment of this application is shown. Figure 5 As shown, the voiceprint recognition device provided in this embodiment may include:

[0107] The voice information acquisition module 601 is used to acquire voice information to be recognized.

[0108] The feature extraction module 602 is used to input the speech information to be recognized into the voiceprint feature extraction model for processing and output the voiceprint feature vector; wherein, the voiceprint feature extraction model is trained according to a loss function, and the loss function is a metric learning function;

[0109] The recognition module 603 is used to determine the speaker corresponding to the speech information to be recognized based on the voiceprint feature vector.

[0110] In one embodiment, the voiceprint recognition device may further include a model training module 604, which is used to acquire a set of speech samples, the set of speech samples including speech samples corresponding to at least two speakers; input the speech samples in the set of speech samples into an initial voiceprint feature extraction model for processing, and output a voiceprint feature vector corresponding to each speech sample; determine the training loss based on the voiceprint feature vector corresponding to each speech sample and the loss function; and adjust the parameters of the initial voiceprint feature extraction model according to the training loss to obtain the voiceprint feature extraction model.

[0111] In one embodiment, the model training module 604 is specifically used to, for each speech sample, determine the maximum value of the cosine similarity between the voiceprint feature vector corresponding to the speech sample and the voiceprint feature vectors of multiple out-of-class samples, where out-of-class samples are speech samples in the speech sample set belonging to different speakers than the speech sample; determine the mean value of the cosine similarity between the voiceprint feature vector corresponding to the speech sample and the voiceprint feature vectors of multiple intra-class samples, where intra-class samples are speech samples in the speech sample set belonging to the same speaker as the speech sample; and determine the training loss based on the maximum value and mean value corresponding to each speech sample, as well as the loss function.

[0112] In one embodiment, the model training module 604 is specifically used to determine the initial training loss based on the maximum and mean values ​​corresponding to each speech sample and the loss function; and to generalize the initial training loss to obtain the training loss.

[0113] In one embodiment, the model training module 604 is specifically used to train the model according to the formula. Determine the maximum value, where p represents the speaker's index, q represents the index of the speech sample corresponding to the p-th speaker, and v ij v represents the voiceprint feature vector corresponding to the j-th speech sample of the i-th speaker; pq This represents the voiceprint feature vector corresponding to the q-th speech sample of the p-th speaker; according to the formula... Determine the mean, where k represents the sequence number of the speech sample corresponding to the i-th speaker, and v ik This represents the voiceprint feature vector corresponding to the k-th speech sample of the i-th speaker.

[0114] The voiceprint recognition device provided in this embodiment is used to execute the voiceprint recognition method provided in the method embodiment of this application. The technical principle and technical effect are similar. For details, please refer to the method embodiment section, which will not be repeated here.

[0115] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0116] This application also provides a terminal device, such as... Figure 1 As shown, the terminal device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments.

[0117] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in any of the above method embodiments.

[0118] Those skilled in the art will understand that any references to memory, storage, databases, or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0119] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A voiceprint recognition method, characterized in that, include: Obtain the speech information to be recognized; The speech information to be recognized is input into a voiceprint feature extraction model for processing, and a voiceprint feature vector is output. The voiceprint feature extraction model is trained based on a loss function, which is a metric learning function. The loss function is: ; wherein, the Let N represent the initial training loss, M represent the number of speakers, i represent the speaker index, and j represent the speech sample index. This represents the maximum value corresponding to the j-th speech sample of the i-th speaker. The mean value corresponding to the j-th speech sample of the i-th speaker is denoted as . Indicates the first threshold, the Indicates the second threshold; The speaker corresponding to the speech information to be identified is determined based on the voiceprint feature vector.

2. The method according to claim 1, characterized in that, The voiceprint feature extraction model is trained based on the loss function, including: Obtain a set of speech samples, which includes speech samples corresponding to at least two speakers; The speech samples in the speech sample set are input into the initial voiceprint feature extraction model for processing, and the voiceprint feature vector corresponding to each speech sample is output. The training loss is determined based on the voiceprint feature vector corresponding to each speech sample and the loss function. The parameters of the initial voiceprint feature extraction model are adjusted according to the training loss to obtain the voiceprint feature extraction model.

3. The method according to claim 2, characterized in that, The step of determining the training loss based on the speaker feature vector corresponding to each speech sample and the loss function includes: For each speech sample, determine the maximum value of the cosine similarity between the speech sample's corresponding voiceprint feature vector and the voiceprint feature vectors of multiple out-of-class samples, wherein the out-of-class samples are speech samples in the speech sample set that belong to different speakers than the speech sample. Determine the mean cosine similarity between the voiceprint feature vector corresponding to the speech sample and the voiceprint feature vectors of multiple intra-class samples, wherein the intra-class samples are speech samples in the speech sample set that belong to the same speaker as the speech sample. The training loss is determined based on the maximum and mean values ​​corresponding to each speech sample, and the loss function.

4. The method according to claim 3, characterized in that, Determining the training loss based on the maximum and mean values ​​corresponding to each speech sample and the loss function includes: The initial training loss is determined based on the maximum and mean values ​​corresponding to each speech sample, and the loss function. The initial training loss is generalized to obtain the training loss.

5. The method according to claim 3, characterized in that, Determining the maximum cosine similarity between the voiceprint feature vector corresponding to the speech sample and the voiceprint feature vectors of multiple out-of-class samples includes: According to the formula Determine the maximum value, where p represents the speaker's index, q represents the index of the speech sample corresponding to the p-th speaker, and the... This represents the voiceprint feature vector corresponding to the j-th speech sample of the i-th speaker; This represents the voiceprint feature vector corresponding to the qth speech sample of the pth speaker; Determining the mean cosine similarity between the voiceprint feature vector corresponding to the speech sample and the voiceprint feature vectors of multiple intra-class samples includes: According to the formula Determine the mean, where k represents the sequence number of the speech sample corresponding to the i-th speaker. This represents the voiceprint feature vector corresponding to the k-th speech sample of the i-th speaker.

6. The method according to any one of claims 1 to 5, characterized in that, The voiceprint feature extraction model includes a convolutional neural network sub-model and a gated recurrent unit sub-model. The convolutional neural network sub-model includes multiple convolutional layers, and the stride of each convolutional layer is 2.

7. The method according to claim 6, characterized in that, The convolutional kernel of the convolutional layer is 5.

5.

8. A voiceprint recognition device, characterized in that, include: The voice information acquisition module is used to acquire the voice information to be recognized; The feature extraction module is used to input the speech information to be recognized into the voiceprint feature extraction model for processing and output a voiceprint feature vector; wherein, the voiceprint feature extraction model is trained based on a loss function, and the loss function is a metric learning function; the loss function is: ; wherein, the Let N represent the initial training loss, M represent the number of speakers, i represent the speaker index, and j represent the speech sample index. This represents the maximum value corresponding to the j-th speech sample of the i-th speaker. The mean value corresponding to the j-th speech sample of the i-th speaker is denoted as . Indicates the first threshold, the Indicates the second threshold; The recognition module is used to determine the speaker corresponding to the voice information to be recognized based on the voiceprint feature vector.

9. A terminal device, characterized in that, The terminal device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the 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 a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.