Method, device and electronic equipment for detecting samples
By generating a noise detector and using training historical features to detect the wrong label data in the data set, the problem of inaccurate detection of error labels in the prior art is solved, and the data set quality and generalization performance of the depth model are improved.
Patent Information
- Application Number
- CN202210510776.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2042-05-11
AI Technical Summary
The prior art cannot accurately detect error labels or fuzzy labels in large data sets, resulting in a decline in the quality of the data set and affecting the generalization performance of the depth model.
By obtaining the noise sample set, the preset depth model is trained based on the sample set, training historical features are generated, and a noise detector is generated based on these features for detecting the wrong label data in the sample set to be detected.
It realizes accurate detection of wrong labeled data in the sample set to be detected, improves the detection accuracy of wrong labeled data, reduces iteration time consumption, and improves iteration efficiency.
Smart Images

Figure CN114970689B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, in particular to the field of deep learning, and specifically to a method, device and electronic device for detecting samples. Background Art
[0002] With the rapid development of large dataset collection and annotation, deep learning models have achieved remarkable performance in various tasks. The rapid development of deep learning models is inseparable from the continuous improvement of computer hardware system equipment, the leap forward in network parameter training methods, and the quantity and quality of labeled training data.
[0003] Although large datasets with accurate labels are essential for training high-performance models, the process of obtaining high-quality labels is time-consuming and expensive. For cost-saving and general considerations, datasets with some label noise have also been widely used in scientific research and business work, but studies have shown that datasets with poor label quality, which often include training samples with wrong and ambiguous labels, have a negative impact on the generalization performance of deep models. Therefore, it is necessary to detect mislabeled samples from large datasets to improve generalization performance from the data aspect.
[0004] However, the existing technology cannot accurately detect wrong labels or ambiguous labels from large data sets, thereby reducing the quality of the data sets. Summary of the invention
[0005] The present disclosure provides a method, device and electronic device for detecting a sample.
[0006] According to one aspect of the present disclosure, a method for detecting samples is provided, comprising: obtaining a noise sample set, wherein the noise sample set includes at least incorrectly labeled data; training a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set, wherein the training history features represent time series data generated by the noise sample set during the training of the preset deep model; generating a noise detector based on the training history features and the noise sample set, wherein the noise detector is used to detect incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected.
[0007] It can be seen from the above content that in the present disclosure, the training history features are the intermediate data generated during the training process of the stochastic gradient descent model or its variant model. The extraction of the time series data corresponding to the training history features can provide a large number of distinguishable features for the detection of incorrectly labeled data in the sample set to be detected, so that the noise detector generated based on the training history features can accurately detect the incorrectly labeled data in the sample set to be detected. In addition, in terms of time consumption, the solution provided in this embodiment only needs to perform one round of additional training process to obtain the training history features. Compared with the existing iterative method, the solution provided in the present disclosure reduces the time consumption of iteration and improves the iteration efficiency.
[0008] It can be seen that the solution provided by the present invention achieves the purpose of detecting incorrectly labeled data in the sample set to be detected, realizes the effect of improving the detection accuracy of incorrectly labeled data, and thus solves the problem of inaccurate detection in the prior art when detecting incorrectly labeled data from the sample set to be detected.
[0009] Optionally, the method for detecting samples also includes: obtaining a clean sample set, wherein the amount of data with incorrect labeling in the clean sample set is less than a preset data amount, and the amount of data with incorrect labeling in the noise sample set is greater than or equal to a preset data amount; performing noise processing on the clean sample set based on preset noise information to obtain a noise sample set.
[0010] Optionally, the method for detecting samples also includes: obtaining data labels corresponding to the data contained in the noise sample set; in the process of training a preset deep model based on the noise sample set, determining the prediction probability corresponding to the data contained in the noise sample set, wherein the prediction probability represents the probability that the label of the data contained in the noise sample set is the data label; and determining the training history features based on the prediction probability.
[0011] Optionally, the method for detecting samples also includes: obtaining noise information; training a preset deep model based on the noise information to obtain an initial noise detector; detecting training history features based on the initial noise detector to obtain detection results; performing binary cross entropy calculation on the detection results and data labels corresponding to the noise sample set to obtain calculation results; and optimizing and iterating the initial noise detector based on the calculation results to obtain a noise detector.
[0012] Optionally, the method for detecting samples also includes: obtaining a sample set to be detected; training a preset deep model based on the sample set to be detected to obtain training history features corresponding to the sample set to be detected; processing the training history features corresponding to the sample set to be detected based on a noise detector to obtain a target detection result of the data to be detected in the sample set to be detected, wherein the target detection result represents whether the label of the data to be detected matches the data to be detected.
[0013] Optionally, the method for detecting samples also includes: obtaining incorrectly labeled data from the sample set to be detected based on the target detection results to obtain mislabeled data; eliminating the mislabeled data from the sample set to be detected, and / or correcting the labels of the mislabeled data to obtain target training samples.
[0014] Optionally, the method for detecting samples also includes: obtaining incorrectly labeled data from the sample set to be detected based on the target detection results to obtain mislabeled data; calculating the proportion of mislabeled data in the sample set to be detected to obtain the mislabeling ratio; based on the size of the mislabeling ratio and a preset mislabeling ratio, adding and / or deleting data in the sample set to be detected to adjust the proportion of mislabeled data in the sample set to be detected.
[0015] According to another aspect of the present disclosure, a device for detecting samples is also provided, including: an acquisition module, used to acquire a noise sample set, wherein the noise sample set at least includes incorrectly labeled data; a training module, used to train a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set, wherein the training history features represent time series data generated by the noise sample set during the process of training the preset deep model; a generation module, used to generate a noise detector based on the training history features and the noise sample set, wherein the noise detector is used to detect incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected.
[0016] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for detecting samples.
[0017] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided. The computer instructions are used to enable a computer to execute the above-mentioned method for detecting a sample.
[0018] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method for detecting a sample.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0021] Figure 1 is a flow chart of a method for detecting a sample according to the first embodiment of the present disclosure;
[0022] Figure 2 is a flow chart of a method for detecting a sample according to a second embodiment of the present disclosure;
[0023] Figure 3 is a flow chart of a method for detecting a sample according to a third embodiment of the present disclosure;
[0024] Figure 4 is a schematic diagram of a device for detecting a sample according to a fourth embodiment of the present disclosure;
[0025] Figure 5 The block diagram is a block diagram of an electronic device used to implement the method for detecting a sample according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] It should be noted that the acquisition, storage and application of user personal information involved in the technical solution of the present disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0028] Example 1
[0029] According to an embodiment of the present disclosure, the present disclosure provides a method for detecting a sample, such as Figure 1 As shown, the method comprises the following steps:
[0030] Step S102: Acquire a noise sample set, wherein the noise sample set at least includes incorrectly labeled data.
[0031] In step S102, the data in the noise sample set is mislabeled data, that is, in the noise sample set, the data and its corresponding label do not match, for example, the label corresponding to the characteristic data of a cat is a dog. In addition, the data in the noise sample set may also include fuzzy labeled data, that is, the label corresponding to the data cannot clearly represent the category corresponding to the data, or the meaning of the label corresponding to the data is ambiguous.
[0032] Optionally, the terminal device may add noise to the data in the clean sample set to obtain a noise sample set, wherein the labels corresponding to the data in the clean sample set are correct labels, that is, in the clean sample set, the data and its corresponding labels match.
[0033] It should be noted that, in practical applications, even high-precision datasets such as the CIFAR10 dataset or the ImageNet dataset may contain mislabeled data. Therefore, in the present disclosure, the clean sample set may also be a sample set with a small amount of mislabeled data.
[0034] In addition, in the process of adding noise to the data in the clean sample set, the terminal device can replace the label of the data in the clean sample set, for example, directly replacing the label corresponding to the cat's feature data with the label corresponding to the dog's feature data; the terminal device can also directly change the label of the data in the clean sample set, for example, changing the label corresponding to the cat's feature data to chinchilla.
[0035] In addition, it should be noted that by obtaining a noise sample set and then analyzing the noise sample set, the distinguishing features that distinguish the noise sample set from the clean sample set can be determined, and then the noise detector trained according to the distinguishing features can accurately detect incorrectly labeled data in the sample set to be detected, thereby improving the detection accuracy of incorrectly labeled data.
[0036] Step S104, training a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set, wherein the training history features represent time series data generated by the noise sample set during the process of training the preset deep model.
[0037] In step S104, the above-mentioned deep model may be, but is not limited to, a stochastic gradient descent model or a corresponding variant model.
[0038] In addition, the training history feature is the intermediate data generated during the training process of the stochastic gradient descent model or its variant model, and the intermediate data includes all training traces in the training process.
[0039] It should be noted that the performance of the clean sample set and the noise sample set is different during the training of the preset deep model. Therefore, the extraction of time series data corresponding to the training history features can provide a large number of distinguishable features for the detection of incorrectly labeled data in the sample set to be detected, so that the noise detector generated based on the training history features can accurately detect the incorrectly labeled data in the sample set to be detected.
[0040] In addition, in terms of time consumption, the solution provided in this embodiment only requires one round of additional training process to obtain training history features. Compared with the existing solution of detecting label noise through iterative cross-validation, the iterative method of the solution provided by the present disclosure is simpler and more time-saving, reduces the time consumption of iteration, and improves the iteration efficiency.
[0041] Step S106, generating a noise detector based on the training history features and the noise sample set, wherein the noise detector is used to detect incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected.
[0042] In step S106, the noise detector can be instantiated as a long short-term memory model that is good at processing time series information. That is, in the present disclosure, the mapping relationship between noise and training history features is learned through the long short-term memory model, and the learning difficulty of each training sample is calculated, and the detection of wrongly labeled data has a high precision and recall rate. Then, the user can directly eliminate the data judged to be wrongly labeled according to actual needs, thereby realizing data optimization of the sample set to be detected.
[0043] Based on the scheme defined by the above steps S102 to S106, it can be learned that a method is adopted to generate a noise detector for detecting incorrectly labeled data in the sample set to be detected based on the training history features of the noise sample set. After obtaining a noise sample set that at least includes incorrectly labeled data, a preset deep model is trained based on the noise sample set to obtain the training history features corresponding to the noise sample set, and a noise detector is generated based on the training history features and the noise sample set, wherein the training history features represent the time series data generated by the noise sample set in the process of training the preset deep model, and the noise detector is used to detect the incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected.
[0044] It is easy to notice that the training history features are the intermediate data generated during the training process of the stochastic gradient descent model or its variant model. The extraction of the time series data corresponding to the training history features can provide a large number of distinguishable features for the detection of the wrongly labeled data in the sample set to be detected, so that the noise detector generated based on the training history features can accurately detect the wrongly labeled data in the sample set to be detected. In addition, in terms of time consumption, the solution provided in this embodiment only needs to perform one round of additional training process to obtain the training history features. Compared with the existing iterative method, the solution provided by the present disclosure reduces the time consumption of iteration and improves the iteration efficiency.
[0045] It can be seen that the solution provided by the present invention achieves the purpose of detecting incorrectly labeled data in the sample set to be detected, realizes the effect of improving the detection accuracy of incorrectly labeled data, and thus solves the problem of inaccurate detection in the prior art when detecting incorrectly labeled data from the sample set to be detected.
[0046] Example 2
[0047] According to an embodiment of the present disclosure, the present disclosure also provides a method for detecting a sample, such as Figure 2 As shown, in this embodiment, the terminal device first obtains a clean sample set, and then obtains a noise sample set based on the clean sample set, and then trains a deep model based on the noise sample set, and obtains training history features during the deep model training process, and trains a noise detector based on the training history features, and then the noise detector can detect incorrectly labeled data in the sample set to be detected.
[0048] In an optional embodiment, the terminal device first obtains a clean sample set, and then performs noise processing on the clean sample set based on preset noise information to obtain a noise sample set, wherein the amount of data with incorrect labeling in the clean sample set is less than the preset data amount, and the amount of data with incorrect labeling in the noise sample set is greater than or equal to the preset data amount.
[0049] It should be noted that the labels corresponding to the data in the clean sample set are correct labels, that is, in the clean sample set, the data matches its corresponding labels. In practical applications, even high-precision datasets such as the CIFAR10 dataset or the ImageNet dataset may contain mislabeled data. Therefore, in the present disclosure, the clean sample set may also be a sample set with a small amount of mislabeled data.
[0050] Optionally, the terminal device may obtain a clean sample set from the CIFAR10 dataset or the ImageNet dataset. In addition, the terminal device may also obtain a clean sample set from other clean datasets. Alternatively, the clean sample set may be a sample set manually annotated by a user. After obtaining the clean sample set, the terminal device may replace the labels of the data in the clean sample set, for example, directly replacing the labels corresponding to the feature data of a cat with the labels corresponding to the feature data of a dog; the terminal device may also directly change the labels of the data in the clean sample set, for example, changing the labels corresponding to the feature data of a cat to chinchilla.
[0051] In addition, it should be noted that by obtaining a noise sample set and then analyzing the noise sample set, the distinguishing features that distinguish the noise sample set from the clean sample set can be determined, and then the noise detector trained according to the distinguishing features can accurately detect incorrectly labeled data in the sample set to be detected, thereby improving the detection accuracy of incorrectly labeled data.
[0052] In addition, since the noise sample set is based on a clean sample set that does not contain incorrectly labeled data, or a clean sample set that contains a small amount of incorrectly labeled data, the noise detector generated by the present disclosure based on the noise sample set has a higher robustness to this small amount of potential label noise, that is, the noise detector generated by the present disclosure can accurately detect incorrectly labeled data.
[0053] Further, such as Figure 2 As shown, after obtaining the noise sample set, the terminal device trains the preset deep model based on the noise sample set to obtain the training history features corresponding to the noise sample set. Specifically, the terminal device obtains the data label corresponding to the data contained in the noise sample set, and in the process of training the preset deep model based on the noise sample set, determines the prediction probability corresponding to the data contained in the noise sample set, and then determines the training history features based on the prediction probability. Among them, the prediction probability represents the probability that the label of the data contained in the noise sample set is the data label.
[0054] Optionally, in the present disclosure, the training history feature is the unnormalized probability value of all training samples obtained by the preset deep model in a training period, denoted as L. That is, L(i, t) represents the predicted probability of each class for the i-th sample in the t-th round, where L c (i, t) represents the predicted probability of the cth class. Let f represent the deep model, and the training history features can be calculated as follows:
[0055] L(i, t) = f (t) (x i )
[0056] In the above formula, x i Represents the input data. For the purpose of calculating gradients and updating parameters, the data label y i It is also necessary. That is, the data label y i Identify the input data x i The corresponding data label.
[0057] In addition, in this disclosure, the clean dataset (which may include potential label noise) is denoted as D, and its corresponding noisy dataset is denoted as D N . Where D includes (x i ,y i ), and D NIncluded in (x i ,y i N , k i ). Whether the label of the i-th sample is contaminated is recorded as k i , that is, k i Satisfy the following formula:
[0058]
[0059] That is, in this disclosure, D N It is only used for training the label noise detector g. The trained detector is recorded as
[0060] It should be noted that the performance of the clean sample set and the noise sample set is different during the training of the preset deep model. Therefore, the extraction of time series data corresponding to the training history features can provide a large number of distinguishable features for the detection of incorrectly labeled data in the sample set to be detected, so that the noise detector generated based on the training history features can accurately detect the incorrectly labeled data in the sample set to be detected.
[0061] In addition, in terms of time consumption, the solution provided in this embodiment only requires one round of additional training process to obtain training history features. Compared with the existing solution of detecting label noise through iterative cross-validation, the iterative method of the solution provided by the present disclosure is simpler and more time-saving, reduces the time consumption of iteration, and improves the iteration efficiency.
[0062] Furthermore, by Figure 2 It can be seen that after obtaining the training history features, the terminal device generates a noise detector based on the training history features and the noise sample set. Specifically, after obtaining the noise information, the terminal device trains the preset deep model based on the noise information to obtain an initial noise detector, and detects the training history features based on the initial noise detector to obtain the detection result, and then performs binary cross entropy calculation on the detection result and the data label corresponding to the noise sample set to obtain the calculation result, and finally, optimizes and iterates the initial noise detector based on the calculation result to obtain the noise detector.
[0063] It should be noted that the above-mentioned noise information may be noise information subjected to noise processing on the clean sample set, that is, the role of the noise information is to pollute the clean sample set. Therefore, in the present disclosure, the noise information may also be noise pollution information.
[0064] Optionally, in the present disclosure, the noise information is T = {t i}, that is, in this disclosure, L N As input features, D N The corresponding noise information T = {ti} as label supervision to train the label noise detector g, and construct the mapping relationship between the training history features and whether the data label is contaminated in a learning manner. Specifically, the label noise detector It can be expressed by the following formula:
[0065]
[0066] In the above formula, is a binary cross entropy loss function, and its corresponding optimizer can be but is not limited to AdamW optimizer. g represents the initial noise detector, Represents a noise detector.
[0067] In addition, considering that the dimension corresponding to the training history feature includes the number of training rounds, in the present disclosure, the noise detector can be instantiated as a long short-term memory model that is good at processing time series information. In addition, considering efficiency and generality, the long short-term memory model only inputs the probability corresponding to the true labeled category, that is, when the input is only In addition, in the process of generating noise detectors, other category information can be added to significantly increase the number of parameters and calculations of the noise detector, thereby improving the robustness of the noise detector.
[0068] In addition, the noise detector generated by the present disclosure It can be directly used on other data sets, that is, the noise detector provided by the present disclosure has good migration capabilities and is suitable for solving more general problems, thus avoiding the problem of poor migration performance to other data in the prior art.
[0069] It should be noted that, since the noise detector is generated based on training history features and a noise sample set, the noise detector generated by the present disclosure can effectively improve the detection accuracy of incorrectly labeled data.
[0070] From the above content, it can be seen that the solution provided by the present disclosure introduces a solution for detecting mislabeled data based on feature learning based on training historical features. Different from the solution of feature learning based on expert features and statistical information, the solution provided by the present disclosure can not only be used as an effective method for filtering mislabeled data on synthetic noise information and noise sample sets, but also can be directly used for unknown data sets with good transferability. That is, the solution provided by the present disclosure can be suitable as a data cleaning method for training data containing labeled noise.
[0071] Example 3
[0072] According to an embodiment of the present disclosure, the present disclosure also provides a method for detecting a sample, such as Figure 3As shown, in this embodiment, the terminal device can detect incorrectly labeled data in the sample set to be detected based on the noise detector.
[0073] Specifically, after obtaining the sample set to be detected, the terminal device trains a preset deep model based on the sample set to be detected, obtains the training history features corresponding to the sample set to be detected, and processes the training history features corresponding to the sample set to be detected based on the noise detector to obtain the target detection result of the data to be detected in the sample set to be detected, wherein the target detection result represents whether the label of the data to be detected matches the data to be detected.
[0074] Optional, such as Figure 3 As shown, D N represents the noise dataset, f represents the preset depth model, L N Represents the training history features corresponding to the noise dataset, represents the noise detector, T={t i} represents noise information. D represents the sample set to be detected, and L represents the training history features corresponding to the sample set to be detected.
[0075] Depend on Figure 3 It can be seen that based on the noise data set D N Train the deep model f to obtain the training history features L corresponding to the noise dataset N , then based on the training history feature L corresponding to the noise dataset N And the noise information T = {t i Generate noise detector
[0076] At the same time, the deep model is trained based on the sample set D to be detected, and the training history features L corresponding to the sample set to be detected are obtained. Then, based on the noise detector The historical feature L is trained to detect whether there is mislabeled data in the sample set D to be tested. Know Estimated label y i With feature x i Whether it matches, that is, Is it equal to 1. Among them, if Then the characteristic x i With label y i Mismatch, i.e. feature x i The data is incorrectly labeled.
[0077] It should be noted that, compared with the existing manual detection method, the present disclosure uses a noise detector to detect incorrectly labeled data in the sample set to be detected, thereby improving the detection efficiency and accuracy of incorrectly labeled data and saving detection costs.
[0078] Further, after obtaining the detection result of the sample set to be detected, the terminal device can optimize the data of the sample set to be detected based on the detection result. Specifically, the terminal device obtains the wrongly labeled data from the sample set to be detected based on the target detection result, obtains the wrongly labeled data, and removes the wrongly labeled data from the sample set to be detected, and / or corrects the label of the wrongly labeled data to obtain the target training sample. For example, after detecting the wrongly labeled data from the sample set to be detected, the terminal device directly deletes the wrongly labeled data from the sample set to be detected to achieve the purpose of data optimization of the sample set to be detected. For another example, after detecting the wrongly labeled data from the sample set to be detected, the terminal device can also re-label the wrongly labeled data to correct the label of the wrongly labeled data, thereby achieving the purpose of data optimization of the sample set to be detected. For example, the label corresponding to the characteristic data of the cat is "dog". After detecting the wrongly labeled data, the terminal device automatically recognizes that the label corresponding to the wrongly labeled data is "cat". At this time, the terminal device automatically updates the label "dog" to the label "cat".
[0079] In addition, the terminal device can also adjust the proportion of mislabeled data in the sample set to be tested based on the test results to meet the user's needs for model training.
[0080] Specifically, the terminal device obtains the wrongly labeled data from the sample set to be detected based on the target detection result, obtains the wrongly labeled data, and calculates the proportion of the wrongly labeled data in the sample set to be detected to obtain the wrongly labeled ratio. Then, based on the size of the wrongly labeled ratio and the preset wrongly labeled ratio, the data in the sample set to be detected is added and / or deleted to adjust the proportion of the wrongly labeled data in the sample set to be detected. For example, in actual applications, the wrongly labeled ratio required by the user is 1%, but the actual wrongly labeled ratio is 1.1%. In this scenario, the user can increase the amount of correctly labeled data in the sample set to be detected, or delete the wrongly labeled data so that the wrongly labeled ratio in the sample set to be detected reaches 1%.
[0081] It should be noted that the method for detecting samples provided by the present disclosure is relatively general, and only requires the model to be trained with an optimization algorithm of SGD or its variants. The method for detecting samples provided by the present disclosure is not limited to the above application scenarios, and can also be applied to image classification, image semantic segmentation, object detection, 3D point cloud classification, 3D point cloud semantic segmentation, 3D object detection, text classification, text sentiment analysis, etc. No more examples will be given here.
[0082] Example 4
[0083] According to an embodiment of the present disclosure, the present disclosure also provides a device for detecting a sample, such as Figure 4As shown, the device includes: an acquisition module 401, a training module 403 and a generation module 405.
[0084] Among them, the acquisition module 401 is used to obtain a noise sample set, wherein the noise sample set at least includes incorrectly labeled data; the training module 403 is used to train a preset deep model based on the noise sample set to obtain the training history features corresponding to the noise sample set, wherein the training history features represent the time series data generated by the noise sample set in the process of training the preset deep model; the generation module 405 is used to generate a noise detector based on the training history features and the noise sample set, wherein the noise detector is used to detect the incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected.
[0085] Optionally, the acquisition module includes: a first acquisition module and a noise module. The first acquisition module is used to acquire a clean sample set, wherein the amount of data with incorrect labeling in the clean sample set is less than a preset amount of data, and the amount of data with incorrect labeling in the noise sample set is greater than or equal to the preset amount of data; the noise module is used to perform noise processing on the clean sample set based on preset noise information to obtain a noise sample set.
[0086] Optionally, the training module includes: a second acquisition module, a first determination module and a second determination module. The second acquisition module is used to acquire the data label corresponding to the data contained in the noise sample set; the first determination module is used to determine the prediction probability corresponding to the data contained in the noise sample set in the process of training a preset deep model based on the noise sample set, wherein the prediction probability represents the probability that the label of the data contained in the noise sample set is the data label; the second determination module is used to determine the training history feature based on the prediction probability.
[0087] Optionally, the generation module includes: a third acquisition module, a first training module, a detection module, a first calculation module and an optimization module. Among them, the third acquisition module is used to obtain noise information; the first training module is used to train a preset deep model based on the noise information to obtain an initial noise detector; the detection module is used to detect the training history features based on the initial noise detector to obtain a detection result; the first calculation module is used to perform binary cross entropy calculation on the detection result and the data label corresponding to the noise sample set to obtain a calculation result; the optimization module is used to optimize and iterate the initial noise detector based on the calculation result to obtain a noise detector.
[0088] Optionally, the device for detecting samples further includes: a fourth acquisition module, a second training module, and a processing module. The fourth acquisition module is used to acquire a sample set to be detected; the second training module is used to train a preset deep model based on the sample set to be detected to obtain the training history features corresponding to the sample set to be detected; the processing module is used to process the training history features corresponding to the sample set to be detected based on the noise detector to obtain the target detection result of the data to be detected in the sample set to be detected, wherein the target detection result indicates whether the label of the data to be detected matches the data to be detected.
[0089] Optionally, the device for detecting samples further includes: a fifth acquisition module and a removal module. The fifth acquisition module is used to obtain wrongly labeled data from the sample set to be detected based on the target detection result to obtain wrongly labeled data; the removal module is used to remove the wrongly labeled data from the sample set to be detected and / or to correct the label of the wrongly labeled data to obtain the target training sample.
[0090] Optionally, the device for detecting samples further includes: a sixth acquisition module, a second calculation module, and a sample processing module. The sixth acquisition module is used to obtain the wrongly labeled data from the sample set to be detected based on the target detection result to obtain the wrongly labeled data; the second calculation module is used to calculate the proportion of the wrongly labeled data in the sample set to be detected to obtain the wrongly labeled ratio; the sample processing module is used to add and / or delete the data in the sample set to be detected based on the size of the wrongly labeled ratio and the preset wrongly labeled ratio, so as to adjust the proportion of the wrongly labeled data in the sample set to be detected.
[0091] Example 5
[0092] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0093] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0094] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0095] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0096] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a method for detecting a sample. For example, in some embodiments, the method for detecting a sample may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or a communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method for detecting a sample described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a method for detecting a sample by any other appropriate means (e.g., by means of firmware).
[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0098] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0101] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0102] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for detecting a sample, comprising: Acquire a noise sample set, wherein the noise sample set at least includes incorrectly labeled data; Training a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set, wherein the training history features represent time series data generated by the noise sample set during the process of training the preset deep model; Generate a noise detector based on the training history features and the noise sample set, wherein the noise detector is used to detect incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected; The method further includes: obtaining the sample set to be detected; training the preset deep model based on the sample set to be detected to obtain the training history features corresponding to the sample set to be detected; processing the training history features corresponding to the sample set to be detected based on the noise detector to obtain the target detection result of the data to be detected in the sample set to be detected, wherein the target detection result represents whether the label of the data to be detected matches the data to be detected; obtaining the wrongly labeled data from the sample set to be detected based on the target detection result to obtain the mislabeled data.
2. The method according to claim 1, wherein: Get a noise sample set, including: Acquire a clean sample set, wherein the amount of data with incorrect labeling in the clean sample set is less than a preset amount of data, and the amount of data with incorrect labeling in the noise sample set is greater than or equal to the preset amount of data; The clean sample set is subjected to noise processing based on preset noise information to obtain the noise sample set.
3. The method according to claim 1, wherein: Training a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set includes: Obtaining data labels corresponding to the data contained in the noise sample set; In the process of training the preset deep model based on the noise sample set, determining the prediction probability corresponding to the data contained in the noise sample set, wherein the prediction probability represents the probability that the label of the data contained in the noise sample set is the data label; The training history feature is determined based on the predicted probability.
4. The method according to claim 2, wherein: Generating a noise detector based on the training history features and the noise sample set includes: Acquiring the noise information; Training the preset depth model based on the noise information to obtain an initial noise detector; Detecting the training history feature based on the initial noise detector to obtain a detection result; Performing binary cross entropy calculation on the detection result and the data label corresponding to the noise sample set to obtain a calculation result; The initial noise detector is optimized iteratively based on the calculation result to obtain the noise detector.
5. The method according to claim 1, further comprising: The mislabeled data is removed from the sample set to be detected, and / or the labels of the mislabeled data are corrected to obtain target training samples.
6. The method according to claim 1, further comprising: Acquire mislabeled data from the to-be-detected sample set based on the target detection result to obtain mislabeled data; Calculate the proportion of the mislabeled data in the sample set to be detected to obtain the mislabeled proportion; Based on the difference between the mislabeling ratio and the preset mislabeling ratio, the data in the to-be-detected sample set is added and / or deleted to adjust the ratio of mislabeled data in the to-be-detected sample set.
7. A device for detecting a sample, comprising: An acquisition module, used for acquiring a noise sample set, wherein the noise sample set at least includes wrongly labeled data; A training module, used to train a preset deep model based on the noise sample set to obtain training history features corresponding to the noise sample set, wherein the training history features represent time series data generated by the noise sample set during the process of training the preset deep model; A generating module, configured to generate a noise detector based on the training history features and the noise sample set, wherein the noise detector is configured to detect incorrectly labeled data in the sample set to be detected based on the training history features corresponding to the sample set to be detected; Among them, the device also includes: a fourth acquisition module, used to acquire the sample set to be detected; a second training module, used to train the preset deep model based on the sample set to be detected, and obtain the training history features corresponding to the sample set to be detected; a processing module, used to process the training history features corresponding to the sample set to be detected based on the noise detector, and obtain the target detection result of the data to be detected in the sample set to be detected, wherein the target detection result represents whether the label of the data to be detected matches the data to be detected; a fifth acquisition module, used to obtain incorrectly labeled data from the sample set to be detected based on the target detection result, and obtain mislabeled data.
8. The device according to claim 7, wherein: The acquisition module comprises: A first acquisition module is used to acquire a clean sample set, wherein the amount of data with incorrect labeling in the clean sample set is less than a preset data amount, and the amount of data with incorrect labeling in the noise sample set is greater than or equal to the preset data amount; The noise module is used to perform noise processing on the clean sample set based on preset noise information to obtain the noise sample set.
9. The device according to claim 7, wherein: The training module includes: A second acquisition module, used to acquire data labels corresponding to the data included in the noise sample set; A first determination module is used to determine the prediction probability corresponding to the data included in the noise sample set during the process of training the preset deep model based on the noise sample set, wherein the prediction probability represents the probability that the label of the data included in the noise sample set is the data label; The second determination module is used to determine the training history feature based on the prediction probability.
10. The device according to claim 8, wherein: The generation module comprises: A third acquisition module is used to acquire the noise information; A first training module, used for training the preset deep model based on the noise information to obtain an initial noise detector; A detection module, used for detecting the training history feature based on the initial noise detector to obtain a detection result; A first calculation module, used to perform binary cross entropy calculation on the detection result and the data label corresponding to the noise sample set to obtain a calculation result; An optimization module is used to iteratively optimize the initial noise detector based on the calculation result to obtain the noise detector.
11. The device according to claim 7, further comprising: The elimination module is used to eliminate the mislabeled data from the sample set to be detected, and / or to correct the labels of the mislabeled data to obtain target training samples.
12. The device according to claim 7, further comprising: A sixth acquisition module, configured to acquire wrongly labeled data from the to-be-detected sample set based on the target detection result, to obtain wrongly labeled data; A second calculation module is used to calculate the proportion of the mislabeled data in the sample set to be detected to obtain the mislabeled proportion; The sample processing module is used to add and / or delete the data in the sample set to be detected based on the difference between the mislabeling ratio and the preset mislabeling ratio, so as to adjust the proportion of mislabeled data in the sample set to be detected.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for detecting a sample according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method for detecting a sample according to any one of claims 1 to 6.
15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for detecting a sample according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for training information extraction model and obtaining knowledge graph, and equipment for training information extraction model and obtaining knowledge graph
CN111737552A