Test-time Adaptation for Regression by Subspace Alignment

## Abstract

Abstract This paper investigates test-time adaptation (TTA) for regression , where a regression model pre-trained in a source domain is adapted to an unknown target distribution with unlabeled target data.
Although regression is one of the fundamental tasks in machine learning, most of the existing TTA methods have classification-specific designs, which assume that models output class-categorical predictions, whereas regression models typically output only single scalar values.
To enable TTA for regression, we adopt a feature alignment approach, which aligns the feature distributions between the source and target domains to mitigate the domain gap.
However, we found that naive feature alignment employed in existing TTA methods for classification is ineffective or even worse for regression because the features are distributed in a small subspace and many of the raw feature dimensions have little significance to the output.
For an effective feature alignment in TTA for regression, we propose Significant-subspace Alignment (SSA) .
SSA consists of two components: subspace detection and dimension weighting.
Subspace detection finds the feature subspace that is representative and significant to the output.
Then, the feature alignment is performed in the subspace during TTA.
Meanwhile, dimension weighting raises the importance of the dimensions of the feature subspace that have greater significance to the output.
We experimentally show that SSA outperforms various baselines on real-world datasets.

## 1 Introduction

Deep neural networks have achieved remarkable success in various tasks [, , , ].
In particular, regression, which is one of the fundamental tasks in machine learning, is widely used in practical tasks such as human pose estimation or age prediction [].
The successes of deep learning have usually relied on the assumption that the training and test datasets are sampled from an i.i.d. distribution.
In the real world, however, such an assumption is often invalid since the test data are sampled from
distributions different from the training one due to distribution shifts caused by changes in environments.
The performance of these models thus deteriorates when a distribution shift occurs [, ].
To address this problem, *test-time adaptation (TTA)* [] has been studied.
TTA aims at adapting a model pre-trained in a source domain (training environment) to the target domain (test environment) with only unlabeled target data.
However, most of the existing TTA methods are designed for classification; that is, TTA for regression has not been explored much [].
Regarding TTA for classification, two main approaches have been explored: entropy minimization and feature alignment.

The entropy minimization approach was introduced by Wang et al. [], and the subsequent methods follow this approach [, , , , ].
Although entropy is a promising proxy of the performance on the target domain, entropy minimization is classification-specific because it assumes that a model directly outputs predictive distributions, *i.e*., a probability for each class.
In contrast, typical regression models output only single scalar values, not distributions.
Thus, we cannot use the entropy minimization approach for regression models.

Another approach, the feature alignment, preliminarily computes the statistics of intermediate features of the source dataset after pre-training in the source domain [, , , , ].
Then, upon moving to the target domain, the feature distribution of the target data is aligned with the source distribution by matching the
target feature statistics with the pre-computed source ones without accessing the source dataset.
Although this approach seems applicable to regression because it allows arbitrary forms of the model output, it assumes to use all feature dimensions to be aligned, and does not sufficiently consider the nature of regression tasks.
For instance, regression models trained with standard mean squared error (MSE) loss tend to make features less diverse than classification models do [].
In particular, we experimentally observed that the features of a trained regression model are distributed in only a small subspace of the entire feature space (Tab. 1).
In this sense, naively aligning all feature dimensions makes the performance suboptimal or even be harmful in regression as shown in Tab. 1 because it equally treats important feature dimensions and degenerated unused ones.

In this paper, we address TTA for regression on the basis of the feature alignment approach.
To resolve the aforementioned feature alignment problem in TTA for regression, we propose *Significant-subspace Alignment (SSA)*.
SSA consists of two components: *subspace detection* and *dimension weighting*.
Subspace detection uses principal component analysis (PCA) to find a subspace of the feature space in which the features are concentrated.
This subspace is representative and significant to the model output.
Then, we perform feature alignment within this subspace, which improves the effectiveness and stability of TTA by focusing only on valid feature dimensions in the subspace.
Further, in regression, a feature vector is finally projected onto a one-dimensional line so as to output a scalar value.
Thus, the subspace dimensions that have an effect on the line need a precise feature alignment.
To do so, dimension weighting raises the importance of the subspace dimensions with respect to their effect on the output.

We conducted experiments on various regression tasks, such as UTKFace [], Biwi Kinect [], and California Housing [].
The results showed that our SSA retains the important feature subspace during TTA and outperforms existing TTA baselines that were originally designed for classification by aligning the feature subspace.

**Table 1: Number of valid (having non-zero variance) feature dimensions and feature subspace dimensions (*i.e*., the rank of the feature covariance matrix), and $R^{2}$ scores on the test datasets. Although the original feature space has 2048 dimensions in the experiment except for the California Housing dataset, the features of the regression models are distributed within the subspaces that have less than a hundred dimensions. Our method improves $R^{2}$ scores by the feature subspace in most cases, whereas the naive feature alignment sometimes diverged (displayed as ‘-’) because of too few valid dimensions. See Sec. 4.3.1 for more details.**
|  |  |  | $R^{2}$ ($\uparrow$) |  |  |
| --- | --- | --- | --- | --- | --- |
| Dataset | #Valid dims | #Subspace dims. | Source | Naive feature alignment | SSA (ours) |
| SVHN | 353 | 14 | $0.406$ | - | $\mathbf{{0.511}}$ |
| UTKFace | 2041 | 76 | $0.020$ | ${{0.705}}$ | $\mathbf{{0.731}}$ |
| Biwi Kinect (mean) | 713 | 34.5 | $0.706$ | $0.753$ | $\mathbf{0.778}$ |
| California Housing (100 dims.) | 45 | 40 | $0.605$ | - | $\mathbf{{0.639}}$ |

## 2 Problem Setting

We consider a setting with a neural network regression model $f_{\theta}:\mathcal{X}\to\mathbb{R}$ pre-trained on a
labeled source dataset $\mathcal{S}=\{(\mathbf{x}_{i}^{\text{s}},y_{i}^{\text{s}})\in\mathcal{X}\times
\mathbb{R}\}_{i=1}^{N_{\text{s}}}$, where $\mathbf{x}_{i}^{\text{s}}$ and $y_{i}^{\text{s}}$ are an input and its label, and $\mathcal{X}$ is the input space.
Our goal is to adapt $f_{\theta}$ to the target domain by using an unlabeled target dataset $\mathcal{T}=\{\mathbf{x}_{i}^{\text{t}}\in\mathcal{X}\}_{i=1}^{N_{\text{t}}}$ without accessing $\mathcal{S}$.
Note that the target labels
$y_{i}^{\text{t}}\in\mathbb{R}$ are not available.
In the source dataset $\mathcal{S}$, the data $\{(\mathbf{x}_{i}^{\text{s}},y_{i}^{\text{s}})\}$ are sampled from the source distribution $p_{\text{s}}$ over $\mathcal{X}\times\mathbb{R}$.
In the target dataset $\mathcal{T}$, we assume covariate shift [], which is a distribution shift that often occurs in the real world.
In other words, the target data $\mathbf{x}_{i}^{\text{t}}$ are sampled from the target distribution $p_{\text{t}}$ over $\mathcal{X}$ that is different from $p_{\text{s}}$, but the predictive distribution is the same, *i.e*., $p_{\text{s}}(\mathbf{x})\neq p_{\text{t}}(\mathbf{x})$ and $p_{\text{s}}(y|\mathbf{x})=p_{\text{t}}(y|\mathbf{x})$.

We split the regression model $f_{\theta}$ into a feature extractor $g_{\phi}:\mathcal{X}\to\mathbb{R}^{D}$ and linear regressor $h_{\psi}(\mathbf{z})=\mathbf{w}^{\top}\mathbf{z}+b$, where $D$ is the number of feature dimensions, $\mathbf{w}\in\mathbb{R}^{D}$, $b\in\mathbb{R}$, $\phi$ and $\psi=(\mathbf{w},b)$ are the parameters of the models.
The whole regression model using the feature extractor and linear regressor is denoted by $f_{\theta}=h_{\psi}\circ g_{\phi}$, where $\theta=(\phi,\psi)$.

## 3 Test-time Adaptation for Regression

Figure: Figure 1: Overview of significant-subspace alignment (SSA).
Overview of significant-subspace alignment (SSA).: x1.png

In this section, we describe the basic idea behind *Significant-subspace Alignment (SSA)* in Sec. 3.1 and describe it in detail in Sec. 3.2.
Our method can be applied regardless of the form of input data since SSA does not rely on input-specific method, such as image data augmentations or self-supervised tasks.

### 3.1 Basic Idea: Feature Alignment

The basic idea of our TTA method for regression is to align the feature distributions of the source and target domains instead of using entropy minimization, as usually done in TTA for classification.
As we assume a covariate shift where the input distribution changes, we update the feature extractor $g_{\phi}$ to pull back the target feature distribution to the source one.
Here, we describe a naive implementation of the idea and its problem.

First, in the source domain, we compute the source feature statistics (mean and variance of each dimension) on $\mathcal{S}$ after the source training:

$$ $\displaystyle\bm{\mu}^{\text{s}}$ $\displaystyle=\frac{1}{N_{\text{s}}}\sum_{i=1}^{N_{\text{s}}}\mathbf{z}_{i}^{ \text{s}},$ (1) $\displaystyle\bm{\sigma}^{\text{s~{}2}}$ $\displaystyle=\frac{1}{N_{\text{s}}}\sum_{i=1}^{N_{\text{s}}}(\mathbf{z}_{i}^{ \text{s}}-\bm{\mu}^{\text{s}})\odot(\mathbf{z}_{i}^{\text{s}}-\bm{\mu}^{\text{ s}}),$ (2) $$

where $\mathbf{z}_{i}^{\text{s}}=g_{\phi}(\mathbf{x}_{i}^{\text{s}})\in\mathbb{R}^{D}$ is a source feature and $\odot$ is the element-wise product.

Then, we move to the target domain, where we cannot access the source dataset $\mathcal{S}$.
Given a target mini-batch $\mathcal{B}=\{\mathbf{x}_{i}^{\text{t}}\}_{i=1}^{B}$ sampled from $\mathcal{T}$, we compute the mini-batch mean and variance $\hat{\bm{\mu}}^{\text{t}}$ and $\hat{\bm{\sigma}}^{\text{t~{}2}}$ analogously to Eqs. 1 and 2.

For feature alignment, we seek to make the target statistics similar to the source ones.
For this purpose, we use the KL divergence as Nguyen et al. [] proved that it is included in an upper bound of the target error in unsupervised domain adaptation.
Concretely, we minimize the KL divergence between two diagonal Gaussian distributions $\mathcal{N}(\bm{\mu}^{\text{s}},{\bm{\sigma}^{\text{s~{}2}}})$ and $\mathcal{N}(\hat{\bm{\mu}}^{\text{t}},\hat{\bm{\sigma}}^{\text{t~{}2}})$:

$$ $\displaystyle\mathcal{L}_{\text{TTA}}(\phi)$ $\displaystyle=\sum_{d=1}^{D}D_{\text{KL}}\left(\mathcal{N}(\mu_{d}^{\text{s}}, {{\sigma}_{d}^{\text{s}}}^{2})\|\mathcal{N}(\hat{\mu}_{d}^{\text{t}},{\hat{{ \sigma}}_{d}^{\text{t~{}2}}})\right)$ $\displaystyle\hskip 17.50002pt+D_{\text{KL}}\left(\mathcal{N}(\hat{\mu}_{d}^{ \text{t}},{\hat{{\sigma}}_{d}^{\text{t~{}2}}})\|\mathcal{N}(\mu_{d}^{\text{s}} ,{{\sigma}_{d}^{\text{s}}}^{2})\right),$ (3) $$

where the subscripts $d$ represent the $d$-th elements of the mean and variance vectors.
Here, we used both directions of the KL divergence because it empirically had good results as recommended by Nguyen et al. [].
The KL divergence between two univariate Gaussians can be written in a closed form []

$$ $\displaystyle D_{\text{KL}}$ $\displaystyle\left(\mathcal{N}(\mu_{1},\sigma_{1}^{2})\|\mathcal{N}(\mu_{2}, \sigma_{2}^{2})\right)$ $\displaystyle\hskip 30.00005pt=\frac{1}{2}\left[\log\frac{\sigma_{2}^{2}}{ \sigma_{1}^{2}}+\frac{(\mu_{1}-\mu_{2})^{2}+\sigma_{1}^{2}}{\sigma_{2}^{2}}-1 \right].$ (4) $$

However, in regression models, the features tend to be less diverse than in classification [].
In addition to the insight from Zhang et al. [], we observed that the features of a regression model trained on $\mathcal{S}$ are distributed in only a small subspace of the feature space and many dimensions of the feature space had zero variances.
Tab. 1 shows the numbers of valid (having non-zero variance) feature dimensions and feature subspace dimensions (see Sec. 4.3.1 for more details).
This property makes the naive feature alignment described above unstable since the KL divergence in Eq. 4 includes the variance in the denominator.
Also, this naive feature alignment is ineffective because many of the feature dimensions have a small effect on the subspace.

### 3.2 Significant-subspace Alignment

In this section, we describe our method, Significant-subspace Alignment (SSA), to tackle the aforementioned problem of naive feature alignment.
Fig. 1 shows an overview of SSA.
As described in Sec. 3.1, the features of a regression model tend to be distributed in a small subspace of the feature space.
Thus, we introduce *subspace detection* to detect a subspace that is representative and significant to the output and then perform feature alignment in the subspace.
Subspace detection is similar to principal component analysis (PCA).
Further, in our regression model, a feature $\mathbf{z}=g_{\phi}(\mathbf{x})$ is projected onto a one-dimensional line determined by $\mathbf{w}$ of $h_{\psi}$ in order to output a scalar value $\mathbf{w}^{\top}\mathbf{z}+b$.
Thus, a subspace basis $\mathbf{v}^{\text{s}}_{d}$ whose direction is not orthogonal to $\mathbf{w}$ needs precise feature alignment.
We use *dimension weighting* to prioritize such dimensions.

Subspace detection. After the training on the source dataset $\mathcal{S}$, we detect the subspace in which the source features are distributed.
Instead of computing the variance of each dimension as Eqs. 1 and 2, we compute the covariance matrix:

$$ $\bm{\Sigma}^{\text{s}}=\frac{1}{N_{\text{s}}}\sum_{i=1}^{N_{\text{s}}}(\mathbf {z}_{i}^{\text{s}}-\bm{\mu}^{\text{s}})(\mathbf{z}_{i}^{\text{s}}-\bm{\mu}^{ \text{s}})^{\top},$ (5) $$

where the source mean vector $\bm{\mu}^{\text{s}}$ is the same as Eqs. 1 and 2.

Then, we detect the source subspace.
On the basis of PCA, the subspace is spanned by the eigenvectors of the covariance matrix $\bm{\Sigma}^{\text{s}}$, denoted by $\mathbf{v}_{k}^{\text{s}}$ ($\|\mathbf{v}_{k}^{\text{s}}\|_{2}=1$).
The corresponding eigenvalues $\lambda_{k}^{\text{s}}$ represent the variance of the source features along the direction $\mathbf{v}_{k}^{\text{s}}$.
We use the top-$K$ largest eigenvalues $\lambda_{1}^{\text{s}},\ldots,\lambda_{K}^{\text{s}}~{}(\lambda_{1}^{\text{s}}
>\cdots>\lambda_{K}^{\text{s}})$, the corresponding source bases $\mathbf{v}_{1}^{\text{s}},\ldots,\mathbf{v}_{K}^{\text{s}}$, and the source mean $\bm{\mu}^{\text{s}}$ as the source statistics.

Dimension weighting.
Since we assume that the output is computed with a linear regressor $h_{\psi}(\mathbf{z})=\mathbf{w}^{\top}\mathbf{z}+b$,
the effect of a subspace dimension $\mathbf{v}^{\text{s}}_{d}$ to the output is determined by $\mathbf{w}^{\top}\mathbf{v}^{\text{s}}_{d}$.
To prioritize the subspace dimensions that have larger effect on the output,
we determine the weight of each subspace dimension as follows:

$$ $\alpha_{d}=1+|\mathbf{w}^{\top}\mathbf{v}^{\text{s}}_{d}|.$ (6) $$

$\alpha_{d}$ assigns a larger weight when the direction along a subspace basis $\mathbf{v}_{d}^{\text{s}}$ affects the output, or keep the weight to one when not.

Feature alignment. This step is done in the target domain.
Given a target mini-batch $\mathcal{B}$ sampled from the target dataset $\mathcal{T}$, we project the target features $\mathbf{z}_{i}^{\text{t}}=g_{\phi}(\mathbf{x}_{i}^{\text{t}})$ into the source subspace and then compute the feature alignment loss.
The projection of the target feature is computed as follows:

$$ $\tilde{\mathbf{z}}_{i}^{\text{t}}=\mathbf{V}^{\text{s}}(\mathbf{z}_{i}^{\text{ t}}-\bm{\mu}^{\text{s}}),$ (7) $$

where $\mathbf{V}^{\text{s}}=[\mathbf{v}_{1}^{\text{s}},\ldots,\mathbf{v}_{K}^{\text{
s}}]^{\top}\in\mathbb{R}^{K\times D}$.
With $\tilde{\mathbf{z}}^{\text{t}}_{i}\in\mathbb{R}^{K}$, we compute the projected target mean and variance over the mini-batch analogously to Eqs. 1 and 2; this is denoted by ${\tilde{\bm{\mu}}^{\text{t}}}$ and $\tilde{\bm{\sigma}}^{\text{t~{}2}}$.
On the other hand, the projected source mean and variance are $\mathbf{0}$ and the eigenvalues $\bm{\lambda}^{\text{s}}=[\lambda_{1}^{\text{s}},\ldots,\lambda_{K}^{\text{s}}]$ since $\bm{\Sigma^{\text{s}}}\mathbf{v}_{k}^{\text{s}}=\lambda^{\text{s}}_{k}\mathbf{
v}_{k}^{\text{s}}$.
Thus, the KL divergence in the detected subspace is computed between two $K$-dimensional diagonal Gaussians $\mathcal{N}(\mathbf{0},\bm{\lambda}^{\text{s}})$ and $\mathcal{N}({\tilde{\bm{\mu}}^{\text{t}}},\tilde{\bm{\sigma}}^{\text{t~{}2}})$.
Using subspace detection and dimension weighting, the loss of SSA is:

$$ $\displaystyle\mathcal{L}_{\text{TTA}}(\phi)$ $\displaystyle=\sum_{d=1}^{K}\alpha_{d}\left\{D_{\text{KL}}\left(\mathcal{N}(0, \lambda_{d}^{\text{s}})\|\mathcal{N}({\tilde{\mu}_{d}^{\text{t}}},{\tilde{ \sigma}_{d}^{\text{t~{}2}}})\right)\right.$ $\displaystyle\hskip 37.00002pt\left.+D_{\text{KL}}\left(\mathcal{N}({\tilde{ \mu}_{d}^{\text{t}}},{\tilde{\sigma}_{d}^{\text{t~{}2}}})\|\mathcal{N}(0, \lambda_{d}^{\text{s}})\right)\right\}$ $\displaystyle=\frac{1}{2}\sum_{d=1}^{K}\alpha_{d}\left(\frac{({\tilde{\mu}_{d} ^{\text{t}}})^{2}+\lambda_{d}^{\text{s}}}{\tilde{\sigma}_{d}^{\text{t~{}2}}}+ \frac{({\tilde{\mu}_{d}^{\text{t}}})^{2}+{\tilde{\sigma}_{d}^{\text{t~{}2}}}}{ \lambda_{d}^{\text{s}}}-2\right).$ (8) $$

During TTA, we optimize the feature extractor $g_{\phi}$ to minimize $\mathcal{L}_{\text{TTA}}$, *i.e*., we seek $\phi^{*}=\min_{\phi}\mathcal{L}_{\text{TTA}}(\phi)$.
We update only the affine parameters $\gamma$ and $\beta$ of the normalization layers such as batch normalization [] or layer normalization [] inspired by Tent [].
This strategy is effective not only to avoid forgetting the source knowledge but also to enable flexible adaptation [, ].
The procedure of SSA is listed in Algorithm 1 of the Appendix.

## 4 Experiment

This section provides empirical analysis of feature subspaces and experimental evaluations of SSA on various regression tasks.
First, we checked whether the learned features are distributed in a small subspace (Sec. 4.3.1) and then evaluated the regression performance (Secs. 4.3.2 and 4.3.3).
We also analyzed the effect of the TTA methods from the perspective of the feature subspace (Sec. 4.3.4).

### 4.1 Dataset

We used regression datasets with two types of covariate shift, *i.e*., domain shift and image corruption.

SVHN-MNIST. SVHN [] and MNIST [] are famous digit-recognition datasets.
Although they are mainly used for classification, we used them for regression by training models to directly output a scalar value of the label.
We used SVHN and MNIST as the source and target domains, respectively.

UTKFace []. UTKFace is a dataset consisting of face images.
The task is to predict the age of the person in an input image.
For the source model, we trained models on the original UTKFace images.
For the target domain, we added corruptions such as noise or blur to the images.
The types of corruption were the same as those of ImageNet-C [].
We applied 13 types of corruption at the highest severity level of the five levels.

Biwi Kinect []. Biwi Kinect is a dataset consisting of person images.
The task is to predict the head pose of the person in an input image in terms of pitch, yaw, and roll angles.
We separately trained models to predict each angle.
The source and target domains are the gender of the person in the image.
We conducted experiments on six combinations of the source/target gender and task, *i.e*., {male $\rightarrow$ female, female $\rightarrow$ male} $\times$ {pitch, yaw, roll}.
We trained regression models to directly output head pose angles in radian, which are roughly in $(-0.4\pi,0.4\pi)$.

California Housing []. California Housing is a tabular dataset aiming at predicting housing prices from the information of areas.
We split the dataset into non-coastal and coastal areas for the source and target domains in accordance with He et al. [].

More details of the datasets are provided in Sec. C.1.

### 4.2 Setting

Source model. We used ResNet-26 [] for SVHN, ResNet-50 for UTKFace and Biwi Kinect, and an MLP for California Housing.
We modified the last fully-connected layer to output single scalar values and trained the models with the standard MSE loss on each dataset and task.
The details of the training are provided in Appendix C.

Test-time adaptation with SSA (ours). We minimized $\mathcal{L}_{\text{TTA}}$ on the target datasets.
We used the outputs of the penultimate layer of the model as features, which had 2048 dimensions.
We set the number of dimensions of the feature subspace to $K=100$ as the default throughout the experiments.
More detailed settings are provided in Sec. C.3.

Baseline. Since there are no TTA baselines designed for regression, we compared SSA with TTA methods designed for classification but can be naively modified to regression: *Source* (no adaptation), *BN-adapt* [], *Feature restoration (FR)* [], *Prototype*, *Variance minimization (VM)*, and *RSD* [].
In addition, we used the following methods other than TTA as baselines: *test-time training (TTT)* [], *DANN* [], and *Oracle* (fine-tuning using labels; performance upper bound).
The details of the baseline methods are described in Sec. C.3.

### 4.3 Results

#### 4.3.1 Number of Dimensions of the Feature Subspace

After the pre-training on the source dataset, we counted the numbers of valid feature dimensions (*i.e*., having non-zero variances) and dimensions of the feature subspace in which the source features are distributed.
The latter value corresponds to the rank of the covariance matrix of the source features in Eq. 5.
Tab. 1 shows the result of each source dataset and regression
test $R^{2}$ scores.
Although the number of feature dimensions is 2048 in ResNet, many feature dimensions of the regression models have zero variance because of ReLU activation.
This is the cause of the failure of the naive feature alignment, as described in Sec. 3.1.
Moreover, the source features are distributed in only a small subspace with fewer than a hundred dimensions.
In the California Housing dataset, we can also see the same tendency that the number of the subspace dimensions is only 40 whereas the number of the entire feature dimensions is 100.
This property limits the performance of the naive feature alignment in regression since aligning the entire feature space is ineffective to the subspace in which the features are actually distributed.

#### 4.3.2 Regression Performance

**Table 2: Test $R^{2}$ score (higher is better) and RMSE (lower is better) on SVHN-MNIST. The best scores are bolded.**
| Method | $R^{2}~{}(\uparrow)$ | RMSE ($\downarrow$) |
| --- | --- | --- |
| Source | ${0.406}$ | ${2.232}$ |
| DANN | ${0.307_{\pm 0.09}}$ | ${2.406_{\pm 0.16}}$ |
| TTT | ${0.288_{\pm 0.02}}$ | ${2.443_{\pm 0.03}}$ |
| BN-adapt | ${0.396_{\pm 0.00}}$ | ${2.251_{\pm 0.01}}$ |
| Prototype | ${0.491_{\pm 0.00}}$ | ${2.065_{\pm 0.01}}$ |
| FR | ${0.369_{\pm 0.01}}$ | ${2.300_{\pm 0.02}}$ |
| VM | ${-685_{\pm 27.6}}$ | ${75.83_{\pm 1.52}}$ |
| RSD | ${0.312_{\pm 0.08}}$ | ${2.397_{\pm 0.15}}$ |
| SSA (ours) | $\mathbf{0.511_{\pm 0.03}}$ | $\mathbf{2.024_{\pm 0.06}}$ |
| Oracle | ${0.874_{\pm 0.00}}$ | ${1.028_{\pm 0.00}}$ |

**Table 3: Test $R^{2}$ score and RMSE on California Housing.**
| Method | $R^{2}~{}(\uparrow)$ | RMSE ($\downarrow$) |
| --- | --- | --- |
| Source | ${0.605}$ | ${0.684}$ |
| BN-adapt | ${0.318_{\pm 0.00}}$ | ${0.899_{\pm 0.00}}$ |
| Prototype | ${-0.726_{\pm 0.01}}$ | ${1.431_{\pm 0.00}}$ |
| FR | ${0.510_{\pm 0.01}}$ | ${0.762_{\pm 0.01}}$ |
| RSD | - | - |
| SSA (ours) | $\mathbf{0.639_{\pm 0.00}}$ | $\mathbf{0.655_{\pm 0.00}}$ |
| Oracle | ${0.729_{\pm 0.00}}$ | ${0.567_{\pm 0.00}}$ |

We evaluated the regression performance
in terms of the $R^{2}$ score (coefficient of determination), which is widely used in regression tasks (see Appendix B).
Tabs. 2 and 3 show the scores for the SVHN-MNIST and California Housing.
In the both cases, SSA outperformed the baselines; some of them even underperformed the Source.
This is because the baselines were designed for classification tasks and they broke the feature subspaces learned by the source model (see Sec. 4.3.4).
On the other hand, RSD [] is originally designed for regression in UDA but did not work in the California Housing dataset because of numerical instability of SVD performed on every target feature batch.
In contrast, our method is stable since it avoids degenerated dimensions during TTA.
Tab. 4 shows the $R^{2}$ scores on the UTKFace with image corruption.
We can see that SSA had the highest $R^{2}$ scores for most of the corruption types.
In particular, SSA outperformed the baselines by a large margin on noise-type corruption which significantly degraded the performance of Source.
Tab. 5 shows the $R^{2}$ scores on Biwi Kinect with genders different from the source domains.
SSA constantly had higher $R^{2}$ scores than the baselines; the baselines’ scores sometimes significantly dropped or even diverged (Prototype).
In summary, SSA consistently improved the scores whereas the baselines sometimes even underperformed Source.
Moreover, SSA worked well not only on image data but also tabular data.

**Table 4: Test $R^{2}$ scores on UTKFace with image corruption. The best scores are bolded.**
| Method | Defocus<br>blur | Motion<br>blur | Zoom<br>blur | Contrast | Elastic<br>transform | Jpeg<br>comp. | Pixelate | Gaussian<br>noise | Impulse<br>noise | Shot<br>noise | Brightness | Fog | Snow | Mean |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Source | $0.410$ | $0.159$ | $0.658$ | $-3.906$ | $0.711$ | $0.069$ | $0.595$ | $-2.536$ | $-2.539$ | $-2.522$ | $0.661$ | $-0.029$ | $-0.544$ | $-0.678$ |
| DANN | $0.512$ | $0.586$ | $0.637$ | $-0.720$ | $0.729$ | $0.698$ | $0.807$ | $-4.341$ | $-3.114$ | $-3.744$ | $0.590$ | $-0.131$ | $-0.425$ | $-0.609$ |
| TTT | $0.748$ | $0.761$ | $0.773$ | $0.778$ | $0.826$ | $0.772$ | $0.861$ | $0.525$ | $0.532$ | $0.477$ | $0.775$ | $0.397$ | $0.493$ | $0.671$ |
| BN-Adapt | $0.727$ | $0.759$ | $0.763$ | $0.702$ | $0.826$ | $0.778$ | $0.850$ | $0.510$ | $0.510$ | $0.446$ | $0.790$ | $0.392$ | $0.452$ | $0.654$ |
| Prototype | $-1.003$ | $-1.020$ | $-1.016$ | $-0.719$ | $-0.967$ | $-0.908$ | $-0.974$ | $-0.514$ | $-0.512$ | $-0.512$ | $-1.004$ | $-0.823$ | $-0.822$ | $-0.830$ |
| FR | $0.794$ | $\mathbf{0.839}$ | $0.849$ | $0.756$ | $\mathbf{0.899}$ | $0.825$ | $\mathbf{0.946}$ | $0.509$ | $0.522$ | $0.458$ | $0.861$ | $0.408$ | $0.428$ | $0.700$ |
| VM | $-2.009$ | $-1.991$ | $-2.037$ | $-1.889$ | $-1.918$ | $-1.918$ | $-1.751$ | $-2.181$ | $-2.207$ | $-2.176$ | $-1.927$ | $-2.250$ | $-2.197$ | $-2.035$ |
| RSD | $0.789$ | $0.833$ | $0.851$ | $0.749$ | $0.897$ | $0.825$ | $0.941$ | $0.502$ | $0.503$ | $0.445$ | $0.862$ | $0.419$ | $0.500$ | $0.701$ |
| SSA (ours) | $\mathbf{0.803}$ | $\mathbf{0.839}$ | $\mathbf{0.851}$ | $\mathbf{0.792}$ | $\mathbf{0.899}$ | $\mathbf{0.829}$ | ${0.943}$ | $\mathbf{0.580}$ | $\mathbf{0.592}$ | $\mathbf{0.560}$ | $\mathbf{0.863}$ | $\mathbf{0.440}$ | $\mathbf{0.517}$ | $\mathbf{0.731}$ |
| Oracle | $0.856$ | $0.890$ | $0.889$ | $0.862$ | $0.917$ | $0.873$ | $0.960$ | $0.635$ | $0.652$ | $0.635$ | $0.895$ | $0.519$ | $0.671$ | $0.789$ |

**Table 5: Test $R^{2}$ scores on Biwi Kinect. The best scores are bolded.**
|  | Female $\rightarrow$ Male | Male $\rightarrow$ Female |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Method | Pitch | Roll | Yaw | Pitch | Roll | Yaw | Mean |
| Source | $0.759$ | $0.956$ | $0.481$ | $0.763$ | $0.791$ | $0.485$ | $0.706$ |
| DANN | $0.698_{\pm 0.03}$ | $0.826_{\pm 0.03}$ | $-0.039_{\pm 0.08}$ | $0.711_{\pm 0.01}$ | $0.850_{\pm 0.01}$ | $0.076_{\pm 0.05}$ | $0.520_{\pm 0.02}$ |
| TTT | $-0.062_{\pm 0.20}$ | $0.606_{\pm 0.00}$ | $0.031_{\pm 0.02}$ | $0.750_{\pm 0.00}$ | $0.725_{\pm 0.00}$ | $-0.321_{\pm 0.00}$ | $0.288_{\pm 0.03}$ |
| BN-adapt | $0.771_{\pm 0.00}$ | $0.953_{\pm 0.00}$ | $0.493_{\pm 0.01}$ | $0.832_{\pm 0.00}$ | $0.842_{\pm 0.00}$ | $\mathbf{0.585_{\pm 0.00}}$ | $0.746_{\pm 0.00}$ |
| Prototype | $-318_{\pm 0.00}$ | - | - | - | - | - | - |
| FR | $-1.27_{\pm 0.70}$ | $0.742_{\pm 0.05}$ | $-2.69_{\pm 0.79}$ | $0.622_{\pm 0.06}$ | $0.855_{\pm 0.01}$ | $-0.406_{\pm 0.30}$ | $-0.357_{\pm 0.23}$ |
| VM | $-0.302_{\pm 0.00}$ | $-0.062_{\pm 0.00}$ | $-0.089_{\pm 0.00}$ | $-0.101_{\pm 0.01}$ | $-0.045_{\pm 0.00}$ | $0.001_{\pm 0.00}$ | $-0.100_{\pm 0.00}$ |
| RSD | $0.783_{\pm 0.02}$ | $0.954_{\pm 0.00}$ | $0.489_{\pm 0.02}$ | $0.832_{\pm 0.00}$ | $0.846_{\pm 0.01}$ | - | - |
| SSA (ours) | $\mathbf{0.860_{\pm 0.00}}$ | $\mathbf{0.962_{\pm 0.00}}$ | $\mathbf{0.513_{\pm 0.01}}$ | $\mathbf{0.869_{\pm 0.00}}$ | $\mathbf{0.886_{\pm 0.00}}$ | $0.575_{\pm 0.00}$ | $\mathbf{0.778_{\pm 0.00}}$ |
| Oracle | $0.966_{\pm 0.00}$ | $0.981_{\pm 0.00}$ | $0.804_{\pm 0.00}$ | $0.959_{\pm 0.00}$ | $0.970_{\pm 0.00}$ | $0.811_{\pm 0.00}$ | $0.915_{\pm 0.00}$ |

#### 4.3.3 Ablation Study

**Table 6: Test $R^{2}$ scores of SSA with and without subspace detection and dimension weighting. Scores averaged over corruption types and gender-task combinations are reported for UTKFace and Biwi Kinect, respectively. The best scores are bolded.**
| Subspace | Weight | SVHN | UTKFace | Biwi Kinect | California |
| --- | --- | --- | --- | --- | --- |
|  |  | ${{0.333}_{\pm 0.04}}$ | ${{0.642}_{\pm 0.27}}$ | ${{0.672}_{\pm 0.24}}$ | ${{0.626}_{\pm 0.01}}$ |
| ✓ |  | ${{0.508}_{\pm 0.04}}$ | ${{0.728}_{\pm 0.16}}$ | ${{0.778}_{\pm 0.17}}$ | ${{0.633}_{\pm 0.00}}$ |
| ✓ | ✓ | $\mathbf{{0.511}_{\pm 0.03}}$ | $\mathbf{{0.731}_{\pm 0.16}}$ | $\mathbf{{0.778}_{\pm 0.17}}$ | $\mathbf{{0.639}_{\pm 0.00}}$ |
| Source | ${0.406}$ | ${0.020}$ | ${0.706}$ | ${0.605}$ |  |

We investigated the effect of subspace detection and dimension weighting by running SSA with and without them.
For the SSA variant without subspace detection (*i.e*., naively aligning the entire feature space), we simply selected the top-$K$ feature dimensions that had the largest variances.
In this case, we directly used the weight of the linear regressor $h_{\psi}$ to compute the dimension weight $\alpha_{d}$ as $\alpha_{d}=1+|w_{d}|$ instead of Eq. 6.
Tab. 6 shows the test $R^{2}$ scores with and without subspace detection and dimension weighting on each dataset.
Without subspace detection, the scores were worse than Source on MNIST and Biwi Kinect, and of the same level as simple baselines like BN-adapt [] on UTKFace (Tab. 4).
In contrast, subspace detection significantly improved the scores on all three datasets.
Dimension weighting also improved the scores, although the gain was smaller than in the case of subspace detection.
This is because the variance of the feature subspace dimension correlates with the weight; *i.e*.,
the top-$K$ selected dimensions with respect to variance tended to have high importance to the output.
Tab. 7 lists the correlation coefficients between the top $K=100$ variances of the source features along the source bases $\lambda_{d}^{\text{s}}$ and the corresponding dimension weight $\alpha_{d}$.
We can see that there are strong correlations in the three datasets we used.
But we can expect that dimension weighting can raise the importance of the feature dimensions that have low variance but affect the output, which further improves regression performance.

**Table 7: Correlation coefficients between the top $K=100$ variances of source features along the source bases $\lambda^{\text{s}}_{d}$ and weight $\alpha_{d}$ in Eq. 6.**
| Dataset | SVHN | UTKFace | Biwi Kinect<br>(Female, Pitch) |
| --- | --- | --- | --- |
| Correlation | 0.787 | 0.917 | 0.782 |

Next, we investigated the effect of the number of feature subspace dimensions $K$.
We varied $K$ within $\{10,25,50,$ $75,100,200,400,1000,2048\}$.
Tab. 8 shows the test $R^{2}$ scores.
Although the best $K$ differs among the datasets, $K=100$ consistently produced competitive results.
With increasing $K$, the best or competitive scores were when $K$ was close to the number of the subspace dimensions in Tab. 1.
This indicates the importance of the subspace feature alignment.
When $K\geq 400$ in MNIST and $K\geq 1000$ in Biwi Kinect, the loss became unstable or diverged because SSA attempted to align too many degenerated feature dimensions.
In contrast, although setting $K\geq 1000$ gave the good scores on UTKFace, $K=100$ produced a competitive score.
Sec. D.4 provides the results for California Housing, which we observed the same tendency with the other three datasets.
From these results, although $K$ is a hyperparameter, we can determine $K$ before accessing the test dataset by calculating the number of the source feature subspace dimensions.

**Table 8: Test $R^{2}$ scores of SSA for different numbers of feature subspace dimensions $K$. The best scores are bolded.**
| $K$ | MNIST | UTKFace | Biwi Kinect |
| --- | --- | --- | --- |
| 10 | ${0.494}$ | ${0.693}$ | ${0.688}$ |
| 25 | $\mathbf{0.538}$ | ${0.717}$ | ${0.761}$ |
| 50 | ${0.524}$ | ${0.728}$ | ${0.767}$ |
| 75 | ${0.516}$ | $\mathbf{0.732}$ | ${0.774}$ |
| 100 | ${0.511}$ | ${0.731}$ | $\mathbf{0.778}$ |
| 200 | ${0.496}$ | ${0.731}$ | ${0.771}$ |
| 400 | - | ${0.731}$ | ${0.755}$ |
| 1000 | - | $\mathbf{0.732}$ | - |
| 2048 | - | ${0.725}$ | - |

#### 4.3.4 Feature Subspace Analysis

Feature reconstruction.
To verify that the reason why the baseline methods degrade the regression performance is that they affect the feature subspace learned by the source model as mentioned in Sec. 4.3.2, we examined the reproducibility of the target features with the source bases $\mathbf{V}^{\text{s}}$ after TTA.
That is, the target features can be represented by a linear combination of the source bases if the model retains the source subspace throughout TTA and the target features fit within the subspace.
To measure this quantitatively, we computed the reconstruction error $L$ as the Euclidean distance between a target feature vector $\mathbf{z}^{\text{t}}$ and $\mathbf{z}_{\text{r}}^{\text{t}}$, the one reconstructed with $n$ source bases:

$$ $\displaystyle L$ $\displaystyle=\|\mathbf{z}_{\text{r}}^{\text{t}}-\mathbf{z}^{\text{t}}\|_{2},$ (9) $\displaystyle\mathbf{z}_{\text{r}}^{\text{t}}$ $\displaystyle=\bm{\mu}^{\text{s}}+\sum_{d=1}^{n}((\mathbf{z}^{\text{t}}-\bm{ \mu}^{\text{s}})^{\top}\mathbf{v}^{\text{s}}_{d})\mathbf{v}^{\text{s}}_{d},$ (10) $$

where $\mathbf{z}^{\text{t}}$ is a target feature vector extracted with the model after TTA, and $n$ is the number of dimensions of the source subspace listed in Tab. 1.

Figure: Figure 2: Reconstruction error of features reconstructed with the source bases relative to the original target features. Note that Source and Prototype are the same, since Prototype does not update the feature extractor of the model. FR [] and VM are not plotted in (a) because they had huge errors.
Reconstruction error of features reconstructed with the source bases relative to the original target features (SVHN).: x2.png

Fig. 2 plots the reconstruction error $L$ versus $n$ on the three datasets.
The error decreased as $n$ increased for all methods, but SSA reduced the error with a smaller $n$ than in those of the baselines, indicating that it could make the target features fit within the source subspace.
Especially in the case of Biwi Kinect (c), the baseline methods produced larger errors than Source; *i.e*., they broke the learned subspace.

In terms of feature alignment, Fig. 4 in Sec. D.2 visualizes and evaluates the feature gap between the domains in the subspace.

Another effect of subspace detection.
Subspace detection has another effect on feature alignment.
We used the KL divergence between two diagonal Gaussian distributions in Eq. 4 to measure the distribution gap between the source and target features, under the assumption that the features follow a Gaussian distribution.
Here, while it is not clear that the assumption actually holds especially when features are output through activation functions like ReLU as in ResNet, we argue that the subspace detection of SSA has, in addition to an effective feature alignment, the effect of making such features follow a distribution close to a Gaussian.

Figure: Figure 3: Histograms of three randomly selected target feature dimension. Left: Original features. Right: Projected features.
Histograms of three randomly selected target feature dimensions on SVHN-MNIST.: x5.png

We visualized the histograms of the target features $\mathbf{z}_{i}^{\text{t}}$ extracted with the source model and ones projected to the source subspace with Eq. 7.
Fig. 3 show the histograms of three randomly selected dimensions of the original and projected features of the three datasets.
In the left column of each figure, the histograms of the original features concentrate on zero because of the ReLU activation and do not follow a Gaussian distribution, which makes the KL divergence computation with Eq. 4 inaccurate.
On the other hand, the histograms of the projected features in the right columns are close to Gaussians.
Thus, subspace detection makes it easier to align the features with the Gaussian KL divergence.

The reason why the projected features follow a Gaussian distribution can be interpreted as follows.
From Eq. 7, the $k$-th element of a projected feature vector $\tilde{z}_{i,k}^{\text{t}}$ is

$$ $\tilde{z}_{i,k}^{\text{t}}=\sum_{d=1}^{D}(z_{i,d}^{\text{t}}-\mu_{d}^{\text{s} })v^{\text{s}}_{k,d}.$ (11) $$

Here, we regard each term $a_{i,d}:=(z_{i,d}^{\text{t}}-\mu_{d}^{\text{s}})v^{\text{s}}_{k,d}$ as a random variable.
Assuming that $a_{i,d}$ is independent of the feature dimension $d$, the central limit theorem guarantees that the distribution of the projected features, *i.e*., the sum of $a_{i,d}$, becomes closer to a Gaussian as the total number of dimensions $D$ increases.

## 5 Related Work

### 5.1 Unsupervised Domain Adaptation

Unsupervised domain adaptation (UDA) has been actively studied as a way to transfer knowledge in the source domain to the target domain [].
Theoretically, it is known that the upper bound of the error on the target domain includes
a distribution gap term between the source and target domains [, , ].
For regression, Cortes and Mohri [] theoretically explored regression UDA.
RSD [] and DARE-GRAM [] take into account that the feature scale matters in regression and explicitly align the feature scale during the feature alignment.
However, UDA requires the source and target datasets to be accessed simultaneously during training, which can be restrictive when datasets cannot be accessed due to privacy or security concerns, or storage limitations.

More recently, source-free domain adaptation (SFDA), which does not access the source dataset during adaptation, has been studied.
The SFDA setting is similar to TTA in that SFDA adapts models with only unlabeled target data.
However, SFDA requires to store the whole target dataset and access the dataset for multiple epochs to train additional models [, , , , ] or perform clustering [].
On the other hand, TTA does not train additional models nor access the target dataset for multiple epochs, which enables instant adaptation with low computational resource and storage.

### 5.2 Test-time Training

Test-time training (TTT) is also similar to TTA as it adapts models with unlabeled target data.
The main difference is that TTT requires to modify the model architecture and training procedure in the source domain.
The main approach of TTT is additionally training an self-supervised branch simultaneously with the main supervised task in the source domain.
Then, during adaptation, the model is updated via minimizing the self-supervised loss on the target data.
On the basis of this approach, TTT methods with various self-supervised tasks have been proposed such as rotation prediction [], contrastive learning [], clustering [], or distribution modeling with normalizing flow [].
However, adding additional losses to the training prohibits the use of off-the-shelf pre-trained models or may potentially affect the performance of the main task.
In contrast, TTA accepts arbitrary training methods in the source domain and thus off-the-shelf-models can be adapted.

### 5.3 Test-time Adaptation

Test-time adaptation (TTA) aims to adapt a model trained on the source domain to the target domain without accessing the source data [].
TTA can be applied in a wider range of situations than SFDA and TTT in that TTA does not train additional models or modify the model architecture and source pre-training.
TTA for classification has attracted attention for its practicality.
Various types of TTA methods have been developed.

Entropy-based.
Wang et al. [] found that the entropy of prediction strongly correlates with accuracy on the target domain and proposed test-time entropy minimization (Tent), which is the most representative of the TTA methods.
BACS [], MEMO [], EATA [] and DELTA [] follow the idea of Tent and improve adaptation performance.
T3A [] adjusts the prototype in the feature space during testing.
However, these TTA methods are designed for classification and cannot be applied to regression.
For instance, computing entropy, which is widely adopted in TTA, requires a predictive probability for each class, whereas ordinary regression models only output a single predicted value.
Thus, we investigate an approach that does not rely on entropy.

Feature alignment.
Another approach of TTA is feature alignment.
It is based on the insight of UDA and makes the target feature distribution close to the source one.
Since accessing the source data is restricted in the TTA setting, methods based on the feature alignment match the statistics of the target features to those of the pre-computed source.
BN-adapt [] updates the feature mean and variance stored in batch normalization (BN) layers [].
DELTA [] modifies BN and introduces class-wise loss re-weighting.
CFA [], BUFR [], CAFe [], and CAFA [] incorporate pre-computed source statistics.
Although some of these methods are directly applicable to regression, we have observed that they are not effective or even degrade regression performance.

Other tasks. TTA for depth estimation [] and super resolution [] are proposed.
But they have task-specific architectures or methods and cannot be applied to ordinary regression.

## 6 Conclusion

We proposed significant-subspace alignment (SSA), a novel test-time adaptation method for regression models.
Since we have found that the naive feature alignment fails in regression TTA because of the learned features being distributed in a small subspace, we incorporated subspace detection and dimension weighting procedures into SSA.
Experimental results show that SSA achieved higher $R^{2}$ scores on various regression tasks than did baselines that were originally designed for classification tasks.
We will extend TTA to further broader tasks in the future.

## Appendix

## Appendix A Limitation

One limitation of SSA is that it assumes a covariate shift, where $p(y|\mathbf{x})$ does not change.
Addressing distribution shifts where $p(y|\mathbf{x})$ changes, *e.g*., concept drift, will be tackled in future work.

## Appendix B Evaluation Metric

We used the $R^{2}$ score (coefficient of determination) to measure the performance of the regression models.
$R^{2}$ is computed as follows:

$$ $R^{2}=1-\frac{\sum_{i=1}^{N}(\hat{y}_{i}-y_{i})^{2}}{\sum_{i=1}^{N}(y_{i}-\bar {y})^{2}},$ (12) $$

where $\hat{y}_{i}$ is a predicted value of the regression model, $y_{i}$ is the ground-truth, and $\bar{y}=(1/N)\sum_{i=1}^{N}y_{i}$ is the mean of the ground truth values.
$R^{2}$ is close to 1 when the regression model is accurate.

## Appendix C Experimental Settings

We used PyTorch [] and PyTorch-Ignite [] to make the implementations of the source pre-training, proposed method, and baselines.
We conducted the experiments with a single NVIDIA A100 GPU.

### C.1 Datasets

SVHN []: We downloaded SVHN via torchvision.datasets.SVHN.
It can be used for non-commercial purposes only(^1^11[http://ufldl.stanford.edu/housenumbers/](http://ufldl.stanford.edu/housenumbers/)).

MNIST []: We downloaded MNIST via torchvison.datasets.MNIST.
We could not find any license information for MNIST.

UTKFace []: We downloaded UTKFace via the official site(^2^22[https://susanqq.github.io/UTKFace/](https://susanqq.github.io/UTKFace/)).
It is available for non-commercial research purposes only.

Biwi Kinect []: We downloaded Biwi Kinect via Kaggle(^3^33[https://www.kaggle.com/datasets/kmader/biwi-kinect-head-pose-database](https://www.kaggle.com/datasets/kmader/biwi-kinect-head-pose-database)).
It is released under Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license.

California Housing []: We downloaded the dataset from Kaggle(^4^44[https://www.kaggle.com/datasets/camnugent/california-housing-prices](https://www.kaggle.com/datasets/camnugent/california-housing-prices)).
It is released in public domain.

### C.2 Pre-training on the Source Domain

SVHN: We trained ResNet-26 [] from scratch.
For optimization, we used Adam [] and set the learning rate to 0.0001, weight decay to 0.0005, batch size to 64, and number of epochs to 100.
We minimized the MSE loss between the predicted values and digit labels.
For the implementation of ResNet-26, we used the PyTorch Image Models (timm) library [].

UTKFace:
We randomly split the dataset into 80% for training and 20% for validation.
We fine-tuned ResNet-50 pre-trained on ImageNet [].
We minimized the MSE loss to predict the ages of the persons in the images.
For optimization, we used the same hyperparameters as the above SVHN case.
For the implementation of ResNet-50, we used torchvision [] with IMAGENET1K_V2 initial weights.

Biwi Kinect: We split the dataset into male and female images and further randomly split them into 80% for training and 20% for validation.
We fine-tuned ResNet-50 pre-trained on ImageNet in the same way as the UTKFace case.
We separately trained the models to predict each of the three head angles, *i.e*., pitch, roll, and yaw, of the persons in the images.
In total, we pre-trained six source models ({male, female} $\times$ {pitch, yaw, roll}).

California Housing: We extracted the data of non-coastal areas for the source domain and split them into 90% for training and 10% for validation.
We standardized the whole dataset using the source mean and standard deviation.
We trained a five-layer MLP, with 100-dimensional hidden layers, ReLU activation, and batch normalization.

### C.3 Test-time Adaptation

As for setting the hyperparameters of the baseline methods, we basically followed their original papers.
For the evaluation, we ran each TTA three times with different random seeds and reported the means of the scores.

Source: We simply fixed the source-pretrained model (*i.e*., model.eval() in PyTorch) and performed inference.

BN-adapt []: updates the feature mean and variance stored in the batch normalization layers during testing, *i.e*., ran inference with model.train() mode in PyTorch.

Feature restoration (FR) []: uses the source statistics of the features and outputs as a form of dimension-wise histogram and aligns the target feature histogram to the source one.
The original FR uses the histograms of the features and logits pre-computed with the source dataset.
Since our focus is on regression models, we used the outputs instead of logits.
We set the number of bins of the histograms to eight and the temperature $\tau$ of soft-binning to 0.01 following Eastwood et al. [].
We set learning rate to 0.0001 (this value gave the best score).

Prototype: We tweaked T3A [], which regards the weights of the last fully-connected layer as the prototype of each class and updates the prototypes with the mean of the arriving target features during testing.
We regarded $\mathbf{w}$ of the linear regressor $h_{\psi}$ as a single prototype and updated it with the mean of the target features.
Although T3A determines whether to use a feature for making an update by using entropy, we omitted this component since we cannot compute entropy with regression models.

Variance minimization (VM): makes augmented views of input images and minimizes output variance.
This is a modification of MEMO [], which minimizes the marginal entropy of the augmented views of inputs in the same manner.
We set the number of augmented views to 32 per input and set the learning rate to 0.001 with Adam optimizer.

Representation subspace distance (RSD) []: The original RSD is a UDA method designed for regression, which aligns the SVD bases between source and target mini-batches.
To adapt to TTA, we pre-computed the SVD of the source features wit the whole source dataset instead of mini-batches before TTA and align the target feature SVD with the RSD loss during testing.

SSA (ours): Algorithm 1 lists the procedure of SSA.
For optimization, we used Adam [] with a learning rate$=0.001$, $(\beta_{1},\beta_{2})=(0.9,0.999)$, and weight decay$=0$, which is the default setting in PyTorch [].
We set the batch size to 64 following other TTA baselines.

Test-time training (TTT) []: incorporates a self-supervised rotation prediction task during pre-training in the source domain; then it updates the feature extractor by minimizing the self-supervised loss during testing.
The rotation-prediction branch is a linear layer that takes a feature $\mathbf{z}$ and outputs four logits corresponding to the rotation angles $\{0^{\circ},90^{\circ},180^{\circ},270^{\circ}\}$ of an input image.
For optimization, we used SGD and set the learning rate to 0.001 in accordance with Sun et al. [].

Domain adversarial neural network (DANN) []: is an unsupervised domain adaptation method which adversarially trains a feature extractor and domain discriminator to learn domain-invariant features.
We trained the domain discriminator during training in addition to the main regression model.
We used layer4 of ResNet for the discriminator.
We scheduled the learning rate and the weight of the domain adaptation loss by following Ganin et al. [].

Oracle: fine-tunes the model using labels during testing, *i.e*., the upper bound of the performance.

Figure: Algorithm 1 Significant-subspace alignment (SSA).

## Appendix D Additional Experimental Results

### D.1 Metric for Feature Alignment

We used the KL divergence between two Gaussian distributions in Eq. 4 for the feature alignment in SSA.
One may suppose that other metrics could also be used, since the variance term in the denominator makes the naive TTA loss in Eq. 3 unstable, as mentioned in Sec. 3.1.
Here, we tried the 2-Wasserstein distance (2WD) between two
Gaussian distributions [] and the L1 norm of the statistics:

$$ $\displaystyle W_{2}^{2}\left(\mathcal{N}(\mu_{1},\sigma_{1}^{2}),\mathcal{N}( \mu_{2},\sigma_{2}^{2})\right)$ $\displaystyle=(\mu_{1}-\mu_{2})^{2}+(\sigma_{1}-\sigma_{2})^{2},$ (13) $\displaystyle L_{1}\left(\mathcal{N}(\mu_{1},\sigma_{1}^{2}),\mathcal{N}(\mu_{ 2},\sigma_{2}^{2})\right)$ $\displaystyle=|\mu_{1}-\mu_{2}|+|\sigma_{1}-\sigma_{2}|.$ (14) $$

We replaced the KL divergence with the 2WD and L1 in Eq. 8 as follows:

$$ $\displaystyle\mathcal{L}_{\text{TTA-2WD}}$ $\displaystyle=\sum_{d=1}^{K}\alpha_{d}W_{2}^{2}\left(\mathcal{N}(\tilde{\mu}_{ d}^{\text{t}},\tilde{\sigma}_{d}^{\text{t~{}2}}),\mathcal{N}(0,\lambda_{d}^{ \text{s}})\right)$ $\displaystyle=\sum_{d=1}^{K}\alpha_{d}\left\{(\tilde{\mu}_{d}^{\text{t}})^{2}+ \!\left(\!\sqrt{\tilde{\sigma}_{d}^{\text{t~{}2}}}-\sqrt{\lambda_{d}^{\text{s} }}\right)^{2}\right\},$ (15) $\displaystyle\mathcal{L}_{\text{TTA-L1}}$ $\displaystyle=\sum_{d=1}^{K}\alpha_{d}L_{1}\left(\mathcal{N}(\tilde{\mu}_{d}^{ \text{t}},\tilde{\sigma}_{d}^{\text{t~{}2}}),\mathcal{N}(0,\lambda_{d}^{\text{ s}})\right)$ $\displaystyle=\sum_{d=1}^{K}\alpha_{d}\left\{|\tilde{\mu}_{d}^{\text{t}}|+ \left|\sqrt{\tilde{\sigma}_{d}^{\text{t~{}2}}}-\sqrt{\lambda_{d}^{\text{s}}} \right|\right\}.$ (16) $$

**Table 9: Comparison between using KL divergence and 2-Wasserstein distance for feature alignment in SSA on SVHN-MNIST. The top row is our method.**
| Metric | Subspace detection | $R^{2}$ ($\uparrow$) | RMSE ($\downarrow$) |
| --- | --- | --- | --- |
| KL | ✓ | $\mathbf{0.511_{\pm 0.03}}$ | $\mathbf{2.024_{\pm 0.06}}$ |
| KL |  | ${0.338_{\pm 0.04}}$ | ${2.355_{\pm 0.07}}$ |
| 2WD | ✓ | ${0.425_{\pm 0.02}}$ | ${2.196_{\pm 0.04}}$ |
| 2WD |  | ${0.342_{\pm 0.04}}$ | ${2.348_{\pm 0.07}}$ |
| L1 | ✓ | ${0.472_{\pm 0.03}}$ | ${2.104_{\pm 0.05}}$ |
| L1 |  | ${0.347_{\pm 0.06}}$ | ${2.337_{\pm 0.11}}$ |
| Source | ${0.406}$ | ${2.232}$ |  |

**Table 10: $R^{2}$ scores of cases using KL divergence and 2-Wasserstein distance for feature alignment in SSA on UTKFace. The top row is our method.**
| Metric | Subspace<br>detection | Defocus blur | Motion blur | Zoom blur | Contrast | Elastic transform | Jpeg compression | Pixelate | Gaussian noise | Impulse noise | Shot noise | Brightness | Fog | Snow | Mean |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| KL | ✓ | $0.803$ | $0.839$ | $\mathbf{0.851}$ | $\mathbf{0.792}$ | $0.899$ | $0.829$ | $0.943$ | $\mathbf{0.580}$ | $\mathbf{0.592}$ | $\mathbf{0.560}$ | $\mathbf{0.863}$ | $\mathbf{0.440}$ | $\mathbf{0.517}$ | $\mathbf{0.731}$ |
| KL |  | $0.826$ | $0.853$ | $0.825$ | $0.752$ | $0.904$ | $0.843$ | $0.944$ | $0.377$ | $0.421$ | $0.294$ | $0.842$ | $0.246$ | $0.205$ | $0.641$ |
| 2WD | ✓ | $0.816$ | $0.843$ | $0.826$ | $0.729$ | $0.903$ | $0.830$ | ${0.946}$ | $0.353$ | $0.424$ | $0.302$ | $0.824$ | $0.177$ | $0.192$ | $0.628$ |
| 2WD |  | ${0.827}$ | $\mathbf{0.854}$ | $0.832$ | $0.755$ | ${0.906}$ | ${0.845}$ | ${0.946}$ | $0.389$ | $0.439$ | $0.298$ | $0.846$ | $0.223$ | $0.238$ | $0.646$ |
| L1 | ✓ | $\mathbf{0.834}$ | $\mathbf{0.858}$ | $\mathbf{0.851}$ | ${0.775}$ | $\mathbf{0.910}$ | $\mathbf{0.849}$ | $\mathbf{0.949}$ | ${0.484}$ | ${0.546}$ | ${0.489}$ | ${0.845}$ | ${0.334}$ | ${0.206}$ | $0.687$ |
| L1 |  | ${0.830}$ | ${0.854}$ | ${0.840}$ | ${0.744}$ | ${0.905}$ | ${0.847}$ | ${0.942}$ | ${0.362}$ | ${0.418}$ | ${0.288}$ | ${0.848}$ | ${0.233}$ | ${0.277}$ | $0.645$ |
| Source | $0.410$ | $0.159$ | $0.658$ | $-3.906$ | $0.711$ | $0.069$ | $0.595$ | $-2.536$ | $-2.539$ | $-2.522$ | $0.661$ | $-0.029$ | $-0.544$ | $-0.678$ |  |

**Table 11: $R^{2}$ scores of cases using KL divergence and 2-Wasserstein distance for feature alignment in SSA on Biwi Kinect. The top row is our method.**
|  |  | Female $\rightarrow$ Male | Male $\rightarrow$ Female |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Metric | Subspace<br>detection | Pitch | Roll | Yaw | Pitch | Yaw | Roll | Mean |
| KL | ✓ | $\mathbf{0.860_{\pm 0.00}}$ | $\mathbf{0.962_{\pm 0.00}}$ | $\mathbf{0.513_{\pm 0.01}}$ | $\mathbf{0.869_{\pm 0.00}}$ | $0.886_{\pm 0.00}$ | $0.575_{\pm 0.00}$ | $\mathbf{0.778_{\pm 0.00}}$ |
| KL |  | $0.525_{\pm 0.04}$ | $0.945_{\pm 0.00}$ | $0.240_{\pm 0.03}$ | $0.835_{\pm 0.01}$ | $0.874_{\pm 0.01}$ | $0.613_{\pm 0.01}$ | $0.672_{\pm 0.01}$ |
| 2WD | ✓ | $0.708_{\pm 0.05}$ | $0.954_{\pm 0.00}$ | $0.465_{\pm 0.01}$ | $0.765_{\pm 0.01}$ | ${0.916_{\pm 0.01}}$ | ${0.617_{\pm 0.00}}$ | $0.738_{\pm 0.01}$ |
| 2WD |  | $0.540_{\pm 0.05}$ | $0.949_{\pm 0.00}$ | $0.279_{\pm 0.02}$ | $0.829_{\pm 0.01}$ | $0.862_{\pm 0.02}$ | $0.598_{\pm 0.01}$ | $0.676_{\pm 0.01}$ |
| L1 | ✓ | ${0.750_{\pm 0.07}}$ | ${0.958_{\pm 0.00}}$ | ${0.482_{\pm 0.01}}$ | ${0.858_{\pm 0.00}}$ | $\mathbf{0.922_{\pm 0.00}}$ | $\mathbf{0.641_{\pm 0.00}}$ | $0.768_{\pm 0.01}$ |
| L1 |  | ${0.562_{\pm 0.03}}$ | ${0.949_{\pm 0.00}}$ | ${0.314_{\pm 0.04}}$ | ${0.802_{\pm 0.00}}$ | ${0.861_{\pm 0.01}}$ | ${0.613_{\pm 0.00}}$ | $0.684_{\pm 0.01}$ |
| Source | ${0.759}$ | ${0.956}$ | ${0.481}$ | ${0.763}$ | ${0.791}$ | ${0.485}$ | ${0.706}$ |  |

Tabs. 9, 10 and 11 compare the effects of using the KL divergence and 2WD on SVHN-MNIST, UTKFace, and Biwi Kinect.
The KL divergence with subspace detection (SSA) achieved highest $R^{2}$ scores in almost all cases.
In contrast, the 2WD variant of SSA produced only a slight improvement over Source on SVHN-MNIST (Tab. 9) and sometimes it had even worse scores than Source on Biwi Kinect (Tab. 11).
This degradation of 2WD is because the scale of the variance $\sigma_{d}^{2}$ is different among feature dimensions $d$.
The KL divergence can absorb the difference in scale since it includes the ratio of the variances, as in Eq. 8.

### D.2 Feature Visualization

Figure: Figure 4: PCA visualizations of source and target features of each dataset and method. The blue and orange dots represent the source and target features, respectively. We also report the optimal transport distance (OTD) between the principal components of the source and target features.
Refer to caption: x8.png

Fig. 4 illustrates PCA visualizations of the source and target features after TTA.
In the visualizations of SVHN-MNIST (a) and Biwi Kinect (c), we can see that SSA makes the target feature distribution fit within the source distribution while the target features of the baselines protrude from the source distribution.
In UTKFace (b), the target features of Source significantly degenerate to a single point, but the other methods alleviate this.
In Fig. 4, we also report the optimal transport distance (OTD) between the features of the both domains, which evaluates the feature alignment quantitatively.
In addition to that our SSA alleviates the feature distribution gap in the subspace, SSA retains the source subspace better, as shown in Fig. 2 of Sec. 4.3.4.

### D.3 Effect of Original Feature Dimensions on the Subspace

As mentioned in Sec. 3.1, many of the feature dimensions have a small effect on the subspace, which makes the naive feature alignment ineffective.
To verify the effect of changing the original features on the subspace, we computed the gradient of a subspace feature vector $\tilde{\mathbf{z}}$ with respect to the $d$-th dimension of the original feature $z_{d}$.
With Eq. 7, the norm of the gradient $s_{d}$ is:

$$ $\displaystyle s_{d}=\left\|\partialderivative{\tilde{\mathbf{z}}}{{z}_{d}} \right\|_{2}=\|(\mathbf{V}^{\text{s}\top})_{d}\|_{2}=\|[v^{\text{s}}_{1,d}, \ldots,v^{\text{s}}_{K,d}]\|_{2},$ (17) $$

which is the norm of the $d$-th row of $\mathbf{V}^{\text{s}}$.

Fig. 5 shows the histograms of $s_{d}$ computed with the three datasets.
As expected, most of the dimensions of the original feature space had small effects; only a few dimensions had significant effect to the subspace.
Specifically, SVHN-MNIST and Biwi Kinect strongly showed this tendency.
In contrast, a larger number of raw feature dimensions affected the subspace in UTKFace compared with the other datasets.
This is why the test $R^{2}$ score was improved from Source without subspace detection in UTKFace, while the scores on the other datasets were lower than those of Source, as shown in Tab. 6.

Figure: Figure 5: Histograms of the gradient of a projected feature $\tilde{z}$ with respect to each original feature dimension $z_{d}$ computed with Eq. 17.
Refer to caption: x20.png

### D.4 Additional Ablation

**Table 12: Test $R^{2}$ scores of SSA for different numbers of feature subspace dimensions $K$ on California Housing.**
| $K$ | 1 | 5 | 10 | 25 | 50 | 75 | 100 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| $R^{2}$ | ${0.496}$ | ${0.625}$ | $\mathbf{0.639}$ | ${0.625}$ | - | - | - |

**Table 13: Test $R^{2}$ scores of SSA without subspace detection. The right column represents the score with subspace detection.**
| $K$ | 1 | 5 | 10 | 25 | 50 | 75 | 100 | 10 (ours) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $R^{2}$ | ${0.524}$ | ${0.605}$ | ${0.625}$ | ${0.620}$ | ${0.584}$ | - | - | $\mathbf{0.639}$ |

**Table 14: Test $R^{2}$ scores of SSA without subspace detection. The bottom row represents the scores with subspace detection of $K=100$ from Tab. 8.**
| $K$ | SVHN | UTKFace | Biwi Kinect |
| --- | --- | --- | --- |
| 10 | ${0.302}$ | ${0.674}$ | ${0.737}$ |
| 25 | ${0.348}$ | ${0.656}$ | ${0.674}$ |
| 50 | ${0.334}$ | ${0.651}$ | ${0.691}$ |
| 75 | ${0.329}$ | ${0.645}$ | ${0.578}$ |
| 100 | ${0.338}$ | ${0.641}$ | ${0.672}$ |
| 200 | ${0.343}$ | ${0.643}$ | ${0.670}$ |
| 400 | - | ${0.643}$ | ${0.709}$ |
| 1000 | - | ${0.656}$ | ${0.755}$ |
| 2048 | - | ${0.706}$ | ${0.753}$ |
| 100 (ours) | $\mathbf{0.511}$ | $\mathbf{0.731}$ | $\mathbf{0.778}$ |

Tab. 12 shows the $R^{2}$ scores on California Housing with changing $K$ of SSA (the same experiment as Tab. 8).
$K=10$ produced the best result, but $K=5$ and $25$ also gave competitive scores.
When $K\geq 50$, which exceeds the number of the subspace dimensions in Tab. 1, the loss became unstable or diverged because SSA attempted to align too many degenerated feature dimensions, as mentioned in Sec. 4.3.3.

Tabs. 14 and 13 shows the test $R^{2}$ scores without subspace detection (*i.e*., naively aligning raw features) with respect to $K$.
Without subspace detection, the performance of regression on the target domain is limited even when all dimensions of the original feature space are aligned.
This result supports the importance of aligning the representative feature subspace with subspace detection.

### D.5 Experiments on Vision Transformer

**Table 15: Number of valid (having non-zero variance) feature dimensions and feature subspace dimensions of the ViT trained on SVHN.**
| Regression | Classification |  |  |
| --- | --- | --- | --- |
| #Valid dims | #Subspace dims. | #Valid dims | #Subspace dims. |
| 768 | 503 | 768 | 544 |

**Table 16: Test $R^{2}$ score and RMSE on SVHN-MNIST with ViT.**
| Method | $R^{2}~{}(\uparrow)$ | RMSE ($\downarrow$) |
| --- | --- | --- |
| Source | ${0.658}$ | ${1.693}$ |
| Prototype | ${0.468_{\pm 0.00}}$ | ${2.111_{\pm 0.00}}$ |
| FR | ${0.724_{\pm 0.00}}$ | ${1.522_{\pm 0.01}}$ |
| VM | ${-1009_{\pm 11.8}}$ | ${92.02_{\pm 0.54}}$ |
| SSA (ours) | $\mathbf{0.741_{\pm 0.03}}$ | $\mathbf{1.471_{\pm 0.08}}$ |
| Oracle | ${0.960_{\pm 0.00}}$ | ${0.575_{\pm 0.02}}$ |

We experimented TTA with vision transformer (ViT) [] on SVHN-MNIST.

First, we trained a ViT-B/16 regressor on SVHN and computed the number of feature dimensions as Sec. 4.3.4.
We used the output of the penultimate layer for the features.

Tab. 15 shows the numbers of the valid (zero variance) and subspace dimensions.
Since no activation function is applied to the feature vectors of ViTs unlike ResNets, all 768 feature dimensions are valid (non-zero variance).
However, the number of the subspace dimensions is 503 in the regression model, which is smaller that of the classification model.
Although the subspace dimension is larger than the ResNet cases in Tab. 1, we can also see the same tendency.

Tab. 16 shows the TTA results on SVHN-MNIST.
SSA outperforms the baselines.

### D.6 Multi-task Regression Model

We applied TTA methods to multi-task regression models, which output multiple prediction values at the same time.
We trained ResNet-50 regression models on Biwi Kinect.
Unlike the experiments on the same dataset in Sec. 4.3, a single regression model outputs pitch, roll, and yaw angles.

Tab. 17 shows the test $R^{2}$ score on each target angle.
We compared TTA methods that can be easily extended to multi-task regression tasks.
Our SSA outperformed the other baselines in most cases.
The numbers of the source feature subspace dimensions were 134 and 132 for the male and female models, which are larger than single-task models but much smaller than the entire feature dimensions (2048).
Thus, SSA is also effective for multi-task regression models.

**Table 17: Test $R^{2}$ scores on multi-task Biwi Kinect. The best scores are in boldface.**
|  | Female $\rightarrow$ Male | Male $\rightarrow$ Female |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Method | Pitch | Yaw | Roll | Pitch | Yaw | Roll | Mean |
| Source | ${0.904}$ | $\mathbf{0.628}$ | ${0.960}$ | ${0.794}$ | ${0.419}$ | ${0.854}$ | ${0.760}$ |
| BN-adapt | ${{0.912}_{\pm 0.00}}$ | ${{0.606}_{\pm 0.00}}$ | ${{0.967}_{\pm 0.00}}$ | ${{0.791}_{\pm 0.00}}$ | ${{0.471}_{\pm 0.00}}$ | ${{0.921}_{\pm 0.00}}$ | ${0.778}$ |
| VM | ${{-1.875}_{\pm 0.37}}$ | ${{-1.962}_{\pm 0.73}}$ | ${{-0.093}_{\pm 0.03}}$ | ${{-0.365}_{\pm 0.08}}$ | ${{-0.143}_{\pm 0.12}}$ | ${{-0.000}_{\pm 0.02}}$ | ${-0.740}$ |
| RSD | ${{0.912}_{\pm 0.00}}$ | ${{0.606}_{\pm 0.00}}$ | ${{0.967}_{\pm 0.00}}$ | ${{0.792}_{\pm 0.00}}$ | ${{0.472}_{\pm 0.00}}$ | ${{0.921}_{\pm 0.00}}$ | ${0.778}$ |
| SSA (ours) | $\mathbf{{0.913}_{\pm 0.00}}$ | ${{0.555}_{\pm 0.01}}$ | $\mathbf{{0.970}_{\pm 0.00}}$ | $\mathbf{{0.837}_{\pm 0.00}}$ | $\mathbf{{0.540}_{\pm 0.00}}$ | $\mathbf{{0.942}_{\pm 0.00}}$ | $\mathbf{0.793}$ |
| Oracle | ${{0.976}_{\pm 0.00}}$ | ${{0.859}_{\pm 0.00}}$ | ${{0.988}_{\pm 0.00}}$ | ${{0.958}_{\pm 0.00}}$ | ${{0.804}_{\pm 0.00}}$ | ${{0.979}_{\pm 0.00}}$ | ${0.928}$ |

### D.7 Combination with Classification TTA

Although our SSA is designed for regression, the subspace detection and feature alignment loss can be used to classification since they operates in the feature space and works regardless of model output forms.
Here, we applied the subspace detection and feature alignment loss to classification models.
We trained ResNet-26 on SVHN and CIFAR10 [], and tested on MNIST and CIFAR10-C [].

Tab. 18 shows the number of the valid feature dimensions and subspace dimensions in classification and regression models on the source datasets.
Although the number of the feature dimensions of the classification models are larger than those of the regression models, the subspace is smaller than the entire feature space.
Thus, we expect that our SSA is also effective on classification models.

Tabs. 19 and 20 show the classification accuracies.
We can easily combine our method with entropy-based TTA methods in classification.
Although SSA significantly improves the accuracy, combining SSA with Tent [] further boosts the accuracy.

**Table 18: Comparison of the numbers of valid (having non-zero variance) feature dimensions and feature subspace dimensions (*i.e*., the rank of the feature covariance matrix) between classification and regression. When training classification models, we discretized the labels.**
|  | Classification | Regression |  |  |
| --- | --- | --- | --- | --- |
| Dataset | #Valid dims | #Subspace dims. | #Valid dims | #Subspace dims. |
| SVHN | 1946 | 64 | 353 | 14 |
| CIFAR10 | 1521 | 86 | 561 | 50 |
| UTKFace | 2048 | 1471 | 2041 | 76 |
| Biwi Kinect (mean) | 2048 | 277 | 713 | 34.5 |
| California Housing (100 dims.) | 100 | 100 | 45 | 40 |

**Table 19: Test classification accuracy (%) on SVHN-MNIST.**
| Method | Accuracy |
| --- | --- |
| Source | ${53.82}$ |
| Tent | ${75.68}_{\pm 8.49}$ |
| SSA | $\underline{{79.97}_{\pm 0.67}}$ |
| Tent+SSA | $\mathbf{{80.69}_{\pm 0.52}}$ |
| Oracle | ${{97.48}_{\pm 0.02}}$ |

**Table 20: Test classification accuracy (%) on CIFAR10-C. The best and second scores are in boldface and underlined.**
| Method | Brightness | Contrast | Defocus<br>blur | Elastic<br>transform | Fog | Gaussian<br>noise | Impulse<br>noise | Jpeg<br>compression | Motion<br>blur | Pixelate | Shot<br>noise | Snow | Zoom<br>blur | Mean |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Source | ${77.80}$ | ${19.97}$ | ${57.74}$ | ${72.33}$ | ${47.62}$ | ${69.06}$ | ${46.97}$ | $\mathbf{79.82}$ | ${58.92}$ | ${76.88}$ | ${70.44}$ | ${72.18}$ | ${60.75}$ | ${62.34}$ |
| Tent | ${79.06}$ | ${56.88}$ | ${77.00}$ | ${73.70}$ | ${67.41}$ | ${76.98}$ | ${70.02}$ | ${79.22}$ | ${74.28}$ | ${77.80}$ | ${77.70}$ | ${75.27}$ | ${77.08}$ | ${74.03}$ |
| SSA | $\underline{81.34}$ | $\underline{64.98}$ | $\underline{79.11}$ | $\underline{74.48}$ | $\underline{71.89}$ | $\mathbf{78.44}$ | $\underline{70.48}$ | $\underline{79.63}$ | $\underline{76.03}$ | $\underline{79.48}$ | $\underline{78.91}$ | $\mathbf{76.55}$ | $\underline{77.80}$ | $\underline{76.09}$ |
| Tent+SSA | $\mathbf{81.43}$ | $\mathbf{65.26}$ | $\mathbf{79.30}$ | $\mathbf{74.61}$ | $\mathbf{71.98}$ | $\underline{78.41}$ | $\mathbf{70.59}$ | ${79.57}$ | $\mathbf{76.13}$ | $\mathbf{79.51}$ | $\mathbf{78.96}$ | $\underline{76.50}$ | $\mathbf{77.84}$ | $\mathbf{76.16}$ |
| Oracle | ${85.62}$ | ${77.57}$ | ${83.93}$ | ${79.59}$ | ${78.68}$ | ${83.15}$ | ${76.42}$ | ${84.09}$ | ${81.45}$ | ${84.27}$ | ${83.60}$ | ${81.94}$ | ${83.28}$ | ${81.82}$ |

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. Why are "two diagonal Gaussian distributions" used in Chapter 3? What is the rationale behind this choice?
2. In Section 4.1, the first dataset utilizes a classification dataset as a regression task. Is this approach reasonable and justifiable? Regarding the second dataset, is it appropriate to consider a noisy version of the test set as the target domain?
3. Could you provide a proof or evidence demonstrating the effectiveness of Significant-subspace Alignment (SSA)?
soundness: 3
strengths: The topic of adapting regression models to unknown target distributions is highly relevant, particularly given the increasing use of machine learning in diverse applications. The proposed SSA approach is innovative and addresses a gap in the literature.
summary: This paper addresses a crucial yet under-explored area in machine learning: test-time adaptation (TTA) for regression models. The authors rightly highlight the limitations of existing TTA methods, which are primarily tailored for classification tasks, and propose a novel approach termed Significant-subspace Alignment (SSA). The paper presents a clear rationale for the need to adapt TTA techniques for regression and offers a compelling solution through feature alignment.
weaknesses: 1. In Section 3.1 of the article, the use of "two diagonal Gaussian distributions" is not adequately justified, and the advantages and limitations of employing such distributions are not discussed.
2. The proposed method in this paper exhibits limited originality, as its various components are commonly found in existing models.
3. The dataset utilized in this study has a relatively small sample size, which weakens the persuasiveness of the findings. Additionally, there is a lack of comparative algorithms from the past three years, resulting in insufficient theoretical validation. Furthermore, the measurement standard is solely based on R²; incorporating additional metrics such as RMSE and RMAE would enhance the evaluation.

---

confidence: 2
contribution: 3
initial_rating: 6
presentation: 2
questions: How does SSA perform in multi-task and multi-class regression tasks? Can it be extended to these scenarios?
soundness: 3
strengths: 1.SSA introduces a novel approach for TTA in regression tasks by combining subspace detection and dimension weighting, which is an innovative contribution to the field.
2.The paper conducts extensive experiments on multiple real-world datasets, validating the effectiveness of SSA.
3.Compared to the original model and other baseline methods, SSA achieves higher R2 scores across multiple datasets, demonstrating performance improvements in regression tasks.
summary: This paper investigates the application of Test-Time Adaptation for regression tasks, where a regression model pre-trained in a source domain is adapted to an unknown target distribution using unlabeled target data. The authors note that most existing TTA methods are designed for classification tasks and do not directly apply to regression models, which typically output single scalar values rather than class-categorical predictions. To address this, the paper proposes a feature alignment approach called Significant-subspace Alignment, which consists of two components: subspace detection and dimension weighting. SSA aims to align feature distributions between the source and target domains to mitigate the domain gap, focusing on a representative and significant subspace of the feature space. Experimental results on various real-world datasets demonstrate that SSA outperforms several baseline methods.
weaknesses: 1.SSA assumes covariate shift, where p(y|x) remains unchanged. The paper does not address distribution shifts where p(y|x) changes, such as concept drift, limiting its applicability in broader scenarios.
2.While the paper mentions the selection of the parameter λ, it lacks a detailed discussion on the impact of other hyperparameters, which could affect the model's generalizability and adaptability.
3.The paper does not discuss the computational complexity of SSA, particularly its performance with large-scale datasets, which is crucial for practical applications.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: See Weaknesses
soundness: 3
strengths: - The paper proposes a novel method for Test time domain adaptation for regression, and adapted common benchmarking procedures for classification to regression, especially on the UTK Face dataset.

- The paper is well-written and clear.

- The method and results seem convincing and easy to implement.
summary: The paper proposes a test-time domain adaptation method for regression. They show that learned embeddings are more compressed in regression than classification. To address this, they introduce Significant-subspace Alignment (SSA). SSA uses PCA to detect a significant feature subspace where features are concentrated, then aligns the first two moments of source embeddings and target batch within this subspace. They also apply dimension weighting to prioritize subspace dimensions based on their significance to the output. The proposed method is evaluated on four regression datasets and demonstrates superior performance compared to baseline TTA methods designed for classification tasks, and domain adaptation for regression adapted for TTA .
weaknesses: - In the related work, feature alignment methods for TTA are reviewed with the claim, “Although some of these methods are directly applicable to regression, we have observed that they are not effective or even degrade regression performance.” However, these methods are not included in the experiments, leaving this claim unsupported.
- In Table 1, the subspace dimension for Biwi Kinect is shown as ‘34.5’, which is unclear, as dimensions are typically integers.
- MLPs and CNNs seem to produce embeddings with different ranks, with MLPs showing less low-rank behavior. A discussion or remark on this difference could provide useful insights.
- The test setup lacks clarity on whether SSA is applied in an online or episodic adaptation manner, and it’s unclear if batches are fed uniformly.
- The dimension weighting approach may lead to disproportionately high contributions from small-scale features if they are assigned high weights (when learned on source), potentially resulting in values similar to large-scale features with lower weights (when learned on source).   Did you consider any normalization or balancing mechanism to prevent this scaling effect?

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: Please see the weaknesses.
soundness: 2
strengths: 1.	A Significant-subspace Alignment (SSA) method is proposed to address TTA for regression on the basis of the feature alignment approach.
2.	SSA consists of two components: subspace detection and dimension weighting. 
3.	Subspace detection uses principal component analysis (PCA) to find a subspace and dimension weighting raises the importance of the subspace dimensions.
summary: This paper investigates test-time adaptation (TTA) for regression, where a regression model pre-trained in a source domain is adapted to an unknown target distribution with unlabeled target data. To enable TTA for regression, the authors adopt a feature alignment approach, which aligns the feature distributions between the source and target domains to mitigate the domain gap. A propose Significant-subspace Alignment (SSA) is proposed for feature alignment in TTA for regression, which consists of two components: subspace detection and dimension weighting. Some experiments have been conducted to verify the performance of the proposed method.
weaknesses: 1.	The description of Figure 1 is too simple to understand the procedure of the proposed method. Some key variables (i.e., gφ and hψ) should be introduced. For easy understand, I suggest the authors provide a step-by-step description of the workflow shown in the figure. 
2.	The used compared methods are all published before 2023, how the proposed method compares to or differs from some newer approaches, such as “Backpropagation-free Network for 3D Test-time Adaptation, CVPR 2024”, “Improved Self-Training for Test-Time Adaptation, CVPR, 2024”.
3.	Why no results for RSD are given in Table 3? Please provide the missing results for RSD in Table 3 or explain why these results were not included.
4.	What is the visualization effect of the proposed method? Provide T-SNE rendering.
5.	What is the limitation of the proposed method? Are there any situations where SSA might not perform well, or any assumptions it makes that might not hold in all regression tasks?

Meta-review: After extensive author-reviewer discussions, all reviewers suggest that the paper should be accepted. In this case, I am happy to recommend accepting the paper.

Decision: Accept (Poster)