둔비의 공부공간

TENT: FULLY TEST-TIME ADAPTATION BY ENTROPY MINIMIZATION 본문

Papers/Domain Adaptation

TENT: FULLY TEST-TIME ADAPTATION BY ENTROPY MINIMIZATION

Doonby 2023. 9. 6. 12:47

 

https://arxiv.org/abs/2006.10726

 

Tent: Fully Test-time Adaptation by Entropy Minimization

A model must adapt itself to generalize to new and different data during testing. In this setting of fully test-time adaptation the model has only the test data and its own parameters. We propose to adapt by test entropy minimization (tent): we optimize th

arxiv.org

 

 

abstract

Model은 새롭거나 다른 data에 대해 testing하는 도중에도 generalize 할 수 있어야 한다.

이를 위해서 논문의 저자들은 'test entropy minimzation'을 제안했다.

 

방법은 각 batch에 대해 normalization 통계를 측정하고, channel-wise affine transformation을 최적화하는 것이다.

 

ImageNet, CIFAR10, CIFAR100에 대해서 generalization error를 낮출 수 있었다.

이러한 방법은 별도의 training수정 없이, one epoch의 test-time optimization으로 달성할 수 있었다.

 

Introduction

Deep learning model은 새롭거나 다른 dataset (dataset shift)에서는 성능이 안좋다.

그러므로, 훈련중에 보지 못한 test data에 대해서도 모델 스스로가 적절하게 적응할 수 있어야 한다.

 

조건은, testing할때 학습한 parameter와 target data만 사용하는 "Fully test-time adaptation" setting이다.

training에 사용한 source data나 supervision등을 사용해서는 안된다.

 

Entropy는 error와 관련이 있다.
Entropy는 corruption과 관련이 있다.

 

Entropy를 최소화하는 Tent는 '확신'을 갖는 방향으로 최적화하는 것이다.

corruption이 심할수록 entropy가 커지고, loss가 커지는 것을 볼 수 있다.

  • corruption이 심해지니까, classification이 어려워져 loss가 커지고 error가 증가하므로 entropy역시 커진다는 의미다.

 

Entropy를 최소화 하기위해 batch별로 affine parameters를 최적화하고, target data의 통계를 측정해서 normalize 및 transform한다.

low-dimensional, channel-wise feature modulation을 선택하면 testing중에 효율적으로 적응할 수 있다.

 

contribution은 다음과 같다.

  • source data없이, target data만 사용해서 test time에 adaptation할 수 있도록 했다.
    online, offline update를 이용해서 결과를 보였다.
  • Entropy를 adaptation의 목적으로 실험해서, test-time entropy minimization (tent)를 제안했다.
  • corruption에 대한 robustness에 대해서 더 낮은 error율을 보였다.
  • digit classification, semanntic segmentation에 대해서 online, source-free adaptation을 적용할 수 있고, 다른 source data와 더 많은 optimization을 하는 애들과도 경쟁할만큼 성능이 좋다.

 

 

Setting

목적은 심플하다.

 

source data, label xs, ys로 paramter θ를 학습한 model fθ(x) 를 shifted target data xt에 대해서 adaptation시키는 것이다.

 

domain adaptation은 source, target data를 모두 사용하고

test-time training은 처음 training할때 supervision loss L(xs,ys)와 self-supervised loss L(xs)가 필요하다.

 

 

Method

 

ˆy=fθ(xt)entropy H(ˆy) 를 최소화하는 것이 L(xt)이다.

θ는 training/source data에 유일한 representation이다. 그러므로, θ를 변경하면, 학습한 것에서 크게 벗어날 수 있다.

또한, f는 비선형이고, θ는 high dimension이라 최적화에 민감해서, 둘 다 test-time usage에는 비효율적이다.

 

그러므로, 안정성과 효율성을 모두 챙기기 위해 scale and shift와 low-dimensional (channel-wise)만 업데이트하는 방법을 택했다.

위 그림은 논문의 modulation two steps를 보여준다.

Two steps of modulations 

  • normalization by statistics
  • transformation by parameters

 

normalization by statistics는 input xˉx=(xμ)/σ 로 normalization한다. 

그러고, x=γˉx+β 로  ˉx를 transformation시킨다.

μ, σ는 data의 통계이며, γ, β는 loss에 의해 최적화 된다.

 

 

각 normalization layer l와 channel k의 affine transform params ${\gamma_{l,k}, \beta_{l,k}$을 모으고

그 외의 affine transform은 고정시켜둔다.

test data가 들어오면 평균과 분산을 이용해서 ˉx를 만들고, entropy를 최소화시키는 loss를 backward하면서 γβ를 학습한다.

 

 

 

Experiments

 

Comments