Adaptive method and system during model test based on efficient active learning

By adopting efficient and active learning methods in the test-time adaptive method, selecting the target samples and weighting the objective function, the error accumulation problem and high annotation cost caused by changes in long sequence distribution are solved, and more efficient and stable model adaptation is achieved.

CN119962611AActive Publication Date: 2025-05-09SOUTH CHINA UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510129463.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-05-09
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

The existing adaptive methods during testing are prone to cumulative errors when facing changes in long sequence distribution, and the labeling costs are high, which affects efficiency.

Method used

Using an efficient and active learning method, the overall objective function of the model is obtained by determining the pseudo-label and original prediction score of the current batch data, selecting the target sample for annotation, and weighting the supervised and unsupervised learning based on the gradient norm.

Benefits of technology

It reduces the annotation cost, improves the efficiency of adaptability during model testing, and helps the model adapt more stably during long-sequence testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962611A_ABST
    Figure CN119962611A_ABST
Patent Text Reader

Abstract

The invention discloses an adaptive method and system during model testing based on efficient active learning, and the method comprises the steps: determining a pseudo tag and an original prediction score corresponding to the current batch of data, selecting a target sample from the current batch of data based on the pseudo tag and the original prediction score, and marking the target sample, the target sample provides target domain learnable knowledge for the model; based on the target sample, determining a first target function corresponding to supervised learning and a second target function corresponding to unsupervised learning; and weighting the first objective function and the second objective function based on the gradient norm to obtain an overall objective function of the model. According to the method, only one sample is selected for labeling each batch of data, the labeling cost is greatly reduced, and reweighting is performed on the two objective functions based on the gradient norm, so that the model is helped to be self-adaptive when a more stable long sequence test is performed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an adaptive method and system for model testing based on efficient active learning. Background Art

[0002] Test-Time Adaptation (TTA) methods aim to adapt pre-trained models to new data distributions during the model deployment phase. TTA is crucial in dynamic scenarios such as autonomous driving, where out-of-distribution data can severely impair model performance. Most existing methods resort to self-training techniques such as pseudo-labeling and entropy minimization to fine-tune the source (pre-)trained model in the absence of ground-truth labels for test data. However, these methods are often prone to error accumulation and even negative transfer when faced with long-sequence distribution changes.

[0003] In order to solve the problem of long-term test adaptation (Long-term TTA), it is common to introduce annotations created by experts or large base models during the model adaptation process. Figure 2 As shown in (a), the Active Test-Time Adaptation (ATTA) method selects multiple samples from each batch of data for annotation and stores them in an additional buffer. Then the model is trained using both the annotated data in the buffer and the current unannotated data. However, due to the increasing amount of data, the annotation cost is also gradually increasing, and the annotation process may seriously affect the efficiency of test-time adaptation.

[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and system for model testing self-adaptation based on efficient active learning in view of the above-mentioned defects of the prior art. The technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides a method for self-adaptation during model testing based on efficient active learning, wherein the method comprises:

[0007] Determine the pseudo label and the original prediction score corresponding to the current batch of data, select a target sample from the current batch of data based on the pseudo label and the original prediction score, and label the target sample, wherein the target sample provides the model with learnable knowledge in the target domain;

[0008] Based on the target sample, determining a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning;

[0009] The first objective function and the second objective function are weighted based on the gradient norm to obtain the overall objective function of the model, and the overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt itself when performing long sequence testing.

[0010] In one implementation, selecting a target sample from the current batch of data based on the pseudo label and the original prediction score includes:

[0011] Add noise data to the original features of each sample to obtain the corresponding noise-added prediction score for each sample;

[0012] For each sample, calculate the difference between the original prediction score and the noisy prediction score in the pseudo-label dimension;

[0013] Based on the difference, the target sample is selected from the current batch of data.

[0014] In one implementation, selecting the target sample from the current batch of data based on the difference includes:

[0015] Obtaining a sample with the largest difference from the current batch of data;

[0016] The sample with the largest difference is taken as the target sample.

[0017] In one implementation, selecting the target sample from the current batch of data based on the difference includes:

[0018] Based on the difference value corresponding to each sample, the samples are sorted to obtain a candidate sample sequence;

[0019] Obtain the historical pseudo labels and historical differences corresponding to the historical samples stored in the preset memory;

[0020] The target sample is determined based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples.

[0021] In one implementation, the determining the target sample based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples includes:

[0022] Sequentially comparing the pseudo labels of the candidate samples in the candidate sample sequence with the historical pseudo labels of the historical samples;

[0023] If the pseudo label of the current candidate sample does not overlap with the historical pseudo label of the historical sample, the current candidate sample is used as the target sample.

[0024] In one implementation, the determining the target sample based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples further includes:

[0025] If the pseudo-label of the current candidate sample coincides with the historical pseudo-label of the historical sample, then the difference value corresponding to the current candidate sample is compared with the historical difference value of the historical sample;

[0026] If the difference value corresponding to the current candidate sample is greater than the historical difference value of the historical sample, the current candidate sample is used as the target sample;

[0027] If the difference value corresponding to the current candidate sample is less than or equal to the historical difference value of the historical sample, the pseudo label of the next candidate sample is compared with the historical pseudo label of the historical sample, and so on, until the target sample is determined.

[0028] In one implementation, the weighted processing of the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model includes:

[0029] respectively calculating a first gradient norm of the first objective function and a second gradient norm of the second objective function;

[0030] Determining a first dynamic weight of the first objective function and a second dynamic weight of the second objective function based on the first gradient norm and the second gradient norm;

[0031] The first objective function and the second objective function are weighted based on the first dynamic weight and the second dynamic weight to obtain the overall objective function.

[0032] In a second aspect, an embodiment of the present invention further provides a model testing adaptive system based on efficient active learning, wherein the system comprises:

[0033] A target sample selection module is used to determine the pseudo label and the original prediction score corresponding to the current batch of data, select a target sample from the current batch of data based on the pseudo label and the original prediction score, and label the target sample, wherein the target sample provides the model with learnable knowledge in the target domain;

[0034] An objective function determination module, used to determine a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning based on the target sample;

[0035] The function weighted processing module is used to perform weighted processing on the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model. The overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt when performing long sequence testing.

[0036] In the third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and an adaptive program during model testing based on efficient active learning stored in the memory and executable on the processor, and when the processor executes the adaptive program during model testing based on efficient active learning, the steps of the adaptive method during model testing based on efficient active learning of any one of the above-mentioned schemes are implemented.

[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein a program for self-adaptation during model testing based on efficient active learning is stored on the computer-readable storage medium, and when the program for self-adaptation during model testing based on efficient active learning is executed by a processor, the steps of the method for self-adaptation during model testing based on efficient active learning described in any one of the above-mentioned schemes are implemented.

[0038] Beneficial effects: Compared with the prior art, the present invention provides a method for model testing self-adaptation based on efficient active learning. The present invention first determines the pseudo-label and original prediction score corresponding to the current batch of data, selects the target sample from the current batch of data based on the pseudo-label and the original prediction score, and labels the target sample. The target sample provides the model with learnable knowledge in the target domain. Then, based on the target sample, the first objective function corresponding to supervised learning and the second objective function corresponding to unsupervised learning are determined. Finally, the first objective function and the second objective function are weighted based on the gradient norm to obtain the overall objective function of the model. The overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time, so as to help the model to adapt to long sequence testing. The present invention only selects one sample for labeling for each batch of data, which greatly reduces the labeling cost and improves the efficiency of model adaptation during testing. And the present invention re-weights the two objective functions based on the gradient norm to help the model to adapt to long sequence testing in a more stable manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a preferred embodiment of a self-adaptive method during model testing based on efficient active learning provided in an embodiment of the present invention.

[0040] Figure 2 It is a comparison diagram of the method frameworks of the traditional model testing self-adaptation method and the model testing self-adaptation method of this embodiment.

[0041] Figure 3 A principle block diagram of an adaptive system for model testing based on efficient active learning provided by an embodiment of the present invention.

[0042] Figure 4 A functional block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0044] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations or steps, nor must they be executed in the order described. For example, some operations or steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0045] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0046] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first control information and the second control information are only used to distinguish different control information, and their order is not limited.

[0047] Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the differences.

[0048] It should be further understood that the term “and / or” used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0049] In order to solve the problems of the prior art, the present embodiment provides a method for model testing based on efficient active learning. The method based on the present embodiment can greatly reduce the labeling cost and improve the efficiency of model testing. In specific application, the present embodiment first determines the pseudo label and the original prediction score corresponding to the current batch of data, selects the target sample from the current batch of data based on the pseudo label and the original prediction score, and labels the target sample, and the target sample provides the model with target domain learnable knowledge. Then, based on the target sample, the first objective function corresponding to supervised learning and the second objective function corresponding to unsupervised learning are determined. Finally, the first objective function and the second objective function are weighted based on the gradient norm to obtain the overall objective function of the model, and the overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time, so as to help the model to adapt to long sequence testing. It can be seen that the present embodiment selects only one sample for labeling for each batch of data, which greatly reduces the labeling cost and improves the efficiency of model testing. And the present embodiment re-weights the two objective functions based on the gradient norm to help the model to adapt to long sequence testing more stably.

[0050] The self-adaptive method for model testing based on efficient active learning in this embodiment can be applied to a terminal, which can be a computer, a mobile phone, a smart TV or other intelligent product terminal. Figure 1 As shown in , the adaptive method for model testing based on efficient active learning in this embodiment includes:

[0051] Step S100, determine the pseudo label and the original prediction score corresponding to the current batch of data, select a target sample from the current batch of data based on the pseudo label and the original prediction score, and label the target sample, wherein the target sample provides the model with learnable knowledge in the target domain.

[0052] Step S200: determining a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning based on the target sample;

[0053] Step S300, weighting the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model, wherein the overall objective function is used to enable the model to pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt when performing long sequence testing.

[0054] This embodiment aims to reduce the annotation cost of model adaptation during model testing, improve the efficiency of model adaptation during model testing, and achieve the purpose of selecting only one sample from a set of data for annotation each time. Existing methods tend to select high entropy samples. However, samples with high entropy are usually challenging for models, especially in scenarios such as test-time adaptation (TTA), which usually only perform single-step optimization. In addition, low entropy samples are difficult to provide effective learning signals for the adaptive process. Secondly, existing studies often ignore the imbalance of gradient size between supervised and unsupervised objective functions during model adaptation, resulting in inefficient model adaptation process. To this end, this embodiment selects samples that are rich in information and easy to learn as target samples, while ensuring balanced learning between supervised and unsupervised training objective functions.

[0055] Specifically, for the sample selection strategy, most of the previous methods select high entropy samples for annotation, but this is not suitable in the test-time adaptive scenario. Because in the test-time adaptive scenario, the model often only performs single-step optimization, it is difficult to fully learn the knowledge of high entropy samples, which may reduce the learning efficiency of the model. Unlike previous methods, this embodiment introduces a new sample selection strategy from the perspective of single-step optimization, intending to find samples that can learn knowledge through single-step optimization, and these samples also have a high amount of information. In the test-time adaptive scenario, the model pre-trained on the source domain data will be deployed in the target domain. Through the prediction of the target domain data by the pre-trained model, it can be estimated whether the distribution of these data is close to the data distribution of the source domain. The samples for which the model is most likely to learn the target domain knowledge through single-step optimization are between the source domain data distribution and the target domain data distribution. Therefore, this embodiment needs to locate these samples and give them true labels.

[0056] In specific applications, if a sample is between the source domain and the target domain data distribution, then the model's prediction of the sample must be more sensitive to slight distribution changes. Slight perturbations can significantly change the model's prediction of these samples. Based on this, this embodiment uses samples between the source domain and the target domain data distribution as the most feasible samples for the model to learn through single-step optimization, and locates this sample through feature perturbations to obtain the target sample.

[0057] In order to determine the target sample, this embodiment first obtains the original features of the current batch of data through the predicted model, and determines the pseudo label and original prediction score (predictionscore) corresponding to the current batch of data based on the original features. Specifically, the current batch of data is represented as: Where t represents the batch, represents the target domain, N T represents the amount of target domain data, x i Represents the i-th sample. The pseudo label of the current batch of data Where f(·) represents the feature extractor, h(·) represents the classifier, δ(·) represents softmax, k represents the category, and argmax represents the independent variable that takes the maximum value.

[0058] Next, the present embodiment selects a target sample from the current batch of data based on the pseudo-label and the original prediction score. Specifically, the present embodiment adds noise data to the original features of each sample in the current batch of data, such as adding slight Gaussian noise, and then obtains the noisy prediction score corresponding to each sample through the predicted model. Then, corresponding to the phenomenon that slight disturbances can significantly change the model's prediction of these sample features, for each sample, the difference between the original prediction score and the noisy prediction score in the pseudo-label dimension is calculated. Next, based on the difference, the target sample is selected from the current batch of data.

[0059] Specifically, add noise f(x) to the original feature corresponding to each sample in the current batch of data. i )+∈, where ∈ is the noise sampled from a Gaussian distribution, ∈∽(μ,σ 2 ), μ, σ 2 Respectively represent the mean and variance of the Gaussian distribution. This embodiment calculates the difference between the original prediction score and the prediction score after adding noise in the pseudo label dimension:

[0060] where |·| represents the absolute value.

[0061] In one implementation, this embodiment can obtain the sample with the largest difference from the current batch of data, and then use the sample with the largest difference as the target sample. Figure 2 As shown, Figure 2 (a) is the traditional adaptive method during active testing. Figure 2 (b) is the method of this embodiment. Compared with the traditional technology of selecting multiple samples from each batch of data for labeling, this embodiment only needs to select one most valuable sample from each batch of data or multiple batches of data for labeling, which greatly reduces the labeling cost and improves the efficiency of self-adaptation during model testing.

[0062] In another implementation, when selecting the target sample, the present embodiment may further consider the category information of the selected sample, taking into account the problem of category balance. Specifically, after calculating the difference corresponding to each sample in the current batch of data, the samples may be sorted in order from large to small based on the difference corresponding to each sample to obtain a candidate sample sequence. Next, the historical pseudo-labels and historical differences corresponding to the historical samples stored in the preset memory are obtained; then the target sample is determined based on the historical pseudo-labels and historical differences corresponding to the candidate sample sequence and the historical samples. In practical applications, the present embodiment sequentially compares the pseudo-labels of the candidate samples in the candidate sample sequence with the historical pseudo-labels of the historical samples. If the pseudo-label of the current candidate sample does not coincide with the historical pseudo-label of the historical sample, the current candidate sample is used as the target sample. If the pseudo-label of the current candidate sample coincides with the historical pseudo-label of the historical sample, the difference corresponding to the current candidate sample is compared with the historical difference of the historical sample. If the difference corresponding to the current candidate sample is greater than the historical difference of the historical sample, the current candidate sample is used as the target sample. If the difference value corresponding to the current candidate sample is less than or equal to the historical difference value of the historical sample, the pseudo-label of the next candidate sample is compared with the historical pseudo-label of the historical sample, and so on, until the target sample is determined. Finally, after all candidate samples of the current batch of data are selected, this embodiment uses the difference value and pseudo-label corresponding to the determined target sample to update the information in the preset memory. The preset memory of this embodiment is a queue with a fixed length and a first-in-first-out feature.

[0063] Further, for dynamic weighting based on gradient norm, most previous methods have ignored the problem that the gradient magnitudes of the first objective function of supervised learning and the second objective function of unsupervised learning are quite different. The dynamic weighting based on gradient norm proposed in this embodiment solves this problem. Since the gradient amplitude of the first objective function of supervised learning is much larger than the gradient amplitude of the second objective function of supervised learning, the model will overfit to the supervised data and ignore the knowledge of the unsupervised data. This will cause the model to continuously accumulate errors in adaptation during long sequence testing, and even cause the model to collapse. This embodiment can calculate the gradient norms of the two objective functions separately, and then re-weight the model to pay attention to the data of supervised learning and the data of unsupervised learning at the same time.

[0064] Specifically, after selecting the target sample, the present embodiment performs supervised learning on the target sample, and performs unsupervised learning on the low entropy samples in the remaining samples except the target sample in the current batch data. The present embodiment respectively determines the first objective function corresponding to the supervised learning and the second objective function corresponding to the unsupervised learning. Due to the imbalance between the gradient sizes of the first objective function of supervised learning and the second objective function of unsupervised learning, the model will overfit to the labeled samples. In order to achieve balanced learning between the first objective function of supervised learning and the second objective function of unsupervised learning, the present embodiment performs weighted processing on the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model, which is used to help the model to adapt more stably during long sequence testing.

[0065] In specific application, this embodiment calculates the first gradient norm of the first objective function and the second gradient norm of the second objective function respectively. Then, based on the first gradient norm and the second gradient norm, the first dynamic weight of the first objective function and the second dynamic weight of the second objective function are determined. Finally, based on the first dynamic weight and the second dynamic weight, the first objective function and the second objective function are weighted to obtain the overall objective function.

[0066] The overall objective function of the model is the sum of the first objective function corresponding to supervised learning and the second objective function corresponding to unsupervised learning, expressed as:

[0067]

[0068] Among them, γ1 is the first dynamic weight corresponding to the first objective function, γ2 is the second dynamic weight corresponding to the second objective function, CE represents the cross entropy loss, and E represents the entropy minimization loss. is an indicator function, which represents the screening of unsupervised samples. Only low entropy samples participate in the calculation of entropy minimization loss function, which is expressed as represents a set of target samples selected based on the sample selection strategy of this embodiment. represents other samples except the target sample, Θ is the model parameter, are the parameters actually updated by the model,

[0069] Specifically, it can be concluded from the overall objective function of the above model that It reflects the first objective function. It reflects the second objective function. In practical application, for simplicity, the first objective function can be referred to as and the second objective function is called Next, this embodiment calculates the first objective function The gradient norm of :

[0070] Calculate the second objective function The gradient norm of in represents the trainable parameters of the lth layer of the model, and ‖·‖2 represents the L2 norm.

[0071] Next, a first dynamic weight γ1 of the first objective function and a second dynamic weight γ2 of the second objective function are determined based on the first gradient norm and the second gradient norm, which are expressed as:

[0072]

[0073] Furthermore, this embodiment may also refine the first dynamic weight of the first objective function and the second dynamic weight of the second objective function based on an exponential moving average strategy, which is expressed as:

[0074] where α is a trade-off parameter, α∈(0,1), reflects the first dynamic weight in t batches of data, is the first dynamic weight in the t-1 batch of data, The second dynamic weight in t batches of data is reflected, is the second dynamic weight in the t-1 batch data. Based on the above determination of the first dynamic weight and the second dynamic weight, this embodiment re-weights the first objective function and the second objective function to obtain the overall objective function. The contributions of the two objective functions of this embodiment are balanced, avoiding the problem of overfitting caused by the gradient of the first objective function of supervised learning being much larger than the gradient of the second objective function of unsupervised learning.

[0075] The target samples selected by the sample selection strategy in the adaptive method during model testing based on efficient active learning of this embodiment have the characteristics of high information content and easy model learning through single-step optimization. This embodiment labels the target samples and divides the current batch data into two parts: supervised data and unsupervised data. Then, the two parts of data are constrained by the first objective function of supervised learning and the second objective function of unsupervised learning respectively. As shown in Table 1 below, the method of this embodiment achieves better performance with fewer labeled samples. When this embodiment uses the same settings as SIMATTA, this advantage is further expanded.

[0076] Table 1

[0077]

[0078] Table 1 shows the performance comparison of various methods on the ImageNet-C dataset.

[0079] ImageNet-C is a dataset derived from the original ImageNet validation set, with common damage and perturbations, as shown in C1-C15 in Table 1 above. C1-C15 in Table 1 represent "Gaussian Noise", "Shot Noise", "Impulse Noise", "Defocus Blur", "Glass Blur", "Motion Blur", "Zoom Blur", "Snow", "Frost", "Fog", "Brightness", "Contrast", "Elastic Transform", "Pixelate", and "JPEGCompression" respectively, representing "Gaussian Noise", "Lens Noise", "Impulse Noise", "Defocus Blur", "Glass Blur", "Motion Blur", "Zoom Blur", "Snow", "Frost", "Fog", "Brightness", "Contrast", "Elastic Transform", "Pixelate", and "JPEG Compression" respectively. In the experiment in Table 1, this embodiment uses the 5 highest noise levels, and generates 50,000 images for each damage type. In total, the dataset contains 750,000 images across 1,000 classes. The base model used in the experiment is ResNet-50 with BatchNorm. The * and + in Table 1 represent that 1 and 3 target samples are selected from each batch of data and given expert labels, respectively. Baseline represents randomly selecting a target sample from the current batch of data and giving it an expert label. and The subscript o in represents that 300 samples and their labels are stored in the extra memory. Source represents the performance of the pre-trained model directly tested in the target domain. The method proposed in this embodiment is Ours. AVG.Err. represents the average error rate. The best and suboptimal performance are highlighted in bold and underlined, respectively.

[0080] In the sample selection strategy section, expert annotation is used for the selected target samples. When faced with a limited annotation budget, this embodiment can replace the expert annotation with an open source large-scale pre-trained model, such as a Transformer model. Directly using a large-scale pre-trained model to provide annotations can ensure that most pseudo-labels are correct without any budget. Experiments show that when a large-scale pre-trained model is used instead of expert annotation, the method of this embodiment is ahead of existing methods, as shown in Table 2. Table 2 shows the performance of this embodiment when the expert annotation is replaced by a large-scale pre-trained model annotation.

[0081] Table 2

[0082]

[0083] Table 2 shows the performance comparison of various methods on the ImageNet-C dataset. The basic model used in the experiment in Table 2 is also ResNet-50 with BatchNormLayer. The marks * and + in Table 2 respectively represent that 1 and 3 target samples are selected in each batch of data and given the labels given by the large-scale pre-trained model. and The subscript o in represents that 300 samples and their labels are stored in the extra memory. Source represents the performance of the pre-trained model directly tested in the target domain. The method proposed in this embodiment is Ours. AVG.Err. represents the average error rate. GT represents the expert labeling. Baseline represents randomly selecting a target sample from the current batch and giving it an expert label. The best and second-best performance are highlighted in bold and underlined, respectively.

[0084] For the overall method framework, most traditional methods keep all labeled samples and corresponding labels in an additional memory (buffer), and then sample from the additional memory (buffer) in the subsequent model adaptation process and use the cross entropy loss constraint, such as Figure 2 As shown in (a). However, this approach may increase memory consumption and reduce the efficiency of test-time adaptation. The method of this embodiment can achieve optimal performance regardless of whether this approach is adopted. This embodiment requires fewer labeled samples and can achieve performance that exceeds that of traditional test-time adaptation methods without relying on the cache area.

[0085] Based on the above embodiments, the present invention also provides a model testing adaptive system based on efficient active learning, such as Figure 3As shown in , the system of this embodiment includes: a target sample selection module 10, an objective function determination module 20 and a function weighted processing module 30. Specifically, the target sample selection module 10 is used to determine the pseudo-label and the original prediction score corresponding to the current batch of data, select the target sample from the current batch of data based on the pseudo-label and the original prediction score, and label the target sample, and the target sample provides the model with learnable knowledge of the target domain. The objective function analysis module 20 is used to determine the first objective function corresponding to supervised learning and the second objective function corresponding to unsupervised learning based on the target sample. The function weighted processing module 30 is used to perform weighted processing on the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model, and the overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time, so as to help the model adapt when performing long sequence testing.

[0086] The working principles of each module in the adaptive system during model testing based on efficient active learning in this embodiment are the same as the principles of each step in the above method embodiment, and will not be repeated here.

[0087] Each module in the adaptive system for the above-mentioned model test based on efficient active learning can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the terminal in the form of hardware, or can be stored in the memory in the terminal in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0088] Based on the above embodiment, the present invention further provides a terminal, the principle block diagram of the terminal can be as follows: Figure 4 The terminal may include one or more processors 100 ( Figure 4 Only one is shown), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, an adaptive analysis program during model testing based on efficient active learning. When one or more processors 100 execute the computer program 102, the various steps in the embodiment of the adaptive method during model testing based on efficient active learning can be implemented. Alternatively, when one or more processors 100 execute the computer program 102, the functions of the various modules / units in the embodiment of the adaptive system during model testing based on efficient active learning can be implemented, which is not limited here.

[0089] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0090] In one embodiment, the memory 101 may be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 101 may also include both an internal storage unit of the electronic device and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.

[0091] Those skilled in the art will understand that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0092] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double operational data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A self-adaptive method for model testing based on efficient active learning, characterized in that: The method comprises: Determine the pseudo label and the original prediction score corresponding to the current batch of data, select a target sample from the current batch of data based on the pseudo label and the original prediction score, and label the target sample, wherein the target sample provides the model with learnable knowledge in the target domain; Based on the target sample, determining a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning; The first objective function and the second objective function are weighted based on the gradient norm to obtain the overall objective function of the model, and the overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt itself when performing long sequence testing.

2. The self-adaptive model testing method based on efficient active learning according to claim 1, characterized in that: The selecting a target sample from the current batch of data based on the pseudo label and the original prediction score comprises: Add noise data to the original features of each sample to obtain the corresponding noise-added prediction score for each sample; For each sample, calculate the difference between the original prediction score and the noisy prediction score in the pseudo-label dimension; Based on the difference, the target sample is selected from the current batch of data.

3. The self-adaptive model testing method based on efficient active learning according to claim 2 is characterized in that: The selecting the target sample from the current batch of data based on the difference includes: Obtaining a sample with the largest difference from the current batch of data; The sample with the largest difference is taken as the target sample.

4. The self-adaptive model testing method based on efficient active learning according to claim 2, characterized in that: The selecting the target sample from the current batch of data based on the difference includes: Based on the difference value corresponding to each sample, the samples are sorted to obtain a candidate sample sequence; Obtain the historical pseudo labels and historical differences corresponding to the historical samples stored in the preset memory; The target sample is determined based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples.

5. The self-adaptive model testing method based on efficient active learning according to claim 4 is characterized in that: The determining the target sample based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples includes: Comparing the pseudo labels of the candidate samples in the candidate sample sequence with the historical pseudo labels of the historical samples in sequence; If the pseudo label of the current candidate sample does not overlap with the historical pseudo label of the historical sample, the current candidate sample is used as the target sample.

6. The self-adaptive method for model testing based on efficient active learning according to claim 5, characterized in that: The determining the target sample based on the historical pseudo labels and historical differences corresponding to the candidate sample sequence and the historical samples further includes: If the pseudo-label of the current candidate sample coincides with the historical pseudo-label of the historical sample, then the difference value corresponding to the current candidate sample is compared with the historical difference value of the historical sample; If the difference value corresponding to the current candidate sample is greater than the historical difference value of the historical sample, the current candidate sample is used as the target sample; If the difference value corresponding to the current candidate sample is less than or equal to the historical difference value of the historical sample, the pseudo label of the next candidate sample is compared with the historical pseudo label of the historical sample, and so on, until the target sample is determined.

7. The self-adaptive method for model testing based on efficient active learning according to claim 1, characterized in that: The step of performing weighted processing on the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model includes: respectively calculating a first gradient norm of the first objective function and a second gradient norm of the second objective function; Determining a first dynamic weight of the first objective function and a second dynamic weight of the second objective function based on the first gradient norm and the second gradient norm; The first objective function and the second objective function are weighted based on the first dynamic weight and the second dynamic weight to obtain the overall objective function.

8. An adaptive system for model testing based on efficient active learning, characterized in that: The system comprises: A target sample selection module is used to determine the pseudo label and the original prediction score corresponding to the current batch of data, select a target sample from the current batch of data based on the pseudo label and the original prediction score, and label the target sample, wherein the target sample provides the model with learnable knowledge in the target domain; An objective function determination module, used to determine a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning based on the target sample; The function weighted processing module is used to perform weighted processing on the first objective function and the second objective function based on the gradient norm to obtain the overall objective function of the model. The overall objective function is used to make the model pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt when performing long sequence testing.

9. A terminal, characterized in that: The terminal includes a memory, a processor, and a model testing self-adaptation program based on efficient active learning stored in the memory and executable on the processor. When the processor executes the model testing self-adaptation program based on efficient active learning, the steps of the model testing self-adaptation method based on efficient active learning as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a model-adaptive testing program based on efficient active learning. When the model-adaptive testing program based on efficient active learning is executed by a processor, the steps of the model-adaptive testing method based on efficient active learning as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Dynamic machine learning modeling method based on sample recommending and labeling

    CN103150454A

  • Active anomaly detection method for multivariate time series and related device thereof

    CN114298240A

  • Interactive image segmentation method based on unsupervised learning

    CN116109656A

  • Systems and methods for online adaptation for cross-domain streaming data

    US20230153307A1

  • Feature conditioned output transformer for generalizable semantic segmentation

    WO2024015811A1