Speaker recognition method and device, equipment and medium
By utilizing the comprehensive weights of speech samples and the design of a loss function in unsupervised speaker recognition, the quality of pseudo-labels is improved, solving the problem of inconsistent pseudo-label quality and achieving higher recognition accuracy and model robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-03
AI Technical Summary
In unsupervised speaker recognition, the quality of pseudo-labels obtained from clustering varies, leading to incorrect supervisory signal input and causing a decline in model performance.
By determining the comprehensive sample weights of speech samples, and combining confidence, duration weights, and cluster quality scores, different loss functions are designed to distinguish samples. A prototype-guided confidence-aware self-training method is adopted to improve the quality of pseudo-labels.
Without human labels, it improves the accuracy of speaker recognition and the robustness of the model, and reduces the negative impact of noise and false labels.
Smart Images

Figure CN121789691A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a speaker recognition method, apparatus, device, and medium. Background Technology
[0002] Unsupervised speaker recognition refers to training a model that can distinguish different speakers by relying solely on the embedding features of speech segments and the clustering structure of these embedded segments in space, without the need for human labeling of speaker identities.
[0003] The most common approach is clustering and pseudo-label training, but this simple and direct solution has a fundamental problem: the quality of pseudo-labels obtained by clustering varies. If all pseudo-labels are treated equally during training and uniformly optimized as true labels, then those "poor clusters" and "poor samples" will continuously input incorrect supervision signals into the model, resulting in a serious "mis-teaching" phenomenon and ultimately poor performance. Summary of the Invention
[0004] The purpose of this application is to provide a speaker recognition method, apparatus, device, and medium that can improve the accuracy of speaker recognition.
[0005] Firstly, a speaker recognition method is provided, comprising: clustering multiple unlabeled speech samples to obtain multiple cluster labels; determining a comprehensive sample weight for a target speech sample, wherein the target speech sample is any one of the multiple speech samples, and the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs; performing speaker recognition using a model to be trained based on the target speech sample to obtain a predicted probability value of the output vector corresponding to the target speech sample; determining a loss value for the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, using a loss function corresponding to the target speech sample; determining a total loss based on the respective loss values of the multiple speech samples; and iteratively training the model to be trained based on the total loss to obtain a speaker recognition model; wherein the speaker recognition model is used to perform speaker recognition on the speech to be recognized.
[0006] In a preferred embodiment, this application can be further configured to: determine the comprehensive sample weight of a target speech sample, including: determining the confidence level of the target speech sample; determining the duration weight of the target speech sample; determining the cluster quality score of the cluster label to which the target speech sample belongs; and determining the comprehensive sample weight of the target speech sample based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs.
[0007] In a preferred embodiment, this application can be further configured to: determine the confidence level of a target speech sample, including: averaging and normalizing the sample vectors of all speech samples belonging to the cluster label to which the target speech sample belongs, to obtain the cluster prototype corresponding to the cluster label; calculating the distance between the target sample vector and the cluster prototype, where the distance represents the similarity between the sample vector and the cluster prototype; determining the separability score of the target sample vector based on the minimum and second-smallest distances; calculating the distance between the cluster prototype corresponding to the target sample vector and a first sample vector, where the first sample vector represents any sample vector included in the cluster label corresponding to the target sample vector; determining the median and scale estimation data based on the distance between the cluster prototype corresponding to the target sample vector and the first sample vector; determining the consistency value of the target sample vector based on the scale estimation data, the median, the distance between the cluster prototype corresponding to the target sample vector and the target sample vector; and determining the confidence level of the target speech sample based on the separability score and the consistency value of the target sample vector.
[0008] In a preferred embodiment, this application can be further configured to: determine the duration weight of the target speech sample, including: determining the target quantile duration based on the speech duration of each of the plurality of speech samples; and determining the duration weight of the target speech sample based on the target quantile duration and the duration of the target speech sample.
[0009] In a preferred embodiment, this application can be further configured to: determine the cluster quality score of the cluster label to which the target speech sample belongs, including: determining the original compactness score, original separation score, size score, and total duration of the cluster label to which the target speech sample belongs; normalizing the original compactness score, the original separation score, the size score, and the total duration; and performing a weighted calculation based on the normalized original compactness score, the normalized original separation score, the normalized size score, and the normalized total duration to obtain the cluster quality score of the cluster label to which the target speech sample belongs.
[0010] In a preferred embodiment, this application can be further configured as follows: before determining the loss value of the target speech sample using the loss function corresponding to the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, the application further includes: determining the loss function corresponding to the target speech sample according to the range to which the confidence level of the target speech sample belongs; wherein, the loss function for the confidence level in the first range includes cross-entropy loss; the loss function for the confidence level in the second range includes a combination loss of hard label cross-entropy and soft label KL divergence; the loss function for the confidence level in the third range includes regularization loss; the minimum confidence level in the first range is greater than any confidence level in the second range, and the minimum confidence level in the second range is greater than any confidence level in the first range.
[0011] In a preferred embodiment, this application may be further configured as follows: after determining the comprehensive sample weight of the target speech sample, it further includes: if the target speech sample is a speech sample with a confidence level of the second range, then calculating the distance between the target sample vector and each cluster prototype; based on the distance between the target sample vector and each cluster prototype, using a softmax function with a temperature coefficient, generating a soft label for the target sample vector under its respective cluster label.
[0012] Secondly, a speaker recognition device is provided, comprising: a clustering module for clustering multiple unlabeled speech samples to obtain multiple cluster labels; a comprehensive sample weight determination module for determining the comprehensive sample weight of a target speech sample, wherein the target speech sample is any one of the multiple speech samples, and the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs; a speaker recognition module for performing speaker recognition using a model to be trained based on the target speech sample to obtain a predicted probability value of the output vector corresponding to the target speech sample; a loss value determination module for determining the loss value of the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, using a loss function corresponding to the target speech sample; and an iterative training module for determining a total loss based on the respective loss values of the multiple speech samples, and iteratively training the model to be trained based on the total loss to obtain a speaker recognition model; wherein the speaker recognition model is used to perform speaker recognition on the speech to be recognized.
[0013] Thirdly, an electronic device is provided, the electronic device including a memory and a processor, the memory storing a computer program, the processor executing the method of any one of the first aspects when running the computer program.
[0014] Fourthly, a computer-readable storage medium is provided, wherein at least one piece of program code is stored therein, the program code being loaded and executed by a processor to implement the method as described in any of the first aspects.
[0015] Fifthly, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the method as described in any of the first aspects.
[0016] In summary, the speaker recognition method provided in this application has the following beneficial technical effects:
[0017] In this application, speech samples are classified, and the cluster labels of the speech samples are determined as labels. Then, the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs. Subsequently, the speaker recognition is performed using the model to be trained based on the target speech sample to obtain the predicted probability value of the output vector corresponding to the target speech sample. A corresponding loss function is assigned to the target speech vector. Then, the total loss is obtained by combining the comprehensive sample weight and the loss function. The speaker recognition model is self-trained by minimizing the total loss. Thus, without any manual labels, robust learning that is aware of the quality of pseudo-labels is achieved by using embedded features and clustering structures, thereby improving the recognition accuracy.
[0018] In addition, this application also provides a speaker recognition device, equipment, and medium, all of which have the aforementioned beneficial technical effects. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, 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.
[0020] Figure 1 This is a schematic flowchart of a speaker recognition method provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the structure of a speaker recognition device provided in an embodiment of this application;
[0022] Figure 3This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of this application.
[0024] It should be noted that, in the optional embodiments of this application, the data related to object information, when applied to specific products or technologies, requires the permission or consent of the object. Furthermore, the collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if the embodiments of this application involve data related to an object, it must be obtained with the permission and consent of the object, the permission and consent of relevant departments, and in accordance with the relevant laws, regulations, and standards of the country and region. If the embodiments involve personal information, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required. The embodiments also need to be implemented with the permission and consent of the object.
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0027] Unsupervised speaker recognition refers to training a model capable of distinguishing different speakers solely based on the embedding features of speech segments and the clustering structure of these embeddings in a spatial vector space, without the need for manual annotation of speaker identities. The embedding features are typically provided by a pre-trained speaker feature extraction network, mapping a speech segment to points in a vector space with measurable similarity. The clustering structure refers to the use of unsupervised algorithms such as K-means, spectral clustering, and hierarchical clustering to group similar embeddings into clusters, using cluster numbers as pseudo-labels. In traditional supervised speaker recognition, each speech segment needs to be labeled with a real speaker ID before these labels are input into a classification network for training. In unsupervised scenarios, real labels are missing, leading to a typical process: first, speaker embeddings are extracted; then, clustering is performed to obtain pseudo-labels; finally, the pseudo-labels are used to self-train the new model, gradually teaching it to distinguish different speakers. The core assumption of this approach is that segments closely spaced in the embedding space are likely from the same speaker, and clustering can yield usable pseudo-labels to replace expensive manual annotation.
[0028] In practical applications, unsupervised speaker recognition has many typical scenarios. Firstly, there's large-scale business recording, such as customer service calls in call centers, recordings from financial institutions, and after-sales voice messages on e-commerce platforms. These systems generate massive amounts of voice data daily, and manually annotating each speaker's identity is impractical in terms of cost, time, and privacy compliance. The core requirement is to improve the quality of speaker modeling as much as possible without annotation. Secondly, there are various device-side and in-vehicle scenarios, such as in-vehicle systems, smart speakers, wearable devices, and mobile voice assistants. The user voice data collected over long periods can only have a portion of its features stored locally. Balancing privacy protection with the need for continuous learning using limited computing power, typically only speaker embeddings and simple clustering results are retained. The recognition model is then incrementally updated on the device. Unsupervised speaker recognition perfectly fits this constraint of weak information and limited computing power. Looking further afield, cross-language, cross-regional, and cross-microphone system transfer is also an important scenario: a speaker model trained on clean English speech often lacks sufficient new domain labeled data when transferring to a noisy Chinese in-vehicle environment. If unlabeled speech from the target domain can be used for re-clustering and self-training in an unsupervised manner, the transfer performance can be significantly improved. Furthermore, when building large-scale general speech / speaker models, it is often necessary to first perform long-term pre-training or self-training on unlabeled speech. Unsupervised speaker recognition can also serve as a key step in this process, used to learn more robust and generalized speaker representations.
[0029] In these scenarios, the most common approach is clustering and pseudo-label training. However, this simple and direct solution has a fundamental problem: the quality of pseudo-labels obtained from clustering varies greatly. Some clusters are very clean, with samples closely related and basically corresponding to a single speaker, while others are small or structurally chaotic, even mixing multiple speakers together. Furthermore, within the same cluster, the reliability of different samples also varies. For example, samples close to the cluster center and with longer speech durations are often more reliable, while samples with short durations and features deviating from the cluster center are more likely to be mis-clustered or noise. If all pseudo-labels are treated equally during training and cross-entropy optimization is performed uniformly, then poor clusters and poor samples will continuously input incorrect supervisory signals into the model, resulting in severe mis-training and ultimately causing performance to deteriorate instead of improve.
[0030] The Prototype-Guided Confidence-Aware Self-Training (PG-CAST) method proposed in this application aims to address this pain point: assuming the system can only access three very light types of information—speech embedding vectors, existing cluster labels, and the duration of each speech segment—it extracts as much information as possible. On one hand, it estimates the separability of each sample within the embedding space and its consistency within a cluster, quantifying the compactness, separation, size, and total duration of each cluster, thus assigning a relatively objective reliability score to both samples and clusters. On the other hand, based on these reliability scores, samples are automatically categorized into high-confidence, medium-confidence, and low-confidence levels. High-confidence samples play a role similar to supervised training, medium-confidence samples are used gently through soft labels and distillation, and low-confidence samples are only used for consistency or contrastive learning of representations, mitigating the negative impact of noise and pseudo-labels on the model from the source. Building on this, the prototype-guided confidence-aware self-training method further improves the training efficiency and final performance of unsupervised speaker recognition through mechanisms such as weight design and adaptive loss, without modifying the original clustering algorithm or introducing any artificial true labels, while also taking into account various deployment modes such as large-scale server training and edge self-learning.
[0031] This application provides a method, such as Figure 1 As shown, the method provided in this application embodiment can be executed by an electronic device, which is a server. This server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and electronic device can be directly or indirectly connected via wired or wireless communication. This application embodiment does not impose any limitations on this connection. The method includes:
[0032] S101. Cluster the multiple unlabeled speech samples to obtain multiple cluster labels.
[0033] During the data preparation phase, speaker embedding vectors are extracted from unannotated speech, and L2 normalization is performed on the embeddings to obtain sample vectors. Simultaneously, a clustering algorithm assigns a cluster label yi to each sample, i.e., a pseudo-label yi (where a special value, such as -1, is used to represent noise samples), and the duration of each speech segment is also recorded. It is understandable that one cluster corresponds to one cluster label, and one cluster includes multiple sample vectors, that is, each speech sample is assigned a corresponding cluster label.
[0034] Therefore, in this embodiment, only non-noise samples will be processed; that is, all cluster labels are non-noise cluster labels. Each cluster label includes several speech samples.
[0035] S102. Determine the comprehensive sample weights of the target speech samples.
[0036] The target speech sample is any one of multiple speech samples. The overall sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs.
[0037] The comprehensive sample weight of the speech samples is determined based on the confidence level of the speech samples, the duration weight of the speech samples, and the cluster quality score of the cluster label to which the speech samples belong. This weight can be used as a coefficient of the loss function, thereby maximizing the contribution of high-confidence, good-cluster, and long-duration speech samples, while low-confidence, poor-cluster, and short-duration samples have only a small impact. In this embodiment, the comprehensive sample weight corresponding to each speech sample can be obtained according to S102.
[0038] S103. Based on the target speech sample, use the model to be trained to perform speaker recognition and obtain the predicted probability value of the output vector corresponding to the target speech sample.
[0039] The model to be trained can be ECAPA-TDNN, and its model structure can refer to relevant technologies. This application does not limit the specific implementation.
[0040] In this embodiment of the application, let the model to be trained output the vector logits for the sample vector xi corresponding to the target speech sample. And obtain the predicted probability based on the output vector: Pseudo-labels (cluster labels) are K is the number of cluster labels, and k represents the cluster k to which the sample vector xi belongs.
[0041] S104. Based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, the loss value of the target speech sample is determined using the loss function corresponding to the target speech sample.
[0042] S105. Determine the total loss based on the loss values of each of the multiple speech samples; and iteratively train the model to be trained based on the total loss to obtain the speaker recognition model; wherein, the speaker recognition model is used to perform speaker recognition on the speech to be recognized.
[0043] In the embodiments of this application, the loss functions corresponding to various types of speech samples may be the same or different.
[0044] In one feasible approach, the loss function differs for speech samples with different confidence levels.
[0045] Determine the confidence level for each speech sample. Subsequently, based on the overall distribution of the speech samples, the speech samples were divided into three different confidence levels. Specifically, the distribution of confidence levels was statistically analyzed, and two quantiles, the lower quantile and the upper quantile (e.g., the 40th percentile and the 80th percentile), were selected. Samples with confidence levels not lower than the upper quantile were assigned to the high-confidence set, samples with confidence levels not higher than the lower quantile were assigned to the low-confidence set, and the remaining samples were assigned to the medium-confidence set. This method does not require manually setting absolute thresholds and can adaptively adapt to different datasets and clustering quality.
[0046] Before determining the loss value of the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, the method further includes: determining the loss function corresponding to the target speech sample according to the range to which the confidence level of the target speech sample belongs; wherein, the loss function for the confidence level in the first range includes cross-entropy loss; the loss function for the confidence level in the second range includes a combination loss of hard label cross-entropy and soft label KL divergence; the loss function for the confidence level in the third range includes regularization loss; the minimum confidence level in the first range is greater than any confidence level in the second range, and the minimum confidence level in the second range is greater than any confidence level in the first range.
[0047] During the training objective design phase, different loss functions are formulated for the three types of samples, and a unified weighted average of the speech samples is used. For high-confidence target speech samples, whose pseudo-labels are considered basically reliable, a supervised learning-like approach is directly adopted: using pseudo-labels (cluster labels). The cross-entropy loss is multiplied by the corresponding sample weight. This results in a relatively large proportion of the total loss. For the target speech sample xi with moderate confidence, we neither want to completely abandon hard label information nor want to be excessively interfered with by pseudo-label noise. We can use a combination loss of hard label cross-entropy and soft label KL divergence: on the one hand, it makes the model output approach the category corresponding to the cluster label; on the other hand, it makes the model output distribution approximate the soft label generated by the prototype through the KL divergence term. This approach utilizes a prototype structure to correct potential erroneous pseudo-labels. For low-confidence target speech samples, due to the poor reliability of their pseudo-labels, a regularized loss in the form of consistency constraints or contrastive learning is employed. For example, two different enhanced perspectives are generated for the same speech sample, requiring the model to provide similar representations for these two perspectives. Alternatively, within a contrastive learning framework, the two perspectives of the same speech are treated as positive samples, distinguishing them from other samples. This ensures that the model learns stable features at least at the representation level, rather than being led by incorrect categories. Finally, the loss terms corresponding to the three types of samples are weighted according to their sample weights and summed to obtain the total loss. The parameters of the speaker recognition model are updated by optimizing this total loss, thus completing a prototype-guided confidence-aware self-training iteration. Even without any manual labels, this approach can still robustly improve the model's discriminative ability.
[0048] Specifically, the three types of sample loss include: (a) high confidence: hard label cross-entropy, Where Wi represents the comprehensive sample weight of the sample vector xi corresponding to the target speech sample, yi represents the pseudo-label of the target speech sample, and pi represents the predicted probability of the output vector of the target speech sample.
[0049] (b) Medium confidence: Hard label CE and soft label KL, ;in, (c) Low confidence: Consistency regularization (giving a commonly used form), applying two enhancement perspectives v=1,2 to the same speech to obtain the predicted distribution. .
[0050] Total loss .
[0051] After determining the comprehensive sample weight of the speech samples, the process also includes: if the target speech sample is a speech sample with a confidence level of the second range, then calculating the distance between the target sample vector and each cluster prototype; based on the distance between the target sample vector and each cluster prototype, using the softmax function with a temperature coefficient, generating a soft label for the target sample vector under its respective cluster label.
[0052] In this embodiment, to utilize more structural information on medium- and high-confidence samples, the system also generates a soft-label distribution using a softmax function with a temperature coefficient, based on the similarity between the sample vector xi of the target speech sample and the prototypes of each cluster (the similarity can be represented by distance). This can be understood as the probability that a sample belongs to each cluster from the perspective of the prototype. For samples with high confidence, the system sets a larger temperature parameter, making the soft label distribution sharper and closer to one-hot; for samples with low confidence, a smaller temperature is used to make the distribution smoother, reflecting the model's uncertainty about its true class.
[0053] soft label distribution for speech sample xi To elaborate further. Let there be a total of There are clusters, and the cluster prototype is... The sample vector is First, calculate the distance between the target sample vector xi and the prototypes of each cluster, and then convert the distance into similarity: ; Use the temperature-inclusive softmax function (multiplied by temperature) to obtain the soft label: The temperature can be taken as a constant according to the confidence level, for example: . These are the high / medium / low confidence sets, respectively. The two quantiles were used to divide the data.
[0054] Specifically, the distance between the target sample vector xi and each cluster prototype can be calculated using Euclidean distance and cosine similarity, among other methods. Example of Euclidean distance: The similarity is converted to a similarity score: if the distance is smaller, the similarity is higher (e.g., Euclidean distance), which can be converted using a negative exponential method: aik=sim(xi,pk)=exp(−d(xi,pk)). As can be seen, in this application, speech samples are classified, and the cluster labels of the speech samples are determined as labels. Then, based on the confidence score of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs, the comprehensive sample weight of the target speech sample is determined. Then, based on the target speech sample, the model to be trained is used to perform speaker recognition, obtaining the predicted probability value of the output vector corresponding to the target speech sample. A corresponding loss function is assigned to the target speech vector. Then, the total loss is obtained by combining the comprehensive sample weight and the loss function. By minimizing this total loss, the speaker recognition model is self-trained. Thus, without any manual labels, robust learning that is aware of the quality of pseudo-labels is achieved by utilizing embedded features and clustering structures, thereby improving recognition accuracy.
[0055] One possible implementation of this application embodiment is to determine the comprehensive sample weight of a target speech sample, including: determining the confidence level of the target speech sample; determining the duration weight of the target speech sample; determining the cluster quality score of the cluster label to which the target speech sample belongs; and determining the comprehensive sample weight of the target speech sample based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs.
[0056] Sample confidence of the target speech sample The cluster quality of the cluster to which this sample belongs and duration weight The three factors are multiplied together to obtain the overall sample weight. .
[0057] Specifically, one possible implementation of this application embodiment involves determining the confidence level of a target speech sample, including:
[0058] SA1: Average and normalize the sample vectors of all speech samples belonging to the cluster label of the target speech sample to obtain the cluster prototype corresponding to the cluster label.
[0059] For each non-noise cluster label, the sample vectors of all speech samples within the cluster label are averaged to obtain the prototype vector of the cluster. The prototype vector is then normalized to form a cluster center in the embedding space, thus obtaining the cluster prototype.
[0060] SA2 calculates the distance between the target sample vector and the cluster prototype of the target speech sample. The distance represents the similarity between the sample vector and the cluster prototype.
[0061] After obtaining the target sample vector and the corresponding cluster prototype, the distance between the target sample vector and each cluster prototype can be calculated as the similarity. The closer the distance, the higher the similarity. The similarity is used to measure which cluster the target speech sample is more like. These similarities will be used to evaluate confidence and construct soft labels.
[0062] SA3. Determine the separability score of the target sample vector based on the minimum and second minimum distances.
[0063] In the confidence assessment phase at the sample level, the reliability of each sample is measured from two key perspectives. The first perspective is Top-2 separability: for a target speech sample, the system compares the distance between the target sample vector and its corresponding cluster prototype, as well as the similarity between the target sample vector and the second closest cluster prototype among all other clusters. The larger the difference between the minimum distance and the second smallest distance, the more compelling the reason for the target speech sample to be clustered in the current cluster, and the more easily it can be correctly distinguished.
[0064] For "separability", first determine the top-1 with the highest similarity and the top-2 with the second highest similarity. Let the target sample vector be... Assigned to cluster a (i.e., the current cluster prototype) Similarity to the current cluster prototype (Top-1): Similarity to the closest prototype (Top-2) in other clusters: Separability of raw fractions: margin The larger the value, the more likely the sample belongs to the current cluster. Normalize to [0,1]: Obtain the separability value. , ,in, This is the temperature / scale parameter: it is usually set to 1.
[0065] SA4. Calculate the distance between the cluster prototype corresponding to the target sample vector and the first sample vector, where the first sample vector represents any sample vector included in the cluster label corresponding to the target sample vector.
[0066] SA5. Determine the median and scale estimation data based on the distance between the cluster prototype corresponding to the target sample vector and the first sample vector.
[0067] SA6. Based on the scale estimation data, median, and the distance between the cluster prototype corresponding to the target sample vector and the target sample vector, determine the consistency value of the target sample vector.
[0068] The second perspective is intra-cluster consistency, which calculates the distance from the target sample vector to the center of the cluster, and this distance can be Euclidean distance.
[0069] By combining the distribution of overall distances within the cluster (e.g., estimating a cluster scale using robust statistics such as the median and median absolute deviation), if a sample is very close to the cluster center and the distance is much smaller than the typical scale within the cluster, it is considered to be "central" within the cluster and has high consistency; otherwise, it is more like an outlier.
[0070] Let the prototype of the k-th cluster be... The sample set within the cluster is For each sample within the cluster First, define the distance from the target sample vector to the cluster center, i.e., the cluster prototype: Euclidean distance: Using the median as the typical intra-cluster distance and MAD (median absolute deviation) as the intra-cluster scale: Intra-cluster distance set Location estimation at the central scale within a cluster: median Intra-cluster scale estimation: Convert MAD to a scale similar to standard deviation. Specifically, if we want the scale and standard deviation to be comparable to those under a normal distribution, we use the constant 1.4826: ,in It is to prevent Minimal numbers (e.g.) ), sk represents the scaling estimation data. Give the range at which the majority of samples in a cluster are considered normal from the center; It provides a normal range of fluctuations; outliers do not amplify the scale like the mean / variance.
[0071] Consistency aims for higher scores closer to the center, and should reference typical cluster scales. Based on the scale estimation data Sk, median mk, and the distance di between the sample vector and its cluster prototype, the consistency value of the sample vector is determined. Specifically, standardization is performed to obtain zi. , among which, if : Even closer to the center than the typical distance within the cluster; if : It is far from the center and more like an outlier. Then, normalize zi to [0,1] to obtain a consistency value. ,in, , This is the temperature / scale parameter: it is usually set to 1.
[0072] SA7. Determine the confidence level of the target speech sample based on the separability score and the consistency value of the target sample vector.
[0073] The sample confidence level is obtained based on the weighted average formula. , .
[0074] In this embodiment, separability and consistency are normalized to a value between 0 and 1, and then a weighted average is performed to obtain the sample confidence level. Sample confidence The closer a sample is to 1, the better it performs in terms of inter-class differentiation and intra-class compactness, and the greater the likelihood that it will be correctly clustered.
[0075] Specifically, one possible implementation of this application embodiment is to determine the duration weight of the target speech sample, including: determining the target quantile duration based on the speech duration of each of the multiple speech samples; and determining the duration weight of the target speech sample based on the target quantile duration and the duration of the target speech sample.
[0076] All other things being equal, longer speech segments tend to carry more speaker information, have more stable embeddings, and more reliable clustering. Therefore, they should be given more weight in training than very short speech segments.
[0077] In this embodiment, the target quantile duration is first obtained by calculating a target quantile (e.g., the 95th percentile) of the duration of all speech samples, and then the duration of the target speech samples is used. A duration weight is constructed using the logarithmic ratio between the duration and the target quantile. This ensures that the duration weight of the vast majority of samples is within the range of 0 to 1, and the longer the duration, the closer the weight is to 1.
[0078] For example, let the duration of the target speech sample be... First, in the set of all sample durations... Take the highest quantile (e.g., 95%): The duration weights of the target speech samples are obtained by constructing duration weights using logarithmic ratios and truncating them to [0,1]. : Where: log can be either the natural logarithm or the common logarithm (as long as they are consistent), It is a very small positive number. ;when hour ,when The weights are close to 0 for a very short time, and the vast majority of samples will fall within the range of 0 to 1.
[0079] Specifically, one possible implementation of this application embodiment involves determining the cluster quality score of the cluster label to which the target speech sample belongs, including: determining the original compactness score, original separation score, size score, and total duration of the cluster label to which the target speech sample belongs; normalizing the original compactness score, original separation score, size score, and total duration; and performing a weighted calculation based on the normalized original compactness score, normalized original separation score, normalized size score, and normalized total duration to obtain the cluster quality score of the cluster label to which the target speech sample belongs.
[0080] In the cluster-level quality assessment phase, to determine whether each cluster is a good cluster overall, four aspects are used to score the clusters: First, compactness, which calculates the typical distance from samples within the cluster to the cluster center; the smaller the distance, the more compact the cluster, and the higher the score. Second, separation, which compares the similarity between the cluster center and all other cluster centers; if all other clusters show significant differences from it, it indicates that the cluster is well-separated in the embedding space. Third, cluster size; clusters with too few samples are often unstable, so a ratio similar to the number of samples to a minimum sample size threshold is used to automatically reduce the weight of clusters with fewer samples. Fourth, total speech duration within the cluster; clusters with longer coverage durations are generally considered to contain richer and more stable speaker information, thus receiving higher scores. Then, these four indicators are normalized and linearly weighted using preset weights to obtain a cluster quality score between 0 and 1. It is used to characterize the reliability of the entire cluster.
[0081] Specifically, let the cluster label of the target speech sample be... The cluster prototype is Intra-cluster sample set The embedding of the speech samples is The duration of the target speech sample is .
[0082] Regarding compactness: Intra-cluster distance between the target speech sample and the cluster prototype: Typical distance (using median): Raw tightness score (the smaller the distance, the higher the score): .
[0083] Regarding separation, this includes similarity between cluster centers (such as cosine similarity). : Similarity to the "closest" cluster (the higher the similarity, the easier it is to be confused). Raw separation score (higher score for less similar individuals); .
[0084] Regarding cluster size. Number of cluster samples: Size score (weighted form of sample size / minimum threshold): ,in, It is the minimum number of cluster samples among all clusters.
[0085] This refers to the total duration of speech within the cluster. Total duration: Duration score (reference threshold may be used) (Make saturation): .
[0086] Furthermore, for each raw score (corresponding to comp / sep / size / dur respectively), perform min-max on all clusters: ;get .
[0087] Then, cluster quality scoring is performed. Linear weighting: ; .
[0088] Based on any of the above embodiments, this application provides a specific approach, including: the overall implementation idea of the new technology solution can be summarized as follows: First, using the L2-normalized sample vector obtained from the unannotated speech through a pre-trained speaker embedding model. Cluster labels output by clustering algorithms (This may include special labels representing noise, such as -1), and the duration of each speech segment. As input, compute the cluster prototype vector for each non-noise cluster. Based on this, the similarity between each sample and each cluster prototype is obtained. Then, at the sample level, the sample confidence score is constructed by combining Top-2 separability (i.e., the difference between the similarity of a sample to its own cluster and the similarity to the second most similar cluster) and intra-cluster consistency (i.e., the normalized result of the distance from a sample to the cluster center relative to the overall intra-cluster scale). At the cluster level, a cluster quality score is constructed based on four dimensions: compactness, separation, cluster size, and total intra-cluster speech duration. And further combined with duration Derived duration factor To obtain the comprehensive sample weights Next, according to The overall distribution adaptively divides samples into three levels—high confidence, medium confidence, and low confidence—using quantiles, and generates a soft-label distribution using the similarity between samples and the prototypes of each cluster through a softmax function with an adaptive temperature coefficient. This is treated as a teacher distribution given by the cluster prototype; finally, different forms of loss functions are applied to the three classes of samples during the training phase: high-confidence samples are treated as... Weighted hard-label cross-entropy loss is applied. For medium-confidence samples, a weighted combination of hard-label cross-entropy loss and soft-label KL divergence loss is used. For low-confidence samples, regularization loss is only used for consistency constraints or contrastive learning. All sample losses are uniformly calculated using...
[0089] The total loss is obtained by weighted summation. The speaker recognition model is self-trained by minimizing this total loss, thereby achieving robust learning that is aware of the quality of pseudo-labels without any human labels, by utilizing embedded features and clustering structures.
[0090] In summary, the embodiments of this application provide a design that is extremely simple yet fully utilizes information. The entire self-training framework relies on only three very lightweight types of information on the input side: speaker embedding vectors, cluster labels obtained from clustering, and the duration of speech segments. It does not require access to the original speech signal, nor does it rely on any manual annotation or additional teacher models. Under these constraints, the scheme utilizes the three types of information to the maximum extent through systematic statistics and modeling, constructing sample-level confidence, cluster-level quality evaluation, and duration weights respectively, and unifying the three into sample weights that can directly participate in loss weighting. This not only greatly reduces the data requirements and deployment costs, but also ensures high compatibility with existing "embedding + clustering" pipelines, making it easy to quickly deploy in real-world systems.
[0091] A refined modeling and grading of pseudo-label quality is implemented. Unlike traditional methods that only assign a coarse confidence level to samples or simply discard low-confidence samples, this scheme measures reliability from both the sample and cluster perspectives. At the sample level, confidence is obtained by combining inter-class separability and intra-class consistency. At the cluster level, the overall quality of the cluster is characterized by four aspects: compactness, separation, size, and total duration, which are then combined with a duration factor to form the final weight. More importantly, the scheme does not simply divide samples into "use" or "not use," but rather adaptively segments samples into three levels—high confidence, medium confidence, and low confidence—using quantiles to assign different training roles to samples: high-confidence samples are used for approximate supervised learning, medium-confidence samples are used flexibly through a combination of hard and soft labels, and low-confidence samples only participate in consistency or contrastive regularization. This "three-tier confidence + differentiated utilization" design fully amplifies the value of good samples and significantly mitigates the negative impact of bad samples.
[0092] A prototype-guided soft-label distillation mechanism is introduced and naturally integrated with the three-way confidence framework. The scheme utilizes the similarity between samples and the prototypes of each cluster to construct a soft-label distribution through a softmax function with adaptive temperature, directly transforming the clustering structure into an optimizable teacher distribution. Simultaneously, the temperature parameter is automatically adjusted based on sample confidence, making the soft labels of high-confidence samples sharper and the soft labels of low-confidence samples smoother. For medium-confidence samples, the model aligns cluster pseudo-labels through cross-entropy and approximates prototype soft labels through KL divergence, achieving dual constraints from hard labels and prototype knowledge, effectively buffering noise from clustering errors. This distillation method, which does not rely on external teachers and is based solely on cluster prototypes, represents a significant extension to typical clustering and self-training paradigms.
[0093] Based on this, an unsupervised speaker recognition system was optimized and constructed, achieving high-precision speaker differentiation under unlabeled conditions, significantly improving the system's reliability and practicality. Finally, this scheme balances robustness and engineering feasibility overall. The algorithm extensively uses robust statistics such as quantiles, median distance, and MAD, making sample confidence, cluster quality assessment, and duration weight calculation insensitive to long-tail noise and extreme values, and more adaptable to the complex distribution of real business data. At the same time, each step is based on common vector operations and standard loss forms (cross-entropy, KL divergence, consistency, or contrastive loss), making it easy to integrate into existing deep learning training frameworks. Whether training on large-scale servers or performing incremental self-training on resource-constrained edge computing, it has a low implementation threshold and good scalability.
[0094] The following describes a speaker recognition device provided by an embodiment of this application. The device described below can be referred to in correspondence with the method described above. The device in this embodiment is installed in an electronic device. Figure 2 , Figure 2 This is a structural block diagram of an apparatus according to one embodiment of this application, including: a clustering module 210, used to cluster multiple unlabeled speech samples to obtain multiple cluster labels; a comprehensive sample weight determination module 220, used to determine the comprehensive sample weight of a target speech sample, wherein the target speech sample is any one of the multiple speech samples, and the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs; a speaker recognition module 230, used to perform speaker recognition using a model to be trained based on the target speech sample to obtain the predicted probability value of the output vector corresponding to the target speech sample; a loss value determination module 240, used to determine the loss value of the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, using a loss function corresponding to the target speech sample; and an iterative training module 250, used to determine the total loss based on the respective loss values of the multiple speech samples; and iteratively train the model to be trained based on the total loss to obtain a speaker recognition model; wherein the speaker recognition model is used to perform speaker recognition on the speech to be recognized.
[0095] In one feasible approach, the comprehensive sample weight determination module 220 is used to: determine the confidence level of the target speech sample; determine the duration weight of the target speech sample; determine the cluster quality score of the cluster label to which the target speech sample belongs; and determine the comprehensive sample weight of the target speech sample based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs.
[0096] In one feasible approach, the comprehensive sample weight determination module 220 is used to: average and normalize the sample vectors of all speech samples belonging to the cluster label of the target speech sample to obtain the cluster prototype corresponding to the cluster label; calculate the distance between the target sample vector of the target speech sample and the cluster prototype, where the distance represents the similarity between the sample vector and the cluster prototype; determine the separability score of the target sample vector based on the minimum and second minimum distances of the target sample vector; calculate the distance between the cluster prototype corresponding to the target sample vector and the first sample vector, where the first sample vector represents any sample vector included in the cluster label corresponding to the target sample vector; determine the median and scale estimation data based on the distance between the cluster prototype corresponding to the target sample vector and the first sample vector; determine the consistency value of the target sample vector based on the scale estimation data, the median, the distance between the cluster prototype corresponding to the target sample vector and the target sample vector; and determine the confidence level of the target speech sample based on the separability score and the consistency value of the target sample vector.
[0097] In one feasible approach, the comprehensive sample weight determination module 220 is used to: determine the target quantile duration based on the individual speech durations of multiple speech samples; and determine the duration weight of the target speech sample based on the target quantile duration and the duration of the target speech sample.
[0098] In one feasible approach, the comprehensive sample weight determination module 220 is used to: determine the original compactness score, original separation score, size score, and total duration of the cluster label to which the target speech sample belongs; normalize the original compactness score, original separation score, size score, and total duration; and perform a weighted calculation based on the normalized original compactness score, normalized original separation score, normalized size score, and normalized total duration to obtain the cluster quality score of the cluster label to which the target speech sample belongs.
[0099] In one possible implementation, the method further includes: a loss function determination module, used to determine the loss function corresponding to the target speech sample based on the range to which the confidence level of the target speech sample belongs; wherein, the loss function for the confidence level in the first range includes cross-entropy loss; the loss function for the confidence level in the second range includes a combined loss of hard label cross-entropy and soft label KL divergence; the loss function for the confidence level in the third range includes regularization loss; the minimum confidence level in the first range is greater than any confidence level in the second range, and the minimum confidence level in the second range is greater than any confidence level in the first range.
[0100] In one possible implementation, the method further includes: a soft label determination module, used to calculate the distance between the target sample vector and each cluster prototype if the target speech sample is a speech sample with a confidence level of the second range; and based on the distance between the target sample vector and each cluster prototype, using a softmax function with a temperature coefficient, to generate a soft label for the target sample vector under its respective cluster label.
[0101] Figure 3 A structural diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device includes: a memory 60 for storing a computer program; and a processor 61 for executing the computer program to implement the steps of the method as described in the above embodiments.
[0102] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.
[0103] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0104] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, is capable of implementing the relevant steps of the method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc.
[0105] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
[0106] Those skilled in the art will understand that Figure 3 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0107] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, 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 storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical disks, and other media capable of storing program code.
[0108] Based on this, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.
[0109] Based on this, embodiments of the present invention also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method. It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying drawings 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, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0110] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A speaker recognition method, characterized in that, include: Multiple unlabeled speech samples are clustered to obtain multiple cluster labels; The comprehensive sample weight of the target speech sample is determined, wherein the target speech sample is any one of the plurality of speech samples, and the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs; Based on the target speech sample, the speaker is identified using the model to be trained, and the predicted probability value of the output vector corresponding to the target speech sample is obtained. Based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, the loss value of the target speech sample is determined using the loss function corresponding to the target speech sample. The total loss is determined based on the loss values of the multiple speech samples; and the model to be trained is iteratively trained based on the total loss to obtain the speaker recognition model. The speaker recognition model is used to perform speaker recognition on the speech to be recognized.
2. The method according to claim 1, characterized in that, Determine the overall sample weights of the target speech samples, including: Determine the confidence level of the target speech sample; determine the duration weight of the target speech sample; determine the cluster quality score of the cluster label to which the target speech sample belongs; The comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs.
3. The method according to claim 2, characterized in that, Determine the confidence level of the target speech sample, including: The sample vectors of all speech samples belonging to the cluster label of the target speech sample are averaged and normalized to obtain the cluster prototype corresponding to the cluster label. Calculate the distance between the target sample vector and the cluster prototype of the target speech sample, where the distance represents the similarity between the sample vector and the cluster prototype; Based on the minimum and second minimum distances of the target sample vectors, the separability score of the target sample vectors is determined; Calculate the distance between the cluster prototype corresponding to the target sample vector and the first sample vector, where the first sample vector represents any sample vector included in the cluster label corresponding to the target sample vector; The median and scale estimation data are determined based on the distance between the cluster prototype corresponding to the target sample vector and the first sample vector; Based on the scale estimation data, the median, and the distance between the cluster prototype corresponding to the target sample vector and the target sample vector, the consistency value of the target sample vector is determined; The confidence level of the target speech sample is determined based on the separability score and the consistency value of the target sample vector.
4. The method according to claim 3, characterized in that, Determining the duration weight of the target speech sample includes: The target quantile duration is determined based on the individual speech durations of the multiple speech samples. The duration weight of the target speech sample is determined based on the target quantile duration and the duration of the target speech sample.
5. The method according to claim 3, characterized in that, Determining the cluster quality score of the cluster label to which the target speech sample belongs includes: Determine the original compactness score, original separation score, size score, and total duration of the cluster label to which the target speech sample belongs; The original compactness score, the original separation score, the size score, and the total duration are normalized; and a weighted calculation is performed based on the normalized original compactness score, the normalized original separation score, the normalized size score, and the normalized total duration to obtain the cluster quality score of the cluster label to which the target speech sample belongs.
6. The method according to claim 2, characterized in that, Before determining the loss value of the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, using the loss function corresponding to the target speech sample, the process further includes: Based on the range of confidence levels of the target speech sample, determine the loss function corresponding to the target speech sample; The loss function for the confidence level in the first range includes cross-entropy loss; The loss function for the second range of confidence levels includes: a combined loss of hard-label cross-entropy and soft-label KL divergence; The loss function for the third range of confidence levels includes regularization loss; The minimum confidence level of the first range is greater than any confidence level of the second range, and the minimum confidence level of the second range is greater than any confidence level of the first range.
7. The method according to claim 3, characterized in that, After determining the comprehensive sample weights of the target speech samples, the following steps are also included: If the target speech sample is a speech sample with a confidence level of the second range, then calculate the distance between the target sample vector and each cluster prototype; Based on the distance between the target sample vector and each cluster prototype, a soft label for the target sample vector under its respective cluster label is generated using a softmax function with a temperature coefficient.
8. A speaker recognition device, characterized in that, include: The clustering module is used to cluster multiple unlabeled speech samples to obtain multiple cluster labels; The comprehensive sample weight determination module is used to determine the comprehensive sample weight of the target speech sample, wherein the target speech sample is any one of the plurality of speech samples, and the comprehensive sample weight of the target speech sample is determined based on the confidence level of the target speech sample, the duration weight of the target speech sample, and the cluster quality score of the cluster label to which the target speech sample belongs; The speaker recognition module is used to perform speaker recognition based on the target speech sample using the model to be trained, and to obtain the predicted probability value of the output vector corresponding to the target speech sample. The loss value determination module is used to determine the loss value of the target speech sample based on the predicted probability value of the output vector corresponding to the target speech sample, the comprehensive sample weight of the target speech sample, and the cluster label to which the target speech sample belongs, using the loss function corresponding to the target speech sample. The iterative training module is used to determine the total loss based on the loss values of the multiple speech samples; and to iteratively train the model to be trained based on the total loss to obtain the speaker recognition model. The speaker recognition model is used to perform speaker recognition on the speech to be recognized.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the method according to any one of claims 1 to 7 when running the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the method as described in any one of claims 1 to 7.