Active learning method and device, electronic equipment and readable storage medium

By obtaining an unsupervised feature extraction network through unsupervised learning and using an active learning algorithm based on feature distribution to identify high-value samples for labeling, the problem of traditional active learning's dependence on labeled data is solved, and more efficient model training is achieved.

CN114298154BActive Publication Date: 2025-12-30HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111456043.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2025-12-30
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

Traditional active learning solutions rely on large amounts of labeled data, resulting in high annotation costs.

Method used

An unsupervised feature extraction network is obtained through unsupervised learning. Based on the unsupervised features of the samples, active learning is performed to identify unlabeled samples with high annotation value for annotation.

Benefits of technology

With the same amount of labeled data, a model with superior performance is trained, reducing the reliance on labeled data and lowering the labeling cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298154B_ABST
    Figure CN114298154B_ABST
Patent Text Reader

Abstract

The application provides an active learning method and device, electronic equipment and readable storage medium. The target detection method comprises: performing unsupervised learning on a sample set to obtain an unsupervised feature extraction network; wherein the sample set comprises an unlabeled sample set, the unlabeled sample set comprises N1 unlabeled samples, and N1 is a positive integer greater than 1; determining unsupervised features of each sample in the sample set according to the unsupervised feature extraction network; and performing active learning on the sample set according to the unsupervised features of each sample in the sample set to determine unlabeled samples that need to be labeled. The method can train a model with better performance than a random labeled set under the same labeling amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to an active learning method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Supervised learning within the deep learning framework has achieved remarkable success in computer vision, thanks not only to increasingly sophisticated model architectures but also to the vast amounts of training data available. In practical applications, labeling training data is costly, incurring costs in terms of time and manpower. To train models with the highest possible performance using the least amount of labeling, active learning techniques have gained increasing attention.

[0003] Traditional active learning relies on a large amount of labeled data (i.e., already labeled data) to explore valuable calibration data. Summary of the Invention

[0004] In view of this, this application provides an active learning method, apparatus, electronic device, and readable storage medium to solve the problem that traditional active learning schemes rely on a large amount of labeled data.

[0005] Specifically, this application is implemented through the following technical solution:

[0006] According to a first aspect of the embodiments of this application, an active learning method is provided, comprising:

[0007] Unsupervised learning is performed on the sample set to obtain an unsupervised feature extraction network; wherein, the sample set includes an unlabeled sample set, which includes N1 unlabeled samples, where N1 is a positive integer greater than 1;

[0008] Based on the unsupervised feature extraction network, the unsupervised features of each sample in the sample set are determined;

[0009] Based on the unsupervised features of each sample in the sample set, active learning is performed on the sample set to determine the unlabeled samples that need to be labeled.

[0010] According to a second aspect of the embodiments of this application, an active learning device is provided, comprising:

[0011] The first learning unit is used to perform unsupervised learning on the sample set to obtain an unsupervised feature extraction network; wherein, the sample set includes an unlabeled sample set, which includes N1 unlabeled samples, where N1 is a positive integer greater than 1;

[0012] The determining unit is used to determine the unsupervised features of each sample in the sample set based on the unsupervised feature extraction network.

[0013] The second learning unit is used to actively learn on the sample set based on the unsupervised features of each sample in the sample set, and determine the unlabeled samples that need to be labeled.

[0014] According to a third aspect of the embodiments of this application, an electronic device is provided, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor is configured to execute the machine-executable instructions to implement the active learning method provided in the first aspect.

[0015] According to a fourth aspect of the embodiments of this application, a machine-readable storage medium is provided, wherein machine-executable instructions are stored therein, and when the machine-executable instructions are executed by a processor, the active learning method provided in the first aspect is implemented.

[0016] The technical solution provided in this application can bring at least the following beneficial effects:

[0017] By performing unsupervised learning on a sample set, an unsupervised feature extraction network is obtained. Based on this network, the unsupervised features of each sample in the set are determined. Then, based on these features, active learning is performed to identify unlabeled samples that need labeling. Unsupervised learning algorithms are used to mine the internal structure of massive unlabeled datasets and characterize the potential distribution of the entire sample space. Based on the unsupervised features of each sample, an active learning sampling algorithm based on feature distribution is used to extract samples with high labeling value. This improves the labeling value of labeled samples obtained from these unlabeled samples, enabling a model with superior performance compared to a randomly labeled set with the same amount of labeling. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating an active learning method according to an exemplary embodiment of this application;

[0019] Figure 2A This is a schematic diagram illustrating an exemplary embodiment of this application of unsupervised feature learning based on full sample learning;

[0020] Figure 2B This is a schematic diagram illustrating an exemplary embodiment of this application for obtaining unsupervised features;

[0021] Figure 3 This is a schematic diagram illustrating an active learning sampling process based on unsupervised distribution, as shown in an exemplary embodiment of this application.

[0022] Figure 4 This is a schematic diagram illustrating the detection results of a supervised target detection network according to an exemplary embodiment of this application;

[0023] Figure 5 This is a schematic diagram of the structure of an active learning device shown in an exemplary embodiment of this application;

[0024] Figure 6 This is a schematic diagram of the hardware structure of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0026] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0027] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0028] Please see Figure 1 This is a flowchart illustrating an active learning method provided in an embodiment of this application, as shown below. Figure 1 As shown, the target detection method may include the following steps:

[0029] Step S100: Perform unsupervised learning on the sample set to obtain an unsupervised feature extraction network; wherein, the sample set includes an unlabeled sample set, which includes N1 unlabeled samples, where N1 is a positive integer greater than 1.

[0030] Step S110: Determine the unsupervised features of each sample in the sample set based on the unsupervised feature extraction network.

[0031] In this embodiment of the application, in order to fully explore the internal structure of massive unlabeled datasets and characterize the potential distribution of the entire sample space, unsupervised learning algorithms can be used to learn spontaneously from a large amount of unlabeled data and explore the potential distribution of the data.

[0032] Accordingly, an unsupervised feature extraction network can be obtained by performing unsupervised learning on the sample set, and the unsupervised features of each sample in the sample set can be determined based on the unsupervised feature extraction network.

[0033] For example, for any sample in the sample set, the sample can be input into an unsupervised feature extraction network, and the unsupervised feature extraction network can output the unsupervised features of the sample.

[0034] For example, the composition of the sample set may include, but is not limited to, the following two cases:

[0035] 1. All samples are unlabeled, meaning the sample set contains N1 samples, all of which are unlabeled.

[0036] 2. It includes some unlabeled samples and some labeled samples, that is, the number of samples in the sample set is greater than N1, of which N1 are unlabeled samples and the rest are labeled samples.

[0037] Step S120: Based on the unsupervised features of each sample in the sample set, perform active learning on the sample set to determine the unlabeled samples that need to be labeled.

[0038] In this embodiment of the application, when the unsupervised features of each sample in the sample set are determined in the manner described above, an active learning sampling algorithm based on feature distribution can be used to mine samples with high labeling value based on the unsupervised features of each sample in the sample set.

[0039] For example, based on the unsupervised features of each unlabeled sample in the sample set, active learning can be performed on the sample set to obtain the ranking of the labeling values ​​of each unlabeled sample in the sample set. Then, based on the preset required number of labeled samples (assuming it is M, where M is a positive integer), the top M unlabeled samples ranked from high to low labeling values ​​can be determined as the unlabeled samples to be labeled. This can improve the labeling value of the labeled samples obtained by labeling the unlabeled samples, and achieve a model with better performance than the random labeled set under the same amount of labeling.

[0040] It can be seen that, in Figure 1 In the illustrated method, an unsupervised feature extraction network is obtained by performing unsupervised learning on the sample set. Based on this network, the unsupervised features of each sample in the set are determined. Then, based on these features, active learning is performed to identify unlabeled samples that need labeling. The internal structure of the massive unlabeled dataset is mined using an unsupervised learning algorithm to characterize the potential distribution of the entire sample space. Based on the unsupervised features of each sample, an active learning sampling algorithm based on feature distribution is used to extract samples with high labeling value. This improves the labeling value of the labeled samples obtained by labeling the unlabeled samples, achieving a model with superior performance compared to a randomly labeled set with the same amount of labeling.

[0041] In some embodiments, step S120, based on the unsupervised features of each sample in the sample set, performs active learning on the sample set to determine the unlabeled samples that need to be labeled, may include:

[0042] Based on the unsupervised features of each sample in the sample set, determine the distance between labeled and unlabeled samples in the sample set;

[0043] Based on the distance between labeled and unlabeled samples, the unlabeled samples that need to be labeled are determined.

[0044] For example, the labeling value of an unlabeled sample can be determined based on the distance between unlabeled and labeled samples.

[0045] Accordingly, when the unsupervised features of each sample in the sample set are determined in the manner described above, the distance between labeled and unlabeled samples in the sample set can be determined, and the unlabeled samples that need to be labeled can be determined based on the distance between labeled and unlabeled samples.

[0046] For example, the labeled value of an unlabeled sample can be positively correlated with the distance between the unlabeled sample and the labeled sample.

[0047] In one example, when the sample set consists entirely of unlabeled samples, before determining the distance between labeled and unlabeled samples in the sample set based on the unsupervised features of each sample in the sample set, the following may also be included:

[0048] Randomly select an unlabeled sample as the first labeled sample in the sample set, and move the labeled sample from the unlabeled sample set into the labeled sample set;

[0049] The above method of determining the unlabeled samples that need to be labeled based on the distance between labeled and unlabeled samples can include:

[0050] Based on the distance between each labeled sample in the labeled sample set and each unlabeled sample in the unlabeled sample set, the unlabeled samples that need to be labeled are determined, and the determined unlabeled samples that need to be labeled are moved from the unlabeled sample set to the labeled sample set as labeled samples.

[0051] For example, when all samples in the sample set are unlabeled samples, an unlabeled sample can be randomly selected as a labeled sample, and this labeled sample can be moved from the unlabeled sample set to the labeled sample set.

[0052] The labeled sample set is initially an empty set.

[0053] When a labeled sample set including a labeled sample is obtained in the above manner, the unlabeled sample with the highest labeling value can be selected from the unlabeled sample set according to the distance between the labeled sample and the unlabeled sample, and then moved from the unlabeled sample set to the labeled sample set as a labeled sample, until the number of labeled samples in the labeled sample set reaches the preset number.

[0054] As can be seen, the above method allows for the selection of unlabeled samples with high annotation value for annotation even when no labeled samples exist initially. This eliminates the need to prepare labeled samples beforehand, effectively expanding the application scenarios of the solution. As an example, determining the unlabeled samples to be labeled based on the distance between each labeled sample in the labeled sample set and each unlabeled sample in the unlabeled sample set can include:

[0055] For any unlabeled sample in the unlabeled sample set, the minimum distance between the unlabeled sample and each labeled sample in the labeled sample set is determined based on the distance between the unlabeled sample and each labeled sample in the labeled sample set; wherein, the minimum distance between the unlabeled sample and each labeled sample is the minimum value among the distances between the unlabeled sample and each labeled sample.

[0056] Based on the minimum distance between each unlabeled sample and a labeled sample in the unlabeled sample set, the maximum value among the minimum distances between each unlabeled sample and a labeled sample is determined, and the unlabeled sample corresponding to the maximum value is determined as the unlabeled sample that needs to be labeled.

[0057] For example, the distance between unlabeled samples and labeled samples can be characterized by the minimum distance between unlabeled samples and each labeled sample in the labeled sample set.

[0058] Accordingly, for any unlabeled sample in the unlabeled sample set, the distance between the unlabeled sample and each labeled sample in the labeled sample set can be determined, and the minimum distance between the unlabeled sample and each labeled sample in the labeled sample set (i.e., the minimum distance between the unlabeled sample and the labeled sample) can be determined.

[0059] For example, the distance between unlabeled samples and labeled samples can be determined based on the unsupervised features of the unlabeled samples and the unsupervised features of the labeled samples.

[0060] For example, the Euclidean distance or cosine distance between the unsupervised features of unlabeled samples and the unsupervised features of labeled samples can be determined as the distance between unlabeled samples and labeled samples.

[0061] For example, the labeling value of an unlabeled sample can be characterized by the distance between the unlabeled sample and the labeled sample; the greater the distance between the unlabeled sample and the labeled sample, the higher the labeling value.

[0062] Accordingly, given that the minimum distance between each unlabeled sample and a labeled sample in the unlabeled sample set has been determined, the maximum value among the minimum distances between each unlabeled sample and a labeled sample in the unlabeled sample set can be determined based on the minimum distance between each unlabeled sample and a labeled sample in the unlabeled sample set, and the unlabeled sample corresponding to the maximum value can be determined as the unlabeled sample that needs to be labeled.

[0063] For example, suppose the unlabeled sample set includes two unlabeled samples (no 1 and no 2), and the labeled sample set includes two labeled samples (with 1 and with 2).

[0064] Then we can determine the distance between "no 1" and "have 1" (denoted as distance 11), and the distance between "no 1" and "have 2" (denoted as distance 12). Assuming that distance 11 is greater than distance 12, that is, the minimum distance between "no 1" and labeled samples is distance 12.

[0065] Similarly, suppose that the minimum distance between the unlabeled sample 2 and the labeled sample is determined to be distance 22.

[0066] We can compare distance 12 and distance 22. If distance 22 is greater than distance 12, then distance 22 is the maximum value among the minimum distances between unlabeled samples and labeled samples. Therefore, we can determine that the unlabeled sample corresponding to distance 22 (i.e., no 2) is the unlabeled sample that needs to be labeled.

[0067] It should be noted that when the initial sample set consists entirely of unlabeled samples, each time a labeled sample is determined in the manner described above, the labeled sample can be moved from the unlabeled sample set to the labeled sample set to refresh both the unlabeled and labeled sample sets. Then, based on the refreshed unlabeled and labeled sample sets, new labeled samples are determined in the manner described above until the number of determined labeled samples reaches the preset number.

[0068] In some embodiments, the sample set further includes a labeled sample set, which includes N2 labeled samples, where N2 is a positive integer greater than 1.

[0069] Before determining the distance between labeled and unlabeled samples in the sample set based on the unsupervised features of each sample in the sample set, the following may also be included:

[0070] The task model is trained using labeled samples in the sample set to obtain a supervised task model;

[0071] Based on the supervised task model, the supervised prior features of each sample in the sample set are determined;

[0072] The above method of determining the distance between labeled and unlabeled samples in a sample set based on the unsupervised features of each sample in the set can include:

[0073] Based on the unsupervised features and supervised prior features of each sample in the sample set, the distance between labeled and unlabeled samples in the sample set is determined.

[0074] For example, when the sample set includes both unlabeled and labeled samples, the advantages of both unsupervised feature distribution and supervised prior can be combined to more effectively mine samples with labeled value.

[0075] Correspondingly, when the sample set also includes a labeled sample set, the task model can be trained based on the labeled samples in the labeled sample set to obtain a supervised task model.

[0076] For example, the task model can be a task model to be trained for performing computer vision tasks, which may include, but is not limited to, task models for image classification, object detection, or semantic segmentation.

[0077] When a supervised task model is obtained in the above manner, the supervised prior features of each sample in the sample set can be determined based on the supervised task model. That is, each sample in the sample set is input into the supervised task model, and the supervised task model outputs the supervised prior features of that sample.

[0078] Accordingly, for any sample, we can obtain the supervised prior features and the unsupervised features of that sample.

[0079] For example, when determining the distance between labeled and unlabeled samples, the distance between labeled and unlabeled samples in the sample set can be determined based on the unsupervised features and supervised prior features of each sample in the sample set.

[0080] As can be seen, by following the above method, when labeled samples exist in the initial state, the labeling value of each unlabeled sample can be determined more accurately based on the existing labeled samples, thereby further improving the rationality of the selection of unlabeled samples for labeling.

[0081] In one example, the above task model is an image classification task model;

[0082] The above method of determining the distance between labeled and unlabeled samples in a sample set based on the unsupervised features and supervised prior features of each sample in the sample set can include:

[0083] For any sample, the unsupervised features of the sample are concatenated with the supervised prior features to obtain the concatenated features;

[0084] Based on the splicing characteristics of each sample, the distance between labeled and unlabeled samples in the sample set is determined.

[0085] For example, the above task model is taken as an image classification task model, that is, a task model used for image classification.

[0086] For example, the output of a sample input into a supervised task model (supervised image classification task model) can be used as the supervised prior features of that sample.

[0087] For any sample, when the unsupervised features of the sample are obtained based on the unsupervised feature extraction network, and the supervised prior features of the sample are obtained based on the supervised task model, the supervised features and supervised prior features of the sample can be concatenated to obtain the concatenated features.

[0088] When determining the distance between labeled and unlabeled samples, it can be done based on the splicing characteristics of labeled and unlabeled samples.

[0089] In another example, the above task model is an object detection task model;

[0090] Based on the supervised task model, the supervised prior features for each sample in the sample set can be determined, including:

[0091] Based on the supervised task model, determine the confidence level of each target in each sample in the sample set;

[0092] Based on the confidence level of each target in each sample in the sample set, determine the first uncertainty score of each sample;

[0093] The above method of determining the distance between labeled and unlabeled samples in a sample set based on the unsupervised features and supervised prior features of each sample in the sample set can include:

[0094] For any labeled sample and any unlabeled sample, determine the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample;

[0095] The distance between the labeled sample and the unlabeled sample is determined based on the first uncertainty score of the unlabeled sample and the first distance.

[0096] For example, the above task model is taken as the target detection task model, that is, the task model used for target detection.

[0097] For example, for any sample, the uncertainty score of the sample (referred to as the first uncertainty score in this paper) can be determined based on the confidence of each detected target when the supervised task model performs target detection on the sample, and the first uncertainty score of the sample can be used as the supervised prior feature of the sample.

[0098] For example, for any given objective, the higher the confidence level of that objective, the lower its uncertainty score.

[0099] For example, the sum of the uncertainty scores of each target in the sample can be determined as the first uncertainty score of the sample.

[0100] For example, considering that for any unlabeled sample, the higher the first uncertainty score determined in the manner described above, the worse the supervised task model performs in object detection on that unlabeled sample, and the higher the labeling value of that unlabeled sample is usually.

[0101] Accordingly, when determining the distance between labeled and unlabeled samples, the first uncertainty score of the unlabeled samples can be used as a weighting coefficient to weight the distance determined based on unsupervised features (referred to as the first distance in this paper), and the resulting weighted distance can be used as the distance between labeled and unlabeled samples.

[0102] As an example, before determining the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample, the process may further include:

[0103] Based on the supervised task model, determine the location information of each target in each sample in the sample set;

[0104] For any sample, based on the location information of each target in the sample, the unsupervised features of the sample are transformed into the distribution features of the region of interest;

[0105] Determining the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample may include:

[0106] Determine the first distance between the distribution characteristics of the region of interest of the labeled sample and the distribution characteristics of the region of interest of the unlabeled sample.

[0107] For example, when performing target detection on any sample using a supervised task model, the location information of each target in the sample can usually also be obtained.

[0108] To extract the feature distribution of the target foreground in a targeted manner and eliminate the interference of the background distribution, the unsupervised features of the samples can be transformed into the distribution features of the Region of Interest (ROI) based on the position information of each target in the sample determined by the supervised task model, so as to improve the accuracy of the label value ranking determined based on the distribution of unsupervised features.

[0109] Accordingly, when determining the distance between labeled and unlabeled samples, it can be determined based on the distribution characteristics of the ROI region of labeled samples and the distribution characteristics of the ROI region of unlabeled samples.

[0110] In yet another example, the above task model is a semantic segmentation task model;

[0111] Based on the supervised task model, the supervised prior features for each sample in the sample set can be determined, including:

[0112] For any sample, the class prediction of each pixel in the sample is obtained by performing T forward predictions based on the supervised task model.

[0113] Based on the category prediction of each pixel in the sample, determine the second uncertainty score of the sample;

[0114] The above method of determining the distance between labeled and unlabeled samples in a sample set based on the unsupervised features and supervised prior features of each sample in the sample set can include:

[0115] For any labeled sample and any unlabeled sample, determine the second distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample;

[0116] The distance between the labeled sample and the unlabeled sample is determined based on the second uncertainty score of the unlabeled sample and the second distance.

[0117] For example, the above task model is used as a semantic segmentation task model, that is, a task model used to perform semantic segmentation on samples.

[0118] For example, for any sample, the uncertainty score of the sample (referred to as the second uncertainty score in this paper) can be determined based on the category prediction of each pixel when the supervised task model makes forward prediction of the sample, and the second uncertainty score of the sample can be used as the supervised prior feature of the sample.

[0119] For example, in order to improve the accuracy of pixel category prediction, the input sample can be subjected to T forward predictions, and a portion of the output results can be randomly discarded each time. For any pixel, the average of the T forward predictions can be used as the category prediction for that pixel.

[0120] For example, considering that the predicted labels of pixels with high model certainty remain basically unchanged in each forward prediction, while pixels with high uncertainty will show significant changes in output probability in multiple forward predictions, the uncertainty of the model (i.e., the second uncertainty score mentioned above) can be characterized by mutual information (MI).

[0121] For example, for any sample, the sum of all uncertainty scores in that sample can be used as the second uncertainty score for that sample.

[0122] Accordingly, when determining the distance between labeled and unlabeled samples, the second uncertainty score of the unlabeled samples can be used as a weighting coefficient to weight the distance determined based on unsupervised features (referred to as the second distance in this paper), and the resulting weighted distance can be used as the distance between labeled and unlabeled samples.

[0123] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below in conjunction with specific embodiments.

[0124] In this embodiment, unsupervised learning and active learning techniques can be combined to fully explore the internal structure of massive unlabeled datasets and characterize the potential distribution of the entire sample space. Based on this distribution, a highly representative sample is extracted using an active learning distribution sampling algorithm, and the required number of samples for labeling is selected in one step. This avoids repeated human-computer interaction, greatly improves the user experience, and saves time spent on active learning.

[0125] In this embodiment, unsupervised learning can be performed on the sample set first to obtain an unsupervised feature extraction network (which can be denoted as f(·)), and its schematic diagram can be shown as follows. Figure 2A As shown.

[0126] For example, the composition of the sample set can include two cases:

[0127] 1. All samples are unlabeled;

[0128] 2. Includes some unlabeled samples and some labeled samples.

[0129] In this embodiment, if labeled samples exist, the task network can be trained based on the labeled samples, and supervised prior features can be obtained based on the trained supervised task network (which can be denoted as g(·)).

[0130] For example, supervised prior features can take many forms, which will be illustrated with examples below.

[0131] Regardless of whether there are labeled samples, all samples can yield unsupervised features, as illustrated in the diagram below. Figure 2B As shown. These outputs will participate in the sample selection process for active learning.

[0132] For example, distribution-based active learning sampling primarily measures the similarity between labeled and unlabeled samples.

[0133] In this embodiment, when the sample set consists entirely of unlabeled samples, the unlabeled sample with the largest minimum distance to the labeled sample can be selected each time based on the unsupervised features of each sample. For details, please refer to [link to implementation details]. Figure 3 .

[0134] When the sample set includes both unlabeled and labeled samples, the ranking of the labeling values ​​of the unlabeled samples can be determined based on the supervised prior features of each unlabeled sample.

[0135] The following examples illustrate different computer vision tasks.

[0136] Example 1: Image Classification Task

[0137] For any input sample x, in addition to the unsupervised table f(x), we can also obtain supervised prior features g(x). These two features are concatenated to obtain concatenated features, allowing features from two different learning objectives to complement each other. Based on this, a distribution query is performed.

[0138]

[0139] Where U is the unlabeled sample set, L is the labeled sample set, d(a, b) is the distance between a and b, and f(x) is the distance between a and b. i Let g(x) be an unsupervised feature of sample i in the unlabeled sample set. i Let f(x) be the supervised prior features of sample i in the unlabeled sample set. j Let g(x) be an unsupervised feature of sample j in the labeled sample set. j Let be the supervised prior features of sample j in the labeled sample set. This represents the feature concatenation operation, where u is the value of i that maximizes the minimum distance between labeled and unlabeled samples.

[0140] Example 2: Target Detection Task

[0141] For any input sample x, in addition to the unsupervised feature f(x), the supervised target detection network can also output its predicted target category and location coordinates.

[0142] For example, suppose the current image is predicted to have N targets, as illustrated in the diagram below. Figure 4 As shown.

[0143] like Figure 4 As shown, conf (i) Let x be the confidence level of the i-th target. (i) Let be the location coordinates of the i-th target. For example, based on the confidence level of the i-th target, the uncertainty score of the i-th target can be derived:

[0144] w (i) =1-conf (i)

[0145] The overall uncertainty score (i.e., the first uncertainty score of the sample) can be expressed as the sum of the uncertainty scores of each objective:

[0146] w = ∑ i w (i)

[0147] Furthermore, based on the location information of each target, the feature distribution of the target foreground can be extracted in a targeted manner, eliminating the interference of the background distribution: GAP(x (i) ) represents the feature vector of the feature map of the associated location of target i after global average pooling.

[0148] The unsupervised features of the samples can be transformed into the distribution features of the RoI region:

[0149]

[0150] Here, the magnitude of the feature vector of each instance is used as the feature saliency weighting coefficient, and a target in the image is considered an instance. GAP(x) (i) Let be the feature vector of the i-th target in the sample. Let be the magnitude (i.e., vector length) of the feature vector of the i-th target in the sample.

[0151] The unsupervised active learning distribution sampling under the prior uncertainty score of the detection network and the target location can be expressed as:

[0152]

[0153]

[0154]

[0155] Where U is the unlabeled sample set, L is the labeled sample set, i is the sample number in the unlabeled sample set, j is the sample number in the labeled sample set, t is the target number in the unlabeled sample set, s is the target number in the labeled sample set, and d(a, b) is the distance between a and b.

[0156] Example 3

[0157] For an input image x, after T forward predictions by segmentation networks (there are T segmentation network models), a portion of the output of the encoding network is randomly discarded each time. The final class prediction of pixel (u, v) is the average of the T predictions. This is the MC-dropout process.

[0158]

[0159] Where c is the category number, and θt represents the parameters of the t-th segmentation network model. Let c be the predicted probability of the class of pixel position (u, v).

[0160] Pixels with high model certainty will have relatively unchanged predicted labels in each forward prediction, while pixels with high uncertainty will show significant changes in output probability in multiple forward predictions. Therefore, MI can be used to characterize the uncertainty of the model (i.e., the second uncertainty score mentioned above).

[0161] For any pixel (u, v), the model uncertainty is:

[0162]

[0163] Here, H(u,v) is the prediction information entropy of a single model at pixel location (u,v).

[0164] The summation of the model uncertainties for all pixels gives the total model uncertainty (i.e., the second uncertainty fraction of the sample):

[0165] MI = ∑ u ∑ v MI (u,v)

[0166] Unsupervised active learning distribution sampling under the prior uncertainty fraction of the segmentation network can be expressed as:

[0167] u = argmax i∈U min j∈L MI i ·d(f(x i ),f(x j ))

[0168] As can be seen, in this embodiment of the application, the unsupervised feature extraction network is used to obtain the structural information inside the data and characterize the feature distribution of its latent space. Compared with the supervised task network, which can only see some of the labeled information, the unsupervised feature extraction network can see more comprehensive information and expose more information to the former.

[0169] Furthermore, based on the diversity sampling of unsupervised feature distribution, valuable labeled samples can be mined in the entire sample space. Since the distribution is known, all samples can be selected by performing one round of active learning, which greatly shortens the time cost of task execution compared with the traditional supervised active learning process.

[0170] With some labeled data already available, we can combine the advantages of both supervised priors and unsupervised distributions to more effectively mine valuable samples.

[0171] The method provided in this application has been described above. The apparatus provided in this application is described below:

[0172] Please see Figure 5 This is a schematic diagram of the structure of an active learning device provided in an embodiment of this application, as shown below. Figure 5 As shown, the active learning device may include:

[0173] The first learning unit 510 is used to perform unsupervised learning on the sample set to obtain an unsupervised feature extraction network; wherein, the sample set includes an unlabeled sample set, the unlabeled sample set includes N1 unlabeled samples, and N1 is a positive integer greater than 1;

[0174] The determining unit 520 is used to determine the unsupervised features of each sample in the sample set based on the unsupervised feature extraction network.

[0175] The second learning unit 530 is used to actively learn on the sample set based on the unsupervised features of each sample in the sample set, and determine the unlabeled samples that need to be labeled.

[0176] In some embodiments, the second learning unit 530 performs active learning on the sample set based on the unsupervised features of each sample in the sample set to determine the unlabeled samples that need to be labeled, including:

[0177] Based on the unsupervised features of each sample in the sample set, determine the distance between labeled and unlabeled samples in the sample set;

[0178] Based on the distance between the labeled and unlabeled samples, the unlabeled samples that need to be labeled are determined.

[0179] In some embodiments, when the samples included in the sample set are all unlabeled samples, before the second learning unit 530 determines the distance between labeled samples and unlabeled samples in the sample set based on the unsupervised features of each sample in the sample set, it further includes:

[0180] Randomly select one of the unlabeled samples as the first labeled sample in the sample set, and move the labeled sample from the unlabeled sample set into the labeled sample set;

[0181] The second learning unit 530 determines the unlabeled samples that need to be labeled based on the distance between the labeled samples and the unlabeled samples, including:

[0182] Based on the distance between each labeled sample in the labeled sample set and each unlabeled sample in the unlabeled sample set, the unlabeled samples that need to be labeled are determined, and the determined unlabeled samples that need to be labeled are moved from the unlabeled sample set to the labeled sample set as labeled samples.

[0183] In some embodiments, the second learning unit 530 determines the unlabeled samples that need to be labeled based on the distance between each labeled sample in the labeled sample set and each unlabeled sample in the unlabeled sample set, including:

[0184] For any unlabeled sample in the unlabeled sample set, the minimum distance between the unlabeled sample and each labeled sample in the labeled sample set is determined based on the distance between the unlabeled sample and each labeled sample in the labeled sample set, wherein the minimum distance between the unlabeled sample and each labeled sample is the minimum value among the distances between the unlabeled sample and each labeled sample.

[0185] Based on the minimum distance between each unlabeled sample and a labeled sample in the unlabeled sample set, the maximum value among the minimum distances between each unlabeled sample and a labeled sample is determined, and the unlabeled sample corresponding to the maximum value is determined as the unlabeled sample that needs to be labeled.

[0186] In some embodiments, the sample set further includes a labeled sample set, which includes N2 labeled samples, where N2 is a positive integer greater than 1;

[0187] Before the second learning unit 530 determines the distance between labeled and unlabeled samples in the sample set based on the unsupervised features of each sample in the sample set, it further includes:

[0188] The task model is trained based on the labeled samples in the sample set to obtain a supervised task model;

[0189] Based on the supervised task model, the supervised prior features of each sample in the sample set are determined;

[0190] The second learning unit determines the distance between labeled and unlabeled samples in the sample set based on the unsupervised features of each sample in the sample set, including:

[0191] Based on the unsupervised features and supervised prior features of each sample in the sample set, the distance between labeled and unlabeled samples in the sample set is determined.

[0192] In some embodiments, the task model is an image classification task model;

[0193] The second learning unit 530 determines the distance between labeled and unlabeled samples in the sample set based on the unsupervised features and supervised prior features of each sample in the sample set, including:

[0194] For any sample, the unsupervised features of the sample are concatenated with the supervised prior features to obtain the concatenated features;

[0195] Based on the splicing characteristics of each sample, the distance between labeled and unlabeled samples in the sample set is determined.

[0196] In some embodiments, the task model is an object detection task model;

[0197] The second learning unit 530, based on the supervised task model, determines the supervised prior features of each sample in the sample set, including:

[0198] Based on the supervised task model, determine the confidence level of each target in each unlabeled sample in the sample set;

[0199] Based on the confidence level of each target in each unlabeled sample in the sample set, determine the first uncertainty score of each unlabeled sample;

[0200] The second learning unit 530 determines the distance between labeled and unlabeled samples in the sample set based on the unsupervised features and supervised prior features of each sample in the sample set, including:

[0201] For any labeled sample and any unlabeled sample, determine the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample;

[0202] The distance between the labeled sample and the unlabeled sample is determined based on the first uncertainty score of the unlabeled sample and the first distance.

[0203] In some embodiments, before the second learning unit 530 determines the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample, it further includes:

[0204] Based on the supervised task model, determine the location information of each target in each sample of the sample set;

[0205] For any sample, based on the location information of each target in the sample, the unsupervised features of the sample are transformed into the distribution features of the region of interest;

[0206] The second learning unit determines a first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample, including:

[0207] Determine the first distance between the distribution characteristics of the region of interest of the labeled sample and the distribution characteristics of the region of interest of the unlabeled sample.

[0208] In some embodiments, the task model is a semantic segmentation task model;

[0209] The second learning unit 530, based on the supervised task model, determines the supervised prior features of each sample in the sample set, including:

[0210] For any sample, the supervised task model is used to perform T forward predictions on the sample to obtain the class prediction probability of each pixel in the sample; where T≥2.

[0211] Based on the category prediction of each pixel in the sample, determine the second uncertainty score of the sample;

[0212] The second learning unit determines the distance between labeled and unlabeled samples in the sample set based on the unsupervised features and supervised prior features of each sample in the sample set, including:

[0213] For any labeled sample and any unlabeled sample, determine the second distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample;

[0214] The distance between the labeled sample and the unlabeled sample is determined based on the second uncertainty score of the unlabeled sample and the second distance.

[0215] This application provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the active learning method described above.

[0216] Please see Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 601 and a memory 602 storing machine-executable instructions. The processor 601 and the memory 602 can communicate via a system bus 603. Furthermore, by reading and executing the machine-executable instructions corresponding to the active learning logic in the memory 602, the processor 601 can execute the active learning method described above.

[0217] The memory 602 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0218] In some embodiments, a machine-readable storage medium, such as Figure 6 The memory 602 in the memory, which is a machine-readable storage medium, stores machine-executable instructions that, when executed by a processor, implement the active learning method described above. For example, the storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0219] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0220] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An active learning method, characterized by, The method comprises the following steps: unsupervised learning is performed on a sample set to obtain an unsupervised feature extraction network; wherein the sample set comprises an unlabeled sample set, and the unlabeled sample set comprises N1 unlabeled samples, wherein N1 is a positive integer greater than 1; unsupervised features of each sample in the sample set are determined according to the unsupervised feature extraction network; active learning is performed on the sample set according to the unsupervised features of each sample in the sample set to determine unlabeled samples that need to be labeled; wherein the active learning performed on the sample set according to the unsupervised features of each sample in the sample set to determine the unlabeled samples that need to be labeled comprises: distances between labeled samples and unlabeled samples in the sample set are determined according to the unsupervised features of each sample in the sample set; the unlabeled samples that need to be labeled are determined according to the distances between the labeled samples and the unlabeled samples; the sample set further comprises a labeled sample set, and the labeled sample set comprises N2 labeled samples, wherein N2 is a positive integer greater than 1; before the distances between the labeled samples and the unlabeled samples in the sample set are determined according to the unsupervised features of each sample in the sample set, the method further comprises: a supervised task model is trained according to the labeled samples in the sample set to obtain a supervised task model; wherein the samples are image samples, and the task model is a task model for a computer vision task; supervised prior features of each sample in the sample set are determined according to the supervised task model; the distances between the labeled samples and the unlabeled samples in the sample set are determined according to the unsupervised features and the supervised prior features of each sample in the sample set. the task model is an image classification task model; 2. The method of claim 1, wherein, the distances between the labeled samples and the unlabeled samples in the sample set are determined according to the unsupervised features and the supervised prior features of each sample in the sample set, comprising: for any sample, the unsupervised features and the supervised prior features of the sample are spliced to obtain spliced features; the distances between the labeled samples and the unlabeled samples in the sample set are determined according to the spliced features of each sample. the task model is a target detection task model; 3. The method of claim 1, wherein, the supervised prior features of each sample in the sample set are determined according to the supervised task model, comprising: confidence of each target in each unlabeled sample in the sample set is determined according to the supervised task model; a first uncertainty score of each unlabeled sample is determined according to the confidence of each target in the unlabeled sample; the distances between the labeled samples and the unlabeled samples in the sample set are determined according to the unsupervised features and the supervised prior features of each sample in the sample set, comprising: for any labeled sample and any unlabeled sample, a first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample is determined. ​ determine the distance between the labeled sample and the unlabeled sample according to the first uncertainty score of the unlabeled sample and the first distance.

4. The method of claim 3, wherein, Before the determining the first distance between the unsupervised feature of the labeled sample and the unsupervised feature of the unlabeled sample, the method further comprises: determining position information of each target in each sample in the sample set according to the supervised task model; for any sample, converting the unsupervised feature of the sample into a distribution feature of a region of interest according to the position information of each target in the sample; the determining the first distance between the unsupervised feature of the labeled sample and the unsupervised feature of the unlabeled sample comprises: determining the first distance between the distribution feature of the region of interest of the labeled sample and the distribution feature of the region of interest of the unlabeled sample.

5. The method of claim 1, wherein, the task model is a semantic segmentation task model; the determining the supervised prior feature of each sample in the sample set according to the supervised task model comprises: for any sample, performing T times of forward prediction on the sample according to the supervised task model to obtain a class prediction probability of each pixel point in the sample; wherein T≥2; determining a second uncertainty score of the sample according to the class prediction of each pixel point in the sample; the determining the distance between the labeled sample and the unlabeled sample in the sample set according to the unsupervised feature and the supervised prior feature of each sample in the sample set comprises: for any labeled sample and any unlabeled sample, determining a second distance between the unsupervised feature of the labeled sample and the unsupervised feature of the unlabeled sample; determining the distance between the labeled sample and the unlabeled sample according to the second uncertainty score of the unlabeled sample and the second distance.

6. An active learning device, characterized by comprise: a first learning unit configured to perform unsupervised learning on a sample set to obtain an unsupervised feature extraction network; wherein the sample set comprises an unlabeled sample set, and the unlabeled sample set comprises N1 unlabeled samples, N1 being a positive integer greater than 1; a determining unit configured to determine an unsupervised feature of each sample in the sample set according to the unsupervised feature extraction network; a second learning unit configured to perform active learning on the sample set according to the unsupervised feature of each sample in the sample set to determine an unlabeled sample that needs to be labeled. The second learning unit performs active learning on the sample set according to the unsupervised feature of each sample in the sample set to determine an unlabeled sample that needs to be labeled, comprising: determining a distance between a labeled sample and an unlabeled sample in the sample set according to the unsupervised feature of each sample in the sample set; determining an unlabeled sample that needs to be labeled according to the distance between the labeled sample and the unlabeled sample; wherein the sample set further comprises a labeled sample set, and the labeled sample set comprises N2 labeled samples, N2 being a positive integer greater than 1; before the second learning unit determines the distance between the labeled sample and the unlabeled sample in the sample set according to the unsupervised feature of each sample in the sample set, the method further comprises: training the task model according to the labeled samples in the sample set, to obtain a supervised task model; wherein the samples are image samples, and the task model is a task model of a computer vision task; determining supervised prior features of the samples in the sample set according to the supervised task model; the second learning unit determines distances between the labeled samples and the unlabeled samples in the sample set according to the unsupervised features of the samples in the sample set, including: determining distances between the labeled samples and the unlabeled samples in the sample set according to the unsupervised features and the supervised prior features of the samples in the sample set.

7. The apparatus of claim 6, wherein, the task model is an image classification task model; the second learning unit determines distances between the labeled samples and the unlabeled samples in the sample set according to the unsupervised features and the supervised prior features of the samples in the sample set, including: for any sample, concatenating the unsupervised features and the supervised prior features of the sample to obtain concatenated features; determining distances between the labeled samples and the unlabeled samples in the sample set according to the concatenated features of the samples; wherein the task model is a target detection task model; the second learning unit determines supervised prior features of the samples in the sample set according to the supervised task model, including: determining confidence of each target in each unlabeled sample in the sample set according to the supervised task model; determining a first uncertainty score of each unlabeled sample according to the confidence of each target in the unlabeled sample; the second learning unit determines distances between the labeled samples and the unlabeled samples in the sample set according to the unsupervised features and the supervised prior features of the samples in the sample set, including: for any labeled sample and any unlabeled sample, determining a first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample; determining a distance between the labeled sample and the unlabeled sample according to the first uncertainty score of the unlabeled sample and the first distance; wherein, before the second learning unit determines the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample, the method further includes: determining position information of each target in each sample in the sample set according to the supervised task model; for any sample, converting the unsupervised features of the sample into distribution features of regions of interest according to the position information of each target in the sample; the second learning unit determines the first distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample, including: determining a first distance between the distribution features of regions of interest of the labeled sample and the distribution features of regions of interest of the unlabeled sample; wherein the task model is a semantic segmentation task model; the second learning unit determines supervised prior features of the samples in the sample set according to the supervised task model, including: For any sample, T times of forward prediction is performed on the sample according to the supervised task model, to obtain a class prediction probability of each pixel point of the sample; wherein T≥2; A second uncertainty score of the sample is determined according to the class prediction of each pixel point of the sample; The second learning unit determines the distance between the labeled samples and the unlabeled samples in the sample set according to the unsupervised features and the supervised prior features of each sample in the sample set, comprising: For any labeled sample and any unlabeled sample, a second distance between the unsupervised features of the labeled sample and the unsupervised features of the unlabeled sample is determined; According to the second uncertainty score of the unlabeled sample and the second distance, the distance between the labeled sample and the unlabeled sample is determined.

8. An electronic device, comprising: The processor is configured to execute the machine executable instructions to implement the method of any one of claims 1-5.

9. A machine-readable storage medium, characterized in that, The machine readable storage medium stores machine executable instructions, and the machine executable instructions are executed by the processor to implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Sample labeling method based on active learning

    CN112308139A

  • Classification model training method, system and device and storage medium

    CN112347261A