Skip to main content
QUICK REVIEW

[Paper Review] TTN: A Domain-Shift Aware Batch Normalization in Test-Time Adaptation

Hyesu Lim, Byeonggeun Kim|arXiv (Cornell University)|Feb 10, 2023
Cancer-related molecular mechanisms researchBiochemistry, Genetics and Molecular Biology21 citations
TL;DR

TTN introduces a domain-shift aware BN layer that interpolates between conventional BN and test-time BN using per-channel weights learned in a post-training phase, improving robustness across varied test batch sizes and scenarios. It can augment existing TTA methods without extra inference cost.

ABSTRACT

This paper proposes a novel batch normalization strategy for test-time adaptation. Recent test-time adaptation methods heavily rely on the modified batch normalization, i.e., transductive batch normalization (TBN), which calculates the mean and the variance from the current test batch rather than using the running mean and variance obtained from the source data, i.e., conventional batch normalization (CBN). Adopting TBN that employs test batch statistics mitigates the performance degradation caused by the domain shift. However, re-estimating normalization statistics using test data depends on impractical assumptions that a test batch should be large enough and be drawn from i.i.d. stream, and we observed that the previous methods with TBN show critical performance drop without the assumptions. In this paper, we identify that CBN and TBN are in a trade-off relationship and present a new test-time normalization (TTN) method that interpolates the statistics by adjusting the importance between CBN and TBN according to the domain-shift sensitivity of each BN layer. Our proposed TTN improves model robustness to shifted domains across a wide range of batch sizes and in various realistic evaluation scenarios. TTN is widely applicable to other test-time adaptation methods that rely on updating model parameters via backpropagation. We demonstrate that adopting TTN further improves their performance and achieves state-of-the-art performance in various standard benchmarks.

Motivation & Objective

  • Motivate robust test-time adaptation under practical domain shifts and batch-size variations.
  • Address the trade-off between conventional BN and transductive BN in TTA.
  • Develop a post-training phase to learn channel-wise interpolation weights without changing pre-trained weights.
  • Show TTN's compatibility with existing TTA methods across classification and segmentation benchmarks.

Proposed method

  • Define TTN as a per-channel interpolation between source (CBN) and test (TBN) batch statistics using channel-wise alpha.
  • Derive tilde statistics as tilde{mu}=alpha mu +(1-alpha) mu_s and tilde{sigma}^2 = alpha sigma^2 +(1-alpha) sigma_s^2 + alpha(1-alpha)(mu-mu_s)^2.
  • Introduce a post-training phase to estimate a prior alpha per layer/channel from domain-shift sensitivity, then optimize alpha with CE and MSE losses while keeping base weights frozen.
  • Compute a gradient-based domain-shift distance score d^{(l,c)} from gradients of BN affine parameters under clean vs augmented inputs to derive a prior A for alpha initialization.
  • Replace BN with TTN during post-training and fix alpha at test time to retain source knowledge while adapting to target domains.
  • Demonstrate compatibility with other TTA methods by applying TTN on top of existing normalization- or optimization-based approaches.
Figure 1: Trade-off between CBN & TBN. In conceptual illustrations (a), (b), and (c), the depicted standardization only considers making the feature distribution have a zero mean, disregarding making it have unit variance. When the source and test distributions are different, and the test batch size
Figure 1: Trade-off between CBN & TBN. In conceptual illustrations (a), (b), and (c), the depicted standardization only considers making the feature distribution have a zero mean, disregarding making it have unit variance. When the source and test distributions are different, and the test batch size

Experimental results

Research questions

  • RQ1Can a per-channel interpolation between source and test batch statistics improve robustness to domain shifts in TTA across varying batch sizes?
  • RQ2Does a post-training phase to learn interpolation weights before test time yield consistent gains across image classification and semantic segmentation benchmarks?
  • RQ3How does TTN perform relative to existing normalization-based and optimization-based TTA methods under stationary, continuously changing, and mixed domain adaptations?
  • RQ4Is TTN able to preserve source-domain knowledge while adapting to unseen target distributions?

Key findings

  • TTN outperforms existing normalization-based BN approaches across a wide range of test batch sizes (200 to 1) and multiple adaptation scenarios.
  • Adopting TTN to existing TTA methods yields additional gains, especially at small batch sizes and in continual or mixed domain adaptation.
  • TTN preserves source-domain knowledge better than pure test-batch statistics methods, reducing degradation when domains differ.
  • Channel-wise interpolation weights reveal that shallower layers benefit more from TBN while deeper layers rely more on CBN, aligning with domain-shift characteristics.
  • A fixed TTN mixing ratio learned in post-training remains effective across evaluation settings without changing pre-trained weights.
  • TTN also improves semantic segmentation generalization in domain-shift benchmarks and complements methods like TENT and SWR.
Figure 2: Method overview. (a) We introduce an additional training phase between pre-train and test time called (a-1) post-training phase. (b) Our proposed TTN layer combines per-batch statistics and frozen source statistics with interpolating weight $\alpha$ , which is (b-1) optimized in post-train
Figure 2: Method overview. (a) We introduce an additional training phase between pre-train and test time called (a-1) post-training phase. (b) Our proposed TTN layer combines per-batch statistics and frozen source statistics with interpolating weight $\alpha$ , which is (b-1) optimized in post-train

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.