Online domain change continuous learning method and system based on pseudo label filtering
By dynamically adjusting the pseudo-label threshold and introducing a class prior alignment method, the problem of degradation of pseudo-label quality in CTTA is solved, and the robustness and adaptability of the model under long-term continuous domain changes are improved, and more stable classification prediction is achieved.
Patent Information
- Application Number
- CN202411020101.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In long-term continuous test time adaptation (CTTA), the degradation of pseudo-label quality leads to a decline in model performance, and it is difficult for the prior art to effectively filter low-quality pseudo-labels, especially under unsupervised conditions, due to the uncertainty of the distribution of the target domain data and Test data unavailability, and fixed threshold filtering methods are impractical.
A threshold-based pseudo-label filtering method is designed to dynamically adjust the pseudo-label threshold by taking into account the number of categories, model confidence fluctuations, and the characteristics of categories in continuous domain variations, and introduce exponential moving average and exponential decay algorithms to evaluate and adjust Confidence, combined with class prior alignment methods to ensure pseudo-label quality.
It effectively solves the problems of low sampling rate and slow convergence speed caused by high thresholds, improves model robustness and adaptability, ensures pseudo-label quality, and realizes continuous learning and optimization in complex environments.
Smart Images

Figure CN119206387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an online domain change continuous learning method and system based on pseudo-label filtering. Background Art
[0002] With the rapid development of deep learning technology, the challenges faced by models in actual deployment are also increasing. Especially in complex scenarios such as autonomous driving and environmental monitoring, models need to be able to adapt to changing environmental conditions and data distribution. To this end, Test-Time Adaptation (TTA) technology came into being, which allows models to adapt to new target domains through unsupervised learning without accessing source data.
[0003] However, traditional TTA methods are usually limited to static or short-term environmental changes, and have limited adaptability to long-term or continuously changing environments. Therefore, Continuous Test-Time Adaptation (CTTA), as an online continuous form of TTA, has received extensive attention in recent years. CTTA technology aims to enable the model to adapt to changes in the target domain data distribution in real time and continuously, so as to maintain efficiency and robustness in unsupervised practical application scenarios.
[0004] In the implementation of CTTA, pseudo-labeling technology is a commonly used method. Pseudo-labeling technology generates predicted labels (i.e., pseudo-labels) for target domain samples and uses these pseudo-labels to optimize the model, thereby promoting the adaptation of the model to the target domain. In particular, in methods based on the Mean Teacher (MT) structure, pseudo-labeling technology is widely used to improve the short-term structural domain adaptation ability of the model under TTA conditions. The MT structure further strengthens the role of pseudo-labels in the model adaptation process by generating a predicted consistency loss.
[0005] However, despite the remarkable success of pseudo-labeling techniques in short-term TTA applications, they face significant challenges in long-term CTTA applications. Over time, the quality of the generated pseudo-labels will gradually degrade due to the uncertainty of model predictions and the uncertainty of environmental changes. These low-quality pseudo-labels may cause errors to accumulate during the model adaptation process, leading to performance degradation. Therefore, how to effectively filter out these low-quality pseudo-labels in CTTA has become an urgent problem to be solved.
[0006] Currently, setting a threshold is a simple and intuitive method for filtering pseudo labels. However, in unsupervised CTTA tasks, due to the unknown distribution of target domain data and the unavailability of test data, it is impractical to filter pseudo labels by fine-tuning a fixed threshold. This requires us to seek a more flexible and adaptive pseudo label filtering strategy to adapt to the complex and changing environmental conditions and data distribution in CTTA.
[0007] In summary, CTTA technology and the challenges it faces in pseudo-labeling technology have put forward new requirements for the continuous adaptation and robustness of current deep learning models in practical deployment. How to design an effective pseudo-label filtering strategy to overcome the problems caused by low-quality pseudo-labels in long-term CTTA applications is one of the important directions of current research. Summary of the invention
[0008] To this end, an embodiment of the present invention provides an online domain change continuous learning method and system based on pseudo-label filtering, which is used to solve the problem in the prior art that it is difficult to effectively filter low-quality pseudo-labels through a fixed threshold due to the lack of supervision information and the uncertainty of target domain data distribution.
[0009] In order to solve the above problem, an embodiment of the present invention provides an online domain change continuous learning method based on pseudo label filtering, the method comprising:
[0010] Obtain source data and pre-trained models, use the pre-trained models to predict the source data, and generate pseudo labels;
[0011] Based on binary classification, a lemma for filtering pseudo labels based on thresholds in continuous learning with online domain changes is derived, and based on the lemma, a threshold setting principle in continuous learning with online domain changes is designed;
[0012] Design threshold setting principles for continuous learning of online domain changes, including:
[0013] Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used;
[0014] Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model;
[0015] Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly;
[0016] The designed threshold setting principle is used to filter out pseudo labels with low model prediction confidence. At the same time, the class prior alignment method is introduced to encourage the model to make fair predictions on samples from unknown domains.
[0017] The model is updated and optimized using the filtered pseudo-labels to obtain the classification prediction results in continuous learning with online domain changes.
[0018] Preferably, a lemma for filtering pseudo labels based on thresholds in continuous learning of online domain changes is derived based on binary classification, specifically including:
[0019] For any target domain in the continuous target domain adaptation process Consider a binary classification problem where the true distribution is an even mixture of two Gaussian distributions, i.e., the pseudo-label Y is equally likely to be positive (+1) or negative (-1), and the input With the following conditional distribution:
[0020]
[0021] In the formula, N(,) represents the conditional distribution, i.e., Gaussian distribution; μ1, μ2 represent the mean; represents variance; X represents the real data category;
[0022] pass Calculate the confidence score, where β is a positive parameter that reflects the learning state of the model, which gradually changes during training as the confidence of the model increases or decreases; x represents the sample; a(x) represents the confidence score;
[0023] A fixed threshold τ∈(1 / 2,1) is used to generate pseudo-label scenarios. If a(x)>τ, the sample x is assigned a pseudo-label of +1; if s(x)<1-τ, the sample x is assigned a pseudo-label of -1; if 1-τ≤(x)≤τ, the sample x is assigned a pseudo-label of 0.
[0024] The probability distribution of pseudo label Y is as follows:
[0025]
[0026] P(Y=0)=1-P(Y=1)-P(Y=-1);
[0027] Where φ(·) is the cumulative distribution function of a standard normal distribution; P(·) represents the probability.
[0028] Preferably, the method using a low initialization threshold related to the number of categories is:
[0029]
[0030] Where τ0(c) represents the low initialization threshold; c represents the category; and N represents the number of categories.
[0031] Preferably, in view of the fluctuation of model confidence, an exponential moving average of the confidence based on each training time step is used as the intra-domain base confidence estimate, and an exponential decay algorithm is used to adjust the inter-domain threshold τ t , in order to maintain β and τ t The positive correlation between them includes:
[0032]
[0033] Where ED(,) represents the exponential decay algorithm; EMA(·) represents the exponential moving average; t represents the training time step; λ∈(0,1) is the momentum decay of EMA; α is the ED factor; Q represents the pre-trained model f θ (·) Abbreviation for prediction after strong data enhancement; represents mathematical expectation; Where B represents the batch size and b represents the samples in the batch.
[0034] Preferably, the model's predicted expected value for each category is calculated to estimate the confidence of a given category, and the threshold is adjusted accordingly, specifically including:
[0035]
[0036] In the formula, p t (c) is a list containing all class thresholds;
[0037] The final pseudo-label threshold τ is set t (c) are as follows:
[0038]
[0039] Preferably, a class prior alignment method is introduced to encourage the model to make fair predictions on samples in unknown domains, including:
[0040] Let the distribution in pseudo labels be the expectation of the model's predictions on unlabeled data, using the strongly augmented data ratio R between the histogram distribution U(C) and the probability expectation Q and weak enhancement data ratio R q , each prediction Q and q on the unlabeled data is normalized to calculate the loss weight of each sample to offset the negative impact of imbalance, and the calculation formula is as follows:
[0041]
[0042] in
[0043]
[0044] In the formula, q represents the pre-trained model f θ (·) Abbreviation for prediction after weak enhancement; Hist B (·) represents histogram; U(C) Q , Represents the histogram distribution of strong or weak enhancement respectively; C represents the category set;
[0045] The loss at the nth iteration is The class prior alignment of is expressed as:
[0046]
[0047] In the formula, Normalize(·) represents the normalization operation, which normalizes the prediction proportion weights in the batch to ensure that the sum of the normalized probabilities is 1.0. Class prior alignment encourages assigning larger weights to predictions with fewer pseudo labels and smaller weights to predictions with more pseudo labels, thereby alleviating the problem of prediction imbalance.
[0048] Preferably, the model is updated and optimized using the filtered pseudo-labels, and the target loss of the model is for:
[0049]
[0050] Where 1(·>τ) is the confidence-based thresholding indicator function; is the symmetric cross entropy loss;
[0051] The task loss of the model for:
[0052]
[0053] In the formula, w u and w c Respectively represent and The loss weight.
[0054] The embodiment of the present invention further provides an online domain change continuous learning system based on pseudo label filtering, which is used to implement the above-mentioned online domain change continuous learning method based on pseudo label filtering, and specifically includes:
[0055] The data preparation and pseudo-label generation module is used to obtain source data and pre-trained models, use the pre-trained models to predict the source data, and generate pseudo-labels;
[0056] The threshold setting principle design module is used to derive the lemma of threshold-based filtering of pseudo labels in continuous learning with online domain changes based on binary classification, and to design the threshold setting principle in continuous learning with online domain changes based on the lemma;
[0057] Design threshold setting principles for continuous learning of online domain changes, including:
[0058] Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used;
[0059] Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model;
[0060] Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly;
[0061] The pseudo-label filtering and class prior alignment module is used to filter pseudo-labels with low model prediction confidence by using the designed threshold setting principle, and at the same time encourage the model to make fair predictions on samples in unknown domains by introducing the class prior alignment method;
[0062] The model updating and optimization module is used to update and optimize the model using the filtered pseudo labels to obtain the classification prediction results in the continuous learning of online domain changes.
[0063] An embodiment of the present invention also provides an electronic device, comprising a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned online domain change continuous learning method based on pseudo-label filtering.
[0064] An embodiment of the present invention further provides a computer storage medium storing a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned online domain change continuous learning method based on pseudo-label filtering.
[0065] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0066] (1) This paper proposes an innovative adaptive threshold setting method, which dynamically adjusts the filtering threshold of pseudo labels by considering the number of categories, the fluctuation of model confidence, and the characteristics of categories in continuous domain changes. This method effectively solves the problems of low sampling rate and slow convergence speed that may be caused by high thresholds, while ensuring the quality of pseudo labels. The setting of adaptive thresholds not only improves the robustness of the model, but also enables it to better adapt to the environment of online domain changes.
[0067] (2) The present invention introduces the exponential moving average (EMA) and exponential decay (ED) strategies to evaluate and adjust the confidence of unlabeled data. This strategy ensures a positive correlation between the threshold and the model confidence, so that the threshold can be automatically adjusted as the model learning state changes. This method improves the accuracy and efficiency of pseudo-label filtering, allowing the model to continue learning and optimizing during online domain changes.
[0068] (3) The present invention also proposes a class-balanced regularization objective and a class prior alignment method to encourage the model to generate different predictions in all categories. This method solves the problem of class centroid proximity that may occur in different categories during continuous domain changes, and reduces the error accumulation caused by continuous domain shift. At the same time, the class prior alignment method encourages the model to make fair predictions for unknown domain samples, further improving the quality of pseudo labels and the robustness of the model. This comprehensive approach enables the model to maintain stable performance and continue learning when facing complex online domain changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0070] Figure 1 A flowchart of an online domain change continuous learning method based on pseudo-label filtering provided in an embodiment;
[0071] Figure 2 This is a flowchart of pseudo-label filtering in the present invention;
[0072] Figure 3 It is a flow chart of the adaptation of the adaptive threshold in the CTTA process of the present invention;
[0073] Figure 4 This is a diagram showing the effect of the class prior alignment method used in the embodiment on the bi-monthly dataset;
[0074] Figure 5 This is a comparison chart of the pseudo-label quality and quantity of the present invention and other advanced methods in the embodiments;
[0075] Figure 6 A block diagram of an online domain change continuous learning system based on pseudo-label filtering provided in an embodiment. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] Embodiment 1
[0078] Before delving into the specific implementation methods of the computing method of the present invention, we first need to clarify several basic concepts in deep learning algorithms, which are crucial to understanding the innovations of the present invention.
[0079] First, Continuous Online Testing and Learning (COLT) is a learning method to address real-world challenges. In reality, the training and test data faced by the model often do not come from the same distribution, that is, there is a so-called domain shift problem. For example, the model may be trained on pictures taken during the day, but needs to be tested on pictures taken at night. Traditional domain adaptation methods rely on obtaining target domain data for adaptation training before testing, which is unrealistic in many practical applications because the target domain data may only appear during testing and may change continuously. Therefore, continuous online testing and learning aims to enable the model to continuously adapt to new and changing data distributions during testing.
[0080] Secondly, pseudo-label filtering learning is an effective strategy to solve the problem of scarce labeled data. In many practical applications, it is expensive and time-consuming to obtain a large amount of accurately labeled data, while unlabeled data is relatively easy to obtain. In order to make full use of these unlabeled data, semi-supervised learning and self-supervised learning methods have emerged. Pseudo-labeling is a key technology in these methods, which uses a pre-trained model to predict unlabeled data and uses these prediction results as pseudo-labels. Subsequently, these pseudo-labels are used together with labeled data for further training of the model to improve the performance of the model. However, the quality of pseudo-labels varies, and directly using all pseudo-labels may lead to a decrease in model performance. Therefore, pseudo-label filtering learning emphasizes screening out high-quality pseudo-labels during the training process to improve the effectiveness of learning and the robustness of the model.
[0081] In summary, the method of the present invention is based on the idea of continuous online test learning and pseudo-label filtering learning, and aims to design a continuous learning method that can adapt to changes in data distribution online and effectively filter pseudo-labels to improve model performance.
[0082] like Figure 1 As shown, an embodiment of the present invention proposes an online domain change continuous learning method based on pseudo-label filtering, the method comprising:
[0083] Step S1: Obtain source data and a pre-trained model, use the pre-trained model to predict the source data, and generate pseudo labels;
[0084] Step S2: Based on binary classification, a lemma for filtering pseudo labels based on thresholds in continuous learning with online domain changes is derived, and a threshold setting principle in continuous learning with online domain changes is designed based on the lemma;
[0085] Design threshold setting principles for continuous learning of online domain changes, including:
[0086] Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used;
[0087] Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model;
[0088] Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly;
[0089] Step S3: Utilize the designed threshold setting principle to filter out pseudo labels with low model prediction confidence, and introduce class prior alignment method to encourage the model to make fair predictions on samples in unknown domains;
[0090] Step S4: Use the filtered pseudo labels to update and optimize the model to obtain the classification prediction results in the continuous learning of online domain changes.
[0091] From the above technical solution, it can be seen that the present invention proposes an online domain change continuous learning method based on pseudo-label filtering, which significantly improves the robustness and adaptability of the model under continuous domain changes. Through the carefully designed threshold setting principle and combined with the class prior alignment method, the present invention effectively identifies and retains high-quality pseudo-labels, and dynamically adjusts the threshold to adapt to the changes in the model learning state, ensuring that the model can continue to learn and optimize in a complex and changeable online environment, thereby achieving more stable and accurate classification predictions in the field of computer vision.
[0092] In step S1, source data and a pre-trained model are obtained, the pre-trained model is used to predict the source data, and a pseudo label is generated.
[0093] In this embodiment, in step S2, a lemma for filtering pseudo labels based on thresholds in continuous learning with online domain changes is derived based on binary classification, and a threshold setting principle in continuous learning with online domain changes is designed according to the lemma.
[0094] Specifically, in the continuous target domain adaptation, the present invention adapts the existing source data to The pre-trained model is parameterized, where and is a dataset and a corresponding label set. After good training, the goal of continuous target domain adaptation is to respond to the changing target domain during the test phase. Without accessing any source data. The present invention achieves this by dynamically filtering pseudo-labels, where pseudo-labels are generated by a pre-trained model f θ (·) is generated online. To facilitate the description of the equation later, we use Q and q to represent the model f θ (·) Abbreviation for predictions after strong augmentation and predictions after weak augmentation.
[0095] For any target domain in the continuous target domain adaptation process Consider a binary classification problem where the true distribution is an even mixture of two Gaussian distributions, i.e., the pseudo-label Y is equally likely to be positive (+1) or negative (-1), and the input With the following conditional distribution:
[0096]
[0097] In the formula, N(,) represents the conditional distribution, i.e., Gaussian distribution; μ1, μ2 represent the mean; represents variance; X represents the real data category;
[0098] pass Calculate the confidence score, where β is a positive parameter that reflects the learning state of the model, which gradually changes during training as the model confidence increases or decreases; x represents the sample; s(x) represents the confidence score.
[0099] A fixed threshold τ∈(1 / 2,1) is used to generate pseudo-label scenarios. If s(x)>τ, the sample x is assigned a pseudo-label of +1; if s(x)<1-τ, the sample x is assigned a pseudo-label of -1; if 1-τ≤(x)≤τ, the sample x is assigned a pseudo-label of 0.
[0100] The probability distribution of pseudo label Y is as follows:
[0101]
[0102]
[0103] P(Y=0)=1-P(Y=1)-P(Y=-1);
[0104] Where φ(·) is the cumulative distribution function of a standard normal distribution; P(·) represents the probability.
[0105] Furthermore, based on the lemma, the threshold setting principle in the continuous learning of online domain changes is designed, including:
[0106] Principle 1 (low initialization): Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is adopted.
[0107] Specifically, based on the low initialization principle, the present invention proposes a low initialization threshold setting method that is closely related to the number of categories, aiming at the problems of low sampling rate and slow convergence speed that may be caused by high thresholds. Specifically, considering that the utilization rate of high-quality data (1-P(Y=0)) is directly affected by the threshold τ, as τ increases, the data utilization rate will decrease accordingly. Especially in the test phase, if the β value is small, the use of a high threshold will further limit the sampling rate and convergence speed. Therefore, the present invention emphasizes the use of a relatively small initialization threshold to improve efficiency, and verifies through experiments that multiple low thresholds can effectively improve performance, although the results are diverse. In view of the impracticality of adjusting the threshold in the test phase, the present invention ultimately chooses a low initialization strategy associated with the number of categories to set the threshold τ, which is simple and effective, ensuring efficient use of data and rapid convergence of the algorithm.
[0108] The method using a low initialization threshold related to the number of categories is:
[0109]
[0110] Where τ0(c) represents the low initialization threshold; c represents the category; and N represents the number of categories.
[0111] Principle 2 (positively correlated with model confidence): In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the intra-domain base confidence estimate, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t The positive correlation between them ensures the stability of the sampling rate during line domain changes, where β is a positive parameter reflecting the learning state of the model, including:
[0112]
[0113] Where ED(,) represents the exponential decay algorithm; EMA(·) represents the exponential moving average; t represents the training time step; λ∈(0,1) is the momentum decay of EMA; α is the ED factor; Q represents the pre-trained model f θ (·) Abbreviation for prediction after strong data enhancement; represents mathematical expectation; Where B represents the batch size and b represents the samples in the batch.
[0114] Specifically, Principle 2 focuses on the positive correlation between model confidence and threshold adjustment to cope with the challenges brought by online domain changes. In view of the volatility of model confidence during training, the present invention innovatively adopts the exponential moving average (EMA) of confidence at each training time step as a stable estimate of the intra-domain base confidence. At the same time, in order to maintain β (a positive parameter reflecting the learning state of the model) and the inter-domain threshold τ t The positive correlation between τ and τ is obtained by introducing an exponential decay algorithm (ED) to dynamically adjust τ t , ensuring that the sampling rate remains stable when the sample distribution fluctuates and the domain changes. This strategy effectively addresses the problem of high-quality data (1-P(Y=0)) utilization fluctuations caused by inconsistent model confidence changes within and between domains. In particular, in the continuous target domain adaptation process, by adaptively adjusting the threshold, it avoids the situation where a large number of high-quality pseudo-labels are incorrectly filtered out due to a fixed threshold, thereby improving the adaptability and performance of the model.
[0115] Principle 3 (differentiate the impact of categories on thresholds): Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly, including:
[0116]
[0117] In the formula, p t (c) is a list containing all class thresholds.
[0118] The final pseudo-label threshold τ is set t (c) are as follows:
[0119]
[0120] Specifically, Principle 3 emphasizes the importance of setting fine thresholds for different categories for pseudo-label filtering in the scenario of continuous domain change. Given that different categories may show closer category centroids in the dynamic target domain due to domain bias, this increases the risk of unlabeled samples being mispredicted. To address this challenge, the present invention proposes to accurately estimate the confidence of a given category by calculating the predicted expected value of the model for each category c, and dynamically adjust the threshold accordingly. Experimental results show that the use of multiple thresholds for pseudo-label filtering leads to a stabilization of the number of pseudo-label quality fluctuations, but the overall number increases, indicating that fine-grained threshold settings can more effectively adapt to the diversity of categories and their potential adjacencies, thereby ensuring sample availability while improving the utilization of high-quality data (1-P(Y=0)), especially when the category centroids are close, reducing the loss caused by misprediction. Therefore, the core of Principle 3 is to distinguish the impact of categories on thresholds and optimize the pseudo-label filtering process through refined threshold settings.
[0121] In step S3, the designed threshold setting principle is used to filter out pseudo labels with low model prediction confidence, and the class prior alignment method is introduced to encourage the model to make fair predictions on samples in unknown domains. Figure 2 and Figure 3 shown.
[0122] When setting the threshold in principle 3, the diversity of classes is ignored, that is, different classes have different domain shifts due to different learning difficulties. The present invention further proposes class prior alignment (CPA) to encourage a more uniform distribution of pseudo labels between different classes. Let the distribution in pseudo labels be the expectation of the model's prediction of unlabeled data. The present invention uses the strong enhancement data ratio R between the histogram distribution U(C) and the probability expectation Q and weak enhancement data ratio R q Each prediction Q and q on the unlabeled data is normalized to calculate the loss weight for each sample to offset the negative impact of imbalance, as follows:
[0123]
[0124] in
[0125]
[0126] In the formula, q represents the pre-trained model f θ (·) Abbreviation for prediction after weak enhancement; Hist B (·) represents histogram; U(C) Q , Represents the histogram distribution of strong or weak enhancement respectively; C represents the category set;
[0127] The loss at the nth iteration is The class prior alignment of is expressed as:
[0128]
[0129] In the formula, Normalize(·) represents the normalization operation, which normalizes the prediction proportion weights in the batch to ensure that the sum of the normalized probabilities is 1.0. Class prior alignment encourages assigning larger weights to predictions with fewer pseudo labels and smaller weights to predictions with more pseudo labels, thereby alleviating the problem of prediction imbalance.
[0130] pass Figure 4 It can be seen that this method can better distinguish category boundaries on the bimonthly dataset.
[0131] In step S4, the model is updated and optimized using the filtered pseudo labels to obtain the classification prediction results in the continuous learning of online domain changes, such as Figure 5 As shown. The target loss of the model for:
[0132]
[0133] Where 1(·>τ) is the confidence-based thresholding indicator function; is the symmetric cross entropy loss.
[0134] The task loss of the model for:
[0135]
[0136] In the formula, w u and w c Respectively represent and The present invention utilizes and The information gap of the neural network is balanced, thereby reducing the classification error.
[0137] In order to verify the advantages of the method of the present invention, it is described below in conjunction with experiments.
[0138] Dataset and source model (pre-trained model) settings: In the field of image processing, the present invention evaluates the robustness of machine learning models to corruption and interference in input data through three benchmark dataset test tasks (CIFAR-10-C, CIFAR-100-C and ImageNet-C). CIFAR-10-C and CIFAR-100-C extend the original CIFAR-10 and CIFAR-100 datasets, respectively, each containing 32x32 color images from 10 and 100 categories, and introduce 15 different corruption types, each of which is applied to test images at 5 severity levels, and 10,000 test images are generated. ImageNet-C extends the ImageNet dataset and applies 15 corruption types to its verification images. All datasets are used to test the performance of the model in the face of multiple corruptions and interferences. We strictly adhere to the CTTA setting, do not directly access the source data, and evaluate multiple comparative experimental models online, including Cotta, TENT, AdaContrast, and DSS, all of which are evaluated based on five levels of maximum damage severity. During the evaluation process, model predictions are generated before being adapted to the current test stream. To ensure the breadth and fairness of the evaluation, we use standard pre-trained WideResNet, ResNeXt-29, and ResNet-50 as source models for each dataset.
[0139] By using an adaptive threshold for pseudo-label filtering, the present invention successfully reduces the average error on CIFAR100-C and ImageNet-C from 32.5% to 30.1%, and from 66.8% to 59.4% compared to Cotta. In order to further study the effectiveness of the present invention on the baseline, the present invention also evaluates its adaptability performance on 10 different sequences on ImageNet-C. Compared with Cotta, more than 10 different sequences are reduced by 3% on average, which shows that the method of the present invention is more robust to the order of the target domain sequence. The experimental results are shown in Tables 1, 2, and 3.
[0140] Table 1 Experimental results of CIFAR10-C dataset
[0141]
[0142] Table 2 Experimental results on CIFAR100-C dataset
[0143]
[0144] Table 3 Experimental results of ImageNet-C dataset
[0145]
[0146] Embodiment 2
[0147] like Figure 6 As shown, the present invention provides an online domain change continuous learning system based on pseudo label filtering, which is used to implement the online domain change continuous learning method based on pseudo label filtering of the above embodiment 1, and specifically includes:
[0148] The data preparation and pseudo-label generation module 100 is used to obtain source data and a pre-trained model, use the pre-trained model to predict the source data, and generate a pseudo-label;
[0149] A threshold setting principle design module 200 is used to derive a lemma for filtering pseudo labels based on thresholds in continuous learning with online domain changes based on binary classification, and to design a threshold setting principle in continuous learning with online domain changes based on the lemma;
[0150] Design threshold setting principles for continuous learning of online domain changes, including:
[0151] Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used;
[0152] Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model;
[0153] Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly;
[0154] The pseudo-label filtering and class prior alignment module 300 is used to filter pseudo-labels with low model prediction confidence by using the designed threshold setting principle, and at the same time encourage the model to make fair predictions on unknown domain samples by introducing a class prior alignment method;
[0155] The model updating and optimization module 400 is used to update and optimize the model using the filtered pseudo labels to obtain the classification prediction results in the continuous learning of online domain changes.
[0156] An online domain change continuous learning system based on pseudo-label filtering in this embodiment is used to implement the aforementioned online domain change continuous learning method based on pseudo-label filtering. Therefore, the specific implementation method of the online domain change continuous learning system based on pseudo-label filtering can be seen in the embodiment part of the online domain change continuous learning method based on pseudo-label filtering in the previous text, for example, the data preparation and pseudo-label generation module 100, the threshold setting principle design module 200, the pseudo-label filtering and class prior alignment module 300, the model updating and optimization module 400, are respectively used to implement steps S1, S2, S3, and S4 in the above-mentioned online domain change continuous learning method based on pseudo-label filtering. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part. In order to avoid redundancy, it will not be repeated here.
[0157] Embodiment 3
[0158] An embodiment of the present invention also provides an electronic device, comprising a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned online domain change continuous learning method based on pseudo-label filtering.
[0159] Embodiment 4
[0160] An embodiment of the present invention further provides a computer storage medium storing a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned online domain change continuous learning method based on pseudo-label filtering.
[0161] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0162] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0164] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims
1. A method for continuous learning of online domain changes based on pseudo-label filtering, characterized in that: include: Obtain source data and pre-trained models, use the pre-trained models to predict the source data, and generate pseudo labels; Based on binary classification, a lemma for filtering pseudo labels based on thresholds in continuous learning with online domain changes is derived, and based on the lemma, a threshold setting principle in continuous learning with online domain changes is designed; The threshold setting principles designed in the continuous learning of online domain changes include: Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used; Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model; Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly; The designed threshold setting principle is used to filter out pseudo labels with low model prediction confidence. At the same time, the class prior alignment method is introduced to encourage the model to make fair predictions on samples from unknown domains. The model is updated and optimized using the filtered pseudo-labels to obtain the classification prediction results in continuous learning with online domain changes.
2. The online domain change continuous learning method based on pseudo-label filtering according to claim 1 is characterized in that: The lemma of filtering pseudo labels based on thresholds in continuous learning of online domain changes derived based on binary classification specifically includes: For any target domain in the continuous target domain adaptation process Consider a binary classification problem where the true distribution is an even mixture of two Gaussian distributions, i.e., the pseudo-label Y is equally likely to be positive (+1) or negative (-1), and the input With the following conditional distribution: In the formula, N(,) represents the conditional distribution, i.e., Gaussian distribution; μ1, μ2 represent the mean; represents variance; X represents the real data category; pass Calculate the confidence score, where β is a positive parameter that reflects the learning state of the model, which gradually changes during training as the confidence of the model increases or decreases; x represents the sample; s(x) represents the confidence score; A fixed threshold τ∈(1 / 2,1) is used to generate pseudo-label scenarios. If s(x)>τ, the sample x is assigned a pseudo-label of +1; if s(x)<1-τ, the sample x is assigned a pseudo-label of -1; if 1-τ≤(x)≤τ, the sample x is assigned a pseudo-label of 0. The probability distribution of pseudo label Y is as follows: P(Y=0)=1-P(Y=1)-P(Y=-1); Where φ(·) is the cumulative distribution function of a standard normal distribution; P(·) represents the probability.
3. The method for online domain change continuous learning based on pseudo-label filtering according to claim 1, characterized in that: The method of using a low initialization threshold value related to the number of categories is: Where τ0(c) represents the low initialization threshold; c represents the category; and N represents the number of categories.
4. The method for online domain change continuous learning based on pseudo-label filtering according to claim 3 is characterized in that: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the intra-domain base confidence estimate, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t The positive correlation between them includes: Where ED(,) represents the exponential decay algorithm; EMA(·) represents the exponential moving average; t represents the training time step; λ∈(0,1) is the momentum decay of EMA; α is the ED factor; Q represents the pre-trained model f θ (·) Abbreviation for prediction after strong data enhancement; represents mathematical expectation; Where B represents the batch size and b represents the samples in the batch.
5. The method for online domain change continuous learning based on pseudo-label filtering according to claim 4 is characterized in that: Calculate the expected value of the model's prediction for each category to estimate the confidence of a given category and adjust the threshold accordingly, including: In the formula, p t (c) is a list containing all class thresholds; The final pseudo-label threshold τ is set t (c) are as follows:
6. The method for online domain change continuous learning based on pseudo-label filtering according to claim 5, characterized in that: By introducing a class prior alignment method, the model is encouraged to make fair predictions on samples from unknown domains, including: Let the distribution in pseudo labels be the expectation of the model's predictions on unlabeled data, using the strongly augmented data ratio R between the histogram distribution U(C) and the probability expectation Q and weak enhancement data ratio R q , each prediction Q and q on the unlabeled data is normalized to calculate the loss weight of each sample to offset the negative impact of imbalance, and the calculation formula is as follows: in In the formula, q represents the pre-trained model f θ (·) Abbreviation for prediction after weak enhancement; Hist B (·) represents histogram; U(C) Q , Represents the histogram distribution of strong or weak enhancement respectively; C represents the category set; The loss at the nth iteration is The class prior alignment of is expressed as: In the formula, Normalize(·) represents the normalization operation, which normalizes the prediction proportion weights in the batch to ensure that the sum of the normalized probabilities is 1.
0. Class prior alignment encourages assigning larger weights to predictions with fewer pseudo labels and smaller weights to predictions with more pseudo labels, thereby alleviating the problem of prediction imbalance.
7. The method for online domain change continuous learning based on pseudo-label filtering according to claim 6, characterized in that: The model is updated and optimized using the filtered pseudo labels, and the target loss of the model is for: Where 1(·>τ) is the confidence-based thresholding indicator function; is the symmetric cross entropy loss; The task loss of the model for: In the formula, w u and w c Respectively represent and The loss weight.
8. An online domain change continuous learning system based on pseudo-label filtering, characterized in that: The system is used to implement the online domain change continuous learning method based on pseudo-label filtering according to any one of claims 1 to 7, and specifically includes: The data preparation and pseudo-label generation module is used to obtain source data and pre-trained models, use the pre-trained models to predict the source data, and generate pseudo-labels; The threshold setting principle design module is used to derive the lemma of threshold-based filtering of pseudo labels in continuous learning with online domain changes based on binary classification, and to design the threshold setting principle in continuous learning with online domain changes based on the lemma; The threshold setting principles designed in the continuous learning of online domain changes include: Principle 1: Considering that a high threshold may lead to low sampling rate and slow convergence, a low initialization threshold related to the number of categories is used; Principle 2: In view of the fluctuation of model confidence, the exponential moving average of the confidence based on each training time step is used as the base confidence estimate within the domain, and the inter-domain threshold τ is adjusted using an exponential decay algorithm t , in order to maintain β and τ t There is a positive correlation between them, where β is a positive parameter reflecting the learning state of the model; Principle 3: Given that different categories may show closer category centroids during continuous domain changes, set fine thresholds for pseudo-label filtering, calculate the model's predicted expected value for each category to estimate the confidence of a given category, and adjust the threshold accordingly; The pseudo-label filtering and class prior alignment module is used to filter pseudo-labels with low model prediction confidence by using the designed threshold setting principle, and at the same time encourage the model to make fair predictions on samples in unknown domains by introducing the class prior alignment method; The model updating and optimization module is used to update and optimize the model using the filtered pseudo labels to obtain the classification prediction results in the continuous learning of online domain changes.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory and a bus system, the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the online domain change continuous learning method based on pseudo-label filtering as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer software product, and the computer software product includes several instructions for enabling a computer device to execute the online domain change continuous learning method based on pseudo-label filtering as described in any one of claims 1 to 7.
Citation Information
Cited By
Automobile headrest sorting method and system based on confidence matching
CN120298804A
Migration risk control method and system for brain-computer interface label-free deployment
CN122634380A
