用可学习的梯度生成器提升测试时自适应的稳定性与速度
Learning to Generate Gradients for Test-Time Adaptation via Test-Time Training Layers
- 设计梯度记忆层,自动学习历史梯度以生成更优更新信号
- 在ImageNet-C上比SOTA快4.2倍,准确率提升7.4%
- 仅需少量无标签样本预训练,适用于实时部署场景
测试时自适应(TTA)旨在利用未标注测试数据在线微调已训练模型,以适应新环境或分布外数据,具有广泛的实际应用前景。然而,在优化过程中,熵最小化等无监督目标常因噪声信号导致不可靠梯度,阻碍模型快速收敛并引入显著不稳定性。本文从优化器设计角度解决该问题,提出一种学习型优化器Meta Gradient Generator(MGG),取代传统手动设计的SGD。MGG通过轻量级梯度记忆层,利用自监督重建损失将历史梯度信息压缩为网络参数,实现长期适应过程中的有效记忆。仅需少量无标签样本预训练MGG,即可部署于未知样本。在ImageNet-C、R、Sketch和A数据集上表现优异,相比当前最优方法(SAR),在图像分类任务中实现7.4%的精度提升,适应速度提升4.2倍,且更新次数更少、所需数据更少。
原文摘要 · Abstract (English)
Test-time adaptation (TTA) aims to fine-tune a trained model online using unlabeled testing data to adapt to new environments or out-of-distribution data, demonstrating broad application potential in real-world scenarios. However, in this optimization process, unsupervised learning objectives like entropy minimization frequently encounter noisy learning signals. These signals produce unreliable gradients, which hinder the model ability to converge to an optimal solution quickly and introduce significant instability into the optimization process. In this paper, we seek to resolve these issues from the perspective of optimizer design. Unlike prior TTA using manually designed optimizers like SGD, we employ a learning-to-optimize approach to automatically learn an optimizer, called Meta Gradient Generator (MGG). Specifically, we aim for MGG to effectively utilize historical gradient information during the online optimization process to optimize the current model. To this end, in MGG, we design a lightweight and efficient sequence modeling layer -- gradient memory layer. It exploits a self-supervised reconstruction loss to compress historical gradient information into network parameters, thereby enabling better memorization ability over a long-term adaptation process. We only need a small number of unlabeled samples to pre-train MGG, and then the trained MGG can be deployed to process unseen samples. Promising results on ImageNet-C, R, Sketch, and A indicate that our method surpasses current state-of-the-art methods with fewer updates, less data, and significantly shorter adaptation iterations. Compared with a previous SOTA method SAR, we achieve 7.4% accuracy improvement and 4.2 times faster adaptation speed on ImageNet-C.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。