Noisy sample identification method and device, computer equipment and storage medium
By dividing the training set into multiple training batches and identifying noise-bound samples using training loss ranking, the training instability problem caused by noise-bound samples in machine learning models is solved, and the improvement of model performance and training stability is achieved.
Patent Information
- Application Number
- CN202411620410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-25
AI Technical Summary
During the training process, the existing machine learning models have degraded model performance and instability in training, and it is difficult for the existing technology to effectively identify and process noise-free samples.
By dividing the training set into multiple training batches, the noise-band samples and noise-free samples form a training batch. The training loss ranking is used to identify the noise-band samples, and integrate them into the training process to make the loss different from the noise-free samples, which is easy to identify.
Accurate identification and removal of noise-bound samples is achieved, the training stability and final performance of the model are improved, and the impact of parameter changes on recognition accuracy is avoided due to model training.
Smart Images

Figure CN119691445A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a noisy sample recognition method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0002] In existing machine learning training, model parameters are generally learned through a large amount of manually annotated training data, resulting in uneven annotation quality. Therefore, the problem of noisy machine learning samples is common in the field of machine learning. When a large number of samples with significant noise are used to train the model, it will seriously affect the model performance and stability. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application provide a noisy sample recognition method, apparatus, computer device and computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides a noisy sample recognition method, comprising:
[0005] Obtaining a training set, where samples in the training set are divided into multiple training batches;
[0006] In each training round, the model is trained based on the samples of each training batch, and the training loss of the samples of each training batch is obtained;
[0007] Based on the training loss of the samples in each training batch, determine the loss ranking of each sample in the training batch to which it belongs;
[0008] Based on the loss ranking of each sample in the training batch in all training rounds, the noisy samples in the training set are determined.
[0009] In a second aspect, an embodiment of the present application provides a noisy sample identification device, comprising:
[0010] An acquisition module, used to acquire a training set, where samples in the training set are divided into multiple training batches;
[0011] A training module is used to train the model based on the samples of each training batch in each training round to obtain the training loss of the samples of each training batch;
[0012] A ranking module, used to determine the loss ranking of each sample in the training batch based on the training loss of the samples in each training batch;
[0013] The determination module is used to determine the noisy samples in the training set based on the loss ranking of each sample in the training batch to which it belongs in all training rounds.
[0014] In a third aspect, an embodiment of the present application further provides a computer device, including a memory storing a plurality of instructions; a processor loads the instructions from the memory to execute the steps of any one of the noisy sample identification methods provided in the embodiments of the present application.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps of any noisy sample identification method provided in the embodiment of the present application.
[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of any noisy sample identification method provided in the embodiment of the present application.
[0017] The scheme of the embodiment of the application is adopted, by obtaining a training set, the samples in the training set are divided into multiple training batches, and by dividing the training set into multiple training batches, the noisy samples and other noise-free samples form a training batch of samples, and the noisy samples in the samples of a training batch are more prominent and easier to be screened out; in each training round, the model is trained based on the samples of each training batch, and the training loss of the samples of each training batch is obtained, and the identification of noisy samples is integrated into the training process of the samples, so that there is a difference between the training losses of the noisy samples and the noise-free samples output after training, which is convenient for identifying the noisy samples ; Furthermore, based on the training loss of the samples in each training batch, the loss ranking of each sample in its training batch is determined, and the distribution of training losses of each sample in a training batch is characterized by the loss ranking, which can accurately compare the difference in training losses between noisy samples and noise-free samples in the same training batch, greatly ensuring the accuracy of the identified noisy samples and avoiding the influence of parameter changes on recognition accuracy during model training; thus, based on the relative loss ranking of each sample in all training rounds in its training batch, the noisy samples in the training set are determined, and the noisy samples can be accurately identified from the training set. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 Schematic diagram of the application environment of the noisy sample recognition method provided in the embodiment of the present application;
[0020] Figure 2This is a flow chart of an embodiment of the training phase provided in the embodiments of the present application;
[0021] Figure 3 is a flowchart of another embodiment of the training phase provided in the embodiments of the present application;
[0022] Figure 4 This is a flow chart of an embodiment of a method for identifying noisy samples provided in an embodiment of the present application;
[0023] Figure 5 It is a schematic diagram of the principle of an embodiment of the present application for calculating the relative loss ranking of each sample in each training batch in any training round;
[0024] Figure 6 This is a schematic diagram of an application example of the polyphone recognition model provided in the embodiment of the present application during the training process;
[0025] Figure 7 This is a schematic diagram of an application example of the polyphone recognition model provided in the embodiments of the present application during application;
[0026] Figure 8 is a flowchart of another embodiment of the noisy sample identification method provided in the embodiments of the present application;
[0027] Fig. 9 It is a schematic diagram of an application scenario of an embodiment of the noisy sample recognition method provided in the embodiments of the present application;
[0028] Fig.10 is a schematic diagram of the structure of a noisy sample recognition device provided in an embodiment of the present application;
[0029] Fig.11 It is a schematic diagram of the internal structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0031] In order to better understand the noisy sample recognition method, device, electronic device and storage medium provided in the embodiments of the present application, the application environment applicable to the embodiments of the present application is described below.
[0032] See also Figure 1 , Figure 1 A schematic diagram of an application environment of the noisy sample recognition method provided by an embodiment of the present application is shown. As an implementation mode, the noisy sample recognition method, the training method of the noisy sample recognition method model and the noisy sample recognition method provided by the embodiment of the present application can be applied to the same electronic device. The electronic device can be as follows: Figure 1 The server 110 shown in the figure can be connected to the terminal device 120 through a network. The network is used to provide a medium for a communication link between the server 110 and the terminal device 120. The network can include various connection types, such as a wired communication link, a wireless communication link, etc., which are not limited in the embodiments of the present application. Optionally, in other embodiments, the electronic device can also be a smart phone, a laptop computer, etc.
[0033] It should be understood that Figure 1 The server 110, network and terminal device 120 are merely illustrative. Depending on the implementation requirements, there may be any number of servers, networks and terminal devices. For example, the server 110 may be a physical server or a server cluster composed of multiple servers, and the terminal device 120 may be a mobile phone, a tablet, a desktop computer, a laptop computer, and the like. It is understood that the embodiments of the present application may also allow multiple terminal devices 120 to access the server 110 at the same time.
[0034] In some embodiments, the terminal device 120 collects samples and sends the samples to the server 110 through the network. After receiving the samples, the server 110 can process the audio data using the noisy sample recognition method of the embodiment of the present application.
[0035] The following is a detailed description with reference to the accompanying drawings. In the above embodiments, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.
[0036] In related technologies, the parameters of machine learning models are generally learned through a large amount of manually annotated training data. Due to the different depth of domain knowledge learning of different annotators, as well as their understanding of the task, or their physical and mental state when working, the quality of annotations varies. Another type of machine learning sample is obtained through open source data. The data quality of open source data sets is even less guaranteed. Therefore, the problem of machine learning sample noise is common in the field of machine learning. A considerable amount of training data with significant noise will have a great adverse effect on model training. This impact may be on the stability of the training process, or it may be reflected in the weakening of the final model effect.
[0037] When the samples contain a considerable proportion of noisy samples, or contain a small number of samples with serious problems, the effectiveness of the training set will be significantly affected. Using such a training set for model training will lead to extremely unstable model training, resulting in gradient loss, gradient explosion, or model non-convergence, and seriously affecting model performance, resulting in low inference accuracy or recall.
[0038] For example, in the Text To Speech (TTS) machine learning task, the samples are voice recordings and transcribed texts, and there may be inconsistencies between the voice and text. For example, the voice in the recording said 100 words, but the corresponding annotated text only has two words. Another example is that the recording is a blank recording, but the corresponding annotated text is a complete sentence. This noisy sample can easily cause training instability and even cause the training process to crash. For another example, in a text classification task, if there are a considerable number of mislabeled classification labels, the classification accuracy and recall ability of the final model will be significantly reduced.
[0039] However, the existing machine learning training process does not have the ability to identify and process noisy samples. The method of manually proofreading a large number of training sets is not only extremely costly, but also extremely unreliable because many noisy samples themselves are labeling errors introduced during manual labeling.
[0040] In view of this, the present application provides a noisy sample identification method, which can accurately identify noisy samples from a training set and process the noisy samples, thereby avoiding the adverse effects of noisy samples on the machine learning process and the performance of its resulting model.
[0041] The noisy sample identification method provided in the embodiment of the present application is applied to the training process of the model, and in particular, it is set after the model preheating training and before the formal model training, so that there is no need to perform additional denoising on the samples separately. And in different model tasks, a single denoising method is difficult to deeply integrate with the model training process, and it is difficult to ensure that under a given model training task, noisy samples are effectively screened out and noise-free samples are retained. The noisy sample identification method provided in the embodiment of the present application can introduce noisy sample identification into the machine learning model training process, that is, identify and mark noisy samples during the training process, thereby reducing the impact of noisy samples on training. And in particular, the noisy sample identification method provided in the embodiment of the present application is suitable for the early or mid-term training process, and the later model has tended to converge. Since the model has been trained in the early and mid-term based on the noisy training set, at this time, not only the accuracy of identifying noisy samples is reduced, but the model has been trained based on the noisy training set, and the performance of the model is also affected.
[0042] For example, the following processes and steps are usually required in machine learning tasks:
[0043] Step a: Collect and process data related to the machine learning task to form a training data set. The training data set includes a training set, a validation set, and a test set.
[0044] Step b: Write the model structure code related to the target task, that is, define the model structure. According to the target learning task, write code to define the structural composition and model configuration of the model. The model configuration mainly includes the model's hyperparameters and specific values.
[0045] Step c: Write the program required for model training, that is, define the model training process pipeline, debug the program, and adjust and optimize the relevant hyperparameters.
[0046] Step d: Use the written program to train the defined model structure with the collected training data to make the model parameters converge.
[0047] Among them, the model training pipeline refers to the process and steps of executing the model training program, including program debugging and adjustment and optimization of hyperparameters. Among them, hyperparameters include model data hyperparameters, model definition hyperparameters, and model training hyperparameters. Among them, model data hyperparameters refer to a set of hyperparameters that describe the characteristics of model training data, such as the sampling rate of audio data. Model definition hyperparameters refer to the set of hyperparameters of each layer of the model, which are used to specify a model of a specific scale. For example, the linear layer has hyperparameters for input dimensions and output dimensions. Model training hyperparameters refer to a set of hyperparameters in the model training process, which are generally related to model training functions, such as loss functions.
[0048] Among them, the loss function is used to measure the inference results of the model. The function of the gap between the model output and the actual result is defined as the loss function. For example, the cross entropy loss function is the cross entropy value between the probability distribution of the magic inference and the real probability distribution, which measures the loss caused by the model inference. The purpose of model training is usually to minimize the loss function.
[0049] During the training process, the samples in the training set are used as input for model inference, and the loss function is calculated with the true labeled values of the samples. The obtained loss value is called training loss.
[0050] In some embodiments, Figure 2 As shown, the training process of machine learning includes at least a preheating training subprocess and a model training subprocess. Then the steps of the noisy sample identification method provided in this application are arranged between the preheating training subprocess and the model training subprocess, that is, the noisy sample detection subprocess.
[0051] Warmup training refers to warming up with certain training steps or training rounds (epochs) at the beginning of model training. If the learning rate is too small, the training converges slowly, and if the learning rate is too large, the training may be unstable or only a suboptimal solution can be obtained. Therefore, a fixed small learning rate is used in warmup training, or a learning rate that gradually increases from the minimum value is used for learning, so that the parameters of the model are better initialized in the warmup training, thus preparing for subsequent model training.
[0052] During the training process, when all samples in the training set have completed one training round, it is called an epoch. Generally speaking, one training round consists of multiple training steps. For example, if the total number of samples in the training set is 128,000 and the training batch size (batch_size) is 128, it takes 1,000 training steps to complete one training round.
[0053] Among them, the samples of a training batch refer to the samples input into the model for training in each training step. The training batch size is a basic model training hyperparameter. For example, when batch_size is 128, it means that the number of samples processed in parallel for each training step is 128. The process of completing a training of samples in a training batch is called completing a training step.
[0054] In other embodiments, Figure 3As shown, when the machine learning model has been fine-tuned with hyperparameters, model training can be directly carried out without preheating training. Then the steps of the noisy sample recognition method of this application are set before model training. That is, the training process of machine learning includes: a noisy sample detection subprocess and a model training subprocess.
[0055] Please refer to Figure 4 , the specific process of this noisy sample recognition method can be as follows in steps 401 to 404, where:
[0056] Step 401, obtain a training set, and the samples in the training set are divided into multiple training batches.
[0057] Among them, the training set refers to all the data that directly participates in training the model parameters to convergence during the machine learning process. These data are called training samples or samples.
[0058] Among them, the noisy data is called a noisy sample. Noisy data refers to data that deviates from or is incorrect from the true value, and these data will affect the model performance and the accuracy of the inference result. Noisy data mainly includes incorrect data, false data, and abnormal data, etc. The types of samples and noisy samples vary with different model training tasks.
[0059] Exemplarily, in the polyphonic character classification task, the model is a polyphonic character model, which is used to identify the correct pronunciation of a polyphonic character at a specific position in the input Chinese sentence. For example, for a sentence: "It's not okay for the bank to do this", the model needs to identify that the correct pronunciation of the character "行" in "银行" is "hang2" (the number "2" indicates the second tone), and identify that the correct pronunciation of the character "行" in "不行" is "xing2".
[0060] In this classification task, the noisy sample can be a sample with incorrect annotation. For example, the sentence: "I think it's okay to do this", where the annotation of the character "行" is "hang2". The noisy sample can be a sentence that is meaningless, incorrect, or invalid. For example, the sentence "一你是我行哈目首", where the annotation of the character "行" is "hang2", but because the sentence itself is meaningless, incorrect, or invalid, it is also regarded as a noisy sample. The noisy sample can also be a sample with typos or other errors. For example, the sentence "这是一种行天发动机", where the character "行" is a typo of "航", so although the annotation of the character "行" is "hang2", it is still regarded as a noisy sample.
[0061] In some embodiments, a validation set and a test set may also be provided in the embodiments of the present application. Among them, the validation set refers to data that does not directly participate in the training of model parameters to convergence during the machine learning process. The validation set data can be used to monitor the convergence progress and performance change process of the model. For example, in a general deep learning training process, a validation process is required every certain number of training steps. During this verification process, the computer device uses the model under the current parameter value to perform an inference on the validation set and calculate its average inference loss. The loss function value obtained in the verification process is called the validation loss. Unlike the training loss, it will not be sent back to adjust the model parameters, but is only used to measure the performance of the current model. Assuming that the validation loss meets the conditions, it can be determined that the model has completed the training. The test set is a set of data sets that test and identify the performance of the machine learning model after the training of the model is completed.
[0062] Specifically, the computer device may obtain the training set of each training round at one time, and use each training set in the training of the corresponding training round in sequence. Alternatively, the computer device may obtain the training set of one training round at a time, and after the training of the training round is completed, obtain the training set of the next training round, and so on.
[0063] The training set includes samples of multiple training batches. After obtaining the training set, the computer device may divide the samples in the training set according to a preset training batch size to obtain multiple training batches, each of which includes a number of samples.
[0064] Among them, since most of the overall training set are noise-free samples, each training batch may contain no noisy samples or a small number of noisy samples. By dividing the samples into multiple training batches, when noisy samples are combined with other noise-free samples to form a training batch, the loss of noisy samples is always more prominent than the loss of noise-free samples, which can help accurately identify noisy samples from the training set.
[0065] In order for the computer device to locate each sample, in some embodiments, each sample in the training set has a corresponding identifier. For example, after obtaining the training set, the computer device sets a unique identifier for each sample in the training set to distinguish one sample from other samples. The identifier of the sample can be, for example, a number, a letter, or a combination thereof.
[0066] Step 402: In each training round, the model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch.
[0067] Specifically, the computer device performs multiple training rounds of training on the preheated trained model according to a preset number of training rounds. For the sake of simplicity of description, the model used in the embodiments of the present application generally refers to a preheated trained model.
[0068] It should be noted that the training referred to here and in the following text is the process of detecting the model using a training set containing noisy samples before model training. It can be regarded as "simulation" training for the model. After the noisy samples are identified and removed, the model is formally trained using a noise-free sample set, which can greatly improve the model performance and the accuracy of the inference results.
[0069] In each training round, the computer device trains the model using the training set corresponding to the training round. Specifically, in each training round, the computer device inputs the samples of each training batch of the training round into the model in sequence to train the model, that is, inputs a training batch of samples into the model for training each time, thereby obtaining the training loss of each sample in the training batch.
[0070] Step 403: Based on the training loss of the samples in each training batch, determine the loss ranking of each sample in the training batch to which it belongs.
[0071] In the embodiment of the present application, the loss ranking is used to characterize the distribution of the training loss of each sample in a training batch. In particular, the loss ranking can use the relative loss ranking.
[0072] The loss ranking of a sample in its training batch refers to the ranking of the training loss of the sample among the training losses of all samples in the training batch.
[0073] Typically, the computer device sorts the training loss from high to low (or from low to high). When sorting from high to low, the loss of the noisy sample is ranked higher because the training loss of the noisy sample is more prominent than the training loss of the noise-free sample. Alternatively, when sorting from low to high, the loss of the noisy sample is ranked lower.
[0074] Furthermore, no matter what the order of sorting is, it is essentially based on the fact that noisy samples are more prominent in the distribution of training loss than noise-free samples. In other words, the predicted value and the labeled value of noise-free samples tend to be close, resulting in the training loss of noise-free samples being kept in a reasonable range or at a low level (and gradually decreasing with continuous training), while the predicted value of noisy samples is quite different from the labeled value, resulting in the training loss of noisy samples significantly deviating from the training loss of other samples, and with continuous training, the difference between the training loss of noisy samples and the training loss of other samples will become more and more obvious. Therefore, the relative loss ranking can characterize the distribution of the training loss of each sample in a training batch. Among them, if all samples in a training batch are noise-free samples, the distribution of training loss in the batch is relatively uniform and tends to be consistent; if a training batch contains noisy samples, the training loss of the noisy samples in the batch will be more prominent than the training loss of other samples.
[0075] Compared with directly using training loss to screen noisy samples, the relative loss ranking method can identify noisy samples with higher accuracy and is more compatible with different training tasks. This is because when training the model, samples from multiple training batches are usually input in one training step. In other words, the samples in a training batch are completed in the same training step, and the model parameters remain unchanged within a training step, which can greatly ensure the accuracy of the identified noisy samples and remove the inaccurate recognition of the model itself due to the instability in the early stage of model training, and thus it is impossible to determine whether the outstanding training loss is affected by the training itself or the noise factor of the sample.
[0076] Moreover, under different training tasks, the sample categories of the samples are different, which can be text categories, image categories or audio categories, etc., and there are also differences in the quality of the samples themselves under each sample category. Taking the text category as an example, some samples have only a few sub-sections, while some samples have a large number of paragraphs; or taking the image category as an example, the size and resolution of the image are also different. Usually, additional preprocessing methods are used to process the samples, but in the recognition of noisy samples, the preprocessing itself will also affect the recognition of noisy samples. The present application adopts a relative loss ranking method to compare the samples in a training batch, which can greatly reduce the impact of differences between samples, thereby significantly improving the recognition accuracy.
[0077] Furthermore, machine learning models are trained with the goal of minimizing loss. With continuous training, the model gradually converges through iteration. This means that the training loss obtained in the early stages of training is naturally greater than the training loss obtained in the later stages of training. If the global training loss is used to determine whether a sample is noisy, the accuracy will be greatly reduced.
[0078] Specifically, in any training batch, the computer device sorts each sample in a preset arrangement order based on the size of the training loss of each sample in the training batch, so as to obtain a relative loss ranking of each sample in the training batch.
[0079] In some embodiments, a computer device sorts each sample according to its relative loss in the targeted training batch to determine the relative loss ranking of each sample in the targeted training batch, including: sorting each sample in descending order based on the size of the relative loss of each sample in the training batch to determine the relative loss ranking of each sample in the training batch.
[0080] In other embodiments, the computer device sorts each sample according to the relative loss of each sample in the targeted training batch to determine the relative loss ranking of each sample in the targeted training batch, including: sorting each sample in an ascending order based on the size of the relative loss of each sample in the targeted training batch to determine the relative loss ranking of each sample in the targeted training batch.
[0081] The computer device also performs the above processing when performing the next training round of training, and then the computer device obtains the relative loss ranking of each sample in each training round and in the training batch to which it belongs.
[0082] For example, Figure 5 As shown, the computer device is provided with N training rounds (e.g., n1, n2, ..., N), and the training set in each training round is divided into M training batches (e.g., m1, m2, ..., M), and each training batch contains 3 samples. In the training round n1, the computer device inputs the 3 samples of the m1 training batch into the model for training, obtains the training loss of each sample k1, k2, k3, and obtains the relative loss ranking of each sample k1, k2, k3 in the m1 training batch: order(n1), order(n2), order(n3); inputs the 3 samples of the m2 training batch into the model for training, obtains the training loss of each sample k4, k5, k6, and obtains the relative loss ranking of each sample k4, k5, k6 in the m2 training batch: order(n4), order(n5), order(n6); inputs the 3 samples of the m3 training batch into the model for training... Furthermore, the computer device determines the relative loss ranking of each sample included in the training set in the training round n1 based on the training of the M training batches.
[0083] The above processing is performed in training round n2, training round n3, ... training round N. After all N training rounds are completed, the computer device can determine the relative loss ranking of each sample in each training round and within its training batch. For example, for sample k1, the computer device determines its relative loss ranking order(n1) in training round n1, its relative loss ranking in training round n2, ..., and its relative loss ranking order(N) in training round N. Thus, for any sample, the computer device obtains N relative loss rankings corresponding to the sample.
[0084] Step 404, based on the loss ranking of each sample in the training batch in all training rounds, determine the noisy samples in the training set.
[0085] For any sample, after the computer device obtains its corresponding relative loss ranking in all training rounds, it can determine the possibility that the sample is a noisy sample by combining its relative loss ranking in each training round.
[0086] In some embodiments, the computer device determines the noisy samples in the training set based on the relative loss ranking of each sample in all training rounds within the training batch to which it belongs, including: determining the noisy samples in the training set based on a preset threshold condition and the relative loss ranking of each sample in all training rounds within the training batch to which it belongs. For example, the computer device determines the top 10% of the samples as noisy samples.
[0087] In other embodiments, the computer device determines the noisy samples in the training set based on the relative loss ranking of each sample in the training batch in all training rounds, and further includes: for any sample, determining the average loss ranking based on the relative loss ranking of the sample in all training rounds; and determining the noisy samples in the training set according to the average loss ranking. For example, the computer device determines the samples with the top 10% of the average loss ranking as noisy samples. For another example, the computer device may also set a threshold and determine the samples with an average loss ranking higher than the threshold as noisy samples, and so on.
[0088] In some other embodiments, the computer device determines the noisy samples in the training set based on the relative loss ranking of each sample in the training batch in all training rounds, and also includes: for any sample, determining the total loss ranking based on the comprehensive relative loss ranking of the targeted sample in all training rounds; determining the noisy samples in the training set according to the total loss ranking. For example, the computer device determines the samples in the top 10% of the total loss ranking as noisy samples. For another example, the computer device can also set a threshold and determine the samples with a total loss ranking higher than the threshold as noisy samples, and so on.
[0089] The noisy sample recognition method provided by the embodiment of the present application obtains a training set, and the samples in the training set are divided into multiple training batches. By dividing the training set into multiple training batches, the noisy samples and other noise-free samples form a training batch of samples. In the samples of a training batch, the noisy samples are more prominent and easier to be screened out; in each training round, the preheated trained model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch, and the recognition of noisy samples is integrated into the training process of the samples, so that there is a difference between the training losses of the noisy samples and the noise-free samples output after training, which is convenient for recognition. noisy samples; further, based on the training loss of the samples in each training batch, the relative loss ranking of each sample in the training batch to which it belongs is determined, and the distribution of the training losses of each sample in a training batch is characterized by the relative loss ranking, which can accurately compare the difference in training loss between noisy samples and noise-free samples in the same training batch, greatly ensuring the accuracy of the identified noisy samples and avoiding the influence of parameter changes in the model training process on the recognition accuracy; thus, based on the relative loss ranking of each sample in all training rounds in the training batch to which it belongs, the noisy samples in the training set are determined, and the noisy samples can be accurately identified from the training set.
[0090] Since there are only a few noisy samples in the training set, the number of noise-free samples in a training batch is greater than the number of noisy samples. Furthermore, if a sample has a high relative loss ranking in each training round, it means that the sample is more likely to be a noisy sample, and its training loss will not gradually decrease as the model converges, which leads to a large difference between its training loss and other noise-free samples, so the relative loss ranking is high.
[0091] If a sample has a low relative loss ranking in each training round, it means that the sample is likely to be a noise-free sample, because the predicted value output by the model is close to its labeled value, resulting in a low training loss, and the difference in training loss with other noise-free samples is small, so the relative loss ranking is low.
[0092] If the relative loss ranking of a sample in each training round fluctuates, and it is unclear whether the model prediction is inaccurate or it is a noisy sample, then the order of training rounds needs to be considered as one of the criteria. Generally speaking, the parameters of the model have not converged in the early stage of training, and as the training rounds progress, the more the model iterates, the closer it converges, and the higher the reliability of the training loss, the higher the reliability of the relative loss ranking within a training batch. This feature also applies to the above situation.
[0093] Based on this, in some embodiments, the computer device sets a weight coefficient for each training round, and the weight coefficient of the subsequent training round is monotonically non-decreasing relative to the weight coefficient of the previous training round. That is, the weight coefficient of the subsequent training round is equal to the weight coefficient of the previous training round, or higher than the weight coefficient of the previous training round.
[0094] Furthermore, the computer device determines the noisy samples in the training set based on the relative loss ranking of each sample in the training batch to which it belongs in all training rounds, including: determining the overall loss ranking of each sample in the training set based on the relative loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round; and screening out noisy samples from the training set based on the overall loss ranking of each sample and a preset threshold condition.
[0095] Specifically, the computer device determines the importance of the relative loss ranking of each sample under the influence of the weight coefficient of each training round based on the loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round. Furthermore, the computer device determines the overall loss ranking of each sample in the training set based on the importance of the relative loss ranking of each sample. For example, the higher the weight coefficient of the training round, the higher the importance of the relative loss ranking of the corresponding sample, and thus the higher the overall loss ranking of the sample.
[0096] Therefore, the computer device determines whether the overall loss ranking of each sample meets the preset threshold condition based on the overall loss ranking of each sample and the preset threshold condition, and further determines whether each sample is a noisy sample, so as to filter out the noisy samples from the training set.
[0097] The preset threshold condition may be: taking samples whose overall ranking loss is higher than a preset threshold as noisy samples, or taking samples whose overall ranking loss is lower than a preset threshold as noisy samples.
[0098] Among them, the comparison direction of the overall loss ranking and the preset threshold in the preset threshold condition is related to the direction of sorting samples in a training batch to determine the relative loss ranking. For example, when the computer device determines the relative loss ranking in order from high to low, the preset threshold condition is: samples with an overall ranking loss higher than a preset threshold are regarded as noisy samples. For another example, when the computer device determines the relative loss ranking in order from low to high, the preset threshold condition is: samples with an overall ranking loss lower than a preset threshold are regarded as noisy samples.
[0099] In the above embodiment, by setting a weight coefficient for each training round, and combining the relative loss ranking of each training round and the weight coefficient, and then comparing it with the preset threshold indicated by the preset threshold condition, the characteristic that the reliability of relatively later training rounds is higher than that of relatively earlier training rounds as the model converges is utilized, thereby improving the accuracy of noisy sample recognition.
[0100] On the basis of the above embodiments, exemplarily, based on the overall loss ranking of each sample and the preset threshold condition, noisy samples are screened out from the training set, including: determining a preset threshold included in the preset threshold condition; comparing the overall loss ranking of each sample with the preset threshold, and determining the samples with an overall loss ranking less than the preset threshold as noisy samples in the training set.
[0101] Specifically, after obtaining the preset threshold condition, the computer device determines the specific preset threshold indicated by the preset threshold condition and the determination direction based on the preset threshold (for example, whether it is greater than the preset threshold or less than the preset threshold).
[0102] Taking the above embodiment in which the samples are sorted from high to low based on the size of the training loss as an example, the computer device determines the samples whose overall loss ranking is less than a preset threshold as noisy samples in the training set.
[0103] In the above embodiment, by comparing the preset threshold and the overall loss ranking to screen noisy samples, noisy samples can be quickly screened out from the training set, with high recognition efficiency.
[0104] On the basis of the above embodiments, in some embodiments, based on the relative loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round, the overall loss ranking of each sample in the training set is determined, including: based on the loss ranking corresponding to a sample in each training round, weighted summing the loss ranking and each weight coefficient to obtain a weighted ranking; based on the weighted ranking, determining the overall loss ranking of the sample.
[0105] Specifically, for any sample, the computer device performs weighted summation of the relative loss ranking and each weight coefficient based on the loss ranking corresponding to the sample in each training round to obtain a weighted ranking.
[0106] For example, for a sample x, the computer device may calculate the weighted ranking using the following formula (1):
[0107] order(x) = Σ order(i) * weight(i) i=1,2,…,N (1)
[0108] Among them, order(x) is the weighted ranking of the sample x, order(i) is the relative loss ranking of the sample x in the i-th training round, and weight(i) is the weight coefficient of the i-th training round.
[0109] Exemplarily, when weigth1,…,weightN are all 1, the computer device performs a weighted summation of the relative loss ranking of sample x and each weight coefficient, which is equivalent to adding up the relative loss rankings.
[0110] Exemplarily, when weigth1,…,weightN are all 1 / N, the computer device performs a weighted summation of the relative loss ranking of sample x and each weight coefficient, which is equivalent to calculating the average of each relative loss ranking.
[0111] Furthermore, for any sample, the computer device determines the overall loss ranking of the sample based on the weighted ranking of the sample. For example, the computer device directly uses the weighted ranking as the overall loss ranking of the sample.
[0112] In the above embodiment, by setting a weight coefficient for each training round and performing a weighted summation of the relative loss ranking of each sample and the weight coefficient, the reliability of different training rounds is taken into account, thereby improving the accuracy of noisy sample recognition.
[0113] Since the training loss of noisy samples is relatively more prominent no matter which noise-free samples they form a training batch with, that is, the relative loss ranking of noisy samples is relatively higher in any training batch and any training round.
[0114] Based on this, in other embodiments, the computer device can also filter out noisy samples in the training set in the following manner, that is, based on the relative loss ranking of each sample in the training batch to which it belongs in all training rounds, determine the noisy samples in the training set, and also include: based on the loss ranking of each sample in a training batch, filter out a preset number of samples with higher loss rankings, and form the preset number of samples into a noisy training set corresponding to the training batch; take the intersection of each noisy training set filtered out from each training batch to obtain the noisy samples in the training set.
[0115] Specifically, in each training round, for any training batch, the computer device determines the relative loss ranking of each sample in the training batch, and based on the relative loss ranking of each sample, selects a preset number of samples with higher rankings. The computer device forms a noisy training set with the preset number of samples selected. The preset number can be determined according to the batch size of the training batch. For example, the preset number can be 1, 2, ... 1% of the number of samples contained in the training batch, and so on.
[0116] For example, for training batch 1, the computer device selects two samples with higher rankings, namely, the highest ranking sample a and the second highest ranking sample b, and forms the sample a and sample b into a noisy training set 1: {a, b}. For training batch 2, the computer device performs the same process to obtain a noisy training set 2: {c, d}... etc. For each training round, the computer device performs the same process to obtain a noisy training set corresponding to each training round.
[0117] Since the training loss of noisy samples is more prominent in any training batch, the higher the frequency of a sample appearing in each noisy training set, the higher the possibility that it is a noisy sample, and the samples that appear in each noisy training set are highly likely to be noisy samples. Then, the computer device performs intersection processing on each noisy training set screened from each training batch to obtain the noisy samples in the training set.
[0118] In the above embodiment, by preliminarily screening out samples that are more likely to be noisy samples in the training batch, and forming a noisy training set with potential noisy samples in each training batch, and combining the noisy training sets of each round and each training batch, further screening out samples that are more likely to be noisy samples can improve the accuracy of noisy sample recognition.
[0119] Among them, since the categories of samples vary with different training tasks, taking image samples as an example, the size and resolution of each image sample may be different; or taking text samples as an example, the number of words contained in each text sample may vary. Therefore, it is inaccurate to directly determine whether it is a noisy sample based on the training loss.
[0120] Moreover, the training loss of a sample is an absolute value, but as the model training gradually converges, this value will continue to decrease, so it cannot be used as an absolute standard to measure whether it is a noisy sample. However, the training loss of a noisy sample will be higher than other noise-free samples, so the comparison between the training loss of a noisy sample and other noise-free samples is a relative value, which is a more reliable measurement standard.
[0121] To this end, in some embodiments, the computer device determines the relative loss ranking of each sample in the training batch to which it belongs based on the training loss of the samples in each training batch, including: determining the weighted loss of each sample in a training batch based on the training loss of each sample in the training batch; and determining the loss ranking of each sample in the training batch by sorting the samples according to the weighted loss of the samples in the training batch.
[0122] Among them, weighted loss is used to measure each sample in a training batch under the same standard. Weighted loss refers to the difference in the distribution of the training loss of a sample in a training batch compared to the overall training loss. The purpose of relative loss is to smooth the impact of the characteristics of the sample itself on the training loss in a training batch. Taking text samples as an example, relative loss is needed to smooth the impact that the text length of different samples may have on the training loss.
[0123] Specifically, for any training batch, the computer device determines the relative loss of each sample in the training batch based on the training loss of all samples in the training batch. Furthermore, the computer device sorts each sample in a high to low (or low to high) order based on the magnitude of the relative loss of each sample in the training batch, thereby determining the relative loss ranking of each sample in the training batch.
[0124] In the above embodiment, by considering the impact of the characteristics of each sample in the training batch on the training loss, the relative loss is calculated based on the training loss, so that the relative loss ranking obtained by subsequent sorting is fairer, thereby improving the accuracy of noisy sample recognition.
[0125] Exemplarily, based on the training loss of each sample in the targeted training batch, determining the relative loss of each sample in the targeted training batch includes: obtaining dimension data of each sample under the sample category to which the training set belongs; and determining the loss of the sample in the training batch based on the ratio of the training loss of each sample to the dimension data.
[0126] The size data of different sample categories are different. For example, the size data of the image sample category may be the size or resolution of the image sample, etc. For another example, the size data of the text sample category may be the text length of the text sample, etc. For another example, the size data of the audio sample category may be the audio length, etc.
[0127] Accordingly, the computer device obtains the size data of each sample under the sample category to which the training set belongs, which may be the image size or resolution of each sample under the image sample category, the text length of each sample under the text sample category, or the audio length of each sample under the audio sample category. Furthermore, for any sample, the computer device calculates the ratio of the training loss of the sample to the size data, and determines the relative loss of the sample in the training batch.
[0128] Exemplarily, taking a text sample as an example, the computer device determines the text length of each sample x, and calculates the relative loss according to the following formula (2):
[0129]
[0130] Among them, Weighted_Loss(x) is the relative loss of sample x; Loss(model_infer(x),tag(x)) is the training loss of sample x, where model_infer(x) is the predicted value of the sample and tag(x) is the labeled value of the sample; Log(Len(x)) is the logarithm of the text length of sample x.
[0131] In the above embodiment, by dividing the training loss by the size data of the sample category to which the sample belongs, the impact caused by the different sizes of samples in the same training batch can be smoothed, so that the relative loss ranking obtained by subsequent sorting is fairer, thereby improving the accuracy of noisy sample recognition.
[0132] In any of the above embodiments, the computer device must first obtain the training loss of each sample, and determine the relative loss ranking of each sample on this basis. To this end, in some embodiments, in each training round, the preheated trained model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch, including: training the model based on each sample to obtain the predicted value output by the model; determining the training loss of each sample based on the difference between the pre-annotated labeled value and the predicted value of each sample.
[0133] Specifically, in each training batch, the computer device inputs each sample included in the training batch into the model for training, and the model extracts features and makes predictions based on the results of the feature extraction, thereby outputting the predicted values of each sample.
[0134] Furthermore, for any sample, the computer device determines the training loss based on the difference between its predicted value and its labeled value. The training loss can be determined based on a loss function constructed by the predicted value and the labeled value. The computer device can predetermine the loss function. Exemplarily, the computer device can measure the training loss of each sample by a cross entropy loss function.
[0135] In the above embodiment, by inputting both noisy samples and noise-free samples into the model for training, the characteristic that the training loss of noisy samples is more prominent than the training loss of noise-free samples is utilized, so that noisy samples can be better identified.
[0136] In any of the above embodiments, the computer device is based on the training batch as the minimum unit, and trains the model with samples of a training batch. Since the computer device is trained in sequence according to the training rounds, in order to further improve the accuracy of noisy sample recognition, in some embodiments, the noisy sample recognition method further includes: arranging each sample in the training set of each training round, and dividing each arranged sample according to the batch size to obtain multiple training batches;
[0137] Specifically, for different training rounds, the computer device arranges all samples in the training set in different orders, so that the arrangement order of the samples in the training set corresponding to each training round is different.
[0138] For example, for training round A, the computer device arranges all samples in a default order, that is, the positions of the samples are not changed. After training round A is completed, for training round B, the computer device may keep the positions of some samples unchanged, change the positions of some samples, etc. Alternatively, the computer device may also perform random arrangement processing on all samples in the entire training set, and so on.
[0139] For example, before each training round begins, when the computer device obtains the training set of this training round, it performs random permutation (Shuffle) processing on all samples in the training set, so that the position of the sample in the training set is random. Therefore, for any sample, its neighbor samples in the training batch to which it is divided are not fixed.
[0140] For example, the computer device can perform random permutation processing on all samples in the training set. Taking the training set size of 640,000 samples as an example, assuming that the batch size of the training batch is 64, each training step will require 64 samples as input. Each training round of training will go through 10,000 (640,000 / 64) training steps, and it is assumed that 3 training rounds of training are performed. Due to the random permutation processing, each sample may be different from the other 63 neighboring samples belonging to the same training batch during the training process of different training rounds. Therefore, for the training set, the arrangement order of the samples corresponding to the training set in different training rounds is different.
[0141] In the above embodiment, by changing the arrangement order of samples in each training set, the arrangement order of samples corresponding to the training set in different training rounds is different, so that the noisy samples can be combined with different noise-free samples to form a training batch. Regardless of which noise-free samples the noisy samples are combined with to form a training batch, their relative loss ranking is higher. Therefore, after changing the arrangement order, the noisy samples can be identified more accurately.
[0142] As mentioned above, the characteristics of the sample itself will also affect the recognition of noisy samples. Therefore, in order to further eliminate the impact of the loss caused by the characteristics of the sample itself on the accuracy of noisy sample recognition, in other embodiments, after obtaining the training set, the noisy sample recognition also includes: based on the sample category to which the training set belongs, determining the size data of each sample under the sample category, and determining multiple size categories corresponding to each size data; classifying each sample based on its size data to obtain multiple samples under each size category; dividing the multiple samples under each size category according to the batch size to obtain multiple training batches under each size category.
[0143] Specifically, the computer device obtains the sample category to which the training set belongs. The sample category is usually related to the training task, for example, it can be an image sample category, a text sample category, or an audio sample category.
[0144] Based on the sample category to which the training set belongs, the computer device can determine the sample category to which each sample in the training set belongs, and determine the size data of each sample under the sample category. For example, the size data of the image sample category can be the size or resolution of the image sample. For another example, the size data of the text sample category can be the text length of the text sample. For another example, the size data of the audio sample category can be the audio length.
[0145] Then, the computer device classifies each sample based on the size data of each sample to obtain multiple samples in each size category. For example, the computer device can set multiple size categories based on the range of the size data of each sample, and then classify each sample into one of the size categories.
[0146] For example, taking the text sample category as an example, the computer device classifies samples with a text length between 10 and 20 into one size category based on the text length of the samples, and classifies samples with a text length between 20 and 40 into another size category... Then, the computer device divides the multiple samples included in each size category into multiple training batches.
[0147] In the above embodiment, by first dividing the samples into size categories and then further dividing the training batches under each size category, the sample characteristics of each sample tend to be consistent when dividing the training batches, and the loss effect caused by the sample's own characteristics can be removed as much as possible, thereby improving the accuracy of noisy sample recognition.
[0148] In some embodiments, the noisy sample recognition method further includes: obtaining an initial model under a given training task; performing preheating training on the initial model to obtain a model, and saving parameter data of the model.
[0149] Specifically, the computer device may obtain different initial models according to different training tasks. For example, for training tasks related to images (such as image recognition, classification, and other training tasks), the computer device obtains an initial model for processing images. For another example, for training tasks related to text, the computer device obtains an initial model for processing text. For another example, for training tasks related to audio, the computer device obtains an initial model for processing audio, and so on.
[0150] The computer device first performs warm-up training on the initial model to initialize the initial model so that the convergence direction of the initial model is initially stabilized, in preparation for subsequent noisy sample recognition and model training.
[0151] Exemplarily, if the learning rate preset by the computer device, such as the model, is 0.002, then during the warm-up training, the computer device specifies the training steps (e.g., 3000 steps) and gradually increases the learning rate from a smaller initial value of 0.000001 to 0.002 linearly through the learning rate scheduler. The linear increase refers to an increase with a fixed amplitude as the training steps increase. The learning rate scheduler refers to a function that gradually adjusts the learning rate with a certain strategy.
[0152] Among them, the learning rate is the step size of parameter change in machine learning and is one of the most important model training hyperparameters. The gradient indicates the direction of parameter change, and the learning rate indicates the step size of the change. Therefore, the model conforms to the following formula (3) during training:
[0153] θ′=θ-learning_rate*grad (3)
[0154] Among them, θ′ represents the updated model parameters, θ represents the updated model parameters, learning_rate is the learning rate, and grad is the gradient.
[0155] In the above embodiment, by preheating the initial model, the model can obtain a relatively stable initial convergence direction and relatively stable initial model parameters, which can provide a better identification environment for identifying noisy samples, thereby improving the recognition accuracy of noisy samples.
[0156] After determining the noisy samples in the training set, the noisy sample identification method may also include: removing the noisy samples from the training set to obtain a noise-free training set; training the model based on the noise-free training set and the parameter data of the model to obtain a trained target model; wherein the target model is used to perform prediction under a given application task to output a prediction result.
[0157] Specifically, the computer device removes the determined noisy samples from the training set to obtain a noise-free training set. The noise-free training set includes a plurality of noise-free samples.
[0158] Furthermore, the computer device reloads the pre-saved parameter data of the preheated trained model, thereby restoring the preheated trained model, and then performs formal model training on the preheated trained model based on the noise-free training set, thereby obtaining a trained target model.
[0159] Exemplarily, the computer device divides the noise-free training set to obtain multiple training batches of noise-free samples, and sequentially inputs the noise-free samples of each training batch into the preheated trained model, and calculates the predicted value of each noise-free sample according to the saved parameter data.
[0160] For example, the model structure is represented by the function f(*), and the model parameters are represented by θ. For any noise-free sample y, the computer device outputs a predicted value Y' through the preheated trained model, where Y'=f(y)θ. Then, the computer device compares its predicted value Y' with its true value Y (labeled value) and calculates the training loss l. The loss function is represented by loss(*). The training loss of the noise-free sample y can be expressed as δ, where δ=loss(Y,Y′)θ. The computer device then feeds back the training loss and calculates the parameter gradient grad, which can be expressed as: grad(θ)with(δ).backward(), and then optimizes the model, updates the model parameter θ, and clears the parameter gradient grad to zero, which can be expressed as zeroGrad(θ), for example, to prepare for the next training step.
[0161] After multiple rounds of training, when the training termination condition is reached, the computer device can obtain a trained model, called the target model. The target model can be used to make predictions under a given application task, thereby outputting prediction results. Among them, the application task and the training task are matched, such as the task of processing images / text / audio.
[0162] Among them, the training termination conditions include but are not limited to one or more of the following: the training time reaches a preset time, the number of training steps reaches a preset number of steps, and the loss value of the model decreases to a preset threshold (i.e., the model has converged).
[0163] Exemplarily, when the computer device is performing model training, it calculates the mean of the training losses of every 100 training steps every 100 training steps, and calculates the difference with the mean of the training losses obtained in the previous adjacent calculation. This difference is the loss decrease value. The computer device then performs a validation based on the validation set every 2000 training steps, so as to calculate the validation loss value. Assuming that three consecutive loss decrease values are all less than the given threshold of 0.01, it is considered that the model is basically convergent after training on the training set. The computer device then determines whether the decrease of the validation loss value meets the preset determination criteria. For example, the preset determination criteria is that the ratio of two adjacent validation loss values is near 1 (for example, not exceeding 0.05), and it can be determined that the model meets the determination criteria, and the model can indeed be regarded as in a convergent state.
[0164] For example, the preset determination criteria can be expressed by the following formula (4):
[0165] |VERIFY_LOSS(j) / VERIFY_LOSS(n - 1)-1|≤0.05 (4)
[0166] Wherein, VERIFY_LOSS(j) represents the validation loss value obtained in the jth validation.
[0167] Exemplarily, Figure 6 shows a training scenario of the model. Taking the training task of polyphonic character recognition as the given training task as an example, the initial model is the initial polyphonic character model. Exemplarily, this polyphonic character model includes a feature extraction (Embedding) layer, a long short-term memory recurrent neural network (Long Short-Term Memory, LSTM) layer, a linear (Linear) layer, and an activation (softmax) layer. The computer device uses the target text "It's not okay for the bank to do so" as the input of the polyphonic character model. This target text contains two polyphonic characters "行". Furthermore, after the computer device performs feature extraction through the Embedding layer, it outputs the feature vectors corresponding to "行" in "银行" and the feature vectors corresponding to "行" in "不行" through the LSTM layer, and sequentially performs predictions through the Linear layer and the softmax layer, so as to output the predicted pronunciation of the polyphonic character "行". The computer device calculates the training loss by substituting the predicted pronunciation and the correct pronunciation based on the pre-constructed cross-entropy loss function, and trains the model based on this training loss.
[0168] In the above embodiments, by removing the noisy samples and performing model training based on the noise-free training set obtained after removal, the model performance can be greatly optimized, and the accuracy of model prediction can be improved.
[0169] The following provides an example of a specific application environment. In some embodiments, the given application task is the recognition task of polyphonic text, and the target model is a polyphonic model; the method for recognizing noisy samples further includes: obtaining a target text to be recognized; the target text includes at least one polyphonic character; extracting a feature vector corresponding to the polyphonic character through the polyphonic model, and performing recognition based on the feature vector to obtain the correct pronunciation corresponding to the polyphonic character.
[0170] Specifically, the computer device obtains the target text to be recognized, and the target text includes at least one polyphonic character. For example, the target text is a sentence: "It's not okay for the bank to do so". Among them, the computer device extracts features from the target text through the trained target model, that is, the polyphonic model, so as to extract the feature vector corresponding to the polyphonic character "行", including the feature vector corresponding to the character "行" in "银行" and the feature vector corresponding to the character "行" in "不行".
[0171] Furthermore, the computer device performs recognition and prediction based on the above feature vector, so as to output the correct pronunciation of the polyphonic character "行", including the correct pronunciation "hang2" corresponding to the character "行" in "银行" and the correct pronunciation "xing2" corresponding to the character "行" in "不行".
[0172] Exemplarily, in combination with Figure 6 , Figure 7 shows an application scenario of the polyphonic model. Taking the given application task as the polyphonic recognition task as an example, the target model is a trained polyphonic model. Then the computer device uses the target text of "It's not okay for the bank to do so" as the input of the polyphonic model. The target text contains two polyphonic characters "行", and outputs the predicted pronunciation of the polyphonic character "行".
[0173] In combination with Figure 2 and the above embodiments, the following provides a specific embodiment to further elaborate on the present application. As Figure 8 shown, before the training starts, the computer device sets a unique identifier for each sample in the training set, and then performs warm-up training to initialize the model parameters. On the one hand, the computer device saves parameter data such as model parameters and hyperparameters at this time.
[0174] On the other hand, the computer device performs N rounds of probing training to identify and mark the noisy samples in the training set. Among them, in each training round, at the end of each training step, the computer device calculates the relative loss of each sample in each training batch, such as the weighted loss based on the training loss; the computer device then sorts each sample from high to low within the training batch to which it belongs according to the weighted loss of each sample, so as to obtain the relative loss ranking of each sample. The computer device records the relative loss and the relative loss ranking.
[0175] After completing N rounds of detection training, the computer device processes the identified and marked noisy samples, that is, removes them from the training set to obtain a noise-free training set. Then, the computer device loads the pre-saved parameter data and uses the noise-free training set for formal model training to obtain a trained target model.
[0176] The following is a specific example to illustrate each step.
[0177] Still taking the training task of polyphone recognition as an example, in the data preparation stage, the computer device obtains a large number of data sets and divides them into training sets, validation sets and test sets. Among them, each sample contains at least one polyphone, and its pronunciation is within the scope of its annotation classification. The computer device sets a unique identifier for each sample. The samples are shown in Table 1 below:
[0178] Table 1
[0179] Logo sample Annotation 0 Welcome to our bank hang2 …… …… …… 63 1. You are my first hang2 …… …… …… 130 These are signs that guide people who travel far away. xing2 …… …… …… 2508 Cherish what you have at the moment xing2 …… …… ……
[0180] Furthermore, before each training round begins, the computer device randomly arranges all samples in the training set so that the neighbor samples of the samples are not fixed.
[0181] In the warm-up training sub-process, it is assumed that the training step wamup_steps of the warm-up training is 500 training steps, the hyperparameter learning rate lr of the polyphone model is 0.002, and the initial value warmup_lr of the warm-up training initial learning rate is 0.00001, and the warm-up learning rate regulator is a linear regulator, that is, the value of the learning rate increases on average with the number of training steps. Furthermore, the hyperparameter learning rate can be expressed by the following formula (5):
[0182] LR_step=warmup_lr+(lr-warmup_lr) / wamup_steps*step (5)
[0183] Here, step indicates the number of training steps. For example, when step=5, it means that the current step is the 5th training step.
[0184] After the warm-up training is completed, the computer device can perform preliminary initialization of the model parameters. The computer device stores parameter data such as model structure, model parameters, model hyperparameters, and model training hyperparameters to facilitate loading and use when the noisy samples are extracted for formal model training.
[0185] After the preheating training subprocess, the noisy sample detection subprocess is performed. In this subprocess, the computer device performs noisy sample detection training based on the parameter data after the preheating training.
[0186] Exemplarily, the computer device performs three rounds of detection training, that is, each sample in the training set will be trained three times. In each training round, the computer device divides the training set to obtain multiple training batches, each training batch includes multiple samples. And before each training round starts, the computer device randomly arranges all samples in the training set so that the neighbor samples of any sample in each training batch are different from those in the previous training round.
[0187] After each training round is completed, the computer device records the training loss of each sample in each training batch, and takes into account the impact of each sample's own characteristics on the loss calculation result, and based on the sample's size data, that is, the text length, performs weighted processing on each training loss to obtain a relative loss. This process can be calculated using formula (2) provided in the above embodiment. For example, among the 64 samples in the same training batch, if the longest sentence length is 100 Chinese characters and the shortest sentence length is 16 Chinese characters. This results in the longer the sample length, the higher the learning cost. By smoothing the differences in the text lengths of each sample in the same training batch, subsequent sorting can be made more fair.
[0188] Furthermore, for each training batch, the computer device sorts each sample in order from high to low based on the relative loss of each sample, thereby obtaining the relative loss ranking corresponding to each sample in each training batch. Furthermore, each sample can determine a relative loss ranking in each training round. The computer device can record its relative loss and relative loss ranking, for example, in the form of [relative loss ranking, relative loss].
[0189] Taking sample x as an example, the three groups of data recorded by the computer device may be: [2.0.932], [1,0.898] and [1,0.890]. The above three groups of data correspond to three training rounds respectively. In the first training round, the relative loss of sample x ranks second among the 64 samples in the training batch to which it belongs, with a relative loss of 0.932; in the second training round, the relative loss of sample x ranks first among the 64 samples in the training batch to which it belongs, with a relative loss of 0.898; in the third training round, the relative loss of sample x ranks first among the 64 samples in the training batch to which it belongs, with a relative loss of 0.890.
[0190] Since detection is performed based on the N relative loss rankings of each sample in the training set obtained in N training rounds of detection training, there is no need to re-sort the entire training set, so the recognition speed of noisy samples is faster.
[0191] Furthermore, the computer device can use formula (1) in the above embodiment to calculate the overall loss ranking of the sample x. Assume that the weight coefficients of each training round are: N1=1, N2=1, N3=1.5.
[0192] The computer device calculates the overall loss ranking as, for example, order(x)=2*1+1*1+1*1.5=4.5, that is, the overall loss ranking of the sample x is 4.5. Assuming the preset threshold is 5, the computer device determines that the sample x is a noisy sample.
[0193] The computer device removes the noisy samples to obtain a noise-free training set. Then, the computer device executes a model training subprocess, that is, loads the pre-saved parameter data, restores the model to the state after the preheating training is completed, and uses the noise-free training set to perform model training on it until the model converges to obtain a trained polyphone model.
[0194] The computer device can also monitor and intervene in the noisy sample detection training subprocess. For example, the computer device continuously observes the convergence of the training loss and the convergence of the validation loss. When overfitting occurs, some samples marked as noisy samples are selected and added to the training set to continue training for a certain number of training steps, thereby reducing the impact of the overfitting phenomenon.
[0195] As a result, a process of detecting and removing noisy samples can be inserted into the general machine learning training process. By identifying the noisy samples that may exist in the training set and removing them, the training set can be denoised and purified before the model is actually trained, thereby improving the stability of the training process and the final model effect.
[0196] Since machine learning tasks have certain goals, their model construction and sample selection are consistent. For example, when the training task is to train a classification model, the sample input and sample category should ideally meet the learning needs under the specified category distribution. However, the input feature distribution or label value of the noisy sample violates the direction of the training task, and will inevitably show a different loss effect from the noise-free sample during the machine learning training process, which specifically has an opposite effect on the model convergence. In other words, when training the model along the target direction, the training loss of the noisy sample must be greater than the training loss of the noise-free sample.
[0197] Using denoised training data for model training makes the model's parameter distribution more consistent with the expected parameter distribution of the machine learning task. For example, the classification accuracy of the classification model is higher.
[0198] In addition, since the data after noise reduction has better distribution consistency, the training process of the model will be more stable, less likely to exhibit drastic fluctuations in gradients or model parameters, and the model convergence curve will be smoother.
[0199] It should be understood that although each step in the flowcharts involved in the above embodiments is shown in sequence according to the arrow indication, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0200] In the above embodiments and Figure 8 on this basis, Fig. 9 a specific application scenario is shown.
[0201] For example, the user inputs the target text "This is not acceptable for the bank" through the client. This target text contains two polyphonic characters "hang2" and "xing2". The client will then apply to the server to call the pre-trained polyphonic character model, and use this target text as the input, and the server outputs the correct pronunciations of the polyphonic characters. Among them, the polyphonic character model is obtained by preheating training on the initial polyphonic character model, detecting training based on a training set containing multiple text samples, identifying the noisy samples, and then using the noise-free training set for model training. The client then receives the correct pronunciations of the polyphonic characters returned by the server and displays them on the display device. The display device is, for example, a display screen.
[0202] Based on the same inventive concept, the embodiments of the present application also provide a device for implementing the above-mentioned noisy sample recognition method, and a device for implementing the above-mentioned noisy sample recognition method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following device for implementing the noisy sample recognition method and the device for implementing the noisy sample recognition method can refer to the limitations on the noisy sample recognition method and the device for implementing the noisy sample recognition method in the above text, and the specific limitations will not be repeated here.
[0203] This embodiment also provides a device for implementing the noisy sample recognition method. This device for implementing the noisy sample recognition method can be specifically integrated in a terminal device. For example, as Fig.10As shown, the noisy sample identification method and device may include:
[0204] The acquisition module 1001 is used to acquire a training set, where samples in the training set are divided into multiple training batches.
[0205] The training module 1002 is used to train the model based on the samples of each training batch in each training round to obtain the training loss of the samples of each training batch.
[0206] The ranking module 1003 is used to determine the loss ranking of each sample in the training batch to which it belongs based on the training loss of the samples in each training batch.
[0207] The determination module 1004 is used to determine the noisy samples in the training set based on the loss ranking of each sample in the training batch in all training rounds.
[0208] The noisy sample identification device provided by the embodiment of the present application obtains a training set, and the samples in the training set are divided into multiple training batches. By dividing the training set into multiple training batches, the noisy samples and other noise-free samples form a training batch of samples. In the samples of a training batch, the noisy samples are more prominent and easier to be screened out; in each training round, the model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch, and the recognition of noisy samples is integrated into the training process of the samples, so that there is a difference between the training losses outputted after training for the noisy samples and the noise-free samples, which is convenient for identification. noisy samples; further, based on the training loss of the samples in each training batch, the loss ranking of each sample in the training batch to which it belongs is determined, and the distribution of the training losses of each sample in a training batch is characterized by the loss ranking, which can accurately compare the difference in training losses between noisy samples and noise-free samples in the same training batch, greatly ensuring the accuracy of the identified noisy samples and avoiding the influence of parameter changes in the model training process on the recognition accuracy; thus, based on the relative loss ranking of each sample in the training batch to which it belongs in all training rounds, the noisy samples in the training set are determined, and the noisy samples can be accurately identified from the training set.
[0209] In some embodiments, the ranking module is further used to determine the weighted loss of each sample in a training batch based on the training loss of each sample in the training batch; and to determine the loss ranking of each sample in the training batch by sorting the samples according to the weighted loss of the samples in the training batch.
[0210] In some embodiments, the determination module is also used to determine the overall loss ranking of each sample in the training set based on the relative loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round; based on the overall loss ranking of each sample and a preset threshold condition, the noisy samples are screened out from the training set; wherein the weight coefficient of the subsequent training round is monotonically non-decreasing relative to the weight coefficient of the previous training round.
[0211] In some embodiments, the determination module is also used to weightedly sum the loss ranking corresponding to a sample in each training round with each weight coefficient to obtain a weighted ranking; based on the weighted ranking, determine the overall loss ranking of the sample.
[0212] In some embodiments, the training module is further used to obtain dimension data of each sample under the sample category to which the training set belongs; and determine the loss of each sample in the training batch based on the ratio of the training loss of each sample to the dimension data.
[0213] In some embodiments, the training module is further used to sort each sample in order from high to low based on the size of the loss of each sample in the training batch, and determine the relative loss ranking of each sample in the training batch.
[0214] In some embodiments, the training module further trains the model based on each sample to obtain a predicted value output by the model; and determines the training loss of each sample based on the difference between a pre-labeled value of each sample and the predicted value.
[0215] In some embodiments, the determination module is also used to determine a preset threshold included in the preset threshold condition; compare the overall loss ranking of each sample with the preset threshold, and determine the samples whose overall loss ranking is less than the preset threshold as noisy samples in the training set.
[0216] In some embodiments, the determination module is also used to screen out a preset number of samples with higher loss rankings based on the loss rankings of each sample in a training batch, and form the preset number of samples into a noisy training set corresponding to the training batch; and perform intersection processing on each of the noisy training sets screened from each training batch to obtain the noisy samples in the training set.
[0217] In some embodiments, the noisy sample identification device also includes a first division module, which is used to arrange each sample in the training set of each training round, and divide the arranged samples according to the batch size to obtain multiple training batches; wherein the arrangement order of the samples corresponding to the training set in different training rounds is different.
[0218] In some embodiments, the noisy sample identification device further comprises a second division module, which determines the size data of each sample under the sample category based on the sample category to which the training set belongs, and determines a plurality of size categories corresponding to each of the size data;
[0219] Each sample is classified based on its size data to obtain multiple samples in each size category; the multiple samples in each size category are divided according to the batch size.
[0220] In some embodiments, the noisy sample recognition device further includes a preheating training module, which is used to obtain an initial model under a given training task; perform preheating training on the initial model to obtain the model, and save parameter data of the model.
[0221] In some embodiments, the noisy sample identification device also includes a model training module, which is used to remove the noisy samples from the training set to obtain a noise-free training set; based on the noise-free training set and the parameter data of the model, the model is trained to obtain a trained target model; wherein the target model is used to perform predictions under a given application task to output prediction results.
[0222] In some embodiments, the given application task is a polyphone text recognition task, and the target model is a polyphone model; the noisy sample recognition device also includes an application module for obtaining a target text to be recognized; the target text includes at least one polyphone; the feature vector corresponding to the polyphone is extracted through the polyphone model, and recognition is performed based on the feature vector to obtain the correct pronunciation corresponding to the polyphone.
[0223] Based on the same inventive concept, the embodiment of the present application also provides a computer device, which can be a server or a terminal device. The computer device includes a memory and a processor, and a computer program is stored in the memory. When the processor executes the computer program, the steps of the above-mentioned noisy sample identification method are implemented. Various functions are thereby implemented, for example: obtaining a training set, and dividing the samples in the training set into multiple training batches; in each training round, training the model based on the samples of multiple training batches, and obtaining the loss ranking of each sample in each training round within the training batch to which it belongs; the loss ranking represents the degree of deviation of the training loss of the sample compared to the training loss of other samples in the training batch to which it belongs; based on the loss ranking of each sample in the training batch to which it belongs in all training rounds, the noisy samples in the training set are determined.
[0224] The computer device provided by the embodiment of the present application obtains a training set, and the samples in the training set are divided into multiple training batches. By dividing the training set into multiple training batches, the noisy samples and other noise-free samples form a training batch of samples, and the noisy samples in the samples of a training batch are more prominent and easier to be screened out; in each training round, the model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch, and the recognition of noisy samples is integrated into the training process of the samples, so that there is a difference between the training losses of the noisy samples and the noise-free samples output after training, which is convenient for identifying the noisy samples. samples; further, based on the training loss of the samples in each training batch, the loss ranking of each sample in the training batch to which it belongs is determined, and the distribution of the training losses of each sample in a training batch is characterized by the loss ranking, which can accurately compare the difference in training loss between noisy samples and noise-free samples in the same training batch, greatly ensuring the accuracy of the identified noisy samples and avoiding the influence of parameter changes in the model training process on the recognition accuracy; thus, based on the relative loss ranking of each sample in the training batch to which it belongs in all training rounds, the noisy samples in the training set are determined, and the noisy samples can be accurately identified from the training set.
[0225] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0226] In one embodiment, the computer device is a terminal device, for example, its internal structure diagram can be as follows: Fig.11As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for identifying noisy samples is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0227] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0228] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0229] Since the computer program stored in the computer-readable storage medium can execute any of the noisy sample identification methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the noisy sample identification methods provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.
[0230] Based on the same inventive concept, the embodiment of the present application further provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations in the above embodiments.
[0231] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. 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.
[0232] Any reference to the memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (Re RAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0233] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0234] It should be noted that the sample data involved in this application (including but not limited to data used for collection, identification, analysis, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0235] In the above-mentioned noisy sample identification method device, computer-readable storage medium, computer equipment, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described noisy sample identification method device, computer-readable storage medium, computer program product, computer equipment and its corresponding units can refer to the description of the noisy sample identification method in the above embodiment, and will not be repeated here.
[0236] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] The above is a detailed introduction to a noisy sample recognition method, device, computer equipment, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A noisy sample recognition method, characterized in that: The method comprises: Obtaining a training set, where samples in the training set are divided into multiple training batches; In each training round, the model is trained based on the samples of each training batch, and the training loss of the samples of each training batch is obtained; Based on the training loss of the samples in each training batch, determine the loss ranking of each sample in the training batch to which it belongs; Based on the loss ranking of each sample in the training batch in all training rounds, the noisy samples in the training set are determined.
2. The method according to claim 1, characterized in that The step of determining the loss ranking of each sample in the training batch based on the training loss of the samples in each training batch includes: Determine a weighted loss of each sample in a training batch based on the training loss of each sample in the training batch; The samples are sorted according to their weighted losses in the training batch to determine the loss ranking of the samples in the training batch.
3. The method according to claim 1 or 2, characterized in that The determining of the noisy samples in the training set based on the loss ranking of each sample in the training batch to which it belongs in all training rounds includes: Determine the overall loss ranking of each sample in the training set based on the loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round; Based on the overall loss ranking of each sample and a preset threshold condition, filtering out noisy samples from the training set; Among them, the weight coefficient of the next training round is monotonically non-decreasing relative to the weight coefficient of the previous training round.
4. The method according to claim 3, characterized in that The determining the overall loss ranking of each sample in the training set based on the loss ranking of each sample in the training batch to which it belongs and the weight coefficient set for each training round includes: Based on the loss ranking corresponding to a sample in each training round, the loss ranking is weighted and summed with each of the weight coefficients to obtain a weighted ranking; Based on the weighted ranking, an overall loss ranking of the sample is determined.
5. The method according to claim 2, characterized in that The determining the loss of each sample in a training batch based on the training loss of each sample in the training batch includes: Obtaining size data of each sample under the sample category to which the training set belongs; Based on the ratio of the training loss of each sample to the size data, the loss of each sample in the training batch is determined.
6. The method according to claim 2, characterized in that The step of sorting the loss of each sample in the training batch to determine the loss ranking of each sample in the training batch includes: Based on the size of the loss of each sample in the training batch, the samples are sorted in order from high to low to determine the relative loss ranking of each sample in the training batch.
7. The method according to claim 1, characterized in that In each training round, the model is trained based on the samples of each training batch to obtain the training loss of the samples of each training batch, including: Training the model based on each sample to obtain a predicted value output by the model; The training loss of each sample is determined based on the difference between the pre-labeled labeled value of each sample and the predicted value.
8. The method according to claim 3, characterized in that The step of selecting noisy samples from the training set based on the overall loss ranking of each sample and a preset threshold condition includes: Determining a preset threshold value included in the preset threshold condition; The overall loss ranking of each sample is compared with the preset threshold, and the samples whose overall loss ranking is less than the preset threshold are determined as noisy samples in the training set.
9. The method according to claim 1, characterized in that The step of determining the noisy samples in the training set based on the loss ranking of each sample in the training batch to which it belongs in all training rounds further includes: Based on the loss ranking of each sample in a training batch, a preset number of samples with higher loss rankings are screened out, and the preset number of samples are combined into a noisy training set corresponding to the training batch; The noisy training sets obtained by screening from each training batch are subjected to intersection processing to obtain noisy samples in the training set.
10. The method according to claim 1, characterized in that After obtaining the training set, the method further includes: Arrange the samples in the training set of each training round, and divide the arranged samples into batches according to the batch size to obtain multiple training batches; Among them, the arrangement order of samples corresponding to the training set in different training rounds is different.
11. The method according to claim 1, characterized in that After obtaining the training set, the method further includes: Based on the sample category to which the training set belongs, determining the size data of each sample under the sample category, and determining a plurality of size categories corresponding to each of the size data; Classify each sample based on its size data to obtain multiple samples in each size category; Multiple samples in each size category are divided according to the batch size to obtain multiple training batches in each size category.
12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: Under a given training task, obtain the initial model; The initial model is preheated and trained to obtain the model, and parameter data of the model is saved.
13. The method according to claim 12, characterized in that After determining the noisy samples in the training set, the method further includes: The noisy samples are removed from the training set to obtain a noise-free training set; Based on the noise-free training set and the parameter data of the model, the model is trained to obtain a trained target model; The target model is used to make predictions under a given application task to output prediction results.
14. The method according to claim 13, characterized in that The given application task is a polyphone text recognition task, and the target model is a polyphone model; the method further comprises: Acquire a target text to be recognized; the target text includes at least one polyphonetic character; The feature vector corresponding to the polyphonetic character is extracted through the polyphonetic character model, and recognition is performed based on the feature vector to obtain the correct pronunciation corresponding to the polyphonetic character.
15. A noisy sample recognition device, characterized in that: The device comprises: An acquisition module, used to acquire a training set, where samples in the training set are divided into multiple training batches; A training module is used to train the model based on the samples of each training batch in each training round to obtain the training loss of the samples of each training batch; A ranking module, used to determine the loss ranking of each sample in the training batch based on the training loss of the samples in each training batch; The determination module is used to determine the noisy samples in the training set based on the loss ranking of each sample in the training batch to which it belongs in all training rounds.
16. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the noisy sample identification method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the noisy sample identification method according to any one of claims 1 to 14.
18. A computer software, characterized in that The computer software comprises a computer program, and the computer program is used by a processor to execute the steps of the noisy sample identification method according to any one of claims 1 to 14.