arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.12400cs.LGcs.CV
收藏

动态世界中稳定的测试时自适应

Towards Stable Test-Time Adaptation in Dynamic Wild World

South China University of Technology(华南理工大学);Tencent AI Lab(腾讯人工智能实验室);National University of Singapore(新加坡国立大学);Pazhou Laboratory(琶洲实验室)

Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Zhiquan Wen, Yaofo Chen, Peilin Zhao, Mingkui Tan

摘要:

测试时自适应(TTA)通过在测试样本上自适应给定的模型,可以有效地解决训练数据和测试数据之间的分布偏移。然而,TTA的在线模型更新可能是不稳定的,这通常是阻止现有TTA方法在现实世界中部署的关键障碍。具体而言,当测试数据具有:1)混合分布偏移,2)小批量,3)在线不平衡的标签分布偏移时,TTA可能无法改善甚至损害模型性能,这在实践中是相当常见的。本文研究了TTA不稳定的原因,发现批量范数层是阻碍TTA稳定性的关键因素。相反地,TTA可以使用与批次无关的范数层、\ie、组或层范数来更稳定地执行。然而,我们观察到,TTA与组和层规范并不总是成功的,仍然遭受许多失败的情况。通过深入研究失效案例,我们发现某些具有较大梯度的噪声测试样本可能会干扰模型自适应,并导致平凡解\ie的崩溃,从而为所有样本分配相同的类标签。为了解决上述崩溃问题,我们提出了一种清晰度感知和可靠的熵最小化方法,称为SAR,用于从两个方面进一步稳定TTA:1)去除具有大梯度的部分噪声样本,2)鼓励模型权重达到平坦的最小值,以便模型对剩余的噪声样本具有鲁棒性。有希望的结果表明,SAR比以前的方法执行更稳定,并在上述野生测试场景下的计算效率。

英文摘要:

Test-time adaptation (TTA) has shown to be effective at tackling distribution shifts between training and testing data by adapting a given model on test samples. However, the online model updating of TTA may be unstable and this is often a key obstacle preventing existing TTA methods from being deployed in the real world. Specifically, TTA may fail to improve or even harm the model performance when test data have: 1) mixed distribution shifts, 2) small batch sizes, and 3) online imbalanced label distribution shifts, which are quite common in practice. In this paper, we investigate the unstable reasons and find that the batch norm layer is a crucial factor hindering TTA stability. Conversely, TTA can perform more stably with batch-agnostic norm layers, \ie, group or layer norm. However, we observe that TTA with group and layer norms does not always succeed and still suffers many failure cases. By digging into the failure cases, we find that certain noisy test samples with large gradients may disturb the model adaption and result in collapsed trivial solutions, \ie, assigning the same class label for all samples. To address the above collapse issue, we propose a sharpness-aware and reliable entropy minimization method, called SAR, for further stabilizing TTA from two aspects: 1) remove partial noisy samples with large gradients, 2) encourage model weights to go to a flat minimum so that the model is robust to the remaining noisy samples. Promising results demonstrate that SAR performs more stably over prior methods and is computationally efficient under the above wild test scenarios.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑