An Adaptive Method and System during Model Testing Based on Efficient Active Learning

By selecting the target sample and processing the objective function based on the gradient norm weighting, the problem of error accumulation and high labeling costs in the adaptive method during model testing is solved, and more efficient long-sequence adaptation is achieved.

CN119962611BActive Publication Date: 2025-08-05SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Adaptive methods during the testing of existing models are prone to cumulative errors when the distribution of long sequences changes, and the labeling costs are high, which affects efficiency.

Method used

By determining the pseudo-label and original prediction score of the current batch data, selecting the target sample from it for annotation, and weighting the supervised and unsupervised learning objective functions based on the gradient norm to form an overall objective function to help the model adapt to long-sequence testing.

Benefits of technology

It reduces the labeling cost, improves the adaptive efficiency during model testing, and achieves more stable long-sequence test adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962611B_ABST
    Figure CN119962611B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for model testing adaptation based on efficient active learning. The method comprises: determining the pseudo-labels and original prediction scores corresponding to the current batch of data; selecting target samples from the current batch of data based on the pseudo-labels and original prediction scores; and labeling the target samples, wherein the target samples provide the model with learnable knowledge of the target domain; determining a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning based on the target samples; and weighting the first and second objective functions based on the gradient norm to obtain the overall objective function of the model. The present invention selects only one sample for labeling for each batch of data, significantly reducing the labeling cost. Furthermore, the reweighting of the two objective functions based on the gradient norm helps the model to achieve more stable adaptation during long sequence testing.
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 a self-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. Existing methods mostly 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-term 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-scale base models during the model adaptation process. Figure 2 As shown in (a), the active test-time adaptation method (ATTA) selects multiple examples from each batch of data, labels them, and stores them in an additional buffer. The model is then trained using both the labeled data in the buffer and the currently unlabeled data. However, as data volumes continue to increase, the cost of labeling is also increasing, and the labeling process can seriously impact the efficiency of test-time adaptation.

[0004] Therefore, the existing technology 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 response to 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 labels and original prediction scores corresponding to the current batch of data, select target samples from the current batch of data based on the pseudo labels and the original prediction scores, and label the target samples, wherein the target samples provide the model with learnable knowledge of 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. 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, so as 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 noised 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 the sample with the largest difference from the current batch of data;

[0016] The sample with the largest difference is used 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] Get 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, determining the target sample based on 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, 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, 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:

[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 includes:

[0033] A target sample selection module is used to determine the pseudo labels and original prediction scores corresponding to the current batch of data, select target samples from the current batch of data based on the pseudo labels and the original prediction scores, and label the target samples. The target samples provide the model with learnable knowledge in the target domain;

[0034] An objective function determination module, configured 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] A 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 enable the model to pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt during long sequence testing.

[0036] In a third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and a model testing self-adaptation program based on efficient active learning stored in the memory and runnable 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 in 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 model self-adaptation program based on efficient active learning is stored on the computer-readable storage medium. When the model self-adaptation program based on efficient active learning is executed by a processor, the steps of the model self-adaptation method based on efficient active learning during testing 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 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 a 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 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. In addition, the present invention re-weights the two objective functions based on the gradient norm, which helps the model to adapt to long sequence testing in a more stable manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 The present invention provides a flowchart of a preferred embodiment of a self-adaptive method for model testing based on efficient active learning.

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

[0041] Figure 3 This is 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 This is 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 below 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 intended to limit the present invention.

[0044] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents, operations, or steps, nor must they be executed in the order described. For example, some operations or steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

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

[0046] It should be understood that, to facilitate a clear description of the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first control information and the second control information are merely used to distinguish different control information and do not limit their order.

[0047] Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0048] It should be further understood that the term "and / or" used in the present description 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] To address the problems of the prior art, this embodiment provides a method for model testing-time adaptation based on efficient active learning. This method can significantly reduce labeling costs and improve the efficiency of model testing-time adaptation. In specific applications, this embodiment first determines the pseudo-labels and original prediction scores corresponding to the current batch of data. Based on the pseudo-labels and original prediction scores, target samples are selected from the current batch of data and labeled. The target samples provide the model with learnable knowledge of the target domain. Then, based on the target samples, a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning are determined. Finally, the first and second objective functions are weighted based on the gradient norm to obtain the overall objective function of the model. This overall objective function is used to enable the model to simultaneously focus on data from both supervised and unsupervised learning, thereby facilitating model adaptation during long sequence testing. As can be seen, this embodiment selects only one sample for labeling from each batch of data, significantly reducing labeling costs and improving the efficiency of model testing-time adaptation. Furthermore, this embodiment reweights the two objective functions based on the gradient norm, helping the model achieve more stable adaptation during long sequence testing.

[0050] The adaptive method for model testing based on efficient active learning in this embodiment can be applied to terminals, which can be intelligent product terminals such as computers, mobile phones, smart TVs, etc. Specifically, 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 labels and original prediction scores corresponding to the current batch of data, select target samples from the current batch of data based on the pseudo labels and the original prediction scores, and label the target samples. The target samples provide 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. 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 during 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 for annotation from a set of data 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) where only single-step optimization is usually performed. In addition, low-entropy samples are difficult to provide effective learning signals for the adaptive process. Secondly, existing studies often ignore the imbalance in the gradient size between supervised and unsupervised objective functions during the model adaptation process, 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, with regard to sample selection strategies, previous methods mostly select high-entropy samples for labeling, but this is inappropriate in test-time adaptive scenarios. This is because in test-time adaptive scenarios, the model often only performs single-step optimization, making it difficult to fully learn the knowledge of high-entropy samples, which may reduce the model's learning efficiency. Unlike previous methods, this embodiment introduces a new sample selection strategy from the perspective of single-step optimization, intending to find samples that the model can learn knowledge from through single-step optimization, and these samples also have a high amount of information. In test-time adaptive scenarios, a model pre-trained on source domain data is deployed in the target domain. The prediction of the target domain data by the pre-trained model can be used to estimate whether the distribution of this data is close to the data distribution of the source domain. The samples for which the model is most likely to learn target domain knowledge through single-step optimization are those that fall between the distribution of the source domain data and the distribution of the target domain data. Therefore, this embodiment needs to locate these samples and assign them true labels.

[0056] In specific applications, if a sample falls between the source and target domain data distributions, the model's predictions for that sample will be more sensitive to slight distribution changes. Slight perturbations can significantly alter the model's predictions for these samples. Based on this, this embodiment uses samples that fall between the source and target domain data distributions as the most feasible samples for the model to learn through single-step optimization. Feature perturbations are then used to locate these samples, ultimately yielding 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 prediction 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 the softmax, k represents the category, and argmax represents the independent variable with the maximum value.

[0058] Next, this embodiment selects a target sample from the current batch of data based on the pseudo label and the original prediction score. Specifically, this 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 perturbations 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. Then, based on the difference, the target sample is selected from the current batch of data.

[0059] Specifically, add noise f(x i )+∈, where ∈ is the noise sampled from Gaussian distribution, ∈∽(μ,σ 2 ), μ, σ 2 Represent the mean and variance of the Gaussian distribution respectively. This embodiment calculates the difference between the original prediction score and the noised prediction score 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 Method (b) in this embodiment is used. Compared to traditional techniques that select multiple samples from each batch of data for labeling, this embodiment only needs to select the most valuable sample from each batch 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 target samples, this embodiment can further consider the category information of the selected samples, taking into account the issue of category balance. Specifically, after calculating the difference value corresponding to each sample in the current batch of data, the samples can be sorted in descending order based on the difference value corresponding to each sample, to obtain a candidate sample sequence. Next, the historical pseudo-labels and historical difference values corresponding to historical samples stored in a preset memory are obtained. The target sample is then determined based on the historical pseudo-labels and historical difference values corresponding to the candidate sample sequence and the historical samples. In actual applications, this 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 overlap with the historical pseudo-label of the historical sample, the current candidate sample is selected as the target sample. If the pseudo-label of the current candidate sample overlaps with the historical pseudo-label of the historical sample, 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 selected 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 in 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] Furthermore, 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 crash. This embodiment can calculate the gradient norms of the two objective functions separately, and then re-weight them to make the model 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, this embodiment performs supervised learning on the target sample, and performs unsupervised learning on the low-entropy samples in the samples remaining after excluding the target sample in the current batch data. This embodiment determines the first objective function corresponding to the supervised learning and the second objective function corresponding to the unsupervised learning respectively. 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, this 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 a specific application, this embodiment calculates a first gradient norm of the first objective function and a second gradient norm of the second objective function. Then, based on the first gradient norm and the second gradient norm, a first dynamic weight of the first objective function and a second dynamic weight of the second objective function are determined. Finally, the first and second objective functions are weighted based on the first and second dynamic weights 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 the entropy minimization loss function, which is expressed as represents the 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 Then 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 model's layer l, 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 can be expressed as:

[0072]

[0073] Furthermore, this embodiment may further 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 can be expressed as:

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

[0075] The target samples selected by the sample selection strategy in the adaptive method during model testing based on efficient active learning in this embodiment have the characteristics of high information content and ease of 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. The two parts of data are then constrained by the first objective function of supervised learning and the second objective function of unsupervised learning. As shown in Table 1 below, the method of this embodiment achieves better performance using 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 corruptions 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 "JPEG Compression," respectively. In the experiments in Table 1, this example used the five highest noise levels, generating 50,000 images for each corruption 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 + marks in Table 1 represent that 1 and 3 target samples are selected from each batch of data and given expert labels. Baseline represents that a target sample is randomly selected from the current batch of data and given an expert label. and The subscript o in the table represents the 300 samples and their labels stored in the additional memory. Source represents the performance of the pre-trained model tested directly on the target domain. The method proposed in this example 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 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 requiring 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 expert annotation is replaced by large-scale pre-trained model annotation.

[0081] Table 2

[0082]

[0083] Table 2 shows the performance comparison of each method on the ImageNet-C dataset. The basic model used in the experiments 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 for each batch of data and given the labels given by the large-scale pre-trained model. and The subscript o in the table represents the storage of 300 samples and their labels in additional memory. Source represents the performance of the pre-trained model tested directly on the target domain. The method proposed in this example is Ours. AVG.Err. represents the average error rate. GT represents expert annotation. Baseline represents randomly selecting a target sample from the current batch and assigning 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 cross-entropy loss constraints, such as Figure 2 (a) in the figure. However, this approach may increase memory consumption and reduce the efficiency of test-time adaptation. The method of this embodiment achieves optimal performance regardless of whether this approach is adopted. This embodiment requires fewer labeled samples and does not rely on a cache to achieve performance that exceeds that of traditional test-time adaptation methods.

[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 weighting 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. The target sample provides the model with learnable knowledge of the target domain. The objective function determination 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 weighting 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. 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 efficient active learning-based model testing can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a terminal in hardware form, or stored in a memory in the terminal in software form, so that the processor can call and execute the corresponding operations of each module.

[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 in the figure), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, a self-adaptive analysis program for 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 self-adaptive method for 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 self-adaptive system for 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. The general-purpose processor may be a microprocessor or any conventional processor.

[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. Furthermore, the memory 101 may 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 about 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 solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0092] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus 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 various 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 labels and original prediction scores corresponding to the current batch of data, select target samples from the current batch of data based on the pseudo labels and the original prediction scores, and label the target samples, wherein the target samples provide the model with learnable knowledge of 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. 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, so as 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 includes: 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 noised 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, characterized in that: The selecting the target sample from the current batch of data based on the difference includes: Obtaining the sample with the largest difference from the current batch of data; The sample with the largest difference is used 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; Get 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 method for model testing based on efficient active learning according to claim 4, 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: Sequentially comparing 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 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 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: 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 labels and original prediction scores corresponding to the current batch of data, select target samples from the current batch of data based on the pseudo labels and the original prediction scores, and label the target samples. The target samples provide the model with learnable knowledge in the target domain; An objective function determination module, configured to determine a first objective function corresponding to supervised learning and a second objective function corresponding to unsupervised learning based on the target sample; A 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 enable the model to pay attention to the data of supervised learning and unsupervised learning at the same time to help the model adapt during 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 runnable 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 testing self-adaptation program based on efficient active learning. When the model testing self-adaptation program based on efficient active learning is executed by the processor, 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.