Data selection method and device, electronic equipment and storage medium
By constructing a sample set using the convergence value of the training file and selecting the target training sample set using the test set error rate, the problems of redundant information and sample independence in deep neural network model training are solved, thus improving the recognition effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- VOICEAI TECH CO LTD
- Filing Date
- 2023-05-10
- Publication Date
- 2026-07-31
AI Technical Summary
In the training of existing deep neural network models, redundant information abounds and the samples in the training and recognition phases are independent, resulting in poor recognition performance. The quality of manual screening is unstable and cannot achieve the best results.
A training sample set is constructed by obtaining the convergence value of the training file, and a target training sample set is selected by testing the error rate using the test set. The model is then trained by combining the optimal parameter configuration.
It achieves better results in the recognition stage, solves the problems of unstable and independent sample selection in the training stage, and improves the recognition performance of the model.
Smart Images

Figure CN116741154B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a data selection method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of deep neural networks, deep neural network models have been widely applied in various fields. However, training deep neural network models requires a large amount of data samples, which are often filled with redundant information, and different deep neural network models require different data. Currently, high-quality data samples are mainly obtained through manual screening based on experience, thus achieving better model training results. However, the manual screening process is very resource-intensive, and the varying levels of knowledge and training among individuals result in inconsistent quality of the obtained data samples, which is detrimental to the training of deep neural network models.
[0003] For example, consider voiceprint recognition using a deep neural network model. Voiceprint recognition is a type of biometric identification that uses a specialized electroacoustic conversion instrument to plot sound wave features into a spectral graph, which is then compared with a registered voiceprint model to distinguish different individuals and achieve identity verification. Compared with common biometric identification methods such as fingerprint recognition, voiceprint recognition has advantages such as convenient and natural acquisition, simple use, and remote verification capabilities. However, when training a deep neural network model, a large number of speech data samples are filled with redundant information and bad samples, which prevents the trained deep neural network model from achieving good recognition results. At the same time, existing models operate independently in the training and open-set recognition phases, and the results in the recognition phase cannot guide the training phase plan, meaning that not all backend model combinations after training can achieve the best results in the voiceprint recognition phase. Summary of the Invention
[0004] In view of the above problems, this application provides a data selection method, apparatus, electronic device and storage medium, which can actively select data that is conducive to improving the recognition effect in the recognition stage during the training stage, and train the back-end model combination with the best parameter configuration to give full play to the best effect of the overall model in the recognition stage.
[0005] The embodiments of this application are implemented using the following technical solutions:
[0006] In a first aspect, this application provides a data selection method, which includes: obtaining N training files and a convergence value corresponding to each training file, wherein N is an integer greater than or equal to 1, and the magnitude of the convergence value is used to characterize the speed of model convergence when the training file is used for model training; constructing multiple training sample sets based on the convergence values of each training file, each training sample set including at least one training file; testing the model trained on each training sample set based on a test set to obtain the error rate corresponding to each training sample set; selecting a target training sample set based on the error rate corresponding to each training sample set, and selecting a target training file from the N training files based on the selected target training sample set, so as to use the selected target training file to train the model to obtain a trained data processing model.
[0007] Secondly, this application provides a data selection device. Using the above method, the data selection device includes: an acquisition module for acquiring N training files and a convergence value corresponding to each training file; a construction module for constructing multiple training sample sets based on the convergence values of each training file, each training sample set including at least one training file; a testing module for testing the model trained on each training sample set based on the test set, and obtaining the error rate corresponding to each training sample set; and a selection module for selecting a target training sample set based on the error rate corresponding to each training sample set, and selecting a target training file from the N training files based on the selected target training sample set.
[0008] In one possible implementation, each training file includes multiple speech files, and the multiple speech files correspond to the same speaker. The acquisition module includes a capture unit and a calculation unit. The capture unit is used to acquire the speech files, the speaker, the user information of the speaker, and the posterior probability of each speech file. The calculation unit is used to obtain the cross-entropy of each speech file based on the posterior probability of each speech file and the user information of the corresponding speaker. The average cross-entropy of each speech file corresponding to the same speaker is calculated as the convergence value of the training file corresponding to the speaker.
[0009] In one possible implementation, the construction module may further include a sorting unit and a combination unit. The sorting unit is used to sort the training files according to the convergence value to obtain N sorted training files; the combination unit is used to combine the sorted training files to construct multiple training sample sets, wherein the i-th training sample set includes the first i training files from the N sorted training files, where i is an integer less than or equal to N.
[0010] In one possible implementation, the testing module includes a sample training unit, a sample testing unit, and an error rate calculation unit. The sample training unit trains the model according to each training sample set, obtaining the trained model corresponding to each training sample set. The sample testing unit inputs multiple test samples from the test set into the trained model corresponding to each training sample set for testing, obtaining the test result of each model on each test sample, with each test sample having a sample label. The error rate calculation unit calculates the error rate of the training sample set corresponding to each model based on the test result of each model on each test sample and the sample label of each test sample.
[0011] In one possible implementation, the selection module further includes a drawing unit, a truncating unit, and a confirmation unit; the drawing unit is used to construct an error rate curve from the first training sample set to the Nth training sample set based on the error rate corresponding to each training sample set; the truncating unit truncates the error rate curve from the starting point to the lowest point; the confirmation unit confirms the training sample set corresponding to the lowest point of the error rate curve as the target training sample set, and uses the training file corresponding to the target training sample set as the target training file.
[0012] In another possible implementation, the truncation unit truncates the curve segment with a negative slope in the error rate curve as the target curve segment; the confirmation unit confirms the training sample sets corresponding to the start and end points of each target curve segment as the target training sample sets, deletes the training files in the training sample set corresponding to the start point of each target curve segment from the training files included in the training sample set corresponding to the end point of each target curve segment, and obtains the training file for each target curve segment; and obtains the training file corresponding to each target curve segment and the first training file in the N arranged training files as the target training file.
[0013] In one possible implementation, the data selection device further includes a parameter confirmation module; the parameter confirmation module further includes a parameter training unit, a parameter testing unit, and a selection unit; the parameter training unit is used to train multiple candidate models according to a target training file to obtain multiple trained candidate models, wherein the candidate models are models with different parameters; the parameter testing unit is used to input multiple test samples from the test set into each trained candidate model for testing, to obtain the test results of each candidate model for each test sample, wherein each test sample has a sample label, and based on the test results of each candidate model for each test sample and the sample labels of each test sample, to obtain the similarity result corresponding to each candidate model; the selection unit is used to select the candidate model with the highest similarity result as the target model according to the similarity result, and to use the selected target training file to train the target model to obtain the trained data recognition model.
[0014] Thirdly, this application provides an electronic device comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured for the methods described above.
[0015] Fourthly, this application provides a computer-readable storage medium storing program code that can be invoked by a processor to execute the above-described method.
[0016] The data selection method, apparatus, electronic device, and storage medium provided in this application embodiment involve the following steps: The data selection method acquires N training files and the convergence value corresponding to each training file, where N is an integer greater than or equal to 1. A training sample set is constructed based on the convergence values of each training file. The model is trained using the constructed training sample set, and each trained model is tested using a test set to obtain the error rate corresponding to each training sample set. A target training sample set is selected based on the error rate of each training sample set, and a target training file is selected from the N training files based on the selected target training sample set. The model is then trained using the selected target training file. The method for selecting training samples based on the convergence value of the training samples is not only improved by selecting training samples based on experience, but also by testing the model trained on the training sample set with a test set. The training samples are then selected based on the error rate obtained from the test, thus enabling the selection of training samples to be guided by the recognition results of the test set. This solves the problem that the samples in the training stage and the samples in the recognition stage are independent of each other, and the effect of the recognition stage cannot guide the solution in the training stage. By using the selected training samples to train the model, the trained data recognition model can achieve better results in the recognition stage.
[0017] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0019] Figure 1 This is a flowchart illustrating the voiceprint recognition process.
[0020] Figure 2 This is a schematic diagram illustrating an application scenario according to an embodiment of this application.
[0021] Figure 3 This is a flowchart illustrating a data selection method provided in an embodiment of this application.
[0022] Figure 4 This is provided by the embodiments of this application. Figure 3 A flowchart of step S110.
[0023] Figure 5 This is provided by the embodiments of this application. Figure 3 A flowchart of step S120.
[0024] Figure 6 This is provided by the embodiments of this application. Figure 3 A flowchart of step S130.
[0025] Figure 7 This is provided by the embodiments of this application. Figure 3 A flowchart of step S140.
[0026] Figure 8 This is provided by the embodiments of this application. Figure 3 Another flowchart of step S140.
[0027] Figure 9 This is a flowchart illustrating another data selection method provided in an embodiment of this application.
[0028] Figure 10 This is a schematic diagram of the structure of a data selection device provided in an embodiment of this application.
[0029] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0030] Figure 12 This is a computer-readable storage medium provided in the embodiments of this application. Detailed Implementation
[0031] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0033] Currently, voiceprint recognition technology has developed rapidly with the incorporation of deep network models, such as... Figure 1 , Figure 1 A flowchart illustrating the voiceprint recognition process is provided. Existing voiceprint recognition methods primarily involve performing a Fourier transform on a speech file to obtain the corresponding speech features, extracting voiceprint features from these features using a neural network, performing progressive dimensionality reduction mapping on the voiceprint features using a backend model combination, converting them into scoring features, and finally calculating the similarity between the registered scoring features and the scoring features to complete the overall voiceprint recognition process.
[0034] It is understandable that the quality of the scoring features directly affects the similarity results, thereby affecting the overall performance of voiceprint recognition. Therefore, obtaining a good combination of backend models is particularly important. However, existing backend model combinations often select training samples based on experience during the training phase, and the samples in the training phase and the samples in the recognition phase are independent of each other. The performance in the recognition phase cannot guide the plan in the training phase, so that not all backend model combinations generated in the training phase can achieve the best performance in the recognition phase.
[0035] To address the aforementioned problems, this application provides a data selection method, apparatus, electronic device, and storage medium. The data selection method involves acquiring N training files and the convergence value corresponding to each training file, where N is an integer greater than or equal to 1. A training sample set is constructed based on the convergence values of each training file. The model is trained using this training sample set, and then each trained model is tested using a test set to obtain the error rate corresponding to each training sample set. A target training sample set is selected based on the error rates of each training sample set, and a target training file is selected from the N training files based on the selected target training sample set. The model is then trained using the selected target training file to obtain the trained data recognition model. In this application, the data recognition model is primarily a backend model for voiceprint recognition.
[0036] By adopting the data selection method provided in this application, when selecting training files to train the model, the selection of training files is not only based on the convergence value of the training files themselves, solving the problem of selecting training samples based on experience in existing training methods; but also by testing the model trained on the training sample set using a test set, and selecting training files based on the error rate obtained from the test. This realizes the use of the recognition results of the test set to guide the selection of training files, solving the problem that the samples in the existing training stage and the samples in the recognition stage are independent of each other, and the effect of the recognition stage cannot guide the scheme in the training stage. By using the selected training samples to train the data recognition model, the trained data recognition model can achieve better results in the recognition stage.
[0037] The following describes an exemplary application of the data selection method provided by the embodiments of the present invention for performing the above-described data selection method. The data selection method provided by the embodiments of the present invention can be applied to, for example... Figure 2 Server 20 in the application environment shown.
[0038] Figure 2 This is a schematic diagram illustrating an application scenario according to an embodiment of this application, such as... Figure 2 As shown, the application scenario includes users, terminal devices 10, networks, servers 20, and databases 30.
[0039] The terminal device 10 may be a mobile phone, computer, smart speaker or vehicle terminal, etc. The terminal device 10 may be equipped with a collection module for acquiring voice information, such as an audio collection module or a video collection module.
[0040] A network can be a wide area network (WAN), a local area network (LAN), or a combination of both.
[0041] Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. In this embodiment, server 20 is a device capable of providing voiceprint recognition services.
[0042] Database 30 stores a large amount of audio data as training files and audio data with sample labels as test files.
[0043] exist Figure 2In the application scenario shown, server 20 obtains multiple training files from database 30 and calculates the convergence value corresponding to each training file. Based on the convergence value of each training file, a training sample set is constructed, and the backend model combination is trained using the constructed training sample set. Server 20 obtains multiple test files from database 30 and then tests each trained backend model combination using the test files to obtain the error rate corresponding to each training sample set. Based on the error rate corresponding to each training sample set, a target training sample set is selected, and a target training file is selected from the training files based on the selected target training sample set. The selected target training file is used to train the model to obtain the trained backend model combination. When the user interacts with terminal device 10, terminal device 10 obtains the user's voice information and transmits it to server 20 via the network. The neural network in server 20 extracts the voiceprint features from the voice information, recognizes the extracted voiceprint features through the trained backend model combination, and outputs the recognition result. Server 20 sends the recognition result to terminal device 10 via the network, and terminal device 10 receives the recognition result and responds.
[0044] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0045] like Figure 3 , Figure 3 A flowchart illustrating a data selection method provided in an embodiment of this application is given. The data selection method includes:
[0046] S110. Obtain N training files and the convergence value corresponding to each training file.
[0047] Where N is an integer greater than or equal to 1, and the magnitude of the convergence value is used to characterize how fast the model converges when the training file is used for model training.
[0048] Training files can be audio files, image files, or video files. When the training file is an audio file, it can be used to train a voiceprint recognition model. When the training file is an image file, it can be used to train an image recognition model. When the training file is a video file, it can be used to train an action recognition model. Furthermore, training files can be multiple training files corresponding to the same user, or multiple training files corresponding to multiple users respectively.
[0049] There are several ways to obtain training files. One method is to actively extract a set number of training files from a sample database based on a neural network. Another method is to manually select N training files and input them manually. The specific method of acquisition is not limited here, but should be based on actual needs.
[0050] It is understandable that obtaining the training files and the convergence value corresponding to each training file can be done synchronously, that is, each training file and its corresponding convergence value are pre-stored in the relevant sample database; or it can be done step by step, that is, the convergence value corresponding to each training file is calculated separately after the training files are obtained. No specific limitation is made here.
[0051] It is understandable that the value of N will affect the training effect of the model, that is, the number of training files will affect the training effect of the model; specifically, within a certain range, the more training files there are, the better the training effect of the model.
[0052] It is understandable that the convergence value of the training file will affect the training effect of the model, that is, the quality of the training file will affect the training effect of the model. Specifically, the smaller the convergence value of the training file, the less likely there is bad information in the training file. When the training file is used for model training, the model is easier to learn, and the convergence speed of the model training is faster.
[0053] In some implementations, such as Figure 4 , Figure 4 Given Figure 3 A flowchart of step S110 is provided. Each training file includes multiple speech files, and the multiple speech files correspond to the same speaker. Step S110 includes:
[0054] S111. Obtain user information for each speaker and the posterior probability of each audio file.
[0055] The user information of each speaker can be obtained by extracting the speaker label of each speaker through a neural network. The speaker label of each speaker can be pre-labeled on the speaker, or it can be manually labeled according to the extraction order after the speaker is extracted to obtain the speaker label of each speaker.
[0056] Specifically, the speaker label corresponds to an N-dimensional vector Lx; for the first speaker, Lx = [1, 0, ..., 0]; for the second speaker, Lx = [0, 1, ..., 0], that is, the dimension corresponding to the speaker is 1, and the other dimensions are 0; it can be understood that the speaker label is unique and corresponds one-to-one with the speaker, that is, the speaker can be uniquely identified through the speaker label.
[0057] The posterior probability of each speech file can be obtained by inputting all speech files into a neural network and calculating the posterior probability of each speech file through the output layer of the neural network. Specifically, the output layer of the neural network calculates the prior probability and likelihood function of each speech file and then uses Bayes' theorem to obtain the posterior probability of each speech file.
[0058] S112. Based on the posterior probability of each speech file and the user information of the corresponding speaker, obtain the cross-entropy of the speech file.
[0059] For example, if there are N voice actors, and each voice actor corresponds to M audio files, then the posterior probability of each audio file is:
[0060] P xy ;x=1,2,…,N; y=1,2,…,M
[0061] The user information for each speaker is as follows:
[0062] L x =[0,0,…,0,1,0,…]; x=1,2,…,N
[0063] The cross-entropy of each audio file is:
[0064]
[0065] It is understandable that the cross-entropy of each audio file represents the degree of similarity between that audio file and other audio files corresponding to the same speaker; specifically, the smaller the cross-entropy value of an audio file, the more similar that audio file is to other audio files corresponding to the same speaker, and the less likely there is harmful information in that audio file.
[0066] S113. Take the mean of the cross-entropy of each speech file corresponding to the same speech object as the convergence value of the training file corresponding to that speech object.
[0067] The mean can be obtained by directly summing the cross-entropies of each speech file and dividing by the number of speech files; or by weighted summing the cross-entropies of each speech file and dividing by the number of speech files. The weights can be allocated by extracting features from each speech file and assigning weights based on the number of features in each speech file. For example, the more features a speech file contains, the higher the weight of the cross-entropy of that speech file.
[0068] It is understandable that the smaller the cross-entropy of the speech files corresponding to the same speech object, the smaller the convergence value of the training file corresponding to that speech object; that is, the smaller the cross-entropy of the speech files corresponding to the same speech object, the higher the similarity between the multiple speech files corresponding to that speech object, the lower the possibility of there being bad speech files, and the more suitable the training file corresponding to that speech object is for model training.
[0069] Understandably, in other implementations, the convergence value can be characterized by cosine similarity or confidence. For example, if cosine similarity is used to characterize the convergence value, it is necessary to extract features from the speech files corresponding to the same object using a neural network to obtain feature vectors for each speech file, calculate the cosine distance between the feature vectors of each speech file, and then calculate the average of the cosine distances for each speech file corresponding to the same speaker to obtain the convergence value of the training file corresponding to that speaker.
[0070] S120. Construct multiple training sample sets based on the convergence values of each training file, with each training sample set including at least one training file.
[0071] The multiple training sample sets can be parallel or contain each other. There are several ways to construct training sample sets based on the convergence values of each training file. One method is to sort the training files according to their convergence values and select a fixed number of training files each time to form a training sample set, so that each training sample set contains the same number of training files. Another method is to select training files in an accumulative manner. For example, the first training file can be selected to form the first training sample set, and the second and third training files can be selected to form the second training sample set. Alternatively, the first training file can be selected to form the first training sample set, and the first and second training files can be selected to form the second training sample set, etc. The specific construction method is not limited here.
[0072] In some implementations, such as Figure 5 , Figure 5 Given Figure 3 A flowchart of step S120 is shown. Step S120 includes:
[0073] S121. Sort the training files in ascending order based on the convergence value to obtain N training files after sorting.
[0074] It is understandable that among N training files arranged in ascending order, the training files at the top of the list are less likely to contain bad information.
[0075] S122. Construct N training sample sets based on the N training files after permutation.
[0076] The i-th training sample set includes the first i training files from the N training files after sorting, where i is an integer less than or equal to N.
[0077] It is understandable that as i increases, the number of training files contained in the training sample set gradually increases, and the convergence value of the training files gradually increases, which means that the possibility of bad information in the training files increases.
[0078] In this case, adjacent training sample sets differ by only one training file. For example, the i-th training sample set has one more training file than the (i-1)-th training sample set. The extra training file is the i-th training file among the N training files after they are arranged.
[0079] S130. Test the models trained on each training sample set based on the test set, and obtain the error rate corresponding to each training sample set.
[0080] The test set is a dataset used to evaluate the model's generalization ability; the test set contains multiple test samples with sample labels; test samples can be obtained by collecting real data in the target use scenario and labeling the collected real data.
[0081] It is understandable that, since multiple models are tested on the same test set, the performance of each model on the same test set can be judged by comparing the test results of the multiple models on the same test set. At the same time, since the test samples in the test set are obtained based on real data in the target use scenario, the test results obtained by testing the model using the test set can, to a certain extent, represent the performance of the model in the actual use scenario.
[0082] In some implementations, such as Figure 6 , Figure 6 Given Figure 3 A flowchart of step S130 is shown. Step S130 includes:
[0083] S131. Train the model based on each training sample set to obtain the trained model corresponding to each training sample set.
[0084] It is understandable that there is a one-to-one correspondence between the training sample set and the trained model, and the only difference between the models is the different training sample sets used.
[0085] S132. Input multiple test samples from the test set into the trained models corresponding to each training sample set for testing, and obtain the test results of each model for each test sample.
[0086] Each test sample has a sample label, which is pre-labeled in the corresponding test sample; the test samples and their corresponding sample labels constitute the test set.
[0087] S133. Based on the test results of each model on each test sample and the sample labels of each test sample, obtain the error rate of the training sample set corresponding to each model.
[0088] There are several ways to calculate the error rate. One method is to calculate the similarity between the test result of each test sample in the test set and the sample label, obtain the similarity result of each test sample, and then calculate the average of the similarity results of all test samples in the test set. The average of the similarity results is used to characterize the error rate. The higher the similarity result, the lower the error rate. Another method is to calculate the similarity between the test result of each test sample in the test set and the sample label, and determine the test samples with similarity results below a preset threshold as test errors. The error rate is obtained by calculating the proportion of test samples with test errors to the total number of test samples. The specific calculation method of the error rate is not specifically limited here.
[0089] Understandably, the lower the error rate of a model, the better its recognition performance in the recognition stage.
[0090] S140. Select a target training sample set based on the error rate corresponding to each training sample set, and select a target training file from N training files based on the selected target training sample set.
[0091] The selected target training files are used to train the model and obtain the trained data processing model. The target training sample set is selected based on the error rate of each training sample set. This can be done by selecting the training sample set with the lowest error rate or by selecting the training sample set with an error rate within a certain range.
[0092] It is understandable that the target training sample set can be one or multiple. When there is only one target training sample set, selecting the target training file from N training files based on the selected target training sample set is equivalent to selecting the training file corresponding to the target training sample set as the target training file. When there are multiple target training sample sets, there can be multiple ways to select the target training file from N training files based on the selected target training sample set. When multiple target training sample sets are independent of each other, the training file corresponding to each target training sample set can be selected as the target training file. When multiple target training sample sets have an intersection, the training file corresponding to the intersection of multiple target training sample sets can be selected as the target training file.
[0093] In some implementations, such as Figure 7 , Figure 7 Given Figure 3 The flowchart of step S140 is shown below. Based on the training sample set constructed in steps S121 and S122, step S140 also includes:
[0094] S141. Construct an error rate curve from the first training sample set to the Nth training sample set based on the error rate corresponding to each training sample set.
[0095] The error rate curve is constructed by using each training sample set as the horizontal axis and the error rate as the vertical axis, and then using a smooth curve to connect the error rates corresponding to the first training sample set to the Nth training sample set in sequence, thus obtaining the error rate curve.
[0096] Understandably, from the first training sample set to the Nth training sample set, the number of training files in the training sample set continuously increases. At the same time, the possibility of bad information in the newly added training files also increases. When there are enough training sample sets, the ideal error rate curve should show a V-shaped trend. That is, as the number of training files in the training sample set increases, the model fits better and better, and the error rate gradually decreases. However, when the number of training files increases to a certain extent, bad information in the training files affects the model training, causing the model to overfit, thus gradually increasing the error rate.
[0097] S142. Use the training sample set corresponding to the lowest point of the error rate curve as the target training sample set.
[0098] It is understandable that in the training sample set before the lowest point of the error rate curve, the bad information in the training files has a small impact on model training, but the number of training files is too small, which leads to model overfitting and thus affects the model's error rate. In the training sample set after the lowest point of the error rate curve, the number of training files is large, but the bad information in the training files has a large impact on model training, which leads to model overfitting. Neither of these scenarios can achieve good model training results.
[0099] S143. Use the training file corresponding to the target training sample set as the target training file.
[0100] For example, if the target training sample set is the i-th training sample set, then the target training file is the first i training files among the N training files after sorting.
[0101] In other implementations, such as Figure 8 , Figure 8 Given Figure 3 Another flowchart of step S140, based on the training sample set constructed in steps S121 and S122, further includes:
[0102] S144. Construct an error rate curve from the first training sample to the Nth training sample based on the error rate corresponding to each training sample set.
[0103] The specific description of step S144 can be found in the previous description of step S141, and will not be repeated in this embodiment.
[0104] S145. Extract the curve segment with a negative slope from the error rate curve as the target curve segment.
[0105] The target curve segment can be one segment or multiple segments.
[0106] It is understandable that the error rate is affected by both the quantity and quality of training samples. The quality of training samples refers to the proportion of bad or redundant information in the training samples. When the quality of newly added training samples is low, that is, when there is a lot of bad information in the training samples, even if the number of training samples increases, the bad information has a greater impact on the model, which will lead to an increase in the model's error rate and cause fluctuations in the error rate curve. On the other hand, a curve segment with a negative slope in the error rate curve means that the addition of that training sample will reduce the error rate, that is, the training sample is beneficial to the model training. Therefore, by extracting the curve segment with a negative slope in the error rate curve as the target curve segment, we can obtain all the training sample sets corresponding to the target curve segment, and thus obtain the corresponding training file.
[0107] Furthermore, the target curve segment can be selected from the error rate curve with a negative slope. This can be done by selecting the entire error rate curve or by selecting the curve between the start and the lowest point of the error rate curve. It is understood that the larger the area selected, the more training files are obtained, but the greater the possibility of bad information in the training files. The specific selection method can be set according to actual needs, and no specific limitation is made here.
[0108] S146. Use the training sample sets corresponding to the start and end points of each target curve segment as the target training sample set.
[0109] It is understandable that the training sample sets corresponding to the start and end points of each target curve segment differ by at least one training file.
[0110] S147. Delete the training file in the training sample set corresponding to the starting point of the target curve segment from the training file included in the training sample set corresponding to the end point of each target curve segment to obtain the training file for each target curve segment.
[0111] It is understandable that the decrease in the error rate of the target curve segment is due to the addition of more training files in the training sample set corresponding to the endpoint than in the training sample set corresponding to the starting point.
[0112] For example, if the training sample set corresponding to the starting point of the target curve segment is the (i-2)th training sample set and the training sample set corresponding to the ending point is the ith training sample set, then the training files corresponding to the target curve segment are the (i-1)th training file and the ith training file.
[0113] S148. Obtain the training file corresponding to each target curve segment and the first training file among the N arranged training files as the target training file.
[0114] It is understandable that the first training file in the N training files after arrangement is included because the first training file has the lowest convergence value, that is, the possibility of bad information in the training file is the lowest. At the same time, it can further increase the number of target training files, thereby improving the training effect of the target training files on the model.
[0115] By employing the data selection method provided in this application embodiment, before training the model using training files, N training files are obtained. The cross-entropy of each training file is calculated, and the training files are sorted in ascending order based on the cross-entropy. A training sample set is constructed using the sorted N training files, where the i-th training sample set contains the first i sorted training files. The model is trained using each training sample set to obtain the trained model. The trained model is then tested using test samples from the test set to obtain the error rate of each model, thereby obtaining the error rate of each training sample set corresponding to the model. An error rate curve is constructed from the first training sample set to the Nth training sample set. A target curve segment with a decreasing trend is selected from the error rate curve, and the training file corresponding to the target curve segment is used as the target training file to train the model using the target training file. The model is trained using the aforementioned data selection method. This method selects training files based on cross-entropy, ensuring the chosen target training files are those with lower cross-entropy. Furthermore, by constructing a progressively accumulating training sample set and corresponding error rate curves, the model selects the training sample size, addressing the problem of experience-based sample selection in existing training methods. Simultaneously, the error rate of the training sample set is obtained from the test set results, which represent the actual recognition performance. This allows for selection of training files based on recognition performance, resolving the issue that training and recognition samples are independent, and the recognition performance cannot guide the training strategy. By training the model using target training files, the trained model can achieve better performance in the recognition stage.
[0116] like Figure 9 , Figure 9 A flowchart illustrating another data selection method provided in an embodiment of this application is given. The data selection method includes:
[0117] S210. Obtain N training files and the convergence value corresponding to each training file.
[0118] S220. Construct multiple training sample sets based on the convergence values of each training file, with each training sample set including at least one training file.
[0119] S230. Test the models trained on each training sample set based on the test set, and obtain the error rate corresponding to each training sample set.
[0120] S240. Select a target training sample set based on the error rate corresponding to each training sample set, and select a target training file from N training files based on the selected target training sample set.
[0121] The specific descriptions of steps S210-S240 can be found in the previous embodiment's description of steps S110-S140, and will not be repeated in this embodiment.
[0122] S250. Train multiple candidate models based on the target training file to obtain multiple trained candidate models, which are models with different parameters.
[0123] The candidate model can be a combination of backend models; for example, the combination of backend models can be length regularization, principal component analysis, linear discriminant analysis, and probability linear discriminant analysis.
[0124] Specifically, different parameters for the backend model combination can include dimensionality reduction parameters, total covariance factor, whether mean normalization is required, whether variance normalization is required, and the number of iterations, etc. The specific parameters can be selected according to actual needs.
[0125] Understandably, in order to obtain the optimal parameter configuration, it is necessary to enumerate and train each parameter of the candidate model.
[0126] S260. Input multiple test samples from the test set into each trained candidate model for testing, and obtain the test results of each candidate model for each test sample.
[0127] Each test sample has a sample label.
[0128] S270. Based on the test results of each candidate model on each test sample and the sample labels of each test sample, obtain the similarity results corresponding to each candidate model;
[0129] The process of obtaining the similarity result of each candidate model using the test samples of the test set is the same as or similar to the process of obtaining the error rate of each training sample set using the test samples of the test set in the previous embodiment. Therefore, the specific description of steps S260-S270 can be found in the specific description of steps S132-S133 in the previous embodiment, and will not be repeated in this embodiment.
[0130] S280. Based on the similarity results, select the candidate model with the highest similarity as the target model, and use the selected target training file to train the target model to obtain the trained data recognition model.
[0131] By employing the data selection method provided in this application embodiment, after selecting the training file, the candidate models with different parameters are enumerated and trained using the selected training file to obtain the trained candidate models. Then, each trained candidate model is tested using the same test set to obtain the similarity result corresponding to each trained candidate model. Thus, the target candidate model with the highest similarity result is selected, and the target model is trained using the selected target training file to obtain the trained data recognition model. Therefore, based on the selection of the target training file, the model parameters are further selected so that the trained data recognition model can perform better in the recognition stage.
[0132] like Figure 10 , Figure 10 This application provides a data selection device 310, which includes:
[0133] The acquisition module 320 is used to acquire N training files and the convergence value corresponding to each training file.
[0134] The acquisition module 320 can acquire any number of training files, or it can acquire them based on preset rules. The preset rules are not specifically limited in this embodiment.
[0135] Understandably, module 320 could also acquire only N training files and then calculate the convergence value from the acquired training files.
[0136] In some implementations, each training file includes multiple speech files, and the multiple speech files correspond to the same speaker. The acquisition module 320 includes a capture unit and a calculation unit. The capture unit is used to acquire the speech files, the speaker, the user information of the speaker, and the posterior probability of each speech file. The calculation unit is used to calculate the cross-entropy of each speech file based on the posterior probability of each speech file and the user information of the corresponding speaker. The average cross-entropy of each speech file corresponding to the same speaker is calculated as the convergence value of the training file corresponding to the speaker.
[0137] Module 330 is used to construct multiple training sample sets based on the convergence values of each training file, and each training sample set includes at least one training file.
[0138] In one possible implementation, the construction module 330 may further include a sorting unit and a combination unit. The sorting unit is used to sort the training files according to the convergence value to obtain N training files after sorting; the sorting method can be ascending, descending, selection sort, etc., and the specific sorting method can be set according to actual needs; the combination unit is used to combine the sorted training files to construct multiple training sample sets, and the combination method can be set according to actual needs. In this embodiment, the i-th training sample set includes the first i training files in the N training files after sorting, where i is an integer less than or equal to N.
[0139] The testing module 340 is used to test the models trained on each training sample set based on the test set, and to obtain the error rate corresponding to each training sample set.
[0140] In one possible implementation, the testing module 340 includes a sample training unit, a sample testing unit, and an error rate calculation unit. The sample training unit is used to train the model according to each training sample set to obtain the trained model corresponding to each training sample set; the sample testing unit is used to input multiple test samples from the test set into the trained model corresponding to each training sample set for testing to obtain the test result of each model on each test sample, and each test sample has a sample label; the error rate calculation unit is used to obtain the error rate of the training sample set corresponding to each model according to the test result of each model on each test sample and the sample label of each test sample.
[0141] The selection module 350 is used to select a target training sample set based on the error rate corresponding to each training sample set, and to select a target training file from N training files based on the selected target training sample set.
[0142] The specific method for selecting the target training file can be either continuous selection or intermittent selection.
[0143] In one possible implementation, the selection module 350 further includes a drawing unit, a truncating unit, and a confirmation unit; the drawing unit is used to construct an error rate curve from the first training sample set to the Nth training sample set based on the error rate corresponding to each training sample set; the truncating unit is used to truncate the error rate curve that meets preset requirements; the confirmation unit is used to select a target training sample set based on the truncated error rate curve, and select a target training file from N training files based on the selected target training sample set.
[0144] In one possible implementation, the truncation unit truncates the error rate curve from the start point to the lowest point; the confirmation unit confirms the training sample set corresponding to the lowest point of the error rate curve as the target training sample set, and uses the training file corresponding to the target training sample set as the target training file.
[0145] In another possible implementation, the truncation unit truncates the curve segment with a negative slope in the error rate curve as the target curve segment; the confirmation unit confirms the training sample sets corresponding to the start and end points of each target curve segment as the target training sample sets, deletes the training files in the training sample set corresponding to the start point of each target curve segment from the training files included in the training sample set corresponding to the end point of each target curve segment, and obtains the training file for each target curve segment; and obtains the training file corresponding to each target curve segment and the first training file in the N arranged training files as the target training file.
[0146] In one possible implementation, the data selection device 310 further includes a parameter confirmation module; the parameter confirmation module is used to determine the optimal parameters of the model when training using the target training file.
[0147] Specifically, the parameter confirmation module also includes a parameter training unit, a parameter testing unit, and a selection unit. The parameter training unit is used to train multiple candidate models according to the target training file to obtain multiple trained candidate models, which are models with different parameters. The parameter testing unit is used to input multiple test samples from the test set into each trained candidate model for testing, and obtain the test results of each candidate model on each test sample. Each test sample has a sample label, and based on the test results of each candidate model on each test sample and the sample labels of each test sample, the similarity result corresponding to each candidate model is obtained. The selection unit is used to select the candidate model with the highest similarity result as the target model according to the similarity result, and use the selected target training file to train the target model to obtain the trained data recognition model.
[0148] The following will combine Figure 11 This application provides a description of an electronic device 410.
[0149] Based on the data selection method provided in the above embodiments, this application also provides an electronic device 410, such as... Figure 11 , Figure 11A structural block diagram of an electronic device 410 according to an embodiment of this application is provided. The electronic device 410 includes one or more processors 420; a memory 430; and one or more programs. The one or more programs are stored in the memory 430 and configured to be executed by the one or more processors 420, and the one or more programs are configured to perform the methods described above.
[0150] Among them, electronic device 410 can be server 20 or terminal device 10. Terminal device 10 can be a smartphone, tablet computer, computer or portable computer or other device capable of acquiring voice information and performing voiceprint recognition.
[0151] Processor 420 may include one or more processing cores. Processor 420 connects to various parts of the wearable device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 430, and by calling data stored in memory 430. Optionally, processor 420 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 420 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 420 and may be implemented separately through a communication chip.
[0152] The memory 430 may include random access memory (RAM) or read-only memory (ROM). The memory 430 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 430 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 410 during use.
[0153] like Figure 12 , Figure 12 This application provides a computer-readable storage medium 510, which stores program code that can be called by a processor 420 to execute the methods described in the above method embodiments.
[0154] Computer-readable storage medium 510 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage medium 510 includes a non-transitory computer-readable storage medium. Computer-readable storage medium 510 has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code may be compressed in an appropriate form.
[0155] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A data selection method, characterized by, The method includes: Obtain N training files and the convergence value corresponding to each training file, where N is an integer greater than or equal to 1, and the magnitude of the convergence value is used to characterize the speed of model convergence when the training file is used for model training; Constructing multiple training sample sets based on the convergence values of each training file includes: arranging each training file in ascending order based on the convergence values to obtain N training files after arrangement; constructing N training sample sets based on the N training files after arrangement, wherein the i-th training sample set includes the first i training files of the N training files after arrangement, where i is an integer less than or equal to N; The model trained on each of the training sample sets is tested based on the test set to obtain the error rate corresponding to each of the training sample sets. Based on the error rate corresponding to each training sample set, a target training sample set is selected, and a target training file is selected from the N training files based on the selected target training sample set, so as to use the selected target training file to train the model and obtain the trained data processing model.
2. The data selection method of claim 1, wherein, Each training file includes multiple speech files, and the multiple speech files correspond to the same speaker. Obtaining the convergence value for each training file includes: Obtain user information for each of the aforementioned voice-generating objects and the posterior probability of each of the aforementioned audio files; Based on the posterior probability of each audio file and the user information of the corresponding speaker, the cross-entropy of the audio file is obtained. The mean of the cross-entropy of each of the speech files corresponding to the same speech object is used as the convergence value of the training file corresponding to that speech object.
3. The data selection method of claim 1, wherein, The selection of the target training sample set based on the error rate corresponding to each training sample set includes: Construct an error rate curve from the first training sample set to the Nth training sample set based on the error rate corresponding to each training sample set; The training sample set corresponding to the lowest point of the error rate curve is used as the target training sample set.
4. The data selection method of claim 1 or 3, wherein, The selection of the target training sample set based on the error rate corresponding to each training sample set includes: Construct an error rate curve from the first training sample to the Nth training sample based on the error rate of each training sample set; The segment with a negative slope in the error rate curve is selected as the target curve segment. The training sample sets corresponding to the start and end points of each target curve segment are used as the target training sample sets.
5. The data selection method of claim 4, wherein, The selection of target training files from N training files based on the selected target training sample set includes: The training files corresponding to the starting point of each target curve segment are deleted from the training files included in the training sample set corresponding to the end point of each target curve segment to obtain the training files for each target curve segment. Obtain the training file corresponding to each target curve segment and the first training file among the N arranged training files as the target training file.
6. The data selection method of claim 1, wherein, The step of testing the models trained on each of the training sample sets based on the test set to obtain the error rate corresponding to each of the training sample sets includes: The model is trained based on each of the training sample sets to obtain the trained model corresponding to each of the training sample sets; Multiple test samples from the test set are input into the trained models corresponding to each training sample set for testing, and the test results of each model for each test sample are obtained. Each test sample has a sample label. Based on the test results of each model on each test sample and the sample labels of each test sample, the error rate of the training sample set corresponding to each model is obtained.
7. The data selection method according to claim 1, characterized in that, After selecting the target training file from N files based on the selected target training sample set, the method further includes: Multiple candidate models are trained based on the target training file to obtain multiple trained candidate models, wherein the candidate models are models with different parameters; Multiple test samples from the test set are input into each trained candidate model for testing, and the test results of each candidate model for each test sample are obtained. Each test sample has a sample label. Based on the test results of each candidate model on each test sample and the sample labels of each test sample, the similarity results corresponding to each candidate model are obtained. Based on the similarity results, the candidate model with the highest similarity result is selected as the target model; The target model is trained using the selected target training file to obtain the trained data recognition model.
8. A data selection device, characterized by include: The acquisition module is used to acquire N training files and the convergence value corresponding to each training file; A construction module is used to construct multiple training sample sets based on the convergence values of each training file, including: arranging each training file in ascending order based on the convergence values to obtain N training files after arrangement; constructing N training sample sets based on the N training files after arrangement, wherein the i-th training sample set includes the first i training files in the N training files after arrangement, and i is an integer less than or equal to N; The testing module is used to test the models trained on each of the training sample sets based on the test set, and to obtain the error rate corresponding to each training sample set. The selection module is used to select a target training sample set based on the error rate corresponding to each training sample set, and to select a target training file from the N training files based on the selected target training sample set.
9. An electronic device, comprising: include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.