Paper: Entropy is not Enough for Test-Time Adaptation: From the Perspective of Disentangled Factors (ICLR-2024)

Reviewer comment (Presentation):
It is not a great practice to include the whole of related works in the appendix. Even the related works section on TTA in appendix is extremely sparse (a single paragraph!) and should be much more broader in its scope.

Author response:
A: Given our focus on demonstrating the effectiveness and robustness of DeYO, we overlooked incorporating sufficient content on related work. Following your comment, we revised the related work section to provide a more comprehensive and in-depth overview. Due to space constraints, we have not been able to include this in the main manuscript yet. However, in the final version, we will make an effort to incorporate at least some of it into the main manuscript.

Reviewer comment (Theory):
I understand that authors’ aim is to reject samples which use spurious features for prediction as doing TTA on them might be harmful. However, past theoretical work (https://proceedings.neurips.cc/paper/2020/file/f1298750ed09618717f9c10ea8d1d3b0-Paper.pdf) shows that self-training avoids using spurious features.

Author response:
A: Thank you for recommending the paper. We included the recommended paper in related work. However, this paper does not seem practically feasible. Self-training requires conditions like “the spurious feature which correlates with the label in the source domain does not exist in the target domain” to avoid using spurious features. Moreover, the source model must be accurately trained. However, it is challenging for the real source model (pre-trained model) and target dataset to satisfy these conditions. Thus, the theoretical proof presented in the recommended paper may not be fully applicable in real-world scenarios.  

Also, we empirically confirmed that the performance of existing TTA methods that utilize self-training (entropy minimization) without considering spurious features, is significantly lower than that of DeYO, which deliberately suppresses the learning of spurious features during self-training.

Reviewer comment (Experiments):
There are many methods which assess augmentation + entropy (see MEMO, SENTRY https://arxiv.org/pdf/2012.11460.pdf). SENTRY does sample filtering based on consistency of predictions over various augmentations. It is a crucial and missing baseline in this work, especially in Table 2 and Table 3. I know SENTRY operates in UDA setting, but the consistency over augmentations part is pretty standard.

Author response:
A: Thank you for the constructive comment. We added the results of MEMO and SENTRY to Tabs. 2 and 3 in the main manuscript. We implement SENTRY based on the implementation of MEMO and excluding the supervised loss component following the TTA setting. As shown in the results, SENTRY yields higher performance than MEMO. However, their performance is similar to other baselines and is significantly lower than DeYO.

We think that there are two reasons why SENTRY showed a higher performance than MEMO. Firstly, SENTRY utilizes additional memory to estimate class distribution and employs a loss function based on it. Secondly, instead of identifying confident samples using the average entropy of predictions, SENTRY identifies samples that are not influenced by augmentations.

The reason why the performance of MEMO and SENTRY is significantly lower than DeYO is due to the fundamental issue we highlighted in Sec. 2.1 regarding entropy: “relying solely on entropy may not be consistently reliable in the presence of distribution shifts, as it cannot distinguish whether the model focuses on the desired target.” 
In other words, entropy cannot distinguish whether a sample is primarily represented by CPR factors or TRAP factors, regardless of its value (including those samples contributing much more to the loss you mentioned). This issue cannot be resolved by averaging entropy over multiple augmentations which is used by MEMO and SENTRY because they rely solely on entropy. To address this, we propose a new metric called PLPD, which can measure the influence of CPR factors. We revised the first paragraph of page 5 in the main manuscript to highlight and provide further explainations for the entropy's problem in distinguishing **harmful** samples.

### MEMO & SENTRY
||ColoredMNIST||WaterBirds||
|-|:-:|:-:|:-:|:-:|
||Avg Acc (%)|Worst Acc (%)|Avg Acc (%)|Worst Acc (%)|
|MEMO|63.77|6.23|82.34|50.47|
|SENTRY|63.23|15.78|85.77|60.90|
|TENT|56.28|8.93|82.61|53.43|
|EATA|60.29|16.99|83.42|57.48|
|DeYO with $x'_{pat}$|77.61|65.51|86.56|74.18|

Reviewer comment (Evaluation):
Can the authors give any reason why their proposed approach should work better under label shift or for batch size 1 as shown in Table 5? I do not see any reason why augmentation-based sample selection should help for label shift TTA (makes sense for spurious TTA). Similar is the question for batch size 1 setting. Are the authors sure they did proper hyperparameter tuning for the baselines?

Author response:
A: Sorry for missing an intuitive description of why our proposed method performs well in wild scenarios compared to existing approaches. The reason why DeYO excels in wild scenarios is that, for the first time, it constrains the direction of adaptation through entropy minimization in distribution shift situations by focusing on the shape of the object. Even in cases where ground-truth labels exist, such as in cross-entropy learning with label shift or batch size 1, training can be disrupted by bias (label shift) or variance (batch size 1). Furthermore, in situations like TTA, error accumulation becomes more severe. Existing methods in such scenarios aim to improve performance by enhancing training stability rather than restricting the direction of adaptation. However, this only delays the worsening of severe error accumulation once it has begun and does not fundamentally reduce it. 

We have conducted sufficient hyperparameter tuning for the baselines, and it is already demonstrated at SAR that Tent and EATA excel only in mild scenarios.

Reviewer comment (Experiments):
Further, the effect of such spurious correlations can be removed by incorporating such transforms (cutmix, random cropping, or the used patch shuffling) during pretraining itself. Will the proposed approach help in those cases as well?

Author response:
A: Thank you for suggesting the experiment. This experiment allowed us to further validate the scalability of our proposed method. In line with your comment, we experimented with utilizing PLPD-based filtering during pretraining. For Waterbirds, during a total of 200 epochs, the initial 50 epochs were trained conventionally, followed by 150 epochs where only samples with PLPD greater than the threshold of 0.2 were used for pretraining. After implementing PLPD filtering, the performance is 5.82% higher compared to the original result on Tent. Similarly, the performance of DeYO also improves by 3.48%.

### Pretraining with PLPD filtering
|Waterbirds|Tent||DeYO||
|-|:-:|:-:|:-:|:-:|
||Avg Acc (%)|Worst Acc (%)|Avg Acc(%)|Worst Acc(%)|
|Pretraining w/o PLPD|82.98|52.9|86.64|74.18|
|Pretraining w/ PLPD|84.45|58.72|87.90|77.66|

Reviewer comment (Theory):
In 2.3, the paper theoretically demonstrates that entropy is not enough and it is better to incorporate the CPR factors for sample selection and reweighting in test time adaptation, which is done by the proposed PLPD. However, PLPD is then combined with the common entropy method in the experiments and implementations. Then what role does entropy play in sample selection? and how it helps PLPD to incorporate the CPR factors?

Author response:
A: In Sec. 2.3, we theoretically demonstrated that when spurious correlations exist, incorrect biases are accumulated in the model while adapting to the target domain through entropy minimization. To address this issue, we propose a new metric called PLPD. By mitigating error accumulation based on the prominent CPR factor: the shape of the object with PLPD, entropy minimization can adapt to the target domain in unlabeled situations with less bias.

The impact of entropy on PLPD is as follows: even with identical PLPD values, entropy can vary depending on the sharpness of $x$'s output. Samples passing through PLPD filtering make predictions based on CPR factors, so those with sharper predictions denote a higher probability of the presence of CPR factors. Therefore, by utilizing entropy with PLPD, we can identify samples that emphasize CPR factors even within the same PLPD level.

Reviewer comment (Experiments):
Did the authors try some other methods like data augmentation methods to replace the transformed one? Will they also work to incorporate CPR factors?

Author response:
A: We compared the average PLPD measured by augmenting $x$ multiple times through AugMix [2] with the PLPD of pixel shuffling, patch shuffling, and center occlusion. AugMix employs various object-preserving augmentations such as autocontrast, equalize, rotate, and solarize, randomly applying them to create multiple augmented instances. Then, the augmented instances are mixed with the original input. AugMix is also utilized in MEMO. 

When using the average PLPD for a total of 8 mixed inputs in DeYO, it showed lower performance than all three object-destructive transformation methods in both ColoredMNIST and Waterbirds as shown in the tables below. The AURC, which evaluates the reliability of PLPD, also exhibited worse performance compared to the object-destructive transformations. Our proposed PLPD needs to disrupt the shape of the object to function effectively. Through the AURC values, we empirically confirmed that AugMix (object-preserving augmentation technique) cannot contribute to measuring the impact on the CPR factor. 

### AugMix with PLPD
||ColoredMNIST||WaterBirds||
|-|:-:|:-:|:-:|:-:|
||Avg Acc (%)|Worst Acc (%)|Avg Acc (%)|Worst Acc (%)|
|DeYO with $8*x'_{AugMix}$|53.53|4.19|82.94|60.75|
|DeYO with $x'_{pix}$|69.68|50.78|85.11|64.17|
|DeYO with $x'_{occ}$|74.56|62.06|86.78|74.96|
|DeYO with $x'_{pat}$|77.61|65.51|86.56|74.18|

### Evaluation of the reliability of AugMix PLPD
||Waterbirds|
|-|:-:|
||AURC (%)
|Entropy|56.3|
|Pixel PLPD|20.71|
|Patch PLPD|14.75|
|Occ PLPD|13.77|
|4*AugMix PLPD|35.58|

Reviewer comment (Reproducibility):
How do the thresholds in eq. (9) defined?

Author response:
A: We defined $\tau_{PLPD}$ based on empirical results. As shown in Fig. 7 (c), defining the threshold was not challenging. The results do not vary significantly with different thresholds, and this phenomenon remains consistent across different models, benchmarks, and test scenarios, as illustrated in Fig. 9 and Tab. 16 in Appendix I.

Reviewer comment (Experiments):
What are the numbers and sizes of the patches for patch shuffling? Will these also influence the adaptation?

Author response:
A: For the reported results, a patch size of 56x56 was employed. Consequently, a total of 16 (4x4) patches were shuffled into a 224x224 image. This information has been stated in Sec. 4.3 of the main manuscript. As demonstrated in Fig. 7 (b), unless using an excessively small patch size (similar to pixel shuffling), which could entirely distort the local features of the image, results remain similar.

Reviewer comment (Writing):
Could the authors give simple explanation TRAP factors and CPR factors? With this, the readers may easily to capture the motivation of the proposed metric.

Author response:
Sorry for the lack of clarity in defining the terms 'TRAP' and 'CPR' factors. To enhance comprehension of these terms, we revised the introduction by incorporating examples and more explanations (Currently, the revised portions are delineated in red in the manuscript).  

We revised the second paragraph of page 2 in the main manuscript as follows: "Based on the observation, we introduce a theoretical proposition for identifying harmful samples, those that decrease the model's discriminability during adaptation: a sample is harmful if its prediction is more influenced by TRAin-time only Positively correlated with label (TRAP) factors (e.g., background, weather) rather than Commonly Positively-coRrelated with label (CPR) factors (e.g., structure, shape), even if its entropy is low. TRAP factors boost training performance but decrease inference performance, attributable to a discrepancy in the correlation sign with labels. If predictions mainly rely on TRAP factors, there is a high risk of wrong predictions under distribution shifts."

Reviewer comment (Theory):
Could the authors explain more about the motivation of the choice of patch shuffled input as x’?

Author response:
The choice of using the patch-shuffled input, denoted as $x'$, can be explained from three perspectives.  
Firstly, to capture the prominent CPR factor: the shape of the object, we had to utilize an object-destructive transformation method rather than an object-preserving transformation method such as rotation or flip. DeYo is designed to measure the difference between $x$ and $x'$, which lies in the presence or absence of the shape of the object. 
Secondly, among various object-destructive transformation methods, patch shuffling and object occlusion are options to disrupt the shape of the object in $x$. However, object occlusion presents difficulties in locating the object. 
Furthermore, unlike augmentation techniques such as CutMix [1], our work aimed to be capable of the destruction of objects using only a single image. This enables the applicability of DeYO in a batch size 1 scenario. 
Therefore, we employ patch shuffling for $x'$ on DeYO.

> References  
[1] Yun, Sangdoo, et al. "Cutmix: Regularization strategy to train strong classifiers with localizable features." Proceedings of the IEEE/CVF international conference on computer vision. 2019.