Data cleaning method and computer readable storage medium
By constructing a neighbor set and a sample set, and using the label propagation method to iteratively update the data labels multiple times, the performance degradation caused by noisy labels in machine learning is solved, and the label accuracy of the dataset and the model training effect are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN MINIEYE INNOVATION TECH CO LTD
- Filing Date
- 2021-12-15
- Publication Date
- 2026-05-05
AI Technical Summary
Machine learning models suffer from performance degradation during training due to the presence of noisy labels, and existing technologies struggle to effectively clean datasets to reduce the impact of noisy labels.
By calculating the distance between data feature vectors, a neighbor set and a sample set are constructed. Using the idea of label propagation, the labels of the data are updated iteratively multiple times to reduce the impact of noisy labels.
This effectively reduces the interference of noisy labels, improves the label accuracy of the dataset, and ensures the effectiveness of subsequent model training and the accuracy of classification results.
Smart Images

Figure CN113934721B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, and in particular to a data cleaning method and a computer-readable storage medium. Background Technology
[0002] Machine learning technology is widely used in data classification, clustering, and other fields. Training machine learning models typically requires a large amount of labeled data. However, due to limitations such as unclear data and insufficient expertise of annotators, labeling errors are common, resulting in noisy labels. If a machine learning model is trained on a dataset with noisy labels, the model's performance may be negatively impacted by the noise. Summary of the Invention
[0003] In view of this, it is necessary to provide a data cleaning method and a computer-readable storage medium that can effectively clean the initial dataset and make the data labels more accurate.
[0004] In a first aspect, embodiments of the present invention provide a data cleaning method, the data cleaning method comprising:
[0005] Calculate the first distance between the feature vectors of every two data points in the initial dataset, wherein the data in the initial dataset includes feature vectors and original label vectors;
[0006] Construct a neighbor set that corresponds one-to-one with each of the data based on the first distance;
[0007] The initial classification model is trained based on the initial dataset to obtain an intermediate classification model;
[0008] Each of the aforementioned feature vectors is input into the intermediate classification model to obtain the corresponding predicted label vector;
[0009] A sample set is constructed based on the second distance between the original label vector and the predicted label vector;
[0010] Update the corresponding data based on the sample set and the neighbor set;
[0011] Determine if the preset number of data updates has been reached;
[0012] If the number of data updates does not reach the preset number, the updated data is used as the initial dataset to train the intermediate classification model to obtain a new intermediate classification model, and the data is updated again using the new intermediate classification model; and
[0013] When the number of data updates reaches a preset number, the current data will be used to form the target dataset.
[0014] Secondly, embodiments of the present invention provide a computer-readable storage medium for storing program instructions that can be executed by a processor to implement the data cleaning method described above.
[0015] The aforementioned data cleaning method and computer-readable storage medium construct a neighbor set based on the first distance between the feature vectors of every two data points, thereby finding data with similar features. A sample set is constructed based on the second distance between the original label vector and the predicted label vector, allowing for the selection of data with higher credibility. The corresponding data is then updated based on the sample set and the neighbor set, increasing the credibility of the data's label vector during the update process. Specifically, constructing a neighbor set using data with similar features and low loss (i.e., low noise) and employing the label propagation concept leverages the high probability that similar data will also have similar labels, propagating the labels of some data in the neighbor set to the corresponding data, effectively enhancing the data's labels and reducing noise. Selecting data with low loss (i.e., high credibility) for label propagation effectively avoids the negative impact of noisy labels. The use of a small number of iterative cleaning processes avoids data diversification and information loss during label propagation. Cleaning multi-label datasets effectively solves the interference of noisy labels, reducing their impact on the dataset and resulting in more accurate labels, leading to better classification results. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0017] Figure 1 A flowchart of the data cleaning method provided in the first embodiment of the present invention.
[0018] Figure 2 This is a first sub-flowchart of the data cleaning method provided in the first embodiment of the present invention.
[0019] Figure 3 This is a second sub-flowchart of the data cleaning method provided in the first embodiment of the present invention.
[0020] Figure 4 This is a sub-flowchart of the data cleaning method provided in the second embodiment of the present invention.
[0021] Figure 5 This is a schematic diagram of the internal structure of a terminal provided in an embodiment of the present invention.
[0022] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0024] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar planned objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data are interchangeable where appropriate; in other words, the described embodiments are implemented according to a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, may also include other content; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include one or more of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0026] Please refer to the following: Figure 1 This is a flowchart of the data cleaning method provided in the first embodiment of the present invention. The data cleaning method is used to clean the data in a multi-label dataset to reduce the impact of noisy labels on the dataset. The data cleaning method specifically includes the following steps.
[0027] Step S102: Calculate the first distance between the feature vectors of every two data points in the initial dataset. The data in the initial dataset includes, but is not limited to, images, text, and audio. The data in the initial dataset includes feature vectors and original label vectors. Feature vectors represent the unique information contained in the data, and original label vectors represent the labels included in the data; the original label vectors are 0-1 vectors. In this embodiment, each data point includes one feature vector and one original label vector. The data in the initial dataset includes at least one label, which includes both true labels and noise labels. It is understood that the data may only include true labels, only include noise labels, or include both true and noise labels. The label categories and the number of label categories are pre-defined. Each value in the original label vector corresponds one-to-one with each label category, and the number of values in the original label vector is the same as the number of label categories. For example, if the pre-defined label categories include a, b, c, d, and e, and data A includes labels c and d, then the original label vector of data A is (0, 0, 1, 1, 0). If label c is not a true label of data A, then label c is a noise label.
[0028] In this embodiment, the Euclidean distance between the feature vectors of every two data points is calculated as the first distance. A smaller first distance between two data points indicates a higher similarity between them; conversely, a larger first distance indicates a lower similarity.
[0029] Step S104: Construct a neighborhood set corresponding to each data point based on the first distance. Select any data point from the initial dataset as the reference data, and sort the first distances between the reference data and all other data points in the initial dataset in ascending order. Understandably, if the initial dataset has n data points, and the first distances between the n-1 data points (excluding the reference data) and the reference data are sorted, then there will be n-1 first distances corresponding to one of the reference data points, forming a total of n sorted first distances. The smaller the first distance between a data point and the reference data, the higher the similarity between them; the larger the first distance, the lower the similarity. Starting with the data point corresponding to the smallest first distance, select a second number of data points in ascending order to form a neighborhood set corresponding to the reference data. Understandably, in each sorted set, starting with the data point corresponding to the smallest first distance, select a second number of data points in ascending order to form a neighborhood set. Each data point in the initial dataset has a corresponding neighborhood set. Understandably, the selection criterion for the data in the neighborhood set is the data with higher similarity to the reference data. The specific value of the second quantity is set based on the similarity of the data labels in the initial dataset, and is not limited here. When the repetition or similarity of the data labels in the initial dataset is high, that is, the data labels are similar, the value of the second quantity can be smaller; when the repetition or similarity of the data labels in the initial dataset is low, that is, the data labels are not very similar, the value of the second quantity can be larger.
[0030] Step S106: Train the original classification model to obtain an intermediate classification model based on the initial dataset. Input the feature vectors of the data in the initial dataset into the original classification model to obtain the corresponding training label vectors, and update the parameters of the original classification model based on the original label vectors and the training label vectors to obtain the intermediate classification model. Input the feature vector of each data point into the original classification model to obtain the corresponding training label vector. It can be understood that the training label vector is the predicted classification result of the original classification model for the corresponding data based on the feature vectors. Update the parameters of the original classification model based on the difference between the original label vector and the training label vector for each data point to obtain the intermediate classification model. It can be understood that the current intermediate classification model is obtained by updating the parameters of the original classification model once. The original classification model is a multi-label classification model, which includes, but is not limited to, neural network models such as ML-KNN (multi-label k-Nearest Neighbor), ML-DT, and Rank-SVM.
[0031] Step S108 involves inputting each feature vector into the intermediate classification model to obtain the corresponding predicted label vector. After obtaining the intermediate classification model, the feature vector of each data point is input into the intermediate classification model to obtain the corresponding predicted label vector. It can be understood that the predicted label vector is the classification result predicted by the intermediate classification model for the corresponding data based on the feature vector. Since the intermediate classification model is obtained by updating the parameters of the original classification model, the accuracy of the predicted label vector is higher than the accuracy of the trained label vector.
[0032] Step S110: Construct a sample set based on the second distance between the original label vector and the predicted label vector. Calculate the second distance between the original label vector and the predicted label vector, and select a first number of data points from the initial dataset in ascending order of the second distance to form the sample set. In this embodiment, the Hamming distance between the original label vector and the predicted label vector is calculated as the second distance. Based on the second distance between the original label vector and the predicted label vector for each data point, starting with the data with the smallest second distance, select a first number of data points in ascending order to form the sample set. It can be understood that the smaller the second distance between the original label vector and the predicted label vector, the higher the probability that the data includes the true label; the larger the second distance between the original label vector and the predicted label vector, the higher the probability that the data includes noisy labels. Accordingly, the selection criterion for data in the sample set is that the data has a higher probability of including the true label. The first number is 15-50% of the data in the initial dataset. Preferably, the first number is 25% of the data in the initial dataset. That is, 25% of the data in the initial dataset is selected as the sample set based on the second distance.
[0033] Step S112: Update the corresponding data based on the sample set and the neighbor set. Based on the data in the sample set and the data in the neighbor set, update the original label vector of the data corresponding to the neighbor set to obtain a more accurate label vector. The specific process of updating the corresponding data based on the sample set and the neighbor set will be described in detail below.
[0034] Step S114: Determine whether the number of times the data has been updated has reached a preset number. If the number of times the data has been updated has not reached the preset number, proceed to step S116; if the number of times the data has been updated has reached the preset number, proceed to step S118. The preset number can be set according to actual circumstances. In this embodiment, the preset number is 10 times.
[0035] Step S116: The updated data is used as the initial dataset to train an intermediate classification model to obtain a new intermediate classification model, and the data is updated again using the new intermediate classification model. During the data update process, the noise rate of the labels in the initial dataset will decrease, meaning fewer and fewer data points will contain noisy labels, and more and more data points will only contain true labels. When the number of data updates does not reach the preset number, it indicates that the noise rate of the labels in the initial dataset is still high. Therefore, when the number of data updates does not reach the preset number, the intermediate classification model is trained using the updated data, and the data is updated again. It can be understood that when the number of data updates does not reach the preset number, steps S106 to S112 are repeated until the preset number of data updates is reached. When step S106 is repeated, the data in the initial dataset is the updated data, and the trained intermediate classification model is the intermediate classification model obtained in the previous training. Accordingly, the feature vector of the data is input into the intermediate classification model obtained in the previous training, and a new training label vector is obtained. Based on the updated data label vector and the new training label vector, the parameters of the intermediate model obtained from the previous training are updated to obtain the currently trained intermediate classification model. When step S108 is re-executed, the feature vectors of the data are predicted based on the currently trained intermediate classification model to obtain new predicted label vectors. It is understood that the accuracy of the new predicted label vector is higher than that of the previous predicted label vector. When step S110 is re-executed, a new sample set is constructed based on the updated data label vector and the new predicted label vector. The process of constructing the new sample set can refer to step S110 above and will not be repeated here. It is understood that the probability of the data in the new sample set including true labels is higher than that in the previous sample set. When step S112 is re-executed, the label vectors of the data corresponding to the neighbor set are updated again based on the data in the new sample set and the data in the neighbor set. It is understood that the neighbor set corresponding to each data point does not change during the data update process.
[0036] Step S118: Form the target dataset from the current data. This means using the last updated data as the target dataset. Since the noise rate of the labels in the initial dataset decreases rapidly at first, then more slowly in subsequent updates, a preset number of updates is set to limit the number of updates. This ensures that forming the target dataset involves minimal computation while efficiently and quickly obtaining data with low noise.
[0037] In the above embodiments, a neighbor set is constructed based on the first distance between the feature vectors of every two data points, thereby finding data with similar features. A sample set is constructed based on the second distance between the original label vector and the predicted label vector of the data, which can filter out data with high credibility as the sample set. Then, the corresponding data is updated based on the sample set and the neighbor set, so that the credibility of the data's label vector increases more and more during the update process. In particular, using data with relatively similar features and low loss (i.e., low noise) to construct the neighbor set, the label propagation idea is adopted. Taking advantage of the fact that data with similar features also have a high probability of similar labels, the labels of some data in the neighbor set are propagated to the corresponding data, which can effectively enhance the labels of the data, i.e., reduce noise. Selecting data with low loss (i.e., relatively reliable) to construct the sample set for label propagation can effectively avoid the negative impact of noisy labels. Using a small number of iterations of cleaning process, data diversification and information loss caused by label propagation are avoided. Cleaning the data of multi-label datasets can effectively solve the interference of noisy labels, reduce the impact of noisy labels on the dataset, and thus obtain more accurate labels, resulting in better classification results. The data cleaning method is applicable to data of any form and has strong practicality. The process of creating the target dataset is very simple and feasible, enabling faster and cheaper acquisition of target datasets with more accurate labels, thus facilitating the subsequent application of the target dataset.
[0038] Please refer to the following: Figure 2 and Figure 3 , Figure 2 This is a first sub-flowchart of the data cleaning method provided in the first embodiment of the present invention. Figure 3 This is a second sub-flowchart of the data cleaning method provided in the first embodiment of the present invention. Step S112 specifically includes the following steps.
[0039] Step S202: Analyze the intersection of the sample set and the neighbor set. Analyze the data in each neighbor set and the data in the sample set separately, and take the overlapping data between each neighbor set and the sample set as the intersection with the corresponding data in the neighbor set. It can be understood that the data in the intersection is data with high credibility and high similarity to the corresponding data.
[0040] Step S204: Determine whether the number of data in the intersection is greater than or equal to a preset value. In this embodiment, the preset value is 4. In some feasible embodiments, the preset value can be set according to the actual situation. When the number of data in the intersection is greater than or equal to the preset value, proceed to step S206; when the number of data in the intersection is less than the preset value, no processing is performed on the data corresponding to the intersection.
[0041] Step S206 involves updating the data corresponding to the neighbor sets based on the data from the intersection. It's understandable that if the amount of data in the intersection is small, and the majority of the data in the intersection contains noisy labels, updating the data based on the intersection data might increase the noise in the data's label vectors, reducing their reliability. Therefore, when the amount of data in the intersection is less than a preset value, no data processing is performed; only when the amount of data in the intersection is greater than or equal to the preset value is the corresponding data updated based on the intersection data. Step S206 specifically includes the following steps.
[0042] Step S2061: Calculate the average of the original label vectors of all data in the intersection as the first average vector. Calculate the average of the original label vectors of all data in each intersection as the first average vector of the corresponding intersection.
[0043] Step S2063: Calculate the average of the original label vectors of the corresponding data in the first average vector and the neighbor set as the second average vector. Then, use the average of the first average vector of the corresponding intersection and the neighbor set, and the average of the original label vectors of the benchmark data as the second average vector.
[0044] Step S2065 updates the original label vector of the data corresponding to the neighbor set to the second average vector. That is, the original label vector of the corresponding benchmark data is replaced with the second average vector.
[0045] Understandably, after a data update, the original label vectors of at least some data in the initial dataset are updated to the second average vector. When the data is updated again and step S112 is executed again, the average of the original label vectors or second average vectors of all data in the intersection is calculated as the new first average vector, and the average of the new first average vector and the corresponding original label vectors or second average vectors is calculated as the new second average vector. Understandably, during the data update process, the original label vectors of some data in the initial dataset may be updated multiple times, that is, after the original label vector is replaced with the second average vector, the second average vector will be replaced with the new second average vector multiple times; the original label vectors of some data may not be updated. Accordingly, when the number of data updates reaches a preset number, the original label vectors of all data in the target dataset may be replaced with the second average vector; the original label vectors of some data in the target dataset may not be replaced, while the original label vectors of other data may be replaced with the second average vector.
[0046] In the above embodiments, the intersection of the sample set and the neighbor set is analyzed, and the original label vectors of the data in the intersection are used for label propagation. That is, the original label vectors of data with high credibility and high similarity are used for label propagation, which can effectively enhance the labels of the corresponding data. Specifically, the average of the original label vectors of all data in the intersection is used as the first average vector, and the average of the original label vectors of the corresponding data is used as the second average vector. This is equivalent to propagating the original label vectors of the data in the intersection to the corresponding data, thereby increasing the credibility of the data label vectors and reducing noisy labels. In addition, the data is only updated when the number of data in the intersection is greater than or equal to a preset value, which can reduce the influence of noisy labels and increase the credibility of the updated data label vectors. Ensuring that the proportion of the original label vectors of all data to be updated in the second average vector is equal makes the amplitude of label propagation more stable.
[0047] Please refer to the following: Figure 4 This is a sub-flowchart of the data cleaning method provided in the second embodiment of the present invention. The difference between the data cleaning method provided in the second embodiment and the data cleaning method provided in the first embodiment is that, in the data cleaning method provided in the second embodiment, step S206 specifically includes the following steps.
[0048] Step S2062: Calculate the weighted average vector of the original label vectors of all data in the intersection and the original label vectors of the corresponding data in the neighbor set. In this embodiment, the weight of each data in the intersection is set to 1, and the weight of the corresponding data in the neighbor set is set to the number of data in the intersection. For example, if the intersection includes 6 data, then the weight of the corresponding data is 6. In some feasible embodiments, the weight of the data corresponding to the neighbor set can be set according to the actual situation. The weighted average vector is obtained by multiplying the original label vectors of all data in the intersection and the original label vectors of the corresponding data by their respective weights, and then dividing by the sum of all weights.
[0049] Step S2064 updates the original label vector of the data corresponding to the neighbor set to a weighted average vector. That is, the original label vector of the corresponding benchmark data is replaced with a weighted average vector.
[0050] Understandably, after a data update, the original label vectors of at least some data in the initial dataset are updated to weighted average vectors. When the data is updated again and step S112 is executed again, the average of the original label vectors or weighted average vectors of all data in the intersection and the corresponding original label vectors or weighted average vectors is calculated as the new weighted average vector. Understandably, during the data update process, the original label vectors of some data in the initial dataset may be updated multiple times, that is, after the original label vectors are replaced with weighted average vectors, the weighted average vectors will be replaced with new weighted average vectors multiple times; the original label vectors of some data may not be updated. Accordingly, when the number of data updates reaches a preset number, the original label vectors of all data in the target dataset may be replaced with weighted average vectors; the original label vectors of some data in the target dataset may not be replaced, while the original label vectors of other data may be replaced with weighted average vectors.
[0051] The other processes of the data cleaning method provided in the second embodiment are basically the same as those of the data cleaning method provided in the first embodiment, and will not be described in detail here.
[0052] Please refer to the following: Figure 5 This is a schematic diagram of the internal structure of a terminal provided in an embodiment of the present invention. The terminal 10 includes a computer-readable storage medium 11, a processor 12, and a bus 13. The computer-readable storage medium 11 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium 11 can be an internal storage unit of the terminal 10, such as the hard disk of the terminal 10. In other embodiments, the computer-readable storage medium 11 can also be an external storage device of the terminal 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal 10. Furthermore, the computer-readable storage medium 11 can include both internal storage units and external storage devices of the terminal 10. The computer-readable storage medium 11 can be used not only to store application software and various types of data installed on the terminal 10, but also to temporarily store data that has been output or will be output.
[0053] Bus 13 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0054] Furthermore, the terminal 10 may also include a display component 14. The display component 14 may be a light-emitting diode (LED) display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touchscreen, etc. The display component 14 may also be appropriately referred to as a display device or display unit, used to display information processed in the terminal 10 and to display a visual user interface.
[0055] Furthermore, the terminal 10 may also include a communication component 15. The communication component 15 may optionally include a wired communication component and / or a wireless communication component, such as a Wi-Fi communication component, a Bluetooth communication component, etc., which are typically used to establish a communication connection between the terminal 10 and other smart control devices.
[0056] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, used to run program code stored in computer-readable storage medium 11 or process data. Specifically, processor 12 executes a processing program to control terminal 10 to implement a data cleaning method.
[0057] Figure 5 Only components 11-15 and a terminal 10 for implementing the data cleaning method are shown; those skilled in the art will understand that... Figure 5 The structure shown does not constitute a limitation on terminal 10. Terminal 10 may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0059] The above-listed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for cleaning image tag data, characterized in that, The image label data cleaning method includes: Calculate the first distance between the feature vectors of every two data points in the initial dataset, wherein the initial dataset includes several images, and the data in the initial dataset includes the feature vector of each image and the original label vector of each image; Construct a neighbor set that corresponds one-to-one with each of the data based on the first distance; The initial classification model is trained based on the initial dataset to obtain an intermediate classification model; Each of the aforementioned feature vectors is input into the intermediate classification model to obtain the corresponding predicted label vector; A sample set is constructed based on the second distance between the original label vector and the predicted label vector; Update the corresponding data based on the sample set and the neighbor set; Determine if the preset number of data updates has been reached; If the number of data updates does not reach the preset number, the updated data is used as the initial dataset to train the intermediate classification model to obtain a new intermediate classification model, and the data is updated again using the new intermediate classification model; and When the number of data updates reaches a preset number, the current data will be used to form the target dataset; Specifically, constructing the sample set based on the second distance between the original label vector and the predicted label vector includes: Calculate the second distance between the original label vector and the predicted label vector; and The sample set is formed by selecting a first number of data points from the initial dataset in ascending order of the second distance; Updating the corresponding data based on the sample set and the neighbor set specifically includes: Analyze the intersection of the sample set and the neighbor set; Determine whether the number of data in the intersection is greater than or equal to a preset value; and When the number of data in the intersection is greater than or equal to a preset value, update the data corresponding to the neighbor set according to the data in the intersection; Specifically, updating the data corresponding to the neighbor set based on the data of the intersection includes: Calculate the average of the original label vectors of all data in the intersection as the first average vector; The average of the first average vector and the original label vectors of the data corresponding to the neighbor set is calculated as the second average vector; and Update the original label vector of the data corresponding to the neighbor set to the second average vector; or Calculate the weighted average vector of the original label vectors of all data in the intersection and the original label vectors of the data corresponding to the neighbor set; and The original label vector of the data corresponding to the neighbor set is updated to the weighted average vector.
2. The image tag data cleaning method as described in claim 1, characterized in that, Calculating the second distance between the original label vector and the predicted label vector specifically includes: The Hamming distance between the original label vector and the predicted label vector is calculated as the second distance.
3. The image tag data cleaning method as described in claim 1, characterized in that, Constructing a neighbor set corresponding one-to-one with each of the data based on the first distance specifically includes: Select any one data point from the initial dataset as the baseline data in sequence; Sort the first distances between the benchmark data and the data in the initial dataset other than the benchmark data in ascending order; and Starting with the data corresponding to the minimum first distance, a second number of data are selected sequentially to form a neighbor set corresponding to the benchmark data.
4. The image tag data cleaning method as described in claim 1, characterized in that, Calculating the first distance between the feature vectors of every two data points in the initial dataset specifically includes: The Euclidean distance between the feature vectors of every two data points is calculated as the first distance.
5. The image tag data cleaning method as described in claim 1, characterized in that, Training the initial classification model based on the initial dataset to obtain the intermediate classification model specifically includes: The feature vectors of the data in the initial dataset are input into the original classification model to obtain the corresponding training label vectors; and The parameters of the original classification model are updated based on the original label vector and the training label vector to obtain the intermediate classification model.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed by a processor to implement the image tag data cleaning method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Community discovering method and device based on label propagation algorithm
CN107862618A
A method and system for extracting label dependencies from neighbor instances
CN109086453A