A method for selecting learning samples in active learning process
By combining pre-trained models with lightweight neural networks, efficient data processing for sample selection in the active learning process is achieved, which solves the problem of high time cost and improves the efficiency of model updating.
Patent Information
- Application Number
- CN202411445451.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Existing active learning methods have too high a time cost in the data selection process, resulting in inefficient model updating.
A pre-trained model is used for one-time feature embedding, and a lightweight neural network is used for iterative sample data selection. Combined with sample pooling and pipeline strategies, the range of sample candidates is narrowed through proxy information estimation, reducing the unit estimation cost.
It effectively reduces data selection time, improves sample selection efficiency, reduces labeling time, and achieves high-accuracy task model updates.
Smart Images

Figure CN119399584B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data analysis and processing, and in particular to a method for selecting learning samples in an active learning process. Background Art
[0002] In the process of implementing large-scale data analysis services, efficient and regular model update conditions are required to adapt to the possible changes in data distribution. For the corresponding large-scale samples, manually labeling all samples that can be used for task model updates is too labor-intensive to be feasible. To address this problem, the existing technology proposes to use active learning technology to iteratively select a subset of samples with high information richness for labeling to achieve the labeling of learning samples. However, through the experience of applying corresponding active learning in actual video analysis systems, a previously overlooked time cost bottleneck problem was discovered, namely the problem of excessively high time cost of data selection.
[0003] Specifically, existing active learning methods select data by estimating the information richness of all unlabeled examples in each iteration (e.g., their output confidence). In corresponding analysis systems, this data selection process can account for a significant portion of the time cost of the entire model update. Experimental results show that this time cost accounts for 42.8% of the total model update time. The total time cost of the entire model update includes the time for data selection, labeling, and model update.
[0004] Therefore, the existing data selection methods for active learning have the problem of taking up too much time and cost, which leads to the inability to guarantee the efficiency of the corresponding entire model update. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for selecting learning samples in an active learning process, so as to improve the efficiency of sample selection in the active learning process and thereby solve the above-mentioned technical problems existing in the prior art.
[0006] The purpose of the present invention is achieved through the following technical solutions:
[0007] A method for selecting learning samples in an active learning process, comprising:
[0008] A pre-trained model is used to perform one-time feature embedding on the original data. After the one-time feature embedding is completed, iterative sample data selection is performed through a micro neural network.
[0009] Based on the iterative sample data, multiple rounds of iterative selection processing are performed based on the micro neural network and the sample pooling process to achieve the selection of learning samples; wherein, based on the micro neural network, information measurement of sample data and the information richness of sample data after each round of iterative processing are obtained, the sample pooling process is a process of reducing the current sample data based on the information richness of sample data from two adjacent rounds.
[0010] The one-time feature embedding process includes:
[0011] A pre-trained natural language processing model is used to obtain embeddings of text input, and four fully connected layers are connected after the embedding to make informative predictions; and as a baseline, a prediction model with the original document as input is also used, which also uses the said four fully connected layers.
[0012] The process of reducing the current sample data based on the information richness of two adjacent rounds of sample data includes:
[0013] The current sample data is subjected to sample data reduction processing based on the information richness of two adjacent rounds of sample data and the determined sample discarding rate; wherein the sample discarding rate can be used to determine the amount of sample data selected to be retained in the total current sample data.
[0014] The sample data reduction process includes:
[0015] The sample discard rate is determined based on a pipeline strategy, and sample data reduction processing is performed based on the sample discard rate based on the pipeline strategy.
[0016] The process of performing sample data reduction processing on the current sample data includes:
[0017] By comparing the comparative measurement results of the information richness of two adjacent rounds of sample data, if the information richness of the two adjacent rounds of sample data changes greatly, the comparative measurement result is larger, otherwise, the comparative measurement result is smaller;
[0018] Based on the comparison and measurement results, the sample data after the reduction processing is obtained by selecting the sample data based on the sample information discarding rate from the largest to the smallest.
[0019] In the process of determining the sample discard rate, it is necessary to achieve load balancing between the various stages of the pipeline.
[0020] The formula for determining the sample discard rate includes:
[0021]
[0022] Among them, K is the number of samples selected and labeled in each round, T a ,Tt , T e represents the unit time cost of annotation, training, and prediction for each sample, where 0 < q ≤ 1, N0 is the maximum number of rounds for pooling operation预定的进行池化操作的最大轮数, N is the number of unlabeled samples at the beginning, and n represents the current nth round.
[0023] The said T a , T t , T e The determination formula of [[ID=!4]]
[0024]
[0025] Compared with the prior art, the implementation solution provided by the present invention can directly predict the information richness of samples by using a lightweight neural network through an efficient proxy information estimation method, and at the same time, it can also narrow down the candidate samples for measuring the information richness of samples in each round according to the historical information richness measurement results, thereby solving the problem of long data selection time-consuming when the amount of unlabeled data is huge, and further enabling a task model with high accuracy to be obtained using less annotation time budget. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0027] Figure 1 is a schematic flowchart of the method for selecting active learning samples provided by an embodiment of the present invention;
[0028] Figure 2 is a schematic comparison diagram of the active learning sample annotation process using three parallel pipelines and without using pipelines. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the specific content of the present invention; obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments, which do not constitute a limitation to the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0030] First, the following explanations are given for the terms that may be used in this article:
[0031] The term “and / or” means that either or both of them can be realized at the same time. For example, X and / or Y includes both “X” or “Y” and “X and Y”.
[0032] The terms "include," "comprises," "contains," "has," or other similar expressions should be interpreted as non-exclusive. For example, "including certain technical features (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products, or manufactured articles, etc.) should be interpreted as including not only the technical features explicitly listed, but also other technical features known in the art that are not explicitly listed.
[0033] The term "consisting of" excludes any technical features not explicitly listed. If used in a claim, this term renders the claim closed, excluding any technical features other than those explicitly listed, except for conventional impurities associated with them. If this term appears only in a clause of a claim, it limits only the elements explicitly listed in that clause; elements listed in other clauses are not excluded from the claim as a whole.
[0034] Unless otherwise specified or limited, the terms "mounted," "connected," "connect," and "fixed" should be interpreted broadly. For example, they can refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in this document based on specific circumstances.
[0035] When concentration, temperature, pressure, size or other parameters are expressed in the form of a numerical range, the numerical range should be understood to specifically disclose all ranges formed by the pairing of any upper limit, lower limit, or preferred value within the numerical range, regardless of whether the range is explicitly stated. For example, if a numerical range of "2 to 8" is stated, the numerical range should be interpreted as including ranges of "2 to 7," "2 to 6," "5 to 7," "3 to 4 and 6 to 7," "3 to 5 and 7," "2 and 5 to 7," etc. Unless otherwise specified, the numerical ranges stated herein include both their endpoints and all integers and fractions within the numerical range.
[0036] The terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings and are only for the convenience and simplification of description, and do not explicitly or implicitly indicate that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore should not be understood as a limitation to this document.
[0037] During the implementation process of the present invention, in order to solve the time cost bottleneck problem caused by data selection in the prior art, a corresponding implementation scheme of proxy informativeness estimation is specifically proposed. Specifically, the time cost of data selection can be modeled first, from which three key factors are determined, namely: unit estimation cost, the number of samples used for estimation, and the number of iterations; wherein, the influence of the first two factors gradually accumulates with the increase in the number of iterations; accordingly, the present invention designs a proxy estimator and a sample aggregation scheme. The proxy estimator can be a lightweight neural network that can be trained to directly predict the informativeness of the sample, which can replace the role of the high-cost task model in the original estimation, thereby reducing the unit cost. On the other hand, the sample aggregation scheme of the present invention uses historical estimation results to narrow the range of sample candidates.
[0038] Furthermore, in order to achieve the above technical effects, the present invention will face the following two key challenges in its specific implementation, i.e., two technical problems that need to be solved:
[0039] (1) Lightweight estimation (i.e., information measurement) problem
[0040] The information richness estimation process must be lightweight to reduce the unit estimation cost. Obviously, a lightweight model can perform faster predictions. Therefore, the present invention needs to solve the problem of how to make a lightweight estimator replace the high-cost task model in the original information richness estimation process.
[0041] (2) Problems with narrowing down the candidate pool
[0042] From the perspective of cost modeling, the data selection cost is linearly positively correlated with the number of candidate samples involved; the fewer candidate samples involved, the faster the prediction. Therefore, the present invention also needs to solve the problem of how to use existing information to narrow the range of sample candidates for information richness estimation.
[0043] Based on the two main technical problems that need to be solved above, the present invention provides a corresponding method for selecting learning samples in the active learning process, and specifically provides a corresponding efficient active learning sample selection method based on agent information estimation. During the implementation process, the present invention mainly involves fields such as data labeling methods, active learning, sample information richness estimation, and data selection methods.
[0044] The goal of this invention is to design an efficient proxy information estimation method that allows the use of lightweight neural networks to directly predict the information richness of samples. Furthermore, the candidate samples for each round of sample information richness measurement can be narrowed down based on historical information richness measurement results. This solves the problem of time-consuming data selection when the amount of unlabeled data is large. This allows for a more accurate task model to be budgeted with less labeling time.
[0045] To facilitate understanding of the present invention, a specific implementation scheme of a method for selecting learning samples in an active learning process provided by an embodiment of the present invention will be explained in detail below with reference to the accompanying drawings.
[0046] In the specific implementation process of the embodiment of the present invention, the selection process of the corresponding learning sample can be, but is not limited to, a corresponding concurrent video packet filtering process, etc., and its main processing process can be as follows: Figure 1 As shown, the following three processing steps may be included:
[0047] (1) Using one-shot feature embedding and lightweight information metrics for iterative data selection;
[0048] Specifically, data embedding can be performed using a one-time feature embedding method, and after the one-time embedding is completed, iterative sample data selection is performed through a micro neural network; thereafter, subsequent multiple rounds of iterative data selection processing can be performed based on the iterative sample data;
[0049] The corresponding lightweight information measurement process can be implemented using a lightweight neural network (or micro neural network), which can also be called a proxy information estimator (referred to as proxy estimator), which can directly learn the information metric to reduce the unit information measurement cost in each iteration;
[0050] The specific implementation process of the processing (I) is as follows:
[0051] In each iteration of active learning, a portion of unlabeled data needs to be selected for labeling. Experiments have found that when applying active learning in video analysis systems, the corresponding data selection process becomes a time bottleneck. To understand this bottleneck, we can first model the time cost of data selection and obtain the following formula:
[0052] Labeling cost = unit cost × number of samples × number of iterations;
[0053] Among them, for existing active learning methods, the "unit cost" is the time cost of running the current task model on unlabeled samples and measuring informativeness; the corresponding "number of samples" and "number of iterations" usually represent the number of all unlabeled samples and the number of active learning iterations, respectively. It can be seen from the above cost formula that when the task model is large (for example, a deep neural network with billions of parameters), the unit cost may be very expensive because it involves inference of the task model. On the other hand, when the number of unlabeled samples is large (for example, millions of images), the overhead of data selection is unacceptable even for smaller task models. The impact of these two factors also gradually accumulates with the increase in the number of active learning rounds. The main purpose of the present invention in the implementation process is to focus on reducing the costs caused by these two key factors.
[0054] In traditional active learning iterations, the same sample's information richness must be estimated repeatedly in each round. Information richness requires embedding the raw data into a feature space using a task model, and then measuring informativeness based on these embeddings. Therefore, the unit cost can be divided into: feature embedding cost (Embed) and information measurement cost (Measure). The corresponding data selection cost (i.e., annotation cost) is given by the following formula:
[0055]
[0056] In the above learning iterations, the repeated feature embedding process takes up most of the time.
[0057] To reduce the cost of repeated feature embedding, this paper experimentally explores the implementation method of one-time embedding using a pre-trained embedding model. Specifically, for a text-based emotion recognition task, the processing process that can be adopted includes:
[0058] First, use a pre-trained natural language processing model, such as BERT, GPT2, etc. (each a natural language processing model), to obtain the embedding of the text input, that is, perform a one-time feature embedding on the original data;
[0059] Then, four fully connected layers are connected after the embedding to predict the informativeness (i.e., perform an information measure); as a baseline, the present invention also implements a prediction model that takes the original text as input and uses the same four fully connected layers.
[0060] In experiments, we found that using pre-trained embeddings, lightweight neural networks can effectively learn information metrics. Therefore, the present invention can use the pre-trained model to perform a one-time feature embedding on the original data and use a lightweight neural network, called a proxy estimator, to predict informativeness directly based on the embeddings. Based on this, the formula for the corresponding data selection cost is rewritten as:
[0061] Data selection cost = Embed × number of samples × 1 + Measure × number of samples × number of iterations;
[0062] It can be seen that the above-mentioned one-time feature extraction design can reduce the time cost of repeated and redundant feature embedding from "Embed × number of samples × number of iterations" to "Embed × number of samples × 1", achieving the purpose of the present invention, namely, reducing the unit estimation cost.
[0063] (2) Sample pooling process based on the information richness of the samples;
[0064] That is, the estimation results of the previous round are used to filter low-information samples, so that the range of sample candidates can be more effectively narrowed down in the next round of processing; that is, based on the iterative sample data obtained in the above processing process (1), the micro neural network and sample pooling process are used to perform multiple rounds of iterative selection processing to achieve the selection of learning samples; wherein, based on the ability of the micro neural network to measure information and obtain the information richness of the sample data after each round of iterative processing, the sample pooling process is a process of narrowing down the current sample data based on the information richness of the sample data of two adjacent rounds;
[0065] That is, in view of the sample quantity factor, the present invention designs a sample pooling module to narrow the sample candidate range for information richness estimation. The processing performed by the sample pooling module may include: first, a comparative measurement result of the information richness of two adjacent rounds of samples can be obtained by comparison. If the information richness of the two adjacent rounds of samples changes greatly, the comparative measurement result is larger, and vice versa; then, based on the comparative measurement results from large to small, the sample data after narrowing down is selected in the samples based on the sample information discarding rate, wherein the sample discarding rate can be used to determine the amount of sample data selected to be retained in the total current sample data;
[0066] Specifically, in the process of implementing the present invention, in order to find opportunities to reduce the range of sample candidates, the information changes between two rounds were studied. Specifically, experiments were conducted on a text-based emotion recognition task, using a minimum confidence strategy and 6,809 samples. By comparing the information richness measurement results of samples in two adjacent rounds, it was found that the information richness measurement results of high-information-rich samples changed significantly in the next round, while the information richness measurement results of low-information-rich samples remained stable. Therefore, the sample pooling module of the present invention filtered out samples with low information richness in the previous round, thereby narrowing the range of sample candidates predicted by the proxy estimator, thereby further reducing the overall data selection cost.
[0067] In statistics, "sampling" is to obtain a subset with the same distribution as the original data set; in contrast, the present invention aims to obtain a subset within a specific distribution (a subset with high information richness); this is more like a "pooling" strategy, so it can be called "sample pooling"; specifically, in each round of active learning, the (1-q) proportion of samples with the lowest information richness will be eliminated, where 0 <q≤1。
[0068] (3) Use pipeline strategy to select appropriate sample discard rate;
[0069] like Figure 2 As shown, in the processing process (three), the pipeline strategy can be used to select the sample discard rate, and in the process of determining the sample discard rate, load balancing can be achieved between the various stages of the pipeline, thereby determining the sample discard rate.
[0070] Specifically, the principle for determining the sample discard rate q comes from the advantages of the technical solution provided by the present invention, namely: it can support pipeline processing strategy;
[0071] For traditional active learning methods, the selection of sample data for the next round must wait until the task model training is completed; this dependency prevents overlapping execution of tasks, leading to stagnation of the task process. However, the adoption of the agent estimator (i.e., micro neural network) of the present invention can eliminate the dependence of data selection on the task model, so the technical solution provided by the present invention can support pipeline processing; refer to Figure 2 As shown, it shows a comparison of active learning annotation processes with and without pipeline processing; in order to fully utilize the pipeline, it is also possible to choose to maintain a balanced workload between the various stages of the pipeline; therefore, the present invention can determine the value of q according to the following equation:
[0072] Among them, N represents the number of unlabeled samples at the beginning, n represents the current round n, and N0 is the predefined maximum number of rounds for pooling operations.
[0073] Among them, K is the number of samples selected and labeled in each round, T a ,T t ,T e represents the unit time cost of annotation, training, and proxy estimator prediction for each sample;
[0074] The above equation is obtained by making the data selection time equal to the labeling and training time, that is:
[0075] For round n,
[0076] Using this equation and the condition q≤1, we can derive the expression of q and then determine the value of q.
[0077] The sample discard rate q value determined by the above processing process (three) can more effectively implement the corresponding sample pooling processing operation in the above processing process (two).
[0078] In order to further understand the specific application effects of the above-mentioned embodiments of the present invention, the specific application implementation process thereof will be compared with the implementation scheme in the prior art to illustrate the effects.
[0079] Specifically, a real-time video analysis system was developed for campus security at the university. 2,529 cameras were installed in the system, generating millions of video frames per day in public areas. To adapt to the dynamic changes in campus data distribution and ensure timely detection of security incidents, the detection model needs to be regularly updated with newly generated videos every day. Obviously, labeling all video frames is impractical. Therefore, during the labeling process, an experimental comparison was conducted using both the traditional labeling method and the labeling method provided by the present invention:
[0080] (1) The classic active learning method based on minimum output confidence was used and it was found that the data selection process took too long (accounting for 42% of the total time cost), becoming an efficiency bottleneck. The reason is very intuitive, because the existing active learning methods require the task model to make predictions on all unlabeled data and measure the information richness based on these predictions of the task model to select data. Therefore, for a large number of unlabeled datasets or a large task model, the iterative data selection process can easily dominate the active learning process.
[0081] (2) Combining the technical solution provided by the present invention with the existing active learning method can save 66% of the labeling time while achieving the same model accuracy.
[0082] In summary, the present invention provides an efficient active learning sample selection scheme based on proxy information estimation. This scheme can directly predict the information richness of a sample using a lightweight neural network through an efficient proxy information estimation method. Furthermore, the candidate samples for each round of sample information richness measurement can be narrowed down based on historical information richness measurement results to solve the problem of time-consuming data selection when the amount of unlabeled data is large, thereby enabling a high-accuracy task model to be obtained using a smaller annotation time budget. Furthermore, by combining the embodiment of the present invention as a plug-in with the most advanced active learning annotation algorithm available, while achieving the same accuracy of the task model, the combination of the embodiment of the present invention can save 53.6-89.1% of the annotation time during the active learning annotation process.
[0083] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or any form of implication that the information constitutes prior art already known to those skilled in the art.
Claims
1. A method for selecting learning samples in an active learning process, characterized in that: include: Use a pre-trained natural language processing model to get the embedding of the text input, and connect four fully connected layers after the embedding to make informative predictions; As a benchmark, a prediction model with the original file as input is also used, which also uses the four fully connected layers. After that, the micro neural network is used to iteratively select sample data. Perform multiple rounds of iterative selection processing based on the iterative sample data, the micro neural network and the sample pooling process to select learning samples; Among them, based on the fact that the micro neural network can measure the information of sample data and obtain the information richness of the sample data after each round of iterative processing, the sample pooling process is: determining the comparative measurement result by comparing the information richness of the sample data of two adjacent rounds, if the information richness of the sample data of the two adjacent rounds changes greatly, the larger the comparative measurement result, and vice versa; and based on the comparative measurement result, selecting the sample data after the reduction processing based on the sample discarding rate in the sample data from large to small based on the sample discarding rate, wherein the amount of sample data selected to be retained in the total current sample data can be determined by the sample discarding rate.
2. The method according to claim 1, characterized in that The sample data reduction process includes: A pipeline strategy is adopted to determine the sample discard rate, and sample data reduction processing is performed based on the sample discard rate.
3. The method according to claim 1 or 2, characterized in that In the process of determining the sample discard rate, it is necessary to achieve load balancing between the various stages of the pipeline.
4. The method according to claim 3, characterized in that The formula for determining the sample discard rate includes: where K is the number of samples selected for annotation in each round, T a , T t , T e represents the unit time cost of annotation, training, and prediction for each sample, and 0 < q ≤ 1, N0 is the maximum number of rounds for the pooling operation, N is the number of unlabeled samples initially, and n represents the current nth round.
5. The method according to claim 4, characterized in that The T a ,T t ,T e The formulas for determining include:
Citation Information
Patent Citations
Systems and methods for semi-supervised active learning
CA3160910A1
Training data selection method for machine learning
CN109961098A