Active learning method, device and storage medium based on data uncertainty and diversity
By incorporating data uncertainty and diversity sampling strategies into active learning methods and selecting high-information samples for annotation, the problems of sample redundancy and high cost in existing technologies are solved, achieving efficient model training and improved classification performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHENGZHOU UNIV
- Filing Date
- 2023-07-11
- Publication Date
- 2026-07-07
AI Technical Summary
Existing active learning methods have shortcomings in measuring the degree of sample uncertainty and selecting sample data with high information content, resulting in redundancy problems and high manual annotation costs, and the model performance needs to be improved.
A hybrid sampling strategy based on data uncertainty and diversity is adopted. By calculating the uncertainty and diversity index of unlabeled data, high-information samples are selected for manual annotation, and the annotation classification model is continuously updated during iterative training.
It effectively alleviated the problem of sample redundancy, reduced the cost of manual annotation, improved the classification performance of the model, and achieved better sampling and classification results.
Smart Images

Figure CN116720570B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an active learning method, device, and storage medium based on data uncertainty and diversity. Background Technology
[0002] In the rapidly developing era of big data, the amount of image data is also increasing daily. For example, medical images, autonomous driving, anomaly detection, and other related technologies based on internet big data all face the challenges of high data annotation costs and difficulties. Therefore, active learning has emerged. Active learning is a machine learning or artificial intelligence method that actively selects the most valuable samples for annotation. Currently, active learning can be divided into three types: stream-based query, query retrieval, and query synthesis methods.
[0003] In this process, query retrieval involves selecting high-information-content sample data through different sampling strategies. The goal is to achieve the best possible model performance using as few high-quality sample labels as possible. In other words, active learning methods can improve the gain of both samples and labels, maximizing model performance within a limited labeling budget. It is a solution to improve data efficiency from the perspective of samples.
[0004] In data retrieval, there are three main methods: based on data uncertainty, based on data diversity, and their combination, to select sample data with high information content to build a classification model. In existing technologies, uncertainty-based methods tend to collect samples with similar features, leading to sampling redundancy, failing to select sample data with higher information content, and not effectively measuring the degree of sample uncertainty. Diversity-based methods primarily focus on the feature diversity of samples, ignoring samples near the model's decision boundary, requiring extensive manual annotation to find the optimal decision boundary. Therefore, existing technologies suffer from problems such as ineffective measurement of sample uncertainty, inability to select sample data with higher information content, high manual annotation costs, and the need for improved model performance. Summary of the Invention
[0005] The main technical problem addressed by this invention is to provide an active learning method, device, and storage medium based on data uncertainty and diversity, thereby solving the problems of not being able to effectively measure the degree of sample uncertainty, not being able to select sample data with higher information content, requiring a large amount of manual annotation costs, and the need to improve model performance.
[0006] To address the aforementioned technical problems, one technical solution adopted by this invention is to provide an active learning method based on data uncertainty and diversity, comprising the following steps:
[0007] The first step is to work on the first unlabeled dataset. In this process, a portion of the samples are randomly selected and manually annotated to form the first labeled data R. l and put the first labeled data R l From the first unlabeled dataset Extract it and put it into the first labeled dataset. And update the data R after removing the first marker. l The unlabeled dataset is the second unlabeled dataset.
[0008] The second step is to utilize the first labeled dataset. The first labeled data R in l The annotation and classification model is trained to form the initial annotation and classification model W. b .
[0009] The third step is to use the initial labeled classification model W. b Calculate the second unlabeled dataset The degree of uncertainty C corresponding to each unlabeled data point.
[0010] The fourth step is to start with the second unlabeled dataset. Bb first-selection samples are chosen from the second unlabeled dataset, and the corresponding uncertainty C is equal to or greater than a preset standard value. In addition, b second-selection samples are selected, and the corresponding diversity indicators meet the preset requirements. The first and second selection samples are combined to form B high-information samples Q. u Where B is a preset high-information sample Q u The quantity.
[0011] Fifth step, analyze the B high-information samples Q. u Manual annotation is performed to form the second labeled data Q. l ;
[0012] Step 6, transfer the second labeled data Q l From the second unlabeled dataset Extracted and added to the first labeled dataset. In the first unlabeled dataset, the second unlabeled dataset is used as the first labeled dataset to begin the next round of training iterations. The second labeled data Q was extracted. l Then, it serves as the first unlabeled dataset at the start of the next round of training iterations.
[0013] Step 7: Begin the next round of iterative training, repeating the above steps until the expected classification performance or number of iterations is achieved. Then, stop iterating to form the final labeled classification model W. e .
[0014] Preferably, the initial labeled classification model W is used. b Calculate the second unlabeled dataset The degree of uncertainty C corresponding to each unlabeled data point includes:
[0015] Based on the initial labeled classification model W b Infer the probability estimate vector P of the unlabeled data; use the probability estimate vector P to calculate the uncertainty C of the unlabeled data according to the uncertainty calculation method.
[0016] Preferably, the probability estimation vector P is represented as:
[0017] p(y i =j|X i ;W)
[0018] Among them, X i Represents the i-th unlabeled data, y i Represents the i-th initially labeled classification model W b The predicted pseudo-labeled data, where j represents the unlabeled data X. i It belongs to the j-th class, and W represents the parameters of the prediction network convolutional neural network.
[0019] The preferred method for calculating the degree of uncertainty is as follows:
[0020]
[0021] Where C represents the degree of uncertainty; p1(y i =j|X i W) represents sample data X i The initial labeled classification model W b Predicted pseudo-label data y i The maximum probability estimate vector value belonging to the j-th class; p2(y i =j|X i W) represents sample data X i The initial labeled classification model W b Predicted pseudo-label data y i , which is the second most probable estimated vector value belonging to the j-th class.
[0022] Preferably, start with the second unlabeled dataset. The method for selecting Bb first-choice samples from the dataset, and whose corresponding uncertainty C is equal to or greater than a preset standard value, includes: sorting the uncertainty C values of the unlabeled dataset in ascending or descending order, with the preset standard value being the C value of the Bbth unlabeled data from the end or the Bbth from the beginning, and selecting the next Bb or the first Bb samples in sequence accordingly.
[0023] Preferably, the diversity index meets the preset requirements as follows: taking all labeled samples and the Bb samples initially selected based on uncertainty as the center point, draw a circle with a certain radius outward to minimize the coverage radius of the unlabeled sample points in other unlabeled datasets, and select b unlabeled samples with diversity.
[0024] Preferably, the neural network used to train the labeled classification model includes ResNet18, ImageNet, or ResNet50.
[0025] The present invention also provides a computer device, including a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the processor executes the instructions to implement the aforementioned active learning method.
[0026] The present invention also provides a computer storage medium storing computer-executable instructions, which, when executed, implement the aforementioned active learning method.
[0027] The beneficial effects of this invention are as follows: The aforementioned active learning method based on data uncertainty and diversity alleviates the redundancy problem caused by uncertainty through sample diversity, thereby selecting sample data with higher information content, obtaining better sampling results, and ultimately obtaining a labeled classification model with better classification performance. This model reduces the cost of manual annotation and achieves good classification results. Furthermore, this active learning method also proposes a method for calculating the degree of sample uncertainty, providing a better standard for measuring the degree of sample uncertainty. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating an embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram illustrating the principle of the K-center problem used in selecting diverse samples according to the present invention;
[0030] Figure 3 This is a comparison chart of experimental results on CIFAR-100 based on the present invention and existing methods;
[0031] Figure 4 This is a comparison chart of experimental results on Fashion-MNIST based on the present invention and existing methods;
[0032] Figure 5 This is a comparison chart of ablation experimental results based on the present invention and existing methods;
[0033] Figure 6 This is a comparison chart of the experimental results of runtime compared with existing methods according to the present invention. Detailed Implementation
[0034] To facilitate understanding of the present invention, a more detailed description is provided below with reference to the accompanying drawings and specific embodiments. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0035] It should be noted that, unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0036] Figure 1 The diagram illustrates a flowchart of an embodiment of an active learning method based on data uncertainty and diversity according to the present invention, including the following steps:
[0037] The first step is to work on the first unlabeled dataset. In this process, a portion of the samples are randomly selected and manually annotated to form the first labeled data R. l and put the first labeled data R l From the first unlabeled dataset Extract it and put it into the first labeled dataset. And update the data R after removing the first marker. l The subsequent unlabeled dataset is the second unlabeled dataset.
[0038] The second step is to utilize the first labeled dataset. The first labeled data R in l The annotation and classification model is trained to form the initial annotation and classification model W. b .
[0039] In this embodiment, the present invention uses ResNet18 to train on the first labeled dataset. ResNet18 is a very popular convolutional neural network used for computer vision tasks such as image classification and object detection. It is a deep neural network that uses residual blocks. Of course, the present invention can also use other neural network models, such as ImageNet, ResNet50, etc., and is not limited here.
[0040] The third step is to use the initial labeled classification model W. b Calculate the second unlabeled dataset The degree of uncertainty C corresponding to each unlabeled data point.
[0041] The fourth step is to start with the second unlabeled dataset. Bb first-selection samples are chosen from the second unlabeled dataset, and the corresponding uncertainty C is equal to or greater than a preset standard value. In addition, b second-selection samples are selected, and the corresponding diversity indicators meet the preset requirements. The first and second selection samples are combined to form B high-information samples Q. u Where B is a preset high-information sample Q u The quantity.
[0042] This method of combining the first and second selection samples to form a high-information sample is called the Con-coreset method in this invention. Con is a sampling method based on the degree of uncertainty in the first selection sample of this invention, and Coreset is an existing sampling method based on diversity in the second selection sample of this invention. The Con-coreset method mentioned below is the hybrid sampling method proposed in this invention.
[0043] The beneficial effects of this Con-coreset sampling method are that it not only alleviates the problems of sample similarity and redundancy caused by uncertainty, but also accelerates the convergence of diversity-based methods. This is because, compared to diversity-based methods, the hybrid sampling method of this invention has an additional uncertainty sampling process, which helps to find samples that are difficult for the model to distinguish and accelerates the finding of the model's decision boundary.
[0044] Fifth step, analyze the B high-information samples Q. u Manual annotation is performed to form the second labeled data Q. l .
[0045] Step 6, transfer the second labeled data Q l From the second unlabeled dataset Extracted and added to the first labeled dataset. In the first unlabeled dataset, the second unlabeled dataset is used as the first labeled dataset to begin the next round of training iterations. The second labeled data Q was extracted. l Then, it serves as the first unlabeled dataset at the start of the next round of training iterations.
[0046] Step 7: Begin the next round of iterative training, repeating the above steps until the expected classification performance or number of iterations is achieved. Then, stop iterating to form the final labeled classification model W. eThe number of iterations is the preset number of iterations before active learning begins. This preset number of iterations is an optimal value that takes into account both iteration cost and model performance. If the cost incurred in a certain iteration is greater than the cost savings brought by the model performance optimization in this iteration, then no further iterations will be performed. The multiple iterations before this iteration can be used as the preset number of iterations.
[0047] The aforementioned active learning method based on data uncertainty and diversity employs a hybrid sampling strategy that combines data uncertainty and diversity. By leveraging sample diversity, it mitigates the redundancy problem caused by uncertainty, thereby selecting sample data with higher information content. This invention manually annotates these high-information samples and merges them into a labeled dataset. Finally, the model is updated and optimized using a new labeled dataset. This process is repeated to obtain a labeled classification model with good classification performance. This model reduces the cost of manual annotation and achieves good classification results.
[0048] Preferably, the initial labeled classification model W is used. b Calculate the second unlabeled dataset Methods for determining the degree of uncertainty C for each unlabeled data point include:
[0049] Based on the initial labeled classification model W b The probability estimate vector P of the unlabeled data is inferred.
[0050] Using the probability estimation vector P, the uncertainty C of the unlabeled data is calculated according to the uncertainty calculation method.
[0051] Preferably, the probability estimation vector P can be represented as: p(y i =j|X i ;W), where X i Represents the i-th unlabeled data, y i Represents X i The initial labeled classification model W b The predicted data is called pseudo-labeled data because labeling and classification models cannot predict unlabeled data with 100% accuracy like manual labeling. Therefore, in the field of active learning technology, it is called "pseudo-labeled". i =j represents pseudo-label data y i It belongs to class j, where W represents the parameters of the prediction network convolutional neural network. Here, class j means that the trained neural network can extract image features and automatically classify them based on the extracted image features.
[0052] The preferred method for calculating the degree of uncertainty is as follows: Where C represents the degree of uncertainty; p1(y i=j|X i ;W) represents unlabeled data X i The initial labeled classification model W b Predicted pseudo-label data y i The maximum probability estimate vector value belonging to the j-th class; p2(y i =j|X i ;W) represents unlabeled data X i The initial labeled classification model W b Predicted pseudo-label data y i The second most probable estimated vector value belonging to class j.
[0053] Here, to avoid interference from unimportant categories, this invention uses the maximum probability estimate vector value and the second highest probability estimate vector value of unlabeled samples to calculate the uncertainty of the samples. In practical applications, some other methods, such as entropy-based uncertainty sampling methods, which consider all probability estimates of the sample's category, are easily affected by categories with lower probability values. However, this invention's method for assessing the uncertainty of unlabeled data provides a new criterion for evaluating the uncertainty of unlabeled data, avoids interference from unimportant categories, and can more accurately capture samples that affect model performance.
[0054] Where, when p1(y i =j|X i ;W) and p2(y i =j|X i The closer the value of p1(y) is to -0.5, the closer the value of C is to -0.5; conversely, when p1(y) is closer to -0.5, the closer the value of C is to -0.5. i =j|X i ;W) and p2(y i =j|X i The greater the difference between W and C, the closer the value of C is to -1; the closer the value of C is to -0.5, the higher the uncertainty of the unlabeled data; the closer the value of C is to -1, the lower the uncertainty of the unlabeled data.
[0055] Preferably, the method mentioned in step four, where the uncertainty level C is equal to or greater than the preset standard value, is as follows: the uncertainty level C values of the unlabeled dataset are sorted in ascending or descending order; the preset standard value is the C value of the Bbth unlabeled data from the end, or the C value of the Bbth unlabeled data from the beginning; correspondingly, the last Bb samples or the first Bb samples are selected in sequence. Obviously, the uncertainty level C corresponding to the first Bb samples or the last Bb samples is equal to or greater than the preset standard value.
[0056] Preferred, combined Figure 2As shown, the diversity index meets the preset requirement as follows: taking all labeled samples and the initial Bb samples selected based on uncertainty as the center points, draw circles outward with a set radius, minimizing the coverage radius of these circles on unlabeled sample points in other unlabeled datasets. Using this method, b unlabeled samples are selected. The above method for selecting samples representing the feature distribution of the entire dataset based on diversity is the Coreset method. This is a high-performance diversity-based sampling method. Coreset uses the solution to the K-center problem to select diverse samples. The K-center problem is to find the center point that minimizes the maximum distance between other data points and their nearest center point. In other words, the smaller the radius in the graph, the more representative the selected unlabeled samples are of the feature distribution of the entire unlabeled dataset.
[0057] Combination Figure 3 , Figure 4 As shown, the vertical axis represents the accuracy improvement of the comparison algorithm compared to the random algorithm, and the horizontal axis represents the number of labeled data used to train the model, where "#" represents the quantity. The performance of five active learning methods based on existing sampling strategies and the active learning method based on the Con-coreset sampling strategy of this invention was evaluated, and experimental verification was performed on the CIFAR-100 and Fashion-MNIST datasets, respectively.
[0058] CIFAR-100 is an image dataset containing various images across 100 categories, with 600 images per category. Each image is 32×32 pixels, and the training, test, and validation sets contain 50,000, 10,000, and 5,000 images, respectively. Fashion-MNIST is a clothing image dataset where each sample is a 28×28 grayscale image, encompassing 10 categories. The training, test, and validation sets contain 60,000, 10,000, and 5,000 images, respectively. The experimental results for Random Sampling (baseline) Active Learning, TA-VAAL Task-Aware Variational Adversarial Active Learning, VAAL Variational Adversarial Active Learning, Learning Loss-based Active Learning, Coreset-based Active Learning, and the Con-coreset-based Active Learning method of this invention are all averages of five experiments. Figure 3 and Figure 4 In the study, it is evident that the active learning method based on Con-coreset outperforms other comparative methods, demonstrating significant effectiveness throughout the entire process.
[0059] To further explore the impact of each module on the overall model, ablation experiments were conducted on CIFAR-100. Ablation experiments, similar to the controlled variable method, are commonly used to verify the effect of a particular module on the overall method. The experimental results are the average of five results. Figure 5 The performance of the proposed method is shown with and without Con-based and Coreset-based modules. Based on the foregoing description, Con is known to be a sampling method based on the degree of uncertainty, while Coreset is a sampling method based on diversity. Additionally, Entropy is an entropy-based uncertainty sampling method, and Entropy-coreset is a method that combines Coreset and Entropy.
[0060] Combination Figure 5 As shown, the vertical axis represents the accuracy improvement of the comparison algorithm compared to the random algorithm, and the horizontal axis represents the number of labeled data used to train the model, where "#" represents the quantity. The Con-coreset method of this invention performs best in all stages, indicating that combining the Con uncertainty sampling strategy with Coreset can improve the accuracy of the Coreset algorithm. Compared with existing uncertain sampling strategies based on Entropy, the Con of this invention outperforms Entropy in accuracy at almost all stages. This is because Entropy is affected by unimportant categories and cannot select samples with high information content. The reason why Entropy-coreset is inferior to the Con-coreset of this invention is that Entropy is disturbed by unimportant categories in the early stage and cannot obtain more uncertain samples, which makes it unable to obtain more diverse samples through Coreset in the later stage. In summary, the active learning method based on the Con-coreset sampling strategy of this invention can improve the accuracy of the model.
[0061] Combination Figure 6 As shown, the running time of six active learning algorithms on CIFAR-100 was compared. The results show that the method of this invention consumes less time compared to all the compared algorithms, even though it adds a module Con to calculate sample uncertainty compared to the Coreset method. However, the Coreset technique is based on high-dimensional data features of the samples and has a very high computational cost. The Con module of this invention, on the other hand, is based on the prediction results of the classification model and only uses the highest and second highest probabilities of sample classification, which makes it relatively less computationally intensive.
[0062] In summary, under the same manual annotation cost, the classification performance of the method proposed in this invention outperforms state-of-the-art active learning methods, and the method of this invention is less time-consuming compared to other methods. Ablation experiments show that the uncertainty measurement method Con of this invention is superior to existing entropy-based methods, and the performance of the Con-coreset method of this invention is significantly improved compared to Coreset.
[0063] The above are merely embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An active learning method based on data uncertainty and diversity, characterized in that, The data includes image data, and the method is used for computer vision task processing, including the following steps: The first step is to work on the first unlabeled dataset. In this process, a portion of the samples were randomly selected and manually annotated to form the first labeled data. and the first marked data From the first unlabeled dataset Extract it and put it into the first labeled dataset. and update the data after removing the first marker. The unlabeled dataset is the second unlabeled dataset. ; The second step is to utilize the first labeled dataset. First tag data Train the labeled classification model to form an initial labeled classification model. This includes using ResNet18 on the first labeled dataset. The ResNet18 was trained for computer vision tasks; The third step is to utilize the initial annotation classification model. Calculate the second unlabeled dataset The degree of uncertainty corresponding to each unlabeled data point ; The fourth step is to start with the second unlabeled dataset. Select Bb A first selected sample, and the corresponding degree of uncertainty. If the value is equal to or greater than a preset standard value, then it is taken from the second unlabeled dataset. Another selection b A second selection sample, and the corresponding diversity index meets the preset requirements, is formed by combining the first selection sample and the second selection sample. B A high-information sample ,in B For pre-set high-information samples Quantity; Fifth step, for B The high-information-content samples Manual annotation is performed to form second-label data. ; Step 6: Transfer the second marker data From the second unlabeled dataset Extracted and added to the first labeled dataset. In the first unlabeled dataset, the second unlabeled dataset serves as the first labeled dataset for the start of the next training iteration. The second tag data This serves as the first unlabeled dataset at the start of the next round of training iterations. Step 7: Begin the next round of iterative training, repeating the above steps until the expected classification performance or number of iterations is achieved. Then, stop iterating to form the final labeled classification model. .
2. The active learning method based on data uncertainty and diversity according to claim 1, characterized in that, The initial labeling classification model is used Calculate the second unlabeled dataset The degree of uncertainty corresponding to each unlabeled data point C include: Based on the initial labeling classification model Infer the probability estimation vector of the unlabeled data P ; Using the probability estimation vector P The uncertainty of the unlabeled data is calculated according to the uncertainty calculation method. C .
3. The active learning method based on data uncertainty and diversity according to claim 2, characterized in that, The probability estimation vector P Represented as: in, Representing the i The unlabeled data mentioned above, Representing the i The initial labeled classification model described above Predicted pseudo-label data, j Represents the unlabeled data Belongs to the kind, These represent the parameters of the prediction network in a convolutional neural network.
4. The active learning method based on data uncertainty and diversity according to claim 3, characterized in that, The method for calculating the degree of uncertainty is as follows: in, C Represents the degree of uncertainty; Representative sample data Based on the initial labeled classification model Predicted pseudo-label data Belongs to the The maximum probability estimate vector value of the class; Representative sample data Based on the initial labeled classification model Predicted pseudo-label data Belongs to the The second most probable estimated vector value for the class.
5. The active learning method based on data uncertainty and diversity according to claim 4, characterized in that, The first from the second unlabeled dataset Select Bb A first selected sample, and the corresponding degree of uncertainty. Methods for determining whether a value is equal to or greater than a preset standard value include: the degree of uncertainty of the unlabeled dataset. C The values are sorted in ascending or descending order, and the preset standard value is the last one. Bb The or positive number Bb The unlabeled data C The values are selected sequentially. Bb One or before Bb One sample.
6. The active learning method based on data uncertainty and diversity according to claim 5, characterized in that, The diversity index meets the preset requirement as follows: all labeled samples and those initially selected based on uncertainty. Bb The sample is considered as the center point, and circles are drawn outwards with a certain radius to minimize the coverage radius of unlabeled sample points in other unlabeled datasets. b The unlabeled samples exhibit diversity.
7. The active learning method based on data uncertainty and diversity according to claim 1, characterized in that, The neural network used to train and label the classification model includes ResNet18, ImageNet, or ResNet50.
8. A computer device, comprising a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the instructions, it implements the active learning method according to any one of claims 1 to 7.
9. A computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement the active learning method according to any one of claims 1 to 7.