Channel-Selective Normalization for Label-Shift Robust Test-Time Adaptation

Pedro Vianna1,2,3   Muawiz Chaudhary4,5   Paria Mehrbod4,5   An Tang2,3 Guy Cloutier1,2,3   Guy Wolf3,4   Michael Eickenberg6   Eugene Belilovsky4,5
1 Laboratory of Biorheology and Medical Ultrasonics; 2 University of Montreal Hospital Research Center;
3 University of Montreal; 4 Mila – Quebec AI Institute; 5 Concordia University; 6 Flatiron Institute
Abstract

Deep neural networks have useful applications in many different tasks, however their performance can be severely affected by changes in the input distribution. For example, in the biomedical field, their performance can be affected by changes in the data (different machines, populations) between training and test datasets. To ensure robustness and generalization to real-world scenarios, test-time adaptation has been recently studied as an approach to adjust models to a new data distribution during inference. Test-time batch normalization is a simple and popular method that achieved compelling performance on domain shift benchmarks. It is implemented by recalculating batch normalization statistics on test batches. Although initial work focused on analysis with test data that has the same label distribution as the training data, in many practical applications this technique is vulnerable to label distribution shifts, sometimes causing catastrophic failure. This presents a risk in applying test time adaptation methods in deployment. We propose to tackle this challenge by only selectively adapting channels in a deep network, minimizing drastic adaptation that is sensitive to label shifts. Our selection scheme is based on two principles that we empirically motivate: (1) later layers of networks are more sensitive to label shift; (2) individual features can be sensitive to specific classes. We apply the proposed technique to three classification tasks, including CIFAR10-C, Imagenet-C, and diagnosis of fatty liver, where we explore both covariate and label distribution shifts. We find that our method allows to bring the benefits of TTA while significantly reducing the risk of failure common in imbalanced scenarios.

1 Introduction

Deep learning models have shown excellent performance on a wide variety of tasks in computer vision research, such as image classification (Krizhevsky et al., 2012; Yu et al., 2022), segmentation (Wasserthal et al., 2023; Ding et al., 2023), and object detection (Chen et al., 2020; Yin et al., 2022). However, a commonly cited limitation of these models is the inability to generalize across different domains (Hendrycks & Dietterich, 2019a). Generalization can be simply defined as the ability of a deep learning algorithm, trained on one or more source domains, to be applied to a different yet still related target domain. Typically, in real-world deployment scenarios models might encounter data with critical differences, hampering their performance. This decrease in performance has been observed in multiple areas, including life-threatening contexts, such as autonomous driving (Kim et al., 2022; VS et al., 2023) and medical diagnostics (Blaivas et al., 2022; Wang et al., 2021b).

Domain adaptation techniques aim to enhance a model’s generalizability, anticipating the possible challenges in the event of distribution shifts. Traditionally, domain adaptation assumes that the model has access to unlabeled test data and source data during the training, which may not be practical in some cases (Piva et al., 2023; Liang et al., 2020). A recently emerging technique to deal with distribution shift is test-time adaptation (TTA) (Sun et al., 2020b; Liang et al., 2023), a type of unsupervised domain adaptation, where unlabeled test data is used to update the model parameters at test-time, before predictions. It is often assumed that data arrives in batches, and some studies have proposed a setting of test-time batch adaptation that take advantage of batch-level information to adapt to the distribution shift (Wang et al., 2021a; Nado et al., 2020; Chen et al., 2022).

Test-time batch normalization (TTN) (Nado et al., 2020; Schneider et al., 2020) is an approach which replaces batch normalization statistics estimated as running averages on the training set with the statistics of the test data batch. Despite being a simple approach, it has been shown to improve robustness under covariate shift, handling particularly well various cases of image corruptions. Based on that, other TTA approaches apply TTN as a critical component in their foundation (Wang et al., 2021a; Lim et al., 2023; Zhao et al., 2023). However TTN was proposed and developed in the context of covariate shifts only, while in many realistic scenarios, such as medical imaging, the label distribution of data can shift from training to testing.

In order to be practically useful, TTA methods relying on batch data need to be able to operate outside of this optimistic scenario of class-balanced training and testing settings, while simultaneously dealing with covariate shifts. As noted in recent work (Boudiaf et al., 2022) label distribution shifts can cause failures. We emphasize that these failures can be catastrophic, thus creating risk in the usage of TTA when the label distribution under deployment is unknown. We observe that certain channels and layers can be much more sensitive with respect to label distribution shifts under TTN. Motivated by this, we propose a method to mitigate the risk of label distribution shift catastrophically affecting model predictions. Our method, based on TTN, aims to adapt only those channels of the batch normalization layers whose activation statistics do not exhibit strong correlation to label distribution. The proposed method is applied to classification of two well-known benchmark natural image datasets — CIFAR-10 (Krizhevsky, 2012) and ImageNet-1K (Deng et al., 2009b) — and on adaptation from a private medical dataset (Vianna et al., 2023) to a publicly available one (Byra et al., 2018). When deployed in target data with different distribution, our proposed method is effective in obtaining the benefits of TTA while avoiding catastrophic failure cases, greatly improving the practical utility of TTN methods.

Our contributions are summarized below:

  1. 1.

    We propose a novel method that deals with label distribution shifts by leveraging information that can be easily computed at the end of model training and used during inference time to select channels sensitive to class information. We augment this channel selection strategy with a prior on the effect of depth on sensitivity to class information.

  2. 2.

    Experiments on three different datasets demonstrate that our method can be applied on a range of classification tasks, in particular for highly imbalanced target data. Notably, the adaptation across liver ultrasound datasets from different sites is shown to be effective. Our method is more robust than benchmark techniques across various degrees of label imbalance, showing similar performance in balanced cases and improvements in imbalanced cases.

2 Related Work

Batch normalization (Ioffe & Szegedy, 2015), henceforth BatchNorm, is a technique that aims to stabilize the distributions of layer inputs by introducing additional network layers that control the first two moments (mean and variance) of these distributions. This positively affects the optimization process of deep neural networks during training, reduces overfitting, and prevents the exploding or the vanishing gradient problems.

Even though BatchNorm is effective, widely accepted, and commonly used in many deep neural networks, its mechanisms are not entirely understood. Methods extending this approach provide alternatives to BatchNorm, such as layer normalization (Ba et al., 2016), instance normalization (Ulyanov et al., 2016), and normalization based on groups of channels (Wu & He, 2018). Furthermore, weight normalization (Salimans & Kingma, 2016) extends this line of work, modifying the weights of the models instead of features.

Various studies have been conducted to further understand how batch-normalization works. The original motivation for BatchNorm refers to the problem of internal covariate shift, however a later study (Santurkar et al., 2018) notes that it is not an appropriate explanation. Rather, the loss landscapes of models with BatchNorm appear to be smoother than those of equivalent models without it, allowing for use of larger range of learning rates and faster network convergence. Moreover, by investigating randomly initialized networks with all layers frozen and adapting only the BatchNorm layers, it has been shown that BatchNorm layers have substantial expressive power, achieving surprisingly good results on CIFAR-10 and ImageNet (Frankle et al., 2021).

Test-time adaptation methods often involve updating the parameters associated with the BatchNorm layers to distributions with covariate shift (Schneider et al., 2020; Nado et al., 2020). This approach is closely related to the unsupervised domain adaptation method AdaBN (Li et al., 2016; Burns & Steinhardt, 2021), and has achieved promising results in mitigating image corruptions. Recent TTA methods have been published using entropy minimization on the BatchNorm affine parameters (Wang et al., 2021a), but they appear to be biased towards the dominant classes (Park et al., 2023). In contrast, a distinct class of methods focuses on TTA without relying on BatchNorm adjustments, proposing techniques that leverage ideas from self-supervised learning (Sun et al., 2020a; Chen et al., 2022), test-time augmentations (Hu et al., 2021; Khurana et al., 2021), or sample selection (Niu et al., 2022).

A common limitation in TTA studies is regarding label distribution shifts, as most of the proposed methods fail to consider the varying class balance in the test sets, eventually falling into the “winner-takes-all” dilemma in which the majority classes dominate the predictions (You et al., 2021; Liang et al., 2023). To address the class-imbalanced domain adaptation challenge, some works focus on estimating the test set distribution (Sun et al., 2022; Lipton et al., 2018; Park et al., 2023).

Recently, other works have also proposed methods for dealing with label distribution shift in TTA. LAME (Boudiaf et al., 2022) performs the online adaptation of the classification outputs instead of the model’s parameters, making it agnostic to training and testing conditions, but it does not perform well in balanced scenarios. DELTA (Zhao et al., 2023) uses test-time batch renormalization and dynamic online reweighting in an online manner to avoid mini-batch bias. A label shift adapter was designed (Park et al., 2023) to improve TTA performance in scenarios where both source and target are imbalanced, by estimating the distribution of the target set. However, it uses a large number of hyperparameters and is specialized to the case of imbalanced source data. Focusing on learned features, in few-shot learning it was observed that trained models presents channel bias, and a channel-wise transformation during test-time can improve predictions in out-of-distribution tasks (Luo et al., 2022).

3 Hybrid Test-Time Batch Normalization

Refer to caption
Refer to caption
Refer to caption
Figure 1: Effect of extreme class imbalance and covariate shift on test-time batch-normalized (TTN) performance: TTN mitigates distributional shift but greatly suffers from class imbalance. We show per-class accuracy plots for a Source model (blue), a class-balanced TTN model (orange), and a class-imbalanced (1-class) TTN model (green). Observe that the class-imbalanced TTN model performs very poorly on the most prevalent class label of the imbalanced adaptation set (label 7, red rectangle).

The main idea behind TTA in general, and TTN in particular, is that while label information is not available at test time, the unlabeled data can provide some information to estimate impact of domain shifts on neural network operations and internal representations. The typical setup is based on data being processed in batches, enabling assessment of distribution shifts between source and target domains.

In order to implement TTA in these settings, TTN views a neural network n𝑛nitalic_n as split into blocks separated by BatchNorm layers:

n=n0B0s0n1B1s1nK1BK1sK1nK,𝑛subscript𝑛0superscriptsubscript𝐵0subscript𝑠0subscript𝑛1superscriptsubscript𝐵1subscript𝑠1subscript𝑛𝐾1superscriptsubscript𝐵𝐾1subscript𝑠𝐾1subscript𝑛𝐾n=n_{0}\circ B_{0}^{s_{0}}\circ n_{1}\circ B_{1}^{s_{1}}\cdots n_{K-1}\circ B_% {K-1}^{s_{K-1}}\circ n_{K},italic_n = italic_n start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∘ italic_B start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∘ italic_n start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∘ italic_B start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ⋯ italic_n start_POSTSUBSCRIPT italic_K - 1 end_POSTSUBSCRIPT ∘ italic_B start_POSTSUBSCRIPT italic_K - 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s start_POSTSUBSCRIPT italic_K - 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∘ italic_n start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT , (1)

where n0,,nKsubscript𝑛0subscript𝑛𝐾n_{0},\ldots,n_{K}italic_n start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , … , italic_n start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT are blocks (i.e., sub-networks) of hidden layers and B0,,BK1subscript𝐵0subscript𝐵𝐾1B_{0},\ldots,B_{K-1}italic_B start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , … , italic_B start_POSTSUBSCRIPT italic_K - 1 end_POSTSUBSCRIPT are batch normalization operators. Each BatchNorm layer modifies each neural activation by

B(h(x),μk,σk,β,γ)=γh(x)μkσk+β𝐵𝑥subscript𝜇𝑘subscript𝜎𝑘𝛽𝛾𝛾𝑥subscript𝜇𝑘subscript𝜎𝑘𝛽B(h(x),\mu_{k},\sigma_{k},\beta,\gamma)=\gamma\frac{h(x)-\mu_{k}}{\sigma_{k}}+\betaitalic_B ( italic_h ( italic_x ) , italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_β , italic_γ ) = italic_γ divide start_ARG italic_h ( italic_x ) - italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT end_ARG start_ARG italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT end_ARG + italic_β (2)

where h(x)𝑥h(x)italic_h ( italic_x ) is the layer input batch, β𝛽\betaitalic_β and γ𝛾\gammaitalic_γ are parameters learned during the training process, and μ𝜇\muitalic_μ and σ𝜎\sigmaitalic_σ represent estimates of the mean and standard deviation of neuron activation over data.

The main premise of the TTN approach is that changes in the distributions of activations of each neuron between source and target batches would predominantly be caused by unwanted covariate shifts, and therefore should be eliminated (TTN eliminates a diagonal affine shift exactly). However, this does not take into account other distribution shifts that should affect, at the very least, the output distribution of the network. In particular, in many real-world applications, one cannot guarantee that classes will be well balanced in general and certainly at test time. Therefore it is often the case that the distribution of available labels during the training process, i.e., on the source domain, will differ from the one encountered at test time.

Our proposed method to tackle this problem consists of three primary ingredients:

  • Creating a channel-level score to indicate the sensitivity to individual classes

  • Using a simple prior that linearly decays the number of selected channels in depth

  • A prior on the label distribution, this can be uniform or derived from a pseudolabeling step

Input: Trained network n𝑛nitalic_n with K𝐾Kitalic_K layers; source model statistics {𝝁ks,𝝈ks}k=1..K\{\bm{\mu}_{k}^{s},\bm{\sigma}_{k}^{s}\}_{k=1..K}{ bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT } start_POSTSUBSCRIPT italic_k = 1 . . italic_K end_POSTSUBSCRIPT; source domain data D𝐷Ditalic_D
for c𝑐citalic_c in C𝐶Citalic_C classes do
       Sample Data from Class c𝑐citalic_c
       x0Dcsimilar-tosubscript𝑥0subscript𝐷𝑐x_{0}\sim D_{c}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∼ italic_D start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT
       for k𝑘kitalic_k in {1,,K}1𝐾\{1,...,K\}{ 1 , … , italic_K } do
             𝒙k=nk1(𝒙k1)subscript𝒙𝑘subscript𝑛𝑘1subscript𝒙𝑘1\bm{x}_{k}=n_{k-1}(\bm{x}_{k-1})bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT = italic_n start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT ( bold_italic_x start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT )
             𝝁kt,𝝈ktsuperscriptsubscript𝝁𝑘𝑡superscriptsubscript𝝈𝑘𝑡\bm{\mu}_{k}^{t},\bm{\sigma}_{k}^{t}bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT \leftarrow Compute BN stats from  𝒙ksubscript𝒙𝑘\bm{x}_{k}bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT
            
            for f𝑓fitalic_f in F𝐹Fitalic_F channels do
                   Scores[c, k, f] = W22(𝝁fs,𝝈fs,𝝁ft,𝝈ft)superscriptsubscript𝑊22superscriptsubscript𝝁𝑓𝑠superscriptsubscript𝝈𝑓𝑠superscriptsubscript𝝁𝑓𝑡superscriptsubscript𝝈𝑓𝑡W_{2}^{2}(\bm{\mu}_{f}^{s},\bm{\sigma}_{f}^{s},\bm{\mu}_{f}^{t},\bm{\sigma}_{f% }^{t})italic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ( bold_italic_μ start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT , bold_italic_μ start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT )
                  
Output:Scores
Algorithm 1 Hybrid-TTN Post-Training
Input: Trained network n𝑛nitalic_n with K𝐾Kitalic_K layers; source model statistics {𝝁ks,𝝈ks}k=1..K\{\bm{\mu}_{k}^{s},\bm{\sigma}_{k}^{s}\}_{k=1..K}{ bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT } start_POSTSUBSCRIPT italic_k = 1 . . italic_K end_POSTSUBSCRIPT; target data batch x0subscript𝑥0x_{0}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, label distribution prior p1..cp_{1..c}italic_p start_POSTSUBSCRIPT 1 . . italic_c end_POSTSUBSCRIPT.
for k𝑘kitalic_k in {1,,K}1𝐾\{1,...,K\}{ 1 , … , italic_K } do
       𝒙k=fk1(𝒙k1)subscript𝒙𝑘subscript𝑓𝑘1subscript𝒙𝑘1\bm{x}_{k}=f_{k-1}(\bm{x}_{k-1})bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT = italic_f start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT ( bold_italic_x start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT )
       𝝁kt,𝝈ktsuperscriptsubscript𝝁𝑘𝑡superscriptsubscript𝝈𝑘𝑡\bm{\mu}_{k}^{t},\bm{\sigma}_{k}^{t}bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT \leftarrow Compute BN stats from  𝒙ksubscript𝒙𝑘\bm{x}_{k}bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT
       for c𝑐citalic_c in C𝐶Citalic_C classes do
             for f𝑓fitalic_f in F𝐹Fitalic_F channels do
                   Scoresk[f] += pcp_{c}*italic_p start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT ∗Scores[c, k, f]
      R=kK𝑅𝑘𝐾R=\frac{k}{K}italic_R = divide start_ARG italic_k end_ARG start_ARG italic_K end_ARG
       topR-ind \leftarrow Compute Top-R Index(Scoresk)
       𝒎k[topR-ind]=0subscript𝒎𝑘delimited-[]topR-ind0\bm{m}_{k}[\textsc{topR-ind}]=0bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT [ topR-ind ] = 0
       𝒎k[topR-ind~]=1subscript𝒎𝑘delimited-[]~topR-ind1\bm{m}_{k}[\tilde{\textsc{topR-ind}}]=1bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT [ over~ start_ARG topR-ind end_ARG ] = 1
       𝝁khybrid=𝒎k𝝁kt+(1𝒎k)𝝁kssuperscriptsubscript𝝁𝑘𝑦𝑏𝑟𝑖𝑑direct-productsubscript𝒎𝑘superscriptsubscript𝝁𝑘𝑡direct-product1subscript𝒎𝑘superscriptsubscript𝝁𝑘𝑠\bm{\mu}_{k}^{hybrid}=\bm{m}_{k}\odot\bm{\mu}_{k}^{t}+(1-\bm{m}_{k})\odot\bm{% \mu}_{k}^{s}bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT = bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ⊙ bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT + ( 1 - bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ⊙ bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT
       𝝈khybrid=𝒎k𝝈kt+(1𝒎k)𝝈kssuperscriptsubscript𝝈𝑘𝑦𝑏𝑟𝑖𝑑direct-productsubscript𝒎𝑘superscriptsubscript𝝈𝑘𝑡direct-product1subscript𝒎𝑘superscriptsubscript𝝈𝑘𝑠\bm{\sigma}_{k}^{hybrid}=\bm{m}_{k}\odot\bm{\sigma}_{k}^{t}+(1-\bm{m}_{k})% \odot\bm{\sigma}_{k}^{s}bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT = bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ⊙ bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT + ( 1 - bold_italic_m start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ⊙ bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT
       𝒙k=B(𝒙k,𝝁khybrid,𝝈khybrid)subscript𝒙𝑘𝐵subscript𝒙𝑘superscriptsubscript𝝁𝑘𝑦𝑏𝑟𝑖𝑑superscriptsubscript𝝈𝑘𝑦𝑏𝑟𝑖𝑑\bm{x}_{k}=B(\bm{x}_{k},\bm{\mu}_{k}^{hybrid},\bm{\sigma}_{k}^{hybrid})bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT = italic_B ( bold_italic_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT )
      
Output:{μkhybrid,σkhybrid}k=1..K\{\bm{\mu}_{k}^{hybrid},\bm{\sigma}_{k}^{hybrid}\}_{k=1..K}{ bold_italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT , bold_italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_h italic_y italic_b italic_r italic_i italic_d end_POSTSUPERSCRIPT } start_POSTSUBSCRIPT italic_k = 1 . . italic_K end_POSTSUBSCRIPT, xKsubscript𝑥𝐾x_{K}italic_x start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT
Algorithm 2 Hybrid-TTN Adaptation

We now describe the three phases of the method:

Storing Post-Training Statistics To mitigate the adverse effects by TTN, our first step focuses on selecting channels for the adaptation process. We aim to identify channels that are primarily sensitive to covariate shifts while excluding those highly sensitive to shifts in the label distribution. This channel selection procedure operates using an initial phase that uses the labelled training set before the model is deployed to compute a set of scores, completely independent of the target data . For each class, denoted as c𝑐citalic_c out of C𝐶Citalic_C total classes, we input a subset of data from the class, Dcsubscript𝐷𝑐D_{c}italic_D start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT, into a trained neural network with K𝐾Kitalic_K layers. Each layer k𝑘kitalic_k within this network possesses source statistics μkssuperscriptsubscript𝜇𝑘𝑠\mu_{k}^{s}italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT and σkssuperscriptsubscript𝜎𝑘𝑠\sigma_{k}^{s}italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT, and the target statistics for the single class, μktsuperscriptsubscript𝜇𝑘𝑡\mu_{k}^{t}italic_μ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT and σktsuperscriptsubscript𝜎𝑘𝑡\sigma_{k}^{t}italic_σ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT, are computed. The Wasserstein distance is then calculated for the source and target distributions with W22({μs,σs},{μt,σt})=μsμt2+(σsσt)2superscriptsubscript𝑊22superscript𝜇𝑠superscript𝜎𝑠superscript𝜇𝑡superscript𝜎𝑡superscriptnormsuperscript𝜇𝑠superscript𝜇𝑡2superscriptsuperscript𝜎𝑠superscript𝜎𝑡2W_{2}^{2}(\{\mu^{s},\sigma^{s}\},\{\mu^{t},\sigma^{t}\})=\|\mu^{s}-\mu^{t}\|^{% 2}+(\sigma^{s}-\sigma^{t})^{2}italic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ( { italic_μ start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT , italic_σ start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT } , { italic_μ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , italic_σ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT } ) = ∥ italic_μ start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT - italic_μ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ( italic_σ start_POSTSUPERSCRIPT italic_s end_POSTSUPERSCRIPT - italic_σ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. This step is described in Algorithm 1.

Test-Time Scoring and Masking For each channel we now have a notion of the sensitivity to each class. We consider a prior p(c)𝑝𝑐p(c)italic_p ( italic_c ) on the class distribution of the target data. For each channel we compute the weighted score of the Wasserstein distances obtained at end of training, with the weighting determined by the class distribution prior. Under a uniform prior on the target data we can simply sum the sensitivities for each class to get a score representing the sensitivity.

At each layer we choose the top-R𝑅Ritalic_R channels for adaptation. Using the prior that later layers are more sensitive to label shifts, we decay R𝑅Ritalic_R with a simple linear function in depth. The algorithm is fully described in Algorithm 2.

In the method analyzed in our paper we focus on a simple method to obtain p(c)𝑝𝑐p(c)italic_p ( italic_c ). Initially, Algorithm 2 is executed with a uniform prior to provide an initial corrected model. The network is prepared for adaptation using the uniform prior, the training data scores calculated in Algorithm 1, and the linear depth prior. By considering the uniform prior as weights to the individual class scores, selected channels in each layer are changed to use the target data batch statistics, with the remaining kee** the source model statistics. The model output is a first classification prediction, which can be further improved if we recalibrate the label distribution prior, using the first prediction.

Re-scoring with Pseudolabels Following the recomputation of the distribution prior using the first prediction, Algorithm 2 is rerun, incorporating the updated, non-uniform prior for further refinement, and giving the second round of predictions, which we consider our Hybrid-TTN output. This secondary application of Algorithm 2 can be seen as aiming to adjust the model prediction to exclude rare classes in the target distribution, unlike the first step which avoids updating channels sensitive to individual classes.

4 Experiments and Results

In this section we discuss our experimental setup. We use three datasets in our evaluations: two popular benchmarks, CIFAR-10-C and ImageNet-1K-C, and a publicly available fatty liver ultrasound dataset.

CIFAR-10 and CIFAR-10-C. We use the CIFAR-10 (Krizhevsky, 2009) dataset along with CIFAR-10-C (Hendrycks & Dietterich, 2019b). CIFAR-10 is a small natural image dataset with 50k training images and 10k validation images. CIFAR-10-C contains corrupted versions of the CIFAR-10 Validation set at varying severities. We train our models on the uncorrupted dataset.

ImageNet-1K and ImageNet-1K-C. We use the ImageNet-1K (Deng et al., 2009a) dataset along with ImageNet-1K-C (Hendrycks & Dietterich, 2019b). ImageNet-1K is a large natural image dataset with 1.2 million training images and 50k validation images. ImageNet-1K-C, similarly to CIFAR-10-C, contains corrupted versions of the ImageNet-1K Validation set at varying severities. Both CIFAR-10-C and ImageNet-1K-C are popular as a measure of robustness to covariate shift.

Liver Ultrasound. We use, as the training data, a dataset of ultrasound abdominal images collected at a liver transplantation center from patients under suspicion of non-alcoholic fatty liver disease (NAFLD) (Vianna et al., 2023). Images were collected between September 2011 to October 2020 with seven different devices, with varying settings, and by multiple operators. It contains 7,529 B-mode images from 57 control cases without NAFLD and 142 patients with NAFLD. We train our models for binary classification, i.e. detecting fatty liver versus non-fatty liver, on this dataset. For the test data in TTN, we use a publicly available dataset collected at a different institution (Byra et al., 2018), with 550 images. The differences between the source and the target data are multiple. On the patients level, we have differences in population demographics and in the inclusion criteria, e.g., the 55 patients on the publicly available dataset are diagnosed with obesity, which impacts the wave propagation during ultrasound exams. On the examinations level, the second dataset was collected prospectively, with consistent settings and using a single ultrasound machine, which was not present in the source data collection. This creates a more homogeneous dataset and provides the covariate shift for the TTN method. Finally, the training dataset has 84% of its images from cases of fatty liver, while the test dataset has 69%, introducing the label distribution shift. For both datasets, all patients underwent liver biopsy and the steatosis grades in the pathology reports are used as the reference standard for diagnosis of fatty liver. In order to introduce higher levels of covariate shift akin to CIFAR-10 and ImageNet-1K evaluations, we added speckle noise to the target dataset, with varying levels of corruption.

Architecture Details On CIFAR-10 we train a Resnet-26 model as defined in (He et al., 2016). For ImageNet-1K we use a pre-trained Resnet-18 model. For the Liver Ultrasound data, we train a Resnet-18 model. Training details are described on Appendix A.1.

Adaptation Details We focus on the source-free domain adaptation setting where adaptation is done offline on a single batch without affecting the deployed model (Liang et al., 2023), avoiding issues with catastrophic forgetting (Niu et al., 2022). For CIFAR-10-C and ImageNet-1K-C we use a batch size of 500 for the experiments (sampled over multiple seeds). For Liver Ultrasound, the batch size is the length of the target set. For the Hybrid-TTN, the percentage of not-adapted channels by layer is defined by a linear function starting at 0% at the first BatchNorm layer and ending at 100% at the last layer. The step of this linear function changes by model (e.g., Resnet-26 has more BatchNorm layers than Resnet-18), but it does not introduce any hyperparameters. Our method is hyperparameter free and appplied on all datasets and settings in the same way. More adaptation details are described in the Appendix A.2.

Target Label Distributions In order to analyze label distribution shifts we consider two approaches for constructing class imbalanced target distributions, while we keep the source training balanced. The first approach is to randomly select N𝑁Nitalic_N classes from the set of all classes and constructing a batch with the specified N𝑁Nitalic_N classes. We also use a more natural imbalanced dataset simulation construction technique popular in the federated learning literature which samples from a Dirichlet distribution with parameter α𝛼\alphaitalic_α (Li et al., 2021). Smaller α𝛼\alphaitalic_α will yield more sample batches with higher imbalances. This allows us to mimic a more natural scenario where the label distribution is not only varying in classes but proportions. In Liver Ultrasound, we use the original target distribution, which is different from the original source distribution, alongside a balanced distribution, and severely imbalanced cases.

4.1 Label Distribution Shift Impact on TTN

We first illustrate the potential pitfalls of TTN on several examples of label distribution shift. Using the CIFAR-10 dataset we show the effect on TTN of an extreme version of label distribution shift in Figure 1. Specifically, we adapt on batches containing one class or all classes (as can be seen in the label distributions shown in Figure 1). We observe in the adaptation of one class batches that the accuracy of TTN degrades severely compared to the source model in cases where there is a covariate shift (application of Gaussian noise to the input) but also in the absence of covariate shift. The latter observation is also confirmed for ultrasound data where we modify the target label proportion of the test data coming from the same distribution, but without adding noise (in Appendix A.3). This catastrophic failure, even without covariate shift, is clearly undesired when operating in a realistic deployment environment where the test set label distribution is unknown and can vary for each incoming batch.

Furthermore, we can observe from the per-class performance evaluations of the adapted models that the majority class is disproportionately affected by TTN, and that classes underrepresented (or not present) will, unintuitively, experience less degradation or even slightly improved performance compared to source model. We can obtain intuition about this latter behavior by considering a strong classification model where representations from each class will be well separated and clustered in the final representation layer (see Figure 2). Note that this is an assumption that is correct for most modern neural network architectures, as it is a consequence of the neural collapse phenomenon first described in Papyan et al. (2020). A biased BatchNorm computation will compute the mean of a specific label cluster and re-center the data by this mean. Now, consider a neural network layer whose activations are tightly clustered, such that each cluster corresponds to one label. Further, assume that the different cluster centers occupy approximately orthogonal directions in this space. As mentioned above, such quasi-orthogonality is not an uncommon property in high dimensions (Papyan et al., 2020). In this setting, linear decision directions would align with cluster means. Subtracting a cluster mean instead of a class-balanced batch mean would then significantly move the label cluster along its decision direction and will likely lead to some examples passing below the classification threshold. Other classes will be barely affected due to the orthogonality of the cluster centers and hence of the decision boundaries.

Refer to caption
Figure 2: Illustration of explanation for depth-wise behaviour under label distribution shift. We consider one class mean (green) which is shifted towards the data mean, as would be the case in a highly imbalanced setting. Classes are not well separated in early layers and thus shifts in any mean are relatively small and non-intrusive. In later layers classes are well separated and a large shift of points from one mean towards the data mean is likely to cross a decision boundary. Data points in other classes moving away from the data mean are less likely to cross a decision boundary.

4.2 Label Sensitive Channel Level Adaptation

As mentioned previously, many works in deep learning have shown that supervised trained neural networks become more specialized as depth of a network increases (Zeiler & Fergus, 2014; Belilovsky et al., 2019; Oyallon, 2017) and that classes progressively become more separated with depth. This suggests the later layers are more likely to have channels which are very sensitive to specific classes.

Adaptation of Early Layers To further confirm that depth can have an effect on the behavior of TTN and taking into account that earlier layers tend to be less specialized, we now consider only adapting earlier parts of the network and study this effect on the classification performance under label distribution shift. We perform experiments on layer-limited adaptation for a Resnet-26 model on CIFAR-10 both with and without noise. Our results are shown in in Figure 3. Specifically, for each index on the x-axis we perform test-time normalization of the model up to this layer. Consequently, the extremes of the x-axis (0 and, here, 30) correspond to Source and TTN models respectively. First, we observe that on the non-corrupted train data the performance of class-imbalanced data degrades gradually at first and increasingly faster towards the later layers. This suggests that later layers can cause a large degradation. Secondly, for corrupted data we observe that adapting up to earlier layers can allow enough label distribution invariance to provide benefits under covariate shift. For example, models that are adapted up to layers 8 through 15 can perform much better than source models under covariate shift but without label distribution shift, while also being able to perform much better than fully adapted and often source models in various label distribution shift scenarios. This suggests limiting adaptation in later layers can be beneficial. On the other hand, it is not obvious a priori which layer should be adapted. Furthermore, different classes can have more fine-grained effects, for example, some classes may lead to over-sensitivity in certain neurons or channels in a layer than others.

Refer to caption
Refer to caption
Figure 3: On CIFAR-10 we adapt models only up to the layer shown on the x-axis, the y-axis showing the accuracy on the target data. We consider label distributions with all (10) classes as well as 5,3, and 1 randomly selected and balanced classes. We observe that adapting later layers has an outsized role in the catastrophic collapse due to TTN.

Adaptive Channel Selection We now study how different class distributions affect the channels that are most adapted. We use a similar setup as in the previous example and consider within a layer the Wasserstein distance as a metric for ranking the channels which would be most changed by TTN adaptation. Subsequently, we take the channels in the top 10% for each layer and compare them for the cases of 1-class vs all-class adaptation, and 1-class vs another. Specifically, we determine how many channels in the top adapted channels for each batch (single classes, all classes) overlap. The results are given in Figure  4. We see from the first diagram that the channels that change the most when adapting to just 1-class versus all-class tend to have more agreement in the earlier layers, further supporting that later layers have many more channels sensitive to label distribution shifts.

Refer to caption
Refer to caption
Figure 4: We compute the BN statistics for all-class and multiple 1-class cases and compare agreement on channels which are most adapted (as measured by top-10% Wasserstein distance). The percentage of overlap** channels that presents the highest Wasserstein distance (between source and adapted models) in both tasks is represented by the blue bars, with orange bars representing the percentage of channels among those with the highest Wassertein distance that are not the same between the two evaluated cases.

However, we can see if we compare two different classes (e.g., Plane vs Cat) that the adaptation can vary substantially, throughout the network and even towards the last layers. This suggest that depending on the class distribution, different channels may be more sensitive to different classes. This supports our dynamic strategy that selects the most sensitive channels to remove from the adaptation set.

4.3 Evaluating Hybrid-TTN

We now use Hybrid-TTN method on a variety of target datasets, covariate shifts, and label distribution shifts. We demonstrate that Hybrid-TTN can provide a good trade-off in being able to adapt to covariate shift without experiencing catastrophic failure due to label distribution shift. Our results are shown in Figures 5, 6, and 7, and more detailed tables are available in the Appendix A.6 and A.7. Here we demonstrate various degrees of covariate and label distribution shift, and the gain or loss as compared to the source model performance.

Refer to caption
Refer to caption
Figure 5: CIFAR-10 evaluations on multiple label shifted distributions and covariate shifts (all corruptions) with different degrees of label imbalance. We show the source model accuracy and the improvement (or degradation) with our proposed method and baseline. We observe that the proposed method provides benefits when there is no covariate shift, while avoiding catastrophic failures and allowing benefits over source when there are label distribution shifts.
Refer to caption
Figure 6: ImageNet-1K evaluations on multiple label shifted distributions and covariate shifts (all corruptions) with different degrees of label imbalance. We observe that the proposed method provides benefits when there is covariate shift, while avoiding catastrophic failures when there are label distribution shifts.

For CIFAR-10 and ImageNet-1K we observe that Hybrid-TTN is able to control the degradation in performance under a variety of label distribution shifts in the absence of covariate shift, while TTN, TENT, LAME, and Delta can present severe decreases in performance depending on the label distribution. When corruptions are applied, Hybrid-TTN is able to bring benefits (substantially improve on source model) for the original distribution. Unlike other methods, it is able to handle the label distribution shift, in many cases avoiding catastrophic failure, and in a variety of combinations of severe label and covariate shift improving over the source model. We observe that LAME, which is designed for the label distribution shift problem, is able to perform well in the severes case of batches with a single class, but performs poorly in the cases that the data is balanced.

We also evaluate on a realistic ultrasound dataset, in Figure 7. Under a shift to a target dataset from a completely different site, we first observe that most methods can maintain or improve the performance compared to the source model in both original distribution and the balanced scenarios, the exception being LAME. This can be compared to the balanced distributions of the results for CIFAR-10-C, where the same methods achieved good performance when dealing with several levels of corruption.

Refer to caption
Figure 7: Evaluation on ultrasound data. Binary classification, subjects with and without fatty liver disease. Models were trained on one site and are evaluated on a publicly available dataset (Byra et al., 2018). We show evaluations on targets with shifts in label distribution. We observe that the proposed method is able to control the degradation in performance under severe label distribution shift.

When we consider more severe imbalance scenarios, such as only using patients without fatty liver and only patients with fatty liver, we see varying results. Hybrid-TTN consistently outperforms the source model in the case of healthy livers, but in the fatty livers case it can only surpass the source model when severe corruption is present. LAME is consistently near 100% accuracy in the fatty liver scenario and 0% accuracy in the healthy liver scenario, indicating that the method might be biased towards the training distribution. The other methods are stable across levels of corruption but have diminishing returns.

Trade-offs of TTA We emphasize that the goal of Hybrid-TTN is to avoid severe failures allowing a user to deploy TTA without concern that it might be counterproductive compared to using just the source model. To illustrate this we also rank the evaluated methods within each dataset for all scenarios (label shift, covariate shift) and compute the median rank. The results are presented in Table 1. We first observe that when viewed under this evaluation, the source model for CIFAR-10 and ImageNet-1K outperforms all the other TTA methods, indeed suggesting that TTA must be applied with extreme caution. To illustrate this point, we can observe that LAME can result in high accuracy increase in specific scenarios, but not on most cases. Similarly, other techniques are more suited to specific use-cases. On the other hand, Hybrid-TTN is the only TTA method able to obtain a substantially better median rank compared to the source model, suggesting it is conservative while providing benefits under covariate shift making it a useful method for real-world deployment.

Ranking (\downarrow)
Technique CIFAR-10 ImageNet-1K Ultrasound
Source 2.0 2.8 5.0
TTN 4.5 4.4 3.5
TENT 3.0 2.8 3.3
LAME 6.0 6.0 6.0
DELTA 4.5 4.3 3.0
Hybrid-TTN 1.0 2.3 1.5
Table 1: Median ranking for each technique across the three different datasets. Lower is better. Across multiple distributions and degrees of corruption, our proposed method offers the best overall performance in multiple tasks and is the only TTA method to show consistent utility from adaptation.

Computational Complexity In terms of computational complexity, we note that the scores are computed in Algorithm 1 prior to deployment, thus Algorithm 1 is run only once while Algorithm 2 can be used for any new data. Algorithm 2 adds minimal overhead to a standard forward pass. We benchmark our implementation of the Hybrid-TTN approach and note it takes 0.89±0.01plus-or-minus0.890.010.89\pm 0.010.89 ± 0.01 seconds to output its predictions, compared to 0.39±0.003plus-or-minus0.390.0030.39\pm 0.0030.39 ± 0.003 seconds for TTN which is the lowest overhead TTA method. This could be explained by the two passes of Algorithm 2, using a different class prior each time. A comparison of runtimes across different methods evaluated is presented in the Appendix A.4.

4.4 Ablation of Channel Selection

We perform an ablation study aimed at investigating the efficacy of the different elements of the channel selection strategy within Hybrid-TTN. The ablation experiments for a single class across all corruptions is presented in Table 2.

Depth Prior Only We first consider the importance of the scoring function compared to the linear decaying thresholding. We denote this ablation the HybridTTN+Random Channel Scores. Specifically we replace the scores used for thresholding in Algorithm 2 (line 10) with random scores. This decouples the scoring obtained from Algorithm 1, with the prior on depth wise adaptation. We observe that we obtain substantial improvement over just standard TTN but that the performance degrades severely compared to our HybridTTN.

Class Prior We now consider the importance of the pseudo-labeling step used to obtain a class prior from the target data described in Section 3. Specifically, we evaluate the performance of just using a uniform prior, we observe this improves the performance from the random channel scores, but substantially underperforms Hybrid-TTN. Finally we also show the performance of an oracle class prior, where the exact target data label distribution is given. We note that for none or low corruption cases this gives performance comparable to Hybrid-TTN, further affirming our approach. As the corruption becomes more severe the performance gap between the oracle and our method increases. This effect was also observed in additional experiments considering different CNN architectures and CIFAR-100, detailed in the Appendix A.5.

Covariate Shift
Accuracy (% or ΔΔ\Deltaroman_Δ%)
Original Corruption-1 Corruption-2 Corruption-3 Corruption-4 Corruption-5
Source 95.0 ± 2.4 89.2 ± 9.9 83.9 ± 12.5 78.5 ± 16.5 71.2 ± 20.5 59.2 ± 26.5
\cdashline2-7[2pt/2pt] TTN -75.1 ± 3.9 -70.2 ± 9.7 -65.5 ± 12.0 -60.5 ± 16.0 -53.7 ± 19.7 -42.2 ± 25.9
Hybrid-TTN -8.0 ± 3.1 -9.2 ± 5.7 -7.4 ± 7.9 -5.1 ± 10.8 -1.7 ± 14.9 +3.8 ± 22.1
\cdashline2-7[2pt/2pt] + Random Channel Scores -21.9 ± 6.9 -25.7 ± 11.6 -22.6 ± 14.3 -18.4 ± 18.3 -13.2 ± 22.6 -5.2 ± 28.1
+ Uniform Prior Class Prior -14.1 ± 4.5 -15.4 ± 6.6 -13.8 ± 8.5 -11.1 ± 11.8 -7.4 ± 15.5 -1.3 ± 22.6
+ Oracle Class Prior -7.8 ± 3.2 -7.5 ± 5.6 -5.5 ± 7.6 -2.8 ± 11.0 +1.6 ± 15.2 +8.1 ± 22.1
Table 2: Results for the ablation study. Each technique delta accuracy is in comparison to the source results. We use CIFAR-10 with batches from a single class and different degrees of covariate shift. We show that our Wassertstein scoring and class prior estimates are both beneficial to Hybrid-TTN.

5 Limitations

A limitation of our proposed technique is that it is designed for architectures featuring batch normalization layers. However, it is noteworthy that this is still a popular kind of architecture in the TTA literature (Zhao et al., 2023). Furthermore, future work can adapt our channel selection criteria to other methods, by using a different kind of scoring function and avoiding adaptation (e.g. to entropy minimization) of selected channels. Another limitation is that we assume access to the post-training but pre-deployment access to the source data, however note that this is practical in most cases except where the entity training the model does not know of the eventual application of TTA to the model.

6 Conclusions

We have studied a popular batch-level Test-time Adaptation method in the context of label distribution shift. We observed that in realistic scenarios where batches at deployment time have label distribution shifts, this method can fail catastrophically. A comparison in the offline setting indicates that common test-time adaptation techniques are detrimental to classification, contingent upon shifts in label distribution. We proposed a direction for solving this problem to keep the benefits of adaptation without risking catastrophic failure due to label shift. Compared to similar works, our proposed technique was designed to be generic and easily applied without hyperparameter tuning, as we assume a fixed linear depth prior and a uniform distribution prior which are applied to all datasets and architectures studied. Moreover, our results indicate that the challenge of domain adaptation in the biomedical field, specifically in diagnosis of fatty liver using grayscale ultrasound images, can be addressed by the proposed Hybrid-TTN method, reducing risks in the deployment of a trained framework in different populations.

Acknowledgments

This work was supported by grants from the Institute of Data Valorization (IVADO PRF3) to A.T., G.W. and E.B. A.T. acknowledges support from the Fonds de Recherche du Québec – Santé (FRQS), Fonds de Recherche du Québec - Nature et technologies (FRQNT) and the Fondation de l’Association des Radiologistes du Québec (FARQ) Clinical Research Scholarship–Senior Salary Award (FRQS-ARQ no. 298509). G.W. acknowledges support from the Canada CIFAR AI Chair. E.B. and G.W. acknowledge funding from Fonds de recherche du Québec — Nature et technologies - NOVA (2023-NOVA-329759 and 2023-NOVA-329125).

References

  • Ba et al. (2016) Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016. URL http://arxiv.longhoe.net/abs/1607.06450.
  • Belilovsky et al. (2019) Eugene Belilovsky, Michael Eickenberg, and Edouard Oyallon. Greedy layerwise learning can scale to imagenet. In International conference on machine learning, pp.  583–593. PMLR, 2019.
  • Blaivas et al. (2022) Michael Blaivas, Laura N Blaivas, and James W Tsung. Deep learning pitfall: Impact of novel ultrasound equipment introduction on algorithm performance and the realities of domain adaptation. Journal of Ultrasound in Medicine, 41(4):855–863, 2022. doi: https://doi.org/10.1002/jum.15765. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/jum.15765.
  • Boudiaf et al. (2022) Malik Boudiaf, Romain Mueller, Ismail Ben Ayed, and Luca Bertinetto. Parameter-free online test-time adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp.  8344–8353, 2022.
  • Burns & Steinhardt (2021) Collin Burns and Jacob Steinhardt. Limitations of post-hoc feature alignment for robustness. CoRR, abs/2103.05898, 2021. URL https://arxiv.longhoe.net/abs/2103.05898.
  • Byra et al. (2018) Michał Byra, Grzegorz Styczynski, Cezary Szmigielski, Piotr Kalinowski, Łukasz Michałowski, Rafał Paluszkiewicz, Bogna Ziarkiewicz-Wróblewska, Krzysztof Zieniewicz, Piotr Sobieraj, and Andrzej Nowicki. Transfer learning with deep convolutional neural network for liver steatosis assessment in ultrasound images. International Journal of Computer Assisted Radiology and Surgery, 13(12):1895–1903, August 2018. doi: 10.1007/s11548-018-1843-2. URL https://doi.org/10.1007/s11548-018-1843-2.
  • Chen et al. (2020) Chaoqi Chen, Zebiao Zheng, Xinghao Ding, Yue Huang, and Qi Dou. Harmonizing transferability and discriminability for adapting object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
  • Chen et al. (2022) Dian Chen, Dequan Wang, Trevor Darrell, and Sayna Ebrahimi. Contrastive test-time adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp.  295–305, 2022.
  • Deng et al. (2009a) J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In Computer Vision and Pattern Recognition, 2009a.
  • Deng et al. (2009b) Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp.  248–255. Ieee, 2009b.
  • Ding et al. (2023) Hao Ding, Changchang Sun, Hao Tang, Dawen Cai, and Yan Yan. Few-shot medical image segmentation with cycle-resemblance attention. In 2023 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp.  2487–2496, 2023. doi: 10.1109/WACV56688.2023.00252.
  • Frankle et al. (2021) Jonathan Frankle, David J. Schwab, and Ari S. Morcos. Training batchnorm and only batchnorm: On the expressive power of random features in cnns. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=vYeQQ29Tbvx.
  • He et al. (2016) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, June 2016.
  • Hendrycks & Dietterich (2019a) Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019a. URL https://openreview.net/forum?id=HJz6tiCqYm.
  • Hendrycks & Dietterich (2019b) Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019b.
  • Hu et al. (2021) Xuefeng Hu, Mustafa Gökhan Uzunbas, Sirius Chen, Rui Wang, Ashish Shah, Ramakant Nevatia, and Ser-Nam Lim. Mixnorm: Test-time adaptation through online normalization estimation. ArXiv, abs/2110.11478, 2021. URL https://api.semanticscholar.org/CorpusID:239616359.
  • Ioffe & Szegedy (2015) Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis R. Bach and David M. Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp.  448–456. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/ioffe15.html.
  • Khurana et al. (2021) Ansh Khurana, Sujoy Paul, Piyush Rai, Soma Biswas, and Gaurav Aggarwal. SITA: Single Image Test-time Adaptation. arXiv e-prints, art. arXiv:2112.02355, December 2021. doi: 10.48550/arXiv.2112.02355.
  • Kim et al. (2022) ** Kim, Jiyoung Lee, Jungin Park, Dongbo Min, and Kwanghoon Sohn. Pin the memory: Learning to generalize semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp.  4350–4360, June 2022.
  • Krizhevsky (2009) Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
  • Krizhevsky (2012) Alex Krizhevsky. Learning multiple layers of features from tiny images. University of Toronto, 05 2012.
  • Krizhevsky et al. (2012) Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C.J. Burges, L. Bottou, and K.Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. URL https://proceedings.neurips.cc/paper_files/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf.
  • Li et al. (2021) Qinbin Li, Yiqun Diao, Quan Chen, and Bingsheng He. Federated learning on non-iid data silos: An experimental study. arXiv preprint arXiv:2102.02079, 2021.
  • Li et al. (2016) Yanghao Li, Naiyan Wang, Jian** Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. arXiv preprint arXiv:1603.04779, 2016.
  • Liang et al. (2020) Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? Source hypothesis transfer for unsupervised domain adaptation. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp.  6028–6039. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/liang20a.html.
  • Liang et al. (2023) Jian Liang, Ran He, and Tieniu Tan. A comprehensive survey on test-time adaptation under distribution shifts. arXiv preprint arXiv:2303.15361, 2023.
  • Lim et al. (2023) Hyesu Lim, Byeonggeun Kim, Jaegul Choo, and Sungha Choi. TTN: A domain-shift aware batch normalization in test-time adaptation. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023. URL https://openreview.net/pdf?id=EQfeudmWLQ.
  • Lipton et al. (2018) Zachary C. Lipton, Yu-Xiang Wang, and Alexander J. Smola. Detecting and correcting for label shift with black box predictors. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp.  3128–3136. PMLR, 2018. URL http://proceedings.mlr.press/v80/lipton18a.html.
  • Loshchilov & Hutter (2016) Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with restarts. CoRR, abs/1608.03983, 2016. URL http://arxiv.longhoe.net/abs/1608.03983.
  • Luo et al. (2022) Xu Luo, **g Xu, and Zenglin Xu. Channel importance matters in few-shot image classification. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (eds.), Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp.  14542–14559. PMLR, 17–23 Jul 2022. URL https://proceedings.mlr.press/v162/luo22c.html.
  • Nado et al. (2020) Zachary Nado, Shreyas Padhy, D. Sculley, Alexander D’Amour, Balaji Lakshminarayanan, and Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. CoRR, abs/2006.10963, 2020. URL https://arxiv.longhoe.net/abs/2006.10963.
  • Niu et al. (2022) Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Yaofo Chen, Shijian Zheng, Peilin Zhao, and Mingkui Tan. Efficient test-time model adaptation without forgetting. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (eds.), Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp.  16888–16905. PMLR, 17–23 Jul 2022. URL https://proceedings.mlr.press/v162/niu22a.html.
  • Oyallon (2017) Edouard Oyallon. Building a regular decision boundary with deep networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp.  5106–5114, 2017.
  • Papyan et al. (2020) Vardan Papyan, X. Y. Han, and David L. Donoho. Prevalence of neural collapse during the terminal phase of deep learning training. Proceedings of the National Academy of Sciences, 117(40):24652–24663, 2020. doi: 10.1073/pnas.2015509117. URL https://www.pnas.org/doi/abs/10.1073/pnas.2015509117.
  • Park et al. (2023) Sunghyun Park, Seunghan Yang, Jaegul Choo, and Sungrack Yun. Label shift adapter for test-time adaptation under covariate and label shifts. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp.  16421–16431, 2023.
  • Piva et al. (2023) Fabrizio J. Piva, Daan de Geus, and Gijs Dubbelman. Empirical generalization study: Unsupervised domain adaptation vs. domain generalization methods for semantic segmentation in the wild. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp.  499–508, January 2023.
  • Salimans & Kingma (2016) Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp.  901, 2016. URL https://proceedings.neurips.cc/paper/2016/hash/ed265bc903a5a097f61d3ec064d96d2e-Abstract.html.
  • Santurkar et al. (2018) Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp.  2488–2498, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/905056c1ac1dad141560467e0a99e1cf-Abstract.html.
  • Schneider et al. (2020) Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/85690f81aadc1749175c187784afc9ee-Abstract.html.
  • Sun et al. (2022) Wujie Sun, Qi Chen, Can Wang, Deshi Ye, and Chun Chen. Source-free unsupervised domain adaptation in imbalanced datasets. In 2022 5th International Conference on Data Science and Information Technology (DSIT), pp.  1–6, 2022. doi: 10.1109/DSIT55514.2022.9943839.
  • Sun et al. (2020a) Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In International conference on machine learning, pp.  9229–9248. PMLR, 2020a.
  • Sun et al. (2020b) Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp.  9229–9248. PMLR, 13–18 Jul 2020b. URL https://proceedings.mlr.press/v119/sun20b.html.
  • Ulyanov et al. (2016) Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Instance normalization: The missing ingredient for fast stylization. CoRR, abs/1607.08022, 2016. URL http://arxiv.longhoe.net/abs/1607.08022.
  • Vianna et al. (2023) Pedro Vianna, Sara-Ivana Calce, Pamela Boustros, Cassandra Larocque-Rigney, Laurent Patry-Beaudoin, Yi Hui Luo, Emre Aslan, John Marinos, Talal M. Alamri, Kim-Nhien Vu, Jessica Murphy-Lavallée, Jean-Sébastien Billiard, Emmanuel Montagnon, Hongliang Li, Samuel Kadoury, Bich N. Nguyen, Shanel Gauthier, Benjamin Therien, Irina Rish, Eugene Belilovsky, Guy Wolf, Michaël Chassé, Guy Cloutier, and An Tang. Comparison of radiologists and deep learning for us grading of hepatic steatosis. Radiology, 309(1), October 2023. ISSN 1527-1315. doi: 10.1148/radiol.230659. URL http://dx.doi.org/10.1148/radiol.230659.
  • VS et al. (2023) Vibashan VS, Poojan Oza, and Vishal M Patel. Towards online domain adaptive object detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp.  478–488, 2023.
  • Wang et al. (2021a) Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno A. Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021a. URL https://openreview.net/forum?id=uXl3bZLkr3c.
  • Wang et al. (2021b) Yan Wang, Yangqin Feng, Lei Zhang, Zizhou Wang, Qing Lv, and Zhang Yi. Deep adversarial domain adaptation for breast cancer screening from mammograms. Medical Image Analysis, 73:102147, 2021b. ISSN 1361-8415. doi: https://doi.org/10.1016/j.media.2021.102147. URL https://www.sciencedirect.com/science/article/pii/S1361841521001936.
  • Wasserthal et al. (2023) Jakob Wasserthal, Hanns-Christian Breit, Manfred T. Meyer, Maurice Pradella, Daniel Hinck, Alexander W. Sauter, Tobias Heye, Daniel T. Boll, Joshy Cyriac, Shan Yang, Michael Bach, and Martin Segeroth. Totalsegmentator: Robust segmentation of 104 anatomic structures in ct images. Radiology: Artificial Intelligence, 5(5):e230024, 2023. doi: 10.1148/ryai.230024. URL https://doi.org/10.1148/ryai.230024.
  • Wu & He (2018) Yuxin Wu and Kaiming He. Group normalization. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part XIII, volume 11217 of Lecture Notes in Computer Science, pp.  3–19. Springer, 2018. doi: 10.1007/978-3-030-01261-8“˙1. URL https://doi.org/10.1007/978-3-030-01261-8_1.
  • Yin et al. (2022) Yifang Yin, Wenmiao Hu, An Tran, Hannes Kruppa, Roger Zimmermann, and See-Kiong Ng. A context-enriched satellite imagery dataset and an approach for parking lot detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp.  1371–1380, January 2022.
  • You et al. (2021) Fuming You, **g**g Li, Lei Zhu, Zhi Chen, and Zi Huang. Domain adaptive semantic segmentation without source data. In Proceedings of the 29th ACM International Conference on Multimedia, MM ’21, pp.  3293–3302, New York, NY, USA, 2021. Association for Computing Machinery. ISBN 9781450386517. doi: 10.1145/3474085.3475482. URL https://doi.org/10.1145/3474085.3475482.
  • Yu et al. (2022) Alice C. Yu, Bahram Mohajer, and John Eng. External validation of deep learning algorithms for radiologic diagnosis: A systematic review. Radiology: Artificial Intelligence, 4(3):e210064, 2022. doi: 10.1148/ryai.210064. URL https://doi.org/10.1148/ryai.210064.
  • Zagoruyko & Komodakis (2016) Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. CoRR, abs/1605.07146, 2016. URL http://arxiv.longhoe.net/abs/1605.07146.
  • Zeiler & Fergus (2014) Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp.  818–833. Springer, 2014.
  • Zhao et al. (2023) Bowen Zhao, Chen Chen, and Shu-Tao Xia. Delta: degradation-free fully test-time adaptation. arXiv preprint arXiv:2301.13018, 2023.

Appendix A Appendix

This appendix includes:

  • Training details (Sec. A.1)

  • Adaptation details (Sec. A.2)

  • Ultrasound failure case without domain shift (Sec. A.3)

  • Runtime comparison across techniques (Sec. A.4)

  • Comparison to different architectures and CIFAR-100 (Sec. A.5)

  • Detailed tables for CIFAR-10-C, ImageNet-1K-C and Ultrasound results (Sec. A.6)

  • CIFAR-10 results by corruption type (Sec. A.7)

A.1 Training details

On CIFAR-10 we train a Resnet-26 model as defined in He et al. (2016). We use an SGD optimizer with a batch size of 128. An initial learning rate set to 0.1 is used in combination with a cosine annealing schedule (Loshchilov & Hutter, 2016) trained over 200 epochs. Weight decay set to 5e-4 is used along with momentum set to 0.9 (Zagoruyko & Komodakis, 2016). Standard augmentation uses random crop of size 32 with 4 padding, and random horizontal flips.

For the Liver Ultrasound data, we train a Resnet-18 model with similar configurations, using a SGD optimizer with learning rate set to 0.001 and a batch size of 32. Differences in the models configurations can be explained by the computational constraints of the Hospital Research Center where the images are secured.

A.2 Adaptation details

For TTN, we use the original configuration, resetting batch normalization layers (BatchNorm) running stats. The difference between TTN and Hybrid-TTN is that for the former we adapt all channels in all BatchNorm during test-time, without our proposed channel selection.

For TENT, original configuration was followed. In addition, the adaptation for each batch was repeated for 10 iterations. In implementing LAME, we adhered to the default configuration provided in the officially released code for achieving best model performance. As per the specified configuration, we chose the radial basis function kernel for the affinity matrix with K-nearest neighbors and σ𝜎\sigmaitalic_σ set to 5 and 1 respectively. We also used the same hyperparameters for optimizer as specified in the mentioned configuration.

To maintain consistency in our comparative analysis, we executed the experiments we adapted DELTA to our setup in which we had one test batch of a specific size. Notably, DELTA is tailored for online setups, excelling in processing multiple batches within a test stream.

A.3 Example of failure case in Ultrasound

In Table 3 we note a significant decline in TTN accuracy compared to the source model, not only in instances with covariate shifts but also without any covariate shift. This phenomenon can be seen in the ultrasound data, where we adjust the proportion of target labels in the test data sourced from the same distribution as the source data.

Accuracy (%)
Labels proportion Source TTN
Original (16%/84%) 82.3 83.1
0%/100% 92.2 84.4
50%/50% 71.9 67.2
100%/0% 51.6 21.9
Table 3: Illustration of failure case on binary classification of medical ultrasound data (detecting presence of fatty liver). If TTN is deployed on target data from the same domain (same hospital, demographics) with the original training proportions (16%/84%) performance is maintained or slightly improved. On the other hand, if the target batch presented has a label distribution shift we see substantial degradation.

A.4 Adaptation runtimes

Below we present the table for the runtime of each investigated test-time adaptation technique. Values are averaged over 50 random seeds and each experiment is for the process time of a batch of size 500 of CIFAR-10 images.

Algorithm Runtime (seconds)
Source 0.23 ±plus-or-minus\pm± 0.002
TTN 0.39 ±plus-or-minus\pm± 0.003
TENT 3.65 ±plus-or-minus\pm± 0.01
LAME 0.83 ±plus-or-minus\pm± 0.03
Delta 0.92 ±plus-or-minus\pm± 0.04
Hybrid-TTN (Uniform prior) 0.49 ±plus-or-minus\pm± 0.01
Hybrid-TTN 0.89 ±plus-or-minus\pm± 0.01
Table 4: Runtime of algorithms, in seconds.

A.5 Additional ablation experiments

In this section, we show ablation results for using Resnet-50 and Resnext-29 with the same configurations as used for the original Resnet-26 in CIFAR-10. Moreover, we run the three architectures using CIFAR-100 as source and CIFAR-100-C as the target domain, instead of CIFAR-10 as used in the paper. The results showed below are only for the extremely imbalanced scenario, with only one class on the target set, and for extremely corrupted cases, with severity level 5 across all corruptions.

CIFAR-10 to CIFAR-10-C
Method Resnet50 Resnet26 Resnext29
Source 60.1 ±plus-or-minus\pm± 26.4 59.2 ±plus-or-minus\pm± 26.5 53.1 ±plus-or-minus\pm± 30.1
\cdashline1-4[2pt/2pt] TTN -42.7 ±plus-or-minus\pm± 25.8 -42.2 ±plus-or-minus\pm± 25.9 -37.9 ±plus-or-minus\pm± 29.7
Random channel selection -20.1 ±plus-or-minus\pm± 26.6 -14.1 ±plus-or-minus\pm± 27.6 +3.4 ±plus-or-minus\pm± 25.2
Hybrid-TTN (Uniform prior) -2.1 ±plus-or-minus\pm± 24.9 -1.3 ±plus-or-minus\pm± 22.6 +7.7 ±plus-or-minus\pm± 19.0
Hybrid-TTN (Proposed) +1.9 ±plus-or-minus\pm± 24.3 +3.8 ±plus-or-minus\pm± 22.1 +8.5 ±plus-or-minus\pm± 19.0
Hybrid-TTN (Oracle prior) +5.2 ±plus-or-minus\pm± 24.4 +8.1 ±plus-or-minus\pm± 22.2 +16.5 ±plus-or-minus\pm± 20.7
CIFAR-100 to CIFAR-100-C
Method Resnet50 Resnet26 Resnext29
Source 26.1 ±plus-or-minus\pm± 25.2 24.0 ±plus-or-minus\pm± 25.0 25.7 ±plus-or-minus\pm± 25.4
\cdashline1-4[2pt/2pt] TTN -23.2 ±plus-or-minus\pm± 25.2 -21.5 ±plus-or-minus\pm± 25.1 -22.5 ±plus-or-minus\pm± 25.3
Random channel selection -7.9 ±plus-or-minus\pm± 23.5 -8.4 ±plus-or-minus\pm± 22.3 -2.8 ±plus-or-minus\pm± 21.8
Hybrid-TTN (Uniform prior) +1.0 ±plus-or-minus\pm± 19.3 -0.8 ±plus-or-minus\pm± 19.9 +2.2 ±plus-or-minus\pm± 15.8
Hybrid-TTN (Proposed) +6.1 ±plus-or-minus\pm± 18.1 +3.4 ±plus-or-minus\pm± 19.2 +4.5 ±plus-or-minus\pm± 15.4
Hybrid-TTN (Oracle prior) +13.9 ±plus-or-minus\pm± 19.9 +13.7 ±plus-or-minus\pm± 21.0 +13.0 ±plus-or-minus\pm± 16.5
Table 5: Ablation study using different models on CIFAR-10 and CIFAR-100. Values for Source model are accuracy, in percentages. Values for different ablated methods are the difference in accuracy between each method and the Source model. Uniform and Oracle priors are considering balanced target sets and true label distribution, respectively. Proposed method uses the pseudo-labels obtained with Uniform prior.

A.6 Detailed results

Below, we present the tables for all of our experiments for CIFAR-10 (Table 6), Imagenet-1K (Table 7), and Ultrasound (Table 8). We report the accuracy (%percent\%%) for the source model, and changes in accuracy (Δ%percentΔ\Delta\%roman_Δ %) for each different method.

Covariate Shift
Accuracy (% or ΔΔ\Deltaroman_Δ%)
Label Distribution Shift Original Corruption-1 Corruption-2 Corruption-3 Corruption-4 Corruption-5
Source 95.0 ± 2.4 89.2 ± 9.9 83.9 ± 12.5 78.5 ± 16.5 71.2 ± 20.5 59.2 ± 26.5
\cdashline2-8[2pt/2pt] TTN -75.1 ± 3.9 -70.2 ± 9.7 -65.5 ± 12.0 -60.5 ± 16.0 -53.7 ± 19.7 -42.2 ± 25.9
1 class TENT -75.2 ± 2.2 -70.2 ± 2.6 -65.5 ± 2.7 -60.4 ± 2.8 -53.6 ± 2.7 -42.1 ± 2.5
LAME +2.4 ± 0.9 +8.2 ± 1.1 +10.6 ± 17.2 +13.6 ± 22.4 +13.3 ± 33.9 +7.8 ± 45.7
DELTA -75.1 ± 2.3 -70.2 ± 2.5 -65.5 ± 2.7 -60.5 ± 2.8 -53.7 ± 2.7 -42.2 ± 2.6
Hybrid-TTN -8.0 ± 3.1 -9.2 ± 5.7 -7.4 ± 7.9 -5.1 ± 10.8 -1.7 ± 14.9 +3.8 ± 22.1
Source 95.2 ± 2.1 87.9 ± 10.3 82.0 ± 12.6 75.9 ± 16.7 68.1 ± 20.2 55.4 ± 22.7
\cdashline2-8[2pt/2pt] TTN -32.4 ± 4.3 -28.1 ± 8.4 -24.2 ± 10.5 -19.4 ± 14.2 -13.4 ± 17.3 -3.5 ± 21.3
3 classes TENT -31.8 ± 4.6 -27.4 ± 6.0 -23.5 ± 6.5 -18.7 ± 7.0 -12.7 ± 7.8 -2.7 ± 7.6
LAME -0.8 ± 2.0 +0.6 ± 13.1 -3.2 ± 22.0 -8.5 ± 30.5 -10.6 ± 34.2 -11.0 ± 33.6
DELTA -32.4 ± 4.6 -28.1 ± 5.9 -24.2 ± 6.4 -19.4 ± 7.0 -13.4 ± 7.9 -3.5 ± 7.6
Hybrid-TTN -3.3 ± 1.0 -0.9 ± 5.3 +2.0 ± 7.4 +5.4 ± 10.1 +10.0 ± 13.1 +16.9 ± 18.1
Source 94.9 ± 1.2 88.5 ± 8.8 82.6 ± 10.3 76.5 ± 14.0 68.7 ± 17.3 56.5 ± 20.7
\cdashline2-8[2pt/2pt] TTN -15.2 ± 2.0 -13.0 ± 5.7 -9.6 ± 7.2 -4.9 ± 10.5 +0.1 ± 13.4 +9.0 ± 19.1
5 classes TENT -14.8 ± 2.8 -12.3 ± 5.3 -9.0 ± 6.2 -4.2 ± 7.1 +0.8 ± 9.1 +9.8 ± 9.0
LAME -2.1 ± 2.5 -3.8 ± 13.0 -9.9 ± 23.9 -18.3 ± 31.2 -22.4 ± 31.5 -22.3 ± 26.6
DELTA -15.2 ± 2.8 -13.0 ± 5.2 -9.6 ± 6.3 -4.9 ± 7.3 +0.1 ± 9.1 +9.0 ± 9.2
Hybrid-TTN -2.2 ± 1.0 +0.1 ± 4.7 +3.0 ± 6.0 +7.3 ± 9.1 +11.9 ± 12.0 +19.1 ± 17.3
Source 93.5 ± 0.9 86.6 ± 9.3 80.2 ± 11.1 73.8 ± 14.7 65.6 ± 17.9 53.1 ± 20.1
\cdashline2-8[2pt/2pt] TTN -1.6 ± 0.6 +2.2 ± 5.5 +6.3 ± 7.0 +10.8 ± 9.9 +16.4 ± 12.9 +25.2 ± 17.7
10 classes TENT -1.5 ± 1.3 +2.4 ± 4.3 +6.5 ± 5.2 +11.1 ± 6.7 +16.8 ± 8.9 +25.6 ± 9.6
(Original) LAME -4.4 ± 1.3 -14.1 ± 21.8 -25.9 ± 28.0 -33.3 ± 28.6 -36.7 ± 25.1 -35.9 ± 11.6
DELTA -1.6 ± 1.3 +2.2 ± 4.4 +6.3 ± 5.4 +10.8 ± 6.9 +16.4 ± 9.1 +25.2 ± 9.8
Hybrid-TTN -1.0 ± 0.6 +2.3 ± 5.0 +6.1 ± 6.5 +10.4 ± 9.3 +15.6 ± 12.2 +23.1 ± 17.0
Source 94.2 ± 1.8 87.5 ± 9.3 80.9 ± 12.6 76.0 ± 14.8 65.3 ± 19.5 53.7 ± 22.2
\cdashline2-8[2pt/2pt] TTN -22.4 ± 6.8 -18.6 ± 8.0 -15.0 ± 12.1 -11.5 ± 14.8 -3.4 ± 15.8 +6.5 ± 19.8
Dirichlet TENT -22.3 ± 6.8 -19.3 ± 8.3 -14.2 ± 11.1 -9.3 ± 14.7 -2.7 ± 18.4 +6.9 ± 22.5
(α=0.01𝛼0.01\alpha=0.01italic_α = 0.01) LAME -1.5 ± 1.5 -1.2 ± 7.0 -8.2 ± 17.1 -14.0 ± 21.3 -19.2 ± 20.5 -16.8 ± 16.4
DELTA -22.9 ± 6.7 -20.1 ± 8.3 -15.0 ± 11.1 -10.0 ± 14.7 -3.5 ± 18.2 +6.1 ± 22.5
Hybrid-TTN -2.6 ± 1.1 +0.2 ± 4.3 +3.6 ± 7.3 +6.6 ± 9.7 +13.3 ± 14.2 +20.3 ± 18.1
Source 94.5 ± 1.4 86.9 ± 10.0 81.3 ± 11.3 74.3 ± 15.5 67.4 ± 17.0 53.4 ± 21.9
\cdashline2-8[2pt/2pt] TTN -10.0 ± 3.6 -7.0 ± 7.4 -3.1 ± 7.8 +1.5 ± 12.1 +6.7 ± 14.1 +16.6 ± 19.1
Dirichlet TENT -9.9 ± 3.4 -7.4 ± 7.2 -1.9 ± 8.5 +2.1 ± 11.5 +7.4 ± 14.7 +17.8 ± 18.8
(α=0.5𝛼0.5\alpha=0.5italic_α = 0.5) LAME -3.6 ± 1.4 -6.0 ± 7.5 -18.6 ± 18.3 -25.5 ± 19.8 -28.2 ± 20.7 -29.3 ± 17.7
DELTA -10.5 ± 3.6 -7.9 ± 7.2 -2.4 ± 8.4 +1.4 ± 11.3 +6.8 ± 14.7 +17.1 ± 18.7
Hybrid-TTN -1.8 ± 0.9 +1.4 ± 4.8 +4.8 ± 6.2 +9.4 ± 10.5 +14.2 ± 12.2 +22.0 ± 18.0
Source 94.6 ± 0.9 87.3 ± 9.5 80.9 ± 10.9 73.6 ± 15.0 65.7 ± 17.5 53.9 ± 20.0
\cdashline2-8[2pt/2pt] TTN -1.9 ± 0.8 +1.9 ± 5.5 +6.0 ± 6.7 +11.5 ± 10.4 +16.7 ± 12.6 +24.8 ± 17.5
Dirichlet TENT -1.7 ± 0.8 +2.1 ± 5.5 +6.2 ± 6.8 +11.0 ± 10.0 +16.8 ± 13.1 +25.7 ± 18.0
(α=100𝛼100\alpha=100italic_α = 100) LAME -5.5 ± 1.1 -14.5 ± 15.1 -26.1 ± 20.5 -33.4 ± 19.5 -37.8 ± 17.7 -35.7 ± 17.7
DELTA -1.9 ± 0.8 +1.9 ± 5.4 +5.9 ± 6.7 +10.7 ± 9.8 +16.4 ± 12.9 +25.2 ± 17.9
Hybrid-TTN -1.3 ± 0.6 +2.1 ± 4.7 +5.9 ± 6.4 +10.9 ± 9.6 +16.0 ± 12.1 +23.0 ± 16.8
Table 6: CIFAR-10 evaluations on multiple label shifted distributions and covariate shifts (corruptions) with different degrees of label imbalance. We show the source model accuracy and the improvement (or degradation) as a delta accuracy. We observe that the proposed method provides benefits over source model when there is no covariate shift, while avoiding catastrophic failures and allowing benefits over source when there are label distribution shifts.
Covariate Shift
Accuracy (% or ΔΔ\Deltaroman_Δ%)
Label Distribution Shift Original Corruption-1 Corruption-2 Corruption-3 Corruption-4 Corruption-5
Source 70.8 ± 15.1 55.6 ± 21.3 44.6 ± 22.8 34.4 ± 23.6 22.8 ± 22.5 14.0 ± 19.5
\cdashline2-8[2pt/2pt] TTN -70.0 ± 15.6 -54.1 ± 21.4 -43.3 ± 22.8 -33.2 ± 23.6 -21.9 ± 22.3 -13.2 ± 19.3
1 class TENT -70.0 ± 1.0 -53.8 ± 1.5 -43.0 ± 1.7 -32.8 ± 1.5 -21.8 ± 1.5 -13.5 ± 1.2
LAME +29.2 ± 0.0 +40.8 ± 19.7 +46.2 ± 29.4 +41.8 ± 43.1 +29.9 ± 50.2 +17.3 ± 46.7
DELTA -70.0 ± 1.0 -53.8 ± 1.6 -43.1 ± 1.7 -32.8 ± 1.5 -21.8 ± 1.5 -13.5 ± 1.3
Hybrid-TTN -22.4 ± 6.7 -17.1 ± 11.4 -15.3 ± 12.5 -10.6 ± 13.0 -6.2 ± 11.9 -3.2 ± 11.1
Source 69.5 ± 5.9 51.9 ± 10.6 41.5 ± 12.8 32.2 ± 15.9 21.5 ± 15.8 13.1 ± 14.0
\cdashline2-8[2pt/2pt] TTN -41.3 ± 4.5 -30.5 ± 7.9 -24.2 ± 9.7 -17.7 ± 11.5 -10.1 ± 10.8 -5.0 ± 9.9
3 classes TENT -40.4 ± 3.5 -30.4 ± 5.6 -23.7 ± 5.9 -17.2 ± 6.7 -9.6 ± 7.1 -4.7 ± 6.4
LAME +9.6 ± 26.1 -9.5 ± 19.0 -3.3 ± 14.3 -0.6 ± 20.1 -1.4 ± 17.8 -2.8 ± 16.1
DELTA -41.6 ± 2.9 -30.9 ± 5.4 -24.2 ± 5.8 -17.7 ± 6.6 -10.0 ± 6.8 -5.0 ± 6.2
Hybrid-TTN -7.2 ± 2.0 -3.3 ± 7.1 -1.8 ± 7.7 +0.2 ± 7.7 +2.3 ± 7.3 +3.7 ± 6.7
Source 71.1 ± 5.3 53.7 ± 9.9 42.8 ± 13.2 32.7 ± 16.2 21.4 ± 15.8 13.2 ± 13.5
\cdashline2-8[2pt/2pt] TTN -26.5 ± 4.4 -19.3 ± 5.8 -14.1 ± 8.4 -8.9 ± 9.4 -3.4 ± 8.7 -0.0 ± 7.7
5 classes TENT -25.8 ± 4.1 -18.6 ± 7.0 -13.0 ± 8.0 -7.7 ± 10.2 -2.6 ± 10.4 +0.7 ± 9.6
LAME -4.2 ± 38.6 -30.0 ± 17.6 -20.8 ± 14.2 -13.3 ± 18.6 -10.0 ± 10.0 -7.7 ± 8.9
DELTA -26.6 ± 4.1 -19.7 ± 7.0 -14.0 ± 7.9 -8.7 ± 10.0 -3.3 ± 10.1 +0.1 ± 9.3
Hybrid-TTN -5.2 ± 2.5 -1.0 ± 4.7 +0.4 ± 6.4 +2.4 ± 7.0 +4.5 ± 6.5 +4.9 ± 6.0
Source 69.8 ± 3.4 50.7 ± 8.1 40.2 ± 10.9 31.0 ± 14.0 20.7 ± 14.0 13.0 ± 12.2
\cdashline2-8[2pt/2pt] TTN -14.7 ± 0.7 -6.2 ± 3.7 -2.5 ± 5.6 +0.9 ± 6.8 +3.9 ± 6.7 +5.0 ± 5.9
10 classes TENT -13.8 ± 3.7 -5.5 ± 5.9 -1.5 ± 8.0 +2.1 ± 11.3 +4.9 ± 11.8 5.7 ± 11.6
LAME -59.8 ± 0.0 -41.3 ± 0.0 -30.8 ± 1.8 -23.8 ± 4.5 -16.3 ± 5.0 -10.3 ± 4.4
DELTA -14.7 ± 3.7 -6.7 ± 6.0 -2.7 ± 8.1 +1.0 ± 11.3 +3.9 ± 11.5 +4.9 ± 11.2
Hybrid-TTN -2.9 ± 0.8 +2.6 ± 3.3 +3.5 ± 5.0 +5.2 ± 6.0 +5.9 ± 5.7 +5.6 ± 5.3
Source 69.7 ± 1.6 52.6 ± 7.3 42.0 ± 10.3 33.1 ± 14.0 23.1 ± 14.3 14.9 ± 12.3
\cdashline2-8[2pt/2pt] TTN -0.6 ± 0.6 +5.9 ± 3.5 +8.6 ± 5.2 +10.4 ± 6.6 +11.5 ± 6.4 +10.7 ± 6.9
500 classes TENT -0.5 ± 2.3 +6.1 ± 5.5 +9.2 ± 8.2 +11.0 ± 12.1 +12.2 ± 13.8 +11.4 ± 14.5
LAME -55.2 ± 28.0 -51.9 ± 6.6 -41.8 ± 0.2 -32.8 ± 0.2 -22.8 ± 0.2 -14.7 ± 0.1
DELTA -0.6 ± 2.1 +5.7 ± 5.8 +8.8 ± 8.3 +10.5 ± 12.2 +11.7 ± 13.8 +10.8 ± 14.4
Hybrid-TTN -0.2 ± 0.4 +4.3 ± 3.1 +5.6 ± 4.7 +7.0 ± 5.8 +7.5 ± 5.6 +7.1 ± 5.9
Source 70.0 ± 2.2 53.0 ± 7.3 42.0 ± 10.7 33.2 ± 13.7 23.1 ± 14.4 14.7 ± 12.3
\cdashline2-8[2pt/2pt] TTN -1.0 ± 0.9 +5.3 ± 3.4 +8.1 ± 5.0 +10.0 ± 6.6 +11.5 ± 6.3 +10.7 ± 6.9
Dirichlet TENT -0.8 ± 0.9 +6.0 ± 3.4 +9.0 ± 5.2 +10.8 ± 6.5 +11.8 ± 7.0 +10.6 ± 6.6
(α=0.01𝛼0.01\alpha=0.01italic_α = 0.01) LAME -67.1 ± 10.7 -51.9 ± 7.0 -40.8 ± 9.9 -32.2 ± 13.7 -22.9 ± 14.1 -14.5 ± 12.7
DELTA -0.9 ± 0.9 +5.6 ± 3.3 +8.4 ± 5.2 +10.2 ± 6.5 +11.2 ± 7.0 +10.1 ± 6.5
Hybrid-TTN -0.5 ± 0.8 +4.4 ± 3.0 +5.8 ± 4.5 +7.0 ± 6.2 +8.0 ± 5.6 +7.4 ± 5.9
Table 7: ImageNet-1K evaluations on multiple label shifted distributions and covariate shifts (corruptions) with different degrees of label imbalance. We observe that the proposed method provides benefits over source model when there is covariate shift, while avoiding catastrophic failures when there are label distribution shifts. Note that we use a batch size of 500 images, and the highest amount of classes is limited by this number.
Covariate Shift
Accuracy (% or ΔΔ\Deltaroman_Δ%)
Label Distribution Shift Original Corruption-1 Corruption-2 Corruption-3 Corruption-4
Source 76.5 ± 2.7 74.8 ± 1.3 70.8 ± 3.1 65.3 ± 3.6 60.4 ± 5.1
\cdashline2-7[2pt/2pt] TTN +5.6 ± 4.2 +3.2 ± 3.2 +3.5 ± 5.5 +4.4 ± 6.7 +5.0 ± 9.4
Original TENT +5.8 ± 4.2 +3.8 ± 5.0 0.0 ± 6.1 +3.5 ± 9.1 +8.0 ± 4.3
(31:69) LAME -7.8 ± 2.7 -4.9 ± 2.3 -4.4 ± 2.9 +2.8 ± 5.0 +9.1 ± 3.4
DELTA +5.6 ± 4.2 +3.2 ± 4.3 -0.4 ± 6.0 +3.0 ± 8.4 +8.1 ± 4.1
Hybrid-TTN +0.9 ± 4.3 -2.2 ± 3.5 +3.5 ± 2.8 +6.7 ± 4.9 +10.5 ± 5.6
Source 65.8 ± 3.2 60.5 ± 3.0 59.8 ± 3.5 53.9 ± 5.9 48.0 ± 3.0
\cdashline2-7[2pt/2pt] TTN +6.4 ± 4.9 +6.1 ± 4.2 +4.5 ± 6.0 +5.5 ± 2.5 +11.9 ± 4.6
Balanced TENT +6.9 ± 4.8 +8.1 ± 5.2 +6.6 ± 5.9 +9.0 ± 6.8 +15.1 ± 5.3
(50:50) LAME -15.8 ± 3.2 -10.4 ± 2.4 -8.5 ± 3.3 -3.8 ± 5.1 +3.5 ± 4.2
DELTA +6.4 ± 4.9 +7.1 ± 4.9 +6.6 ± 5.7 +9.0 ± 6.7 +14.8 ± 5.2
Hybrid-TTN +8.2 ± 3.9 +9.1 ± 3.6 +5.8 ± 5.4 +8.8 ± 7.0 +10.6 ± 5.0
Source 34.6 ± 4.9 23.1 ± 3.6 22.4 ± 5.2 24.2 ± 2.8 15.9 ± 4.7
\cdashline2-7[2pt/2pt] TTN -11.9 ± 7.7 +3.4 ± 4.1 +4.1 ± 4.3 +2.8 ± 4.4 +9.9 ± 6.1
Healthy livers TENT -11.9 ± 8.1 +2.4 ± 6.2 +0.8 ± 5.7 +2.6 ± 4.2 +11.4 ± 4.7
(100:0) LAME -34.0 ± 5.2 -23.0 ± 5.0 -25.6 ± 3.8 -24.5 ± 3.7 -15.4 ± 5.1
DELTA -11.9 ± 7.7 +2.2 ± 6.1 +0.6 ± 5.5 +2.4 ± 4.4 +10.8 ± 5.2
Hybrid-TTN +29.0 ± 3.1 +41.1 ± 5.0 +19.4 ± 5.5 +6.0 ± 6.9 +5.4 ± 7.0
Source 96.6 ± 1.2 98.8 ± 1.3 94.8 ± 3.1 86.1 ± 2.6 79.9 ± 6.1
\cdashline2-7[2pt/2pt] TTN -24.0 ± 3.7 -24.6 ± 2.2 -22.6 ± 3.3 -12.8 ± 3.7 -5.8 ± 8.5
Fatty livers TENT -24.0 ± 2.9 -25.6 ± 2.4 -22.9 ± 3.3 -10.6 ± 4.9 -7.8 ± 3.4
(0:100) LAME +3.4 ± 1.2 +0.4 ± 0.6 +5.6 ± 2.4 +15.5 ± 4.4 +19.2 ± 4.0
DELTA -24.0 ± 3.7 -26.0 ± 3.0 -23.0 ± 3.3 -10.0 ± 4.8 -7.6 ± 4.3
Hybrid-TTN -21.4 ± 4.1 -25.0 ± 6.4 -11.4 ± 4.7 +2.1 ± 6.2 +10.0 ± 8.8
Table 8: Evaluation on ultrasound data. Binary classification, subjects without fatty liver or patients with fatty liver disease. Models were trained on one site and are evaluated on a publicly available dataset (Byra et al., 2018). We show evaluations on targets with shifts in label distribution and added speckle noise. We observe that the proposed method is able to control the degradation in performance under severe label distribution shift.

A.7 Results by corruption type

Similarly to other works on Test-time Adaptation, we display here the results separated by corruption type. In the interest of space, we show the results for accuracy in CIFAR-10 and Imagenet-1K, considering severity level 5 for all corruptions.

CIFAR-10 Imagenet-1K
Corruption / # of Classes 1 3 5 10 1 3 5 10 500
Brightness 83.5±5.3plus-or-minus83.55.383.5\pm 5.383.5 ± 5.3 89.4±2.6plus-or-minus89.42.689.4\pm 2.689.4 ± 2.6 89.9±1.5plus-or-minus89.91.589.9\pm 1.589.9 ± 1.5 90.4±1.9plus-or-minus90.41.990.4\pm 1.990.4 ± 1.9 36.4±12.3plus-or-minus36.412.336.4\pm 12.336.4 ± 12.3 46.8±9.3plus-or-minus46.89.346.8\pm 9.346.8 ± 9.3 50.6±5.6plus-or-minus50.65.650.6\pm 5.650.6 ± 5.6 49.8±3.9plus-or-minus49.83.949.8\pm 3.949.8 ± 3.9 54.4±2.9plus-or-minus54.42.954.4\pm 2.954.4 ± 2.9
Contrast 73.8±7.4plus-or-minus73.87.473.8\pm 7.473.8 ± 7.4 82.4±3.8plus-or-minus82.43.882.4\pm 3.882.4 ± 3.8 84.4±2.0plus-or-minus84.42.084.4\pm 2.084.4 ± 2.0 84.7±1.8plus-or-minus84.71.884.7\pm 1.884.7 ± 1.8 2.4±2.6plus-or-minus2.42.62.4\pm 2.62.4 ± 2.6 2.9±3.3plus-or-minus2.93.32.9\pm 3.32.9 ± 3.3 4.5±1.1plus-or-minus4.51.14.5\pm 1.14.5 ± 1.1 5.8±3.9plus-or-minus5.83.95.8\pm 3.95.8 ± 3.9 6.1±1.1plus-or-minus6.11.16.1\pm 1.16.1 ± 1.1
Defocus Blur 72.2±9.4plus-or-minus72.29.472.2\pm 9.472.2 ± 9.4 82.8±2.8plus-or-minus82.82.882.8\pm 2.882.8 ± 2.8 83.7±2.6plus-or-minus83.72.683.7\pm 2.683.7 ± 2.6 86.1±2.2plus-or-minus86.12.286.1\pm 2.286.1 ± 2.2 2.0±1.4plus-or-minus2.01.42.0\pm 1.42.0 ± 1.4 4.5±0.9plus-or-minus4.50.94.5\pm 0.94.5 ± 0.9 4.5±1.6plus-or-minus4.51.64.5\pm 1.64.5 ± 1.6 5.2±3.2plus-or-minus5.23.25.2\pm 3.25.2 ± 3.2 7.5±0.9plus-or-minus7.50.97.5\pm 0.97.5 ± 0.9
Elastic Transform 58.1±7.7plus-or-minus58.17.758.1\pm 7.758.1 ± 7.7 71.1±5.6plus-or-minus71.15.671.1\pm 5.671.1 ± 5.6 73.6±1.1plus-or-minus73.61.173.6\pm 1.173.6 ± 1.1 75.0±2.0plus-or-minus75.02.075.0\pm 2.075.0 ± 2.0 7.6±8.9plus-or-minus7.68.97.6\pm 8.97.6 ± 8.9 22.1±10.3plus-or-minus22.110.322.1\pm 10.322.1 ± 10.3 22.6±7.6plus-or-minus22.67.622.6\pm 7.622.6 ± 7.6 25.0±4.3plus-or-minus25.04.325.0\pm 4.325.0 ± 4.3 31.4±1.3plus-or-minus31.41.331.4\pm 1.331.4 ± 1.3
Fog 67.5±12.3plus-or-minus67.512.367.5\pm 12.367.5 ± 12.3 75.2±3.9plus-or-minus75.23.975.2\pm 3.975.2 ± 3.9 80.1±1.7plus-or-minus80.11.780.1\pm 1.780.1 ± 1.7 80.6±2.7plus-or-minus80.62.780.6\pm 2.780.6 ± 2.7 14.4±7.3plus-or-minus14.47.314.4\pm 7.314.4 ± 7.3 25.1±10.5plus-or-minus25.110.525.1\pm 10.525.1 ± 10.5 27.4±5.0plus-or-minus27.45.027.4\pm 5.027.4 ± 5.0 29.2±2.1plus-or-minus29.22.129.2\pm 2.129.2 ± 2.1 32.8±2.1plus-or-minus32.82.132.8\pm 2.132.8 ± 2.1
Frost 65.7±11.5plus-or-minus65.711.565.7\pm 11.565.7 ± 11.5 70.0±5.8plus-or-minus70.05.870.0\pm 5.870.0 ± 5.8 74.4±2.1plus-or-minus74.42.174.4\pm 2.174.4 ± 2.1 77.2±2.1plus-or-minus77.22.177.2\pm 2.177.2 ± 2.1 9.6±3.6plus-or-minus9.63.69.6\pm 3.69.6 ± 3.6 16.9±5.6plus-or-minus16.95.616.9\pm 5.616.9 ± 5.6 18.8±6.6plus-or-minus18.86.618.8\pm 6.618.8 ± 6.6 20.2±3.6plus-or-minus20.23.620.2\pm 3.620.2 ± 3.6 23.2±1.4plus-or-minus23.21.423.2\pm 1.423.2 ± 1.4
Gaussian Blur 68.0±14.1plus-or-minus68.014.168.0\pm 14.168.0 ± 14.1 81.1±3.5plus-or-minus81.13.581.1\pm 3.581.1 ± 3.5 81.8±2.5plus-or-minus81.82.581.8\pm 2.581.8 ± 2.5 85.0±1.4plus-or-minus85.01.485.0\pm 1.485.0 ± 1.4 2.4±3.6plus-or-minus2.43.62.4\pm 3.62.4 ± 3.6 3.7±2.1plus-or-minus3.72.13.7\pm 2.13.7 ± 2.1 3.7±1.5plus-or-minus3.71.53.7\pm 1.53.7 ± 1.5 4.6±3.2plus-or-minus4.63.24.6\pm 3.24.6 ± 3.2 6.4±1.5plus-or-minus6.41.56.4\pm 1.56.4 ± 1.5
Gaussian Noise 45.4±27.9plus-or-minus45.427.945.4\pm 27.945.4 ± 27.9 50.2±11.7plus-or-minus50.211.750.2\pm 11.750.2 ± 11.7 58.5±5.4plus-or-minus58.55.458.5\pm 5.458.5 ± 5.4 58.6±2.0plus-or-minus58.62.058.6\pm 2.058.6 ± 2.0 1.6±1.7plus-or-minus1.61.71.6\pm 1.71.6 ± 1.7 6.0±4.5plus-or-minus6.04.56.0\pm 4.56.0 ± 4.5 6.4±3.2plus-or-minus6.43.26.4\pm 3.26.4 ± 3.2 6.0±1.9plus-or-minus6.01.96.0\pm 1.96.0 ± 1.9 8.3±0.9plus-or-minus8.30.98.3\pm 0.98.3 ± 0.9
Glass Blur 47.3±17.4plus-or-minus47.317.447.3\pm 17.447.3 ± 17.4 59.1±9.4plus-or-minus59.19.459.1\pm 9.459.1 ± 9.4 64.7±2.6plus-or-minus64.72.664.7\pm 2.664.7 ± 2.6 61.8±1.8plus-or-minus61.81.861.8\pm 1.861.8 ± 1.8 1.2±2.7plus-or-minus1.22.71.2\pm 2.71.2 ± 2.7 5.6±4.0plus-or-minus5.64.05.6\pm 4.05.6 ± 4.0 4.4±2.2plus-or-minus4.42.24.4\pm 2.24.4 ± 2.2 5.9±1.6plus-or-minus5.91.65.9\pm 1.65.9 ± 1.6 7.5±1.2plus-or-minus7.51.27.5\pm 1.27.5 ± 1.2
Impulse Noise 46.6±20.9plus-or-minus46.620.946.6\pm 20.946.6 ± 20.9 53.9±12.8plus-or-minus53.912.853.9\pm 12.853.9 ± 12.8 59.3±6.1plus-or-minus59.36.159.3\pm 6.159.3 ± 6.1 57.8±1.0plus-or-minus57.81.057.8\pm 1.057.8 ± 1.0 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1 4.5±3.8plus-or-minus4.53.84.5\pm 3.84.5 ± 3.8 4.6±2.6plus-or-minus4.62.64.6\pm 2.64.6 ± 2.6 5.4±1.4plus-or-minus5.41.45.4\pm 1.45.4 ± 1.4 6.9±1.0plus-or-minus6.91.06.9\pm 1.06.9 ± 1.0
JPEG Compression 52.9±11.0plus-or-minus52.911.052.9\pm 11.052.9 ± 11.0 69.6±5.0plus-or-minus69.65.069.6\pm 5.069.6 ± 5.0 70.6±2.8plus-or-minus70.62.870.6\pm 2.870.6 ± 2.8 72.6±1.3plus-or-minus72.61.372.6\pm 1.372.6 ± 1.3 18.8±7.6plus-or-minus18.87.618.8\pm 7.618.8 ± 7.6 21.7±5.4plus-or-minus21.75.421.7\pm 5.421.7 ± 5.4 26.2±2.0plus-or-minus26.22.026.2\pm 2.026.2 ± 2.0 25.7±5.0plus-or-minus25.75.025.7\pm 5.025.7 ± 5.0 27.1±1.1plus-or-minus27.11.127.1\pm 1.127.1 ± 1.1
Motion Blur 73.1±8.0plus-or-minus73.18.073.1\pm 8.073.1 ± 8.0 81.2±3.0plus-or-minus81.23.081.2\pm 3.081.2 ± 3.0 81.8±1.8plus-or-minus81.81.881.8\pm 1.881.8 ± 1.8 84.0±1.8plus-or-minus84.01.884.0\pm 1.884.0 ± 1.8 8.8±8.3plus-or-minus8.88.38.8\pm 8.38.8 ± 8.3 10.8±3.7plus-or-minus10.83.710.8\pm 3.710.8 ± 3.7 11.0±5.1plus-or-minus11.05.111.0\pm 5.111.0 ± 5.1 12.0±6.5plus-or-minus12.06.512.0\pm 6.512.0 ± 6.5 17.6±2.3plus-or-minus17.62.317.6\pm 2.317.6 ± 2.3
Pixelate 59.1±11.3plus-or-minus59.111.359.1\pm 11.359.1 ± 11.3 72.3±7.1plus-or-minus72.37.172.3\pm 7.172.3 ± 7.1 75.4±3.5plus-or-minus75.43.575.4\pm 3.575.4 ± 3.5 74.3±1.2plus-or-minus74.31.274.3\pm 1.274.3 ± 1.2 18.4±13.7plus-or-minus18.413.718.4\pm 13.718.4 ± 13.7 25.9±4.5plus-or-minus25.94.525.9\pm 4.525.9 ± 4.5 26.0±5.1plus-or-minus26.05.126.0\pm 5.126.0 ± 5.1 26.8±6.1plus-or-minus26.86.126.8\pm 6.126.8 ± 6.1 32.4±4.0plus-or-minus32.44.032.4\pm 4.032.4 ± 4.0
Saturate 82.3±6.7plus-or-minus82.36.782.3\pm 6.782.3 ± 6.7 89.8±3.4plus-or-minus89.83.489.8\pm 3.489.8 ± 3.4 91.6±1.8plus-or-minus91.61.891.6\pm 1.891.6 ± 1.8 90.6±2.3plus-or-minus90.62.390.6\pm 2.390.6 ± 2.3 34.0±11.8plus-or-minus34.011.834.0\pm 11.834.0 ± 11.8 43.2±7.3plus-or-minus43.27.343.2\pm 7.343.2 ± 7.3 44.9±5.4plus-or-minus44.95.444.9\pm 5.444.9 ± 5.4 46.0±2.6plus-or-minus46.02.646.0\pm 2.646.0 ± 2.6 50.4±3.2plus-or-minus50.43.250.4\pm 3.250.4 ± 3.2
Shot Noise 47.9±26.8plus-or-minus47.926.847.9\pm 26.847.9 ± 26.8 51.1±11.0plus-or-minus51.111.051.1\pm 11.051.1 ± 11.0 60.2±4.9plus-or-minus60.24.960.2\pm 4.960.2 ± 4.9 61.0±3.1plus-or-minus61.03.161.0\pm 3.161.0 ± 3.1 4.0±4.9plus-or-minus4.04.94.0\pm 4.94.0 ± 4.9 6.3±4.7plus-or-minus6.34.76.3\pm 4.76.3 ± 4.7 5.8±4.2plus-or-minus5.84.25.8\pm 4.25.8 ± 4.2 5.6±1.1plus-or-minus5.61.15.6\pm 1.15.6 ± 1.1 8.0±1.5plus-or-minus8.01.58.0\pm 1.58.0 ± 1.5
Snow 66.5±8.3plus-or-minus66.58.366.5\pm 8.366.5 ± 8.3 75.1±4.3plus-or-minus75.14.375.1\pm 4.375.1 ± 4.3 76.1±2.1plus-or-minus76.12.176.1\pm 2.176.1 ± 2.1 77.5±2.8plus-or-minus77.52.877.5\pm 2.877.5 ± 2.8 12.4±9.9plus-or-minus12.49.912.4\pm 9.912.4 ± 9.9 17.6±6.5plus-or-minus17.66.517.6\pm 6.517.6 ± 6.5 21.7±5.9plus-or-minus21.75.921.7\pm 5.921.7 ± 5.9 19.3±2.5plus-or-minus19.32.519.3\pm 2.519.3 ± 2.5 24.1±2.4plus-or-minus24.12.424.1\pm 2.424.1 ± 2.4
Spatter 69.9±15.4plus-or-minus69.915.469.9\pm 15.469.9 ± 15.4 81.5±7.0plus-or-minus81.57.081.5\pm 7.081.5 ± 7.0 81.4±3.6plus-or-minus81.43.681.4\pm 3.681.4 ± 3.6 81.1±1.8plus-or-minus81.11.881.1\pm 1.881.1 ± 1.8 12.8±7.3plus-or-minus12.87.312.8\pm 7.312.8 ± 7.3 25.1±5.0plus-or-minus25.15.025.1\pm 5.025.1 ± 5.0 25.6±5.5plus-or-minus25.65.525.6\pm 5.525.6 ± 5.5 25.9±2.4plus-or-minus25.92.425.9\pm 2.425.9 ± 2.4 30.0±3.1plus-or-minus30.03.130.0\pm 3.130.0 ± 3.1
Speckle Noise 49.2±25.4plus-or-minus49.225.449.2\pm 25.449.2 ± 25.4 52.7±10.0plus-or-minus52.710.052.7\pm 10.052.7 ± 10.0 61.4±4.8plus-or-minus61.44.861.4\pm 4.861.4 ± 4.8 61.7±4.6plus-or-minus61.74.661.7\pm 4.661.7 ± 4.6 7.2±4.4plus-or-minus7.24.47.2\pm 4.47.2 ± 4.4 13.6±4.3plus-or-minus13.64.313.6\pm 4.313.6 ± 4.3 15.0±4.4plus-or-minus15.04.415.0\pm 4.415.0 ± 4.4 14.3±2.9plus-or-minus14.32.914.3\pm 2.914.3 ± 2.9 16.3±1.2plus-or-minus16.31.216.3\pm 1.216.3 ± 1.2
Zoom Blur 68.8±15.2plus-or-minus68.815.268.8\pm 15.268.8 ± 15.2 84.4±3.5plus-or-minus84.43.584.4\pm 3.584.4 ± 3.5 86.2±1.4plus-or-minus86.21.486.2\pm 1.486.2 ± 1.4 87.8±2.6plus-or-minus87.82.687.8\pm 2.687.8 ± 2.6 10.8±7.4plus-or-minus10.87.410.8\pm 7.410.8 ± 7.4 16.8±3.2plus-or-minus16.83.216.8\pm 3.216.8 ± 3.2 19.7±3.4plus-or-minus19.73.419.7\pm 3.419.7 ± 3.4 21.0±3.9plus-or-minus21.03.921.0\pm 3.921.0 ± 3.9 27.2±1.6plus-or-minus27.21.627.2\pm 1.627.2 ± 1.6
Table 9: Performance of Hybrid-TTN on CIFAR-10 and ImageNet-1K datasets under various corruptions and multiple imbalance scenarios.
Only 1-class CIFAR-10 ImageNet-1K
Corruption Source TTN Hybrid-TTN Source TTN Hybrid-TTN
Brightness 91.6±3.7plus-or-minus91.63.791.6\pm 3.791.6 ± 3.7 19.2±2.8plus-or-minus19.22.819.2\pm 2.819.2 ± 2.8 83.5±5.3plus-or-minus83.55.383.5\pm 5.383.5 ± 5.3 46.4±23.0plus-or-minus46.423.046.4\pm 23.046.4 ± 23.0 1.6±2.6plus-or-minus1.62.61.6\pm 2.61.6 ± 2.6 36.4±12.3plus-or-minus36.412.336.4\pm 12.336.4 ± 12.3
Contrast 36.5±26.7plus-or-minus36.526.736.5\pm 26.736.5 ± 26.7 18.6±1.8plus-or-minus18.61.818.6\pm 1.818.6 ± 1.8 73.8±7.4plus-or-minus73.87.473.8\pm 7.473.8 ± 7.4 1.2±1.8plus-or-minus1.21.81.2\pm 1.81.2 ± 1.8 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 2.4±2.6plus-or-minus2.42.62.4\pm 2.62.4 ± 2.6
Defocus Blur 44.2±23.4plus-or-minus44.223.444.2\pm 23.444.2 ± 23.4 17.6±2.5plus-or-minus17.62.517.6\pm 2.517.6 ± 2.5 72.2±9.4plus-or-minus72.29.472.2\pm 9.472.2 ± 9.4 6.0±9.3plus-or-minus6.09.36.0\pm 9.36.0 ± 9.3 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 2.0±1.4plus-or-minus2.01.42.0\pm 1.42.0 ± 1.4
Elastic Transform 69.0±12.3plus-or-minus69.012.369.0\pm 12.369.0 ± 12.3 17.2±1.6plus-or-minus17.21.617.2\pm 1.617.2 ± 1.6 58.1±7.7plus-or-minus58.17.758.1\pm 7.758.1 ± 7.7 5.2±7.6plus-or-minus5.27.65.2\pm 7.65.2 ± 7.6 0.0±0.0plus-or-minus0.00.00.0\pm 0.00.0 ± 0.0 7.6±8.9plus-or-minus7.68.97.6\pm 8.97.6 ± 8.9
Fog 62.6±9.4plus-or-minus62.69.462.6\pm 9.462.6 ± 9.4 18.4±3.1plus-or-minus18.43.118.4\pm 3.118.4 ± 3.1 67.5±12.3plus-or-minus67.512.367.5\pm 12.367.5 ± 12.3 9.6±12.0plus-or-minus9.612.09.6\pm 12.09.6 ± 12.0 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1 14.4±7.3plus-or-minus14.47.314.4\pm 7.314.4 ± 7.3
Frost 67.5±14.9plus-or-minus67.514.967.5\pm 14.967.5 ± 14.9 17.4±0.9plus-or-minus17.40.917.4\pm 0.917.4 ± 0.9 65.7±11.5plus-or-minus65.711.565.7\pm 11.565.7 ± 11.5 8.4±7.0plus-or-minus8.47.08.4\pm 7.08.4 ± 7.0 2.4±2.2plus-or-minus2.42.22.4\pm 2.22.4 ± 2.2 9.6±3.6plus-or-minus9.63.69.6\pm 3.69.6 ± 3.6
Gaussian Blur 32.7±31.5plus-or-minus32.731.532.7\pm 31.532.7 ± 31.5 17.8±2.0plus-or-minus17.82.017.8\pm 2.017.8 ± 2.0 68.0±14.1plus-or-minus68.014.168.0\pm 14.168.0 ± 14.1 3.2±5.0plus-or-minus3.25.03.2\pm 5.03.2 ± 5.0 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 2.4±3.6plus-or-minus2.43.62.4\pm 3.62.4 ± 3.6
Gaussian Noise 40.4±33.3plus-or-minus40.433.340.4\pm 33.340.4 ± 33.3 14.6±2.5plus-or-minus14.62.514.6\pm 2.514.6 ± 2.5 45.4±27.9plus-or-minus45.427.945.4\pm 27.945.4 ± 27.9 0.0±0.0plus-or-minus0.00.00.0\pm 0.00.0 ± 0.0 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1 1.6±1.7plus-or-minus1.61.71.6\pm 1.71.6 ± 1.7
Glass Blur 58.7±24.3plus-or-minus58.724.358.7\pm 24.358.7 ± 24.3 14.7±2.3plus-or-minus14.72.314.7\pm 2.314.7 ± 2.3 47.3±17.4plus-or-minus47.317.447.3\pm 17.447.3 ± 17.4 2.4±5.4plus-or-minus2.45.42.4\pm 5.42.4 ± 5.4 0.0±0.0plus-or-minus0.00.00.0\pm 0.00.0 ± 0.0 1.2±2.7plus-or-minus1.22.71.2\pm 2.71.2 ± 2.7
Impulse Noise 47.1±27.6plus-or-minus47.127.647.1\pm 27.647.1 ± 27.6 13.4±2.2plus-or-minus13.42.213.4\pm 2.213.4 ± 2.2 46.6±20.9plus-or-minus46.620.946.6\pm 20.946.6 ± 20.9 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 0.0±0.0plus-or-minus0.00.00.0\pm 0.00.0 ± 0.0 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1
JPEG Compression 70.2±11.0plus-or-minus70.211.070.2\pm 11.070.2 ± 11.0 16.5±1.8plus-or-minus16.51.816.5\pm 1.816.5 ± 1.8 52.9±11.0plus-or-minus52.911.052.9\pm 11.052.9 ± 11.0 37.6±22.3plus-or-minus37.622.337.6\pm 22.337.6 ± 22.3 1.2±1.1plus-or-minus1.21.11.2\pm 1.11.2 ± 1.1 18.8±7.6plus-or-minus18.87.618.8\pm 7.618.8 ± 7.6
Motion Blur 67.7±15.2plus-or-minus67.715.267.7\pm 15.267.7 ± 15.2 18.5±2.1plus-or-minus18.52.118.5\pm 2.118.5 ± 2.1 73.1±8.0plus-or-minus73.18.073.1\pm 8.073.1 ± 8.0 17.2±23.7plus-or-minus17.223.717.2\pm 23.717.2 ± 23.7 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 8.8±8.3plus-or-minus8.88.38.8\pm 8.38.8 ± 8.3
Pixelate 40.0±33.9plus-or-minus40.033.940.0\pm 33.940.0 ± 33.9 17.2±2.6plus-or-minus17.22.617.2\pm 2.617.2 ± 2.6 59.1±11.3plus-or-minus59.111.359.1\pm 11.359.1 ± 11.3 26.8±20.9plus-or-minus26.820.926.8\pm 20.926.8 ± 20.9 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1 18.4±13.7plus-or-minus18.413.718.4\pm 13.718.4 ± 13.7
Saturate 90.7±3.9plus-or-minus90.73.990.7\pm 3.990.7 ± 3.9 18.9±2.1plus-or-minus18.92.118.9\pm 2.118.9 ± 2.1 82.3±6.7plus-or-minus82.36.782.3\pm 6.782.3 ± 6.7 52.8±18.1plus-or-minus52.818.152.8\pm 18.152.8 ± 18.1 1.2±1.1plus-or-minus1.21.11.2\pm 1.11.2 ± 1.1 34.0±11.8plus-or-minus34.011.834.0\pm 11.834.0 ± 11.8
Shot Noise 48.8±30.5plus-or-minus48.830.548.8\pm 30.548.8 ± 30.5 14.8±2.0plus-or-minus14.82.014.8\pm 2.014.8 ± 2.0 47.9±26.8plus-or-minus47.926.847.9\pm 26.847.9 ± 26.8 0.8±1.8plus-or-minus0.81.80.8\pm 1.80.8 ± 1.8 0.0±0.0plus-or-minus0.00.00.0\pm 0.00.0 ± 0.0 4.0±4.9plus-or-minus4.04.94.0\pm 4.94.0 ± 4.9
Snow 72.3±8.4plus-or-minus72.38.472.3\pm 8.472.3 ± 8.4 17.3±2.2plus-or-minus17.32.217.3\pm 2.217.3 ± 2.2 66.5±8.3plus-or-minus66.58.366.5\pm 8.366.5 ± 8.3 8.4±8.6plus-or-minus8.48.68.4\pm 8.68.4 ± 8.6 0.8±1.1plus-or-minus0.81.10.8\pm 1.10.8 ± 1.1 12.4±9.9plus-or-minus12.49.912.4\pm 9.912.4 ± 9.9
Spatter 78.4±21.5plus-or-minus78.421.578.4\pm 21.578.4 ± 21.5 16.6±2.7plus-or-minus16.62.716.6\pm 2.716.6 ± 2.7 69.9±15.4plus-or-minus69.915.469.9\pm 15.469.9 ± 15.4 15.6±7.1plus-or-minus15.67.115.6\pm 7.115.6 ± 7.1 2.4±0.9plus-or-minus2.40.92.4\pm 0.92.4 ± 0.9 12.8±7.3plus-or-minus12.87.312.8\pm 7.312.8 ± 7.3
Speckle Noise 53.7±27.3plus-or-minus53.727.353.7\pm 27.353.7 ± 27.3 16.0±2.2plus-or-minus16.02.216.0\pm 2.216.0 ± 2.2 49.2±25.4plus-or-minus49.225.449.2\pm 25.449.2 ± 25.4 4.8±7.6plus-or-minus4.87.64.8\pm 7.64.8 ± 7.6 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 7.2±4.4plus-or-minus7.24.47.2\pm 4.47.2 ± 4.4
Zoom Blur 52.2±26.9plus-or-minus52.226.952.2\pm 26.952.2 ± 26.9 17.9±2.2plus-or-minus17.92.217.9\pm 2.217.9 ± 2.2 68.8±15.2plus-or-minus68.815.268.8\pm 15.268.8 ± 15.2 18.8±17.2plus-or-minus18.817.218.8\pm 17.218.8 ± 17.2 0.4±0.9plus-or-minus0.40.90.4\pm 0.90.4 ± 0.9 10.8±7.4plus-or-minus10.87.410.8\pm 7.410.8 ± 7.4
Table 10: Comparison of Hybrid-TTN to source model an TTN on CIFAR-10 and ImageNet-1K datasets under various corruptions at the most imbalanced scenario, containing only one class on the target data.