Voiceprint similarity calculation method and system, computer equipment and storage medium
Constructing the data set and loss function of the learning model through comparative learning methods, combined with high-quality segment collection and feature extraction, solves the problems of tedious training and low recognition efficiency in the existing voiceprint similarity calculation methods, and achieves simplified training and recognition effects of the model improvement.
Patent Information
- Application Number
- CN202410839825.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-03
AI Technical Summary
The training process of the existing voiceprint similarity calculation method is cumbersome, requires high voice training data, and the precision and recall rates are unbalanced, resulting in poor model recognition and low recognition efficiency.
The comparative learning method is used to construct the data set of the learning model, and the loss function is constructed through the data set for model training, which simplifies the training process and improves the generalization ability. It combines high-quality fragment collection and feature extraction to improve the accuracy and efficiency of feature extraction.
It achieves the simplification of model training and the improvement of generalization ability, improves the accuracy and efficiency of voiceprint similarity calculation, reduces the requirements for voice training data, and ensures the improvement of recognition effect.
Smart Images

Figure CN118588090A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio recognition, and in particular to a voiceprint similarity calculation method, system, computer equipment and storage medium. Background Art
[0002] In the financial service scenario, there are a large number of telephone customer service scenarios for individuals, covering all aspects of marketing, service, and customer complaints. This leaves opportunities for criminals. Criminals have developed a series of gray industries by impersonating identities to handle services or acting as agents for malicious customer complaints. Generally, there are the following two situations: the first is that the voices of calls with the same user ID are different, such as when a user entrusts a professional agent to make malicious customer complaints; the second is that the voices of calls with different user IDs are the same, such as applying for loans multiple times by impersonating others. Since it is difficult to verify the true identity of the user over the phone, voiceprint similarity calculation technology has become the most direct technical defense method. The voiceprint similarity calculation system needs to make accurate judgments on both of the above situations and issue timely alarms during the operation of the enterprise.
[0003] The existing voiceprint similarity calculation method generally first trains a learning model as a feature extractor for speech segments. Then, in actual usage scenarios, the speech segments are extracted using the trained learning model and stored in the database for subsequent comparison. When there is a new speech segment, the feature extractor is used to extract the features, which are then compared with the features of the historical speech segments in the database to output the similarity results. However, the existing learning model training methods generally use supervised learning methods, that is, using labeled speech training data for model training. This training process is cumbersome and has high requirements for speech training data. At the same time, the precision and recall rates during training are unbalanced. At the same time, the existing loss function makes it difficult for the voiceprint similarity calculation model to converge, or the generalization ability is poor, which ultimately leads to poor model recognition effect and low recognition efficiency. Summary of the invention
[0004] In order to solve at least one of the problems mentioned in the above background technology, the present invention provides a voiceprint similarity calculation method, system, computer device and storage medium, which has a simple model training process, good generalization ability, good voiceprint similarity calculation effect and high efficiency.
[0005] The specific technical solutions provided by the present invention are as follows:
[0006] In a first aspect, a method for calculating voiceprint similarity is provided, comprising the following steps:
[0007] Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0008] Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0009] Collect high-quality segments of speech production data to obtain a set of sound segments;
[0010] Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions;
[0011] The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
[0012] As a preferred embodiment of the above solution, the data set for constructing the learning model by contrastive learning includes:
[0013] Each data in the speech training data is randomly sampled and randomly enhanced at different time nodes to generate two sub-samples;
[0014] Inputting all the sub-samples into the learning model to obtain training feature values of the sub-samples;
[0015] The autocorrelation expression matrix of all the sub-samples is obtained according to the training feature values, and the sub-samples from the same data in the autocorrelation expression matrix are positive samples to each other, and vice versa, they are negative samples to each other.
[0016] As a preferred embodiment of the above solution, the formula of the loss function is:
[0017]
[0018] Among them, v i represents the training feature value of the i-th sub-sample, v pair Indicates that v i The training feature value of another sub-sample from the same data source, v j represents the training feature value of the jth subsample, k represents the number of the data in the speech training data, 2k represents the number of all the subsamples, and τ represents the training temperature coefficient.
[0019] As a preferred embodiment of the above solution, the step of collecting high-quality segments of speech production data to obtain a sound segment set includes:
[0020] For the speech production data, first remove non-human voice segments and then remove short segments to obtain a valid segment set;
[0021] The sound paragraph set is obtained by removing low-quality segments from the valid paragraph set.
[0022] As a preferred embodiment of the above scheme, first removing non-human voice segments and then removing short segments from the speech production data to obtain the non-human voice segments in the valid paragraph set includes:
[0023] The sound segments that last longer than a preset time and are lower than a first preset threshold are eliminated.
[0024] As a preferred embodiment of the above solution, removing low-quality segments from the valid paragraph set to obtain the sound paragraph set includes:
[0025] For each paragraph in the valid paragraph set, removing the sound segments below a second preset threshold value to obtain a set of sub-paragraphs including each paragraph;
[0026] Using the formula: the quality score of each paragraph = the number of sub-paragraphs of each paragraph * the maximum length of the paragraph in the sub-paragraph,
[0027] The quality score of each paragraph is calculated, and the paragraphs in the valid paragraph set are sorted according to the quality score and the first several paragraphs are selected to obtain the sound paragraph set.
[0028] As a preferred embodiment of the above solution, the similarity comparison of the feature expressions of the speech production data of different groups to obtain the similarity result includes:
[0029] Performing cosine similarity calculation on the feature expressions of the speech production data of different groups to obtain a similarity matrix;
[0030] Setting a similarity threshold, setting the element values in the similarity matrix that are greater than or equal to the similarity threshold to 1, and vice versa, setting them to 0, to obtain a voting matrix;
[0031] A voting ratio threshold is set. If the ratio of elements with a value of 1 in the voting matrix is greater than or equal to the voting ratio threshold, the similarity result is similar; otherwise, the similarity result is dissimilar.
[0032] In a second aspect, a voiceprint similarity calculation system is provided, comprising:
[0033] Data set construction module: used to input speech training data during the training process of the learning model, and construct the data set of the learning model by contrastive learning;
[0034] Model training module: used for constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0035] High-quality segment collection module: used to collect high-quality segments of speech production data to obtain a set of sound segments;
[0036] Feature extraction module: used to extract features from the sound paragraph set using the feature extraction model to obtain feature expressions;
[0037] Similarity comparison module: used to compare the similarity of the feature expressions of different groups of speech production data to obtain similarity results.
[0038] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0039] Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0040] Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0041] Collect high-quality segments of speech production data to obtain a set of sound segments;
[0042] Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions;
[0043] The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
[0044] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a processor, the processor implements the following steps:
[0045] Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0046] Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0047] Collect high-quality segments of speech production data to obtain a set of sound segments;
[0048] Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions;
[0049] The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
[0050] By means of the above technical scheme, the voiceprint similarity calculation method, system, computer device and storage medium of the present invention construct a data set of the learning model by adopting contrastive learning and construct a loss function through the data set. In this way, the training of the learning model does not require manual labeling and data segmentation. It only needs to pull the voice data of different users as voice training data. The requirements for voice training data are low and the training is simple. At the same time, contrastive learning enables the learning model to have stronger directional prompts for a batch of voice training data in a generation of training process, so that the learning model pays more attention to key features during gradient descent, and is not easy to overfit to special individual training data. In addition, compared with the traditional method of directly using each user ID as a label for classification tasks Training, the training method of contrastive learning is more balanced in the number of categories and the number within categories during training, and the precision performance and the recall performance are more balanced. Moreover, the loss function constructed by contrastive learning in the present invention can make the learning model converge quickly and have good generalization performance. Finally, the trained learning model is used to extract the features of speech production data and calculate the voiceprint similarity, with good recognition effect and high efficiency. In addition, the present invention first collects high-quality fragments of speech production data to obtain a sound paragraph set, and then extracts features from the sound paragraph set. In this way, the sound paragraph set before feature extraction contains high-quality sound fragments, which is conducive to the expression of feature extraction, improves the accuracy and efficiency of feature extraction, and thus further improves the efficiency of voiceprint similarity calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 Schematic diagram of a process of a method according to a first embodiment of the present invention;
[0053] Figure 2 A schematic diagram of constructing a data set using contrastive learning in Embodiment 1 of the present invention;
[0054] Figure 3 This is a schematic diagram of the similarity comparison between two groups of speech production data in Example 1 of the present invention;
[0055] Figure 4 This is a schematic diagram of the system structure of the second embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0057] As described in the background technology, the existing voiceprint similarity calculation method has a cumbersome training process and high requirements for speech training data. At the same time, the precision and recall rates of the voiceprint similarity calculation model are unbalanced, difficult to converge, or have poor generalization ability, which ultimately leads to poor model recognition effect and low recognition efficiency. The model training process of the present invention is simple, has good generalization ability, and has good voiceprint similarity calculation effect and high efficiency. The embodiments of the present invention are explained in detail below.
[0058] Embodiment 1
[0059] like Figure 1 As shown, the present invention provides a voiceprint similarity calculation method, comprising the following steps:
[0060] S1: inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0061] The learning model is a machine learning model, and a neural network model is generally selected, and a deep learning model can be further selected. The learning model in this embodiment adopts a TDNN (Time-Delay Neural Network) model. The TDNN model generally requires multiple generations (dozens or even hundreds of generations) of training processes to eventually converge the model. The speech training data in each generation of training of the learning model in this embodiment are a batch of speech samples randomly extracted from the data set, wherein the data set is a large amount of unlabeled speech data collected from telephone recordings or online audio and video. In model training and inference, the speech data spectrum preprocessing adopts the FilterBanks (filter bank) method. The speech training data determines whether it needs to be extracted and cleaned according to the different data sources. If the speech training data is collected from telephone recordings, it needs to be extracted and cleaned to improve the quality of the training data to facilitate the training of the learning model. If it is high-quality audio and video recordings collected from the Internet, it does not need to be extracted and cleaned. In short, the speech training data used in the training of the learning model must be high-quality speech data to improve the training effect of the learning model.
[0062] Contrastive learning is a type of unsupervised learning, which is used to learn the general characteristics of a data set by letting the model learn the similarities or differences of data points without labels. The data set for constructing the learning model in a contrastive learning manner includes:
[0063] Each data in the speech training data is randomly sampled and randomly enhanced at different time nodes to generate two sub-samples; specifically, in the first generation training process of the learning model, the speech training data is K speech samples randomly selected from the data set, and the value of K can be as large as possible, for example, greater than 256, such as Figure 2 As shown in the figure, the processing and reasoning process is represented by F(x), and each speech sample is named with letters such as A, B, and C. Each speech sample generates two sub-samples through random sampling and random enhancement (noise addition, volume adjustment, etc.) at different time nodes. For example, A generates two sub-samples A1 and A2, and K speech samples generate a total of 2K sub-samples.
[0064] Input all the sub-samples into the learning model to obtain the training feature values of the sub-samples; specifically, input all the sub-samples into the learning model to obtain multi-dimensional training feature values. The TDNN model in this embodiment generates 192-dimensional training feature values. The feature matrix of all current sub-samples is (2K, 192). The above training feature values are feature values obtained when the learning model is not trained (initialized weights) or has not converged. This feature value does not meet the requirement of the feature value to be extracted from the subsequent speech production data;
[0065] According to the training feature values, the autocorrelation expression matrix of all the sub-samples is obtained, and the sub-samples from the same data in the autocorrelation expression matrix are positive samples to each other, and vice versa. Specifically, the feature matrix (2K, 192) is transposed and multiplied, that is, each feature in the feature matrix is transposed and multiplied: (2K, 192)*(192, 2K)=(2K, 2K). As shown in the figure, (2K, 2K) is the autocorrelation expression matrix. The expression meaning of the autocorrelation expression matrix is clear. For example, in the first row, the value obtained by multiplying A1 and A2 is a positive sample P because they come from the common sample A, so they should have the highest similarity; the value obtained by multiplying A1 with B1, B2 and other features is a negative sample N because they are irrelevant from the same source, and the same applies to each of the following rows. P represents a positive sample and N represents a negative sample. This encourages the learning model to express sounds from the same source as equal features and sounds from different sources as unequal features.
[0066] S2: constructing a loss function according to the data set, and training the learning model according to the loss function until the learning model converges, thereby obtaining a feature extraction model after the learning model is trained;
[0067] The loss function is used to express the difference between the model prediction and the actual data. In this embodiment, the loss function is constructed in the form of the comparative learning loss function InfoNCE. The formula of the loss function is:
[0068]
[0069] Among them, v i represents the training feature value of the i-th sub-sample, v pair Indicates that v i The training feature value of another sub-sample from the same data source, v j represents the training feature value of the jth subsample, k represents the number of the data in the speech training data, 2k represents the number of all the subsamples, τ represents the training temperature coefficient, and the default value is 0.07. If the coefficient is reduced, the model tends to strengthen the distinction between different people's voices and reduce the FAR (False Acceptance Rate); if the coefficient is increased, the model tends to strengthen the retrieval of similar voices of the same person and reduce the FRR (False Rejection Rate). It can be adjusted as needed in actual use. Indicates v i The loss function of the learning model is Loss, which represents the total loss function of the learning model. The learning model is trained according to the above formula. Through generations of training (in each generation of training, a batch of speech samples are extracted from the data set - the data set is constructed by contrastive learning - the loss function is constructed - the learning model is trained), the weight parameters of the learning model are gradually adjusted, and the Loss value gradually decreases until it no longer changes. At this time, the learning model converges and a feature extraction model that meets the requirements is obtained. The feature extraction model has the ability to encode and represent voiceprint features.
[0070] S3: Collect high-quality segments of speech production data to obtain a sound segment set;
[0071] Different from the voiceprint collection conditions in smart home and smart attendance scenarios, customer service calls may face more noise, the sound collection quality is uncontrollable, and it is impossible to constrain or predict the user's oral content. Experienced gray market agents will deliberately shorten the speech content. The complete audio is often several minutes long, but the high-quality clips suitable for voiceprint comparison are not long. At the same time, during the user's phone call, due to various reasons such as call equipment, signal transmission, and question and answer content, the original phone recording is hundreds of seconds long, but it is full of a large proportion of blank, low-quality and meaningless clips. Blank and low-quality clips will cause feature interference to the voiceprint similarity calculation; meaningless clips refer to clips with qualified sound quality but less information in the response content, such as short response sentences such as "um" and "oh ok" when responding to customer service. These clips are not conducive to the expression of user voiceprint features. Therefore, it is necessary to collect high-quality clips of the voice production data generated during the call.
[0072] Specifically, S3 includes:
[0073] S31: first remove non-human voice segments and then remove short segments from the speech production data to obtain a valid segment set;
[0074] This stage can be summarized as the effective segmentation stage, wherein the removal of non-human voice segments includes:
[0075] Eliminate sound clips that last longer than a preset time and are lower than a first preset threshold;
[0076] Specifically, the sound energy size under the decibel full amplitude standard (DBFS, a unit used to represent the strength of audio signals) is measured for the original voice production data, and changes with the time axis. If the sound segment lasts for more than a preset time and less than a first preset threshold, it is considered that the segment does not belong to the user's voice segment, and may belong to a blank paragraph or pure noise. The preset time and the first preset threshold can be statistically obtained and modified in the actual scene data set. In this embodiment, the preset time is 1000 milliseconds, and the first preset threshold is -40 decibels;
[0077] After removing the non-human voice segments from the original speech production data, the remaining segments are valid segments. At this time, the length of each valid segment is measured and the segments that are too short are removed. At this time, the meaningless response sentences have been removed, leaving only a set of valid paragraphs;
[0078] S32: Eliminate low-quality segments from the valid paragraph set to obtain the sound paragraph set.
[0079] This stage can be summarized as the stage of evaluating paragraph quality, where S32 includes:
[0080] S321: removing the sound segments below a second preset threshold from each paragraph in the valid paragraph set to obtain a set of sub-paragraphs including each paragraph;
[0081] In the effective paragraph set, the quality of the human voice content is judged by measuring the sound energy, and coherent sentences with more pronunciation are found. In this embodiment, the following method is used to measure the paragraph sound quality, which can effectively exclude low-quality content paragraphs: use librosa.effects.split() tool (a speech processing package tool) to remove the sound segments below the second preset threshold for each paragraph in the effective paragraph set to obtain shorter sub-paragraphs of each paragraph, wherein the second preset threshold can be statistically obtained and modified in the actual scene data set. In this embodiment, since the sound energy will fluctuate violently around 20 decibels during the coherent and clear pronunciation process, the second preset threshold is set to 20 decibels;
[0082] S322: using the formula: quality score of each paragraph = number of sub-paragraphs of each paragraph * maximum length of paragraphs in the sub-paragraphs, the quality score of each paragraph is calculated, and the paragraphs in the valid paragraph set are sorted according to the quality scores and the first several paragraphs are selected to obtain the sound paragraph set;
[0083] Specifically, the above formula can be expressed as: Quality = Num para ×Length max , where Quality represents the quality score of each paragraph, Num para Indicates the number of sub-paragraphs of each paragraph, Length max Indicates the maximum length of a paragraph in a subparagraph, calculates all the qualities in the valid paragraph set, sorts the qualities and takes the first several paragraphs of the qualities (n paragraphs in this embodiment), and obtains the audio paragraph set, where Length max The maximum number of time frames in a sub-paragraph. The general sampling rate of a voice file is 8000, that is, 8000 samples per second. max The unit is each time frame of the voice file, that is, 1 / 8000 second.
[0084] The above-mentioned high-quality segment collection method in this embodiment can also be used to extract and clean low-quality training data in the speech training data of the learning model, but there is no need to divide the speech into several segments. It only needs to ensure that each speech in the speech training data is a complete segment of high-quality speech.
[0085] S4: extracting features from the sound paragraph set using the feature extraction model to obtain feature expressions;
[0086] Specifically, the trained feature extraction model is used to extract voiceprint features from a set of sound segments to obtain a feature expression matrix with a dimension of n*192. In actual customer service telephone recordings, as long as a new voice segment is generated, high-quality segments of the voice segment are first collected, and then feature extraction is performed to obtain a feature expression matrix, which is finally stored in the historical feature library of the database for subsequent similarity comparison.
[0087] S5: Performing a similarity comparison on the feature expressions of the speech production data of different groups to obtain a similarity result.
[0088] The S5 stage can be summarized as the voting method to determine the similarity stage. S5 includes:
[0089] S51: performing cosine similarity calculation on the feature expressions of the speech production data of different groups to obtain a similarity matrix;
[0090] Specifically, the feature expression matrices (n, 192) of the two sets of speech production data are subjected to cosine similarity calculation to obtain the similarity matrix (n, n) between any two features;
[0091] S52: Setting a similarity threshold, setting the element values in the similarity matrix that are greater than or equal to the similarity threshold to 1, and vice versa, setting them to 0, to obtain a voting matrix;
[0092] S53: Setting a voting ratio threshold. If the ratio of elements with a value of 1 in the voting matrix is greater than or equal to the voting ratio threshold, the similarity result is similar. Otherwise, the similarity result is dissimilar.
[0093] Specifically, if the similarity result is similar, this embodiment can also generate an alarm, and directly point out in the alarm which segments in the sound segment sets of the two sets of voice production data are most similar, so as to facilitate manual verification processing, such as Figure 3As shown in the figure, in order to illustrate the similarity comparison, n=3 is simplified, and voice 1 and voice 2 are the sound segment sets of two groups of voice production data, and the sound segment sets contain 3 sound segments. The figure shows the conversion process from the similarity matrix to the voting matrix. Since the third sound segment at the end of voice 2 has quality problems, the similarity of the third row in the similarity matrix is low, and the overall similarity average is about 0.53. The similarity threshold and the voting ratio threshold in this embodiment are both set to 0.6. If the average similarity comparison method is used, 0.53<0.6, then this group of There will be no alarm; if voting is performed, the ratio of the last 1 is 6 / 9, which is about 0.67. If 0.67>0.6, an alarm will be generated. In the actual customer service call scenario, there may be severe noise or changes in the user's voice state, resulting in the similarity of a small number of speech segments deviating from the actual situation. In order to minimize the impact of this situation on the result judgment, the voting method is used to determine the similarity. The voting method can reduce the impact of a small number of sound segments with quality problems on the overall similarity, making the learning model more robust, thereby further improving the accuracy of voiceprint similarity calculation. In an actual customer service call scenario, two groups of voice production data are generated in different time periods. The earlier generated voice production data has been feature extracted by the feature extraction model to obtain a feature expression matrix and stored in the historical feature library. The later generated voice production data is feature extracted by the feature extraction model after generation to obtain a feature expression matrix, and then a similarity comparison is performed with the feature expression matrix in the historical feature library to obtain a comparison result. If the voice similarity results of different users are similar, it is possible that someone has repeatedly impersonated another person to perform illegal activities. If the voice similarity results of the same user are not similar, it is possible that the user has entrusted a professional agent to make a malicious customer complaint. Both of the above are fraudulent situations. The voiceprint similarity calculation method of the present invention can make accurate judgments on the above two situations and issue timely alarms during enterprise operations.
[0094] Embodiment 2
[0095] like Figure 4 As shown, the present invention provides a voiceprint similarity calculation system, comprising:
[0096] Dataset construction module 1: used to input speech training data during the training process of the learning model, and construct the data set of the learning model by contrastive learning;
[0097] Model training module 2: used to construct a loss function according to the data set, train the learning model according to the loss function until the learning model converges, and obtain a feature extraction model after the learning model is trained;
[0098] High-quality segment collection module 3: used to collect high-quality segments of speech production data to obtain a sound segment set;
[0099] Feature extraction module 4: used to extract features from the sound paragraph set using the feature extraction model to obtain feature expressions;
[0100] Similarity comparison module 5: used to compare the similarity of the feature expressions of different groups of speech production data to obtain similarity results.
[0101] Embodiment 3
[0102] The present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0103] Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0104] Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0105] Collect high-quality segments of speech production data to obtain a set of sound segments;
[0106] Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions;
[0107] The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
[0108] Embodiment 4
[0109] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program, and when the program is executed by a processor, the processor implements the following steps:
[0110] Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning;
[0111] Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained;
[0112] Collect high-quality segments of speech production data to obtain a set of sound segments;
[0113] Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions;
[0114] The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
[0115] In summary, the voiceprint similarity calculation method, system, computer device and storage medium of the present invention construct a data set of the learning model by adopting contrastive learning and construct a loss function through the data set. In this way, the training of the learning model does not require manual labeling and data segmentation. It only needs to pull the voice data of different users as voice training data. The requirements for voice training data are low and the training is simple. At the same time, contrastive learning enables the learning model to have stronger directional prompts for a batch of voice training data in a generation of training process, so that the learning model pays more attention to key features during gradient descent, and is not easy to overfit to special individual training data. In addition, compared with the traditional method of directly taking each user ID as a label for classification task training The contrastive learning training method has a more balanced number of categories and number of classes during training, and the precision performance and the recall performance are more balanced. Moreover, the loss function constructed by contrastive learning in the present invention can make the learning model converge quickly and have good generalization performance. Finally, the trained learning model is used to perform feature extraction and voiceprint similarity calculation of speech production data, with good calculation effect and high efficiency. In addition, the present invention first collects high-quality fragments of speech production data to obtain a sound paragraph set, and then extracts features from the sound paragraph set. In this way, the sound paragraph set before feature extraction contains high-quality sound fragments, which is conducive to the expression of feature extraction, improves the accuracy and efficiency of feature extraction, and further improves the efficiency of voiceprint similarity calculation.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0117] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0118] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for calculating voiceprint similarity, It is characterized in that The following steps are involved: Inputting speech training data during the training process of the learning model, and constructing a data set of the learning model by contrastive learning; Constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained; Collect high-quality segments of speech production data to obtain a set of sound segments; Using the feature extraction model to extract features from the sound paragraph set to obtain feature expressions; The feature expressions of the speech production data of different groups are compared for similarity to obtain a similarity result.
2. The voiceprint similarity calculation method according to claim 1, It is characterized in that The data set for constructing the learning model by contrastive learning includes: Each data in the speech training data is randomly sampled and randomly enhanced at different time nodes to generate two sub-samples; Inputting all the sub-samples into the learning model to obtain training feature values of the sub-samples; The autocorrelation expression matrix of all the sub-samples is obtained according to the training feature values, and the sub-samples from the same data in the autocorrelation expression matrix are positive samples to each other, and vice versa, they are negative samples to each other.
3. The voiceprint similarity calculation method according to claim 2, It is characterized in that The formula of the loss function is: Among them, v i represents the training feature value of the i-th sub-sample, v pair Indicates that v i The training feature value of another sub-sample from the same data source, v j represents the training feature value of the jth subsample, k represents the number of the data in the speech training data, 2k represents the number of all the subsamples, and τ represents the training temperature coefficient.
4. The voiceprint similarity calculation method according to claim 1, It is characterized in that The method of collecting high-quality segments of speech production data to obtain a sound segment set includes: For the speech production data, first remove non-human voice segments and then remove short segments to obtain a valid segment set; The sound paragraph set is obtained by removing low-quality segments from the valid paragraph set.
5. The voiceprint similarity calculation method according to claim 4, It is characterized in that The non-human voice segments are first removed from the speech production data and then the short segments are removed to obtain the non-human voice segments removed from the valid paragraph set, which include: The sound segments that last longer than a preset time and are lower than a first preset threshold are eliminated.
6. The voiceprint similarity calculation method according to claim 4 or 5, It is characterized in that The step of eliminating low-quality segments from the valid paragraph set to obtain the sound paragraph set comprises: For each paragraph in the valid paragraph set, removing the sound segments below a second preset threshold value to obtain a set of sub-paragraphs including each paragraph; Using the formula: the quality score of each paragraph = the number of sub-paragraphs of each paragraph * the maximum length of the paragraph in the sub-paragraph, The quality score of each paragraph is calculated, and the paragraphs in the valid paragraph set are sorted according to the quality score and the first several paragraphs are selected to obtain the sound paragraph set.
7. The voiceprint similarity calculation method according to claim 1, It is characterized in that The similarity comparison of the feature expressions of the speech production data of different groups to obtain the similarity result includes: Performing cosine similarity calculation on the feature expressions of the speech production data of different groups to obtain a similarity matrix; Setting a similarity threshold, setting the element values in the similarity matrix that are greater than or equal to the similarity threshold to 1, and vice versa, setting them to 0, to obtain a voting matrix; A voting ratio threshold is set. If the ratio of elements with a value of 1 in the voting matrix is greater than or equal to the voting ratio threshold, the similarity result is similar; otherwise, the similarity result is dissimilar.
8. A voiceprint similarity calculation system, It is characterized in that include: Data set construction module: used to input speech training data during the training process of the learning model, and construct the data set of the learning model by contrastive learning; Model training module: used for constructing a loss function according to the data set, training the learning model according to the loss function until the learning model converges, and obtaining a feature extraction model after the learning model is trained; High-quality segment collection module: used to collect high-quality segments of speech production data to obtain a set of sound segments; Feature extraction module: used to extract features from the sound paragraph set using the feature extraction model to obtain feature expressions; Similarity comparison module: used to compare the similarity of the feature expressions of different groups of speech production data to obtain similarity results.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, Features: The computer-readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 7.
