Year: 2021

Abstract:
This paper studies zero-shot domain adaptation where each domain is indexed on a multi-dimensional array, and we only have data from a small subset of domains. Our goal is to produce predictors that perform well on unseen domains. We propose a model which consists of a domain-invariant latent representation layer and a domain-specific linear prediction layer with a low-rank tensor structure. Theoretically, we present explicit sample complexity bounds to characterize the prediction error on unseen domains in terms of the number of domains with training data and the number of data per domain. In addition, we provide experiments on two-way MNIST and four-way fiber sensing datasets to demonstrate the effectiveness of our proposed model.

text: This paper studies zero-shot domain adaptation where each domain is indexed on a multi-dimensional array, and we only have data from a small subset of domains. Our goal is to produce predictors that perform well on unseen domains. We propose a model which consists of a domain-invariant latent representation layer and a domain-specific linear prediction layer with a low-rank tensor structure. Theoretically, we present explicit sample complexity bounds to characterize the prediction error on unseen domains in terms of the number of domains with training data and the number of data per domain. In addition, we provide experiments on two-way MNIST and four-way fiber sensing datasets to demonstrate the effectiveness of our proposed model.

heading: 1 INTRODUCTION
text: In many applications, collected datasets are cross-classified by a number of categorical factors such as a set of experimental or environmental conditions that are either controllable or known. These applications can be formalized as a zero-shot domain adaptation (ZSDA) problem with each domain being indexed on a multi-dimensional array. Domain-shifts often exist among data collected under different conditions, and to minimize the bias, one would like to collect diverse data to cover all conditions. However, due to high cost of data collection or insufficient resource in the field, it is often impractical to cover all possible combinations of factors. In most cases, training data collection can only cover a few limited, accessible scenarios, and the data from target domain may not be available during the training phase at all.
One motivating example is the distributed fiber optical sensing (Rogers, 1988) technique started to be used in smart city applications (Huang et al., 2019). Collecting fiber sensing data for machine learning is expensive and the characteristics of sensing data vary considerably across various heterogeneous factors, such as weather-ground conditions, signal source types, and sensing distances. Although conducting experiments to cover a small subset of combinations of different factors is possible, it is difficult to conduct experiments to cover all possible combinations. Specifically, in order to account for the effects of multiple factors (e.g., soil type × distance to sensor × weather), one has to visit multiple sites and set up the sensing equipment, and wait for the right time until the target type of data can be collected, and some combination of factors are not accessible due to the constraint of the physical world (e.g. a testbed at 10km sensing distance with asphalt pavement surface). Besides, in the digital pathology application, domain shift can be caused by different clinical centers, scanners, and tumor types (Fagerblom et al., 2021). It is impossible to cover every combination in training (e.g., one center maybe specialized in certain tumor class or own one particular type of scanners). Ideally, for these applications, one would want to train a model under a subset of scenarios, and adapt it to new unseen scenarios without collecting new data.
Another motivating application to design data augmentation with composition of operations. For instance, in image recognition applications, there are often multiple operations can be combined into augmented datasets, including blurring, translating, viewpoint, flipping, scaling, etc, and each with several levels or values to choose from. It may require huge amount of augmented data to cover all combinations of operations. Ideally, one only wants to try a small subset of all possible combinations. Previous works have shown that composing operations in careful ways outperforms randomly using data augmentation schemes (Ratner et al., 2017; Cubuk et al., 2019).
In the general ZSDA formulation, each domain is associated with a task descriptor, which is used to generate a predictor for the domain. This function that maps a task descriptor to a predictor, i.e., a predictor generator, is trained on training domains where data is available (Yang & Hospedales, 2014). In our setting, we can view the categorical indices for each domain as a task descriptor and thus apply existing approaches. However, this ignores the inherent multiway structure that connects different domains. Furthermore, existing approaches lack theoretical guarantees, and thus it is unclear under what conditions, the learned predictor generator can provably output an accurate predictor on unseen domains. A natural question is
Can we design a provably sample-efficient algorithm for zero-shot domain adaptation that exploits the multiway structure?

heading: 1.1 OUR CONTRIBUTIONS
text: In this paper, we answer this question affirmatively. Our contributions are summarized below.
• we consider a multilinear structure which naturally characterize the relatedness among different domains. Formally, we assume that there are totally D = dM domains that form a d×M -dimensional task tensor, where the predictor on domain t ∈ [D] is parameterized by w∗t ◦ ϕ∗ ∈ W ◦ Φ where ϕ∗ : X → Rp is a common representation for tasks and wt ∈ Rp is a domain specific linear predictor. We only consider the case when p is small. Note the linear predictors, w∗1 , . . . , w ∗ D ∈ Rp, together form a form a d× d× · · · × d︸ ︷︷ ︸
M times
×p-dimensional tensor,
which we denote as T . To enable domain adaptation, we further impose a low-rank multi-linear on the linear predictor T . The structure we impose on the model is that the slice along the last axis is always rank-K with K ≪ dM . That is, for all j ∈ [p], T·,j ∈ Rd×d×···×d has rank K.
• We provide a finite-sample statistics analysis for this model. We show that if during training T ∈ [D] source domains are observed, and in each observed domain n samples are collected, then the expected excess risk across all D domains is of order Õ ((
TC(W)+C(Φ) nT
)1/4 + p ( KdM2
T
)1/2) ,
where C(F) represents the complexity of function class F . The first term corresponds to the cost of learning the common representation and domain-specific linear classifiers, and the second term corresponds to the cost of generalizing to unseen domains. In the case where n is large, we can simply ignore the first term, and conclude that T should scale with Kd(pM)2. This theoretically justifies our method can adapt to unseen domains with limited training domains.
• We test our proposed method on a two-way MNIST dataset and four-way fiber sensing datasets. The empirical results show our method matches the performance of general ZSDA algorithm by Yang & Hospedales (2014) which has a lot more parameters than our method.

heading: 2 RELATED WORK
text: For theoretical results of multi-task learning, Baxter (2000) first derived a covering number bound for sample complexities. Later Maurer et al. (2016) gave a uniform convergence bound for multitask representation learning. Their bound is of order O( √ 1/m + √ 1/T ), where m is the number of training samples in the target domain, so it is not reflecting how their learning process benefits from seeing multiple domains. Recently, Du et al. (2020); Tripuraneni et al. (2020) successfully derived results of type O( √ 1/m + √ 1/(nT )), which satisfactorily explained how learning algorithm benefits from seeing abundant training data in many source domains, even if training data in target domain is scarce. This setting is often referred to as transfer learning or few-shot learning. A key difference between this setting and ours is that we do not see any training data from the target domain. Blitzer et al. (2009) also studied ZSDA, but they studied a different approach which relies on multi-view learning and is restricted to linear models.
Many attempts to solving multi-task learning via low-rank matrices/tensors have been proposed Romera-Paredes et al. (2013); Signoretto et al. (2013); Wimalawarne et al. (2014), focusing on regularizing shallow models. Wimalawarne et al. (2014) specifically discussed task imputation and gave a sample complexity bound. However, their analysis assumed each training data is uniformly
sampled from all source domains, so it is incomparable to our result. Yang & Hospedales (2017); Li et al. (2017) used low-rank tensor decomposition to share parameters between neural architectures for multiple tasks and empirically verified that both multi-task learning and domain generalization can benefit from the low-rank structure. Some different but closely related settings include unsupervised domain adaptation and zero-shot learning, where the test labels are either unseen during the training phase or different from what the model has been trained with. This is beyond the scope of this paper, as we only consider the case where all domains share same set of labels.
The low-rank matrix completion problem has been thoroughly studied in the past decade Srebro & Shraibman (2005); Srebro et al. (2004); Candès & Recht (2009); Recht (2011). Despite the combinatorial nature of rank, it has a nice convex relaxation, the trace norm, that can be optimized efficiently, in both noiseless and noisy settings Wainwright (2019). Although these quantities (trace norms, ranks, etc) are easy to calculate for matrices, most quantities associated with tensors are NP-hard to compute, including the trace norm Hillar & Lim (2013). There are many efforts in the theoretical computer science community to tackle tensor completion problems from the computational complexity perspective Barak & Moitra (2016); Liu & Moitra (2020). In this paper, we use the statistical properties of tensor completion despite their computational inefficiency. Hence our sample complexity bound does not contradict the seemingly worse bounds in the theory literature.

heading: 3 PRELIMINARY AND OVERVIEW
text: Notation. For D ∈ Z, we let [D] = {1, 2, . . . , D}. We write ∥ · ∥ to represent the ℓ2 norm or Frobenius norm. Let ⟨·, ·⟩ be the inner product on an inner product space. Throughout the paper, we assume for simplicity in total there are D = d× d× · · · × d︸ ︷︷ ︸
M
data domains. One can easily
generalize the results to the general case where D = ∏M
i=1 di. We use ⊗ to denote the tensor product and ⊙ the Hadamard product. We use T ∈ [D] to denote the number of seen source domains, n to be the amount of sample in a single source domain. Since each t ∈ [D] also uniquely corresponds to a multi-index in I ∈ [d]×M , if T ∈ Rd×···×d×p is a d×M dimension tensor composing of pdimensional linear functionals, we also write Tt,· ∈ Rp to represent the classifier at multi-index I , and we use t and I as indices interchangeably.

heading: 3.1 PROBLEM SETUP
text: During training, we have T source domains out of the D domains uniformly at random. For each domain t ∈ [T ], we have n i.i.d data {(xt,i, yt,i)ni=1} samples from the following probability (Tripuraneni et al., 2020): Pt(x, y) = Pw∗t ◦ϕ∗(x, y) = Px(x)Py|x(y|w ∗ t ◦ϕ∗(x)), where all domains share the common feature mapping ϕ∗ : (Rr → Rp) ∩ Φ and a common marginal distribution Px. Each domain has its specific classifier w∗t ∈ (Rp → R) ∩ W . Φ can be a general function class and W composes of Lipschitz linear functionals. We denote this distribution as Dt. The key assumption is that D domain-specific classifiers form a D × p rank-K tensor T in the following sense:
∀I ∈ [d]×M : T ∗I,· = w∗t = K∑
k=1
M ⊙
m=1 α∗k,tm , (1)
for α∗k,tm ∈ R p. We remark that this does not mean T has rank K. Instead, this means for each j ∈ [p], T·,j has rank K. Let ℓ : R×R → R≥0 be the loss function, L((w◦ϕ)(x), y) = Ex,y[ℓ((w◦ϕ)(x), y)] be the expected loss, L̂n((w ◦ ϕ)(x), y) = 1n ∑n i=1 ℓ((w ◦ ϕ)(xi), yi) be the empirical loss. When x and y are clear from the context, we write L(w◦ϕ) to denote L((w◦ϕ)(x), y), and similarly for ℓ and L̂n. When the number of samples n is clear from the context, we write L̂ := L̂n. We write Lt := EDt [ℓ(·, ·))] to emphasize the data is from Dt. Our goal is to minimize the average excess risk across all domains: 1 D ∑ t∈[D] EDt [ ℓ ( ŵt ◦ ϕ̂ ) − ℓ (w∗t ◦ ϕ∗) ] .
Our learning algorithm first outputs the empirical risk minimizer (ERM) on the seen source domains:
ŵt, ϕ̂ = argmin ϕ∈Φ,
w1,...,wt∈W
1
nT T∑ t=1 n∑ i=1 ℓ ((wt ◦ ϕ)(xt,i), yt,i) . (2)
Naturally we put ŵt into a d×M × p tensor T̃ , such that T̃t,· = ŵt. Then we do a tensor completion for each j ∈ [p] separately:
T̂·,i = argmin rank-K T
1
T ∑ t∈[T ] ∣∣∣Tt,i − T̃t,i∣∣∣ . (3) Finally, at test time, for target domain indexed by t ∈ [D] and test data x ∼ Dt, we make the prediction ŷ = (ŵt ◦ ϕ̂)(x), where ŵt = T̂t,·
Notion of Complexity We use Gaussian complexity and Rademacher complexity to measure the function class complexity. Definition 3.1 (Gaussian and Rademacher complexity). Let F ⊂ {f : Rp → Rq} be a vectorvalued function class, the empirical Gaussian and Rademacher complexity on n points X = {x1, . . . , xn} are defined as:
Ĝn(F|X) = Eg sup f∈F 1 N ∑ i∈[N ] ∑ k∈[q] gkifk(xi)  , R̂n(F|X) = Eϵ sup f∈F 1 N ∑ i∈[N ] ∑ k∈[q] ϵkifk(xi)  , where gki’s are all standard Gaussian random variables, ϵki’s are Rademacher random variables, and fk is the kth entry of f .
Let Gn(F) = EX [Ĝn(F|X)] denote the expected Gaussian complexity (similarly for Rademacher complexity). To deal with the divergence among domains, we adopt the following notions from Tripuraneni et al. (2020): Gn(W) = maxZ∈Z Ĝn(W|Z), where Z = {(ϕ (x1) , · · · , ϕ (xn)) | ϕ ∈ Φ, xi ∈ X for all i ∈ [n]}. To measure the complexity of tensors, we use the notion of pseudo-dimension. Definition 3.2 (Pseudo-dimension). Let F ⊆ RX be a real-valued function class. Let xm1 = (x1, . . . , xm) ∈ Xm. We say xm1 is pseudo-shattered by F is there exists r = (r1, . . . , rm) ∈ Rm such that for all b = (b1, . . . , bm) ∈ {±1}m, there exists f ∈ F such that sign(fb(xi) − ri) = bi for all i ∈ [m]. The pseudo-dimension of F is defined as:
Pdim(F) = max { m ∈ N : ∃xm1 s.t xm1 is pseudo-shattered by F } .

heading: 4 THEORETICAL RESULTS
text: In this section, we derive the sample complexity bound for our DG setting. As a high level overview, we first prove that on the T seen source domains, with enough training data and sufficient regularity conditions, we can have ŵt being sufficient close to w∗t on the source domains. Then we show that with a large enough T , even on an unseen domain t ∈ [D]\[T ] we can also approximate w∗t well by completing the low-rank tensor formed by learned ŵt. Finally, by certain regularity conditions on the loss function, we can show the excess risk is also small.
We require the following regularity assumptions for our theoretical development. Assumption 4.1. 1. The learning problem is realizable, that is, w∗t ∈ W for all t ∈ [D] and
ϕ∗ ∈ Φ. WLOG assume that w∗t ◦ ϕ∗ is the unique minimizer of Lt for all t.
2. ℓ(·, ·) is B-bounded, and ℓ(·, y) is L-Lipschitz.
3. For all w ∈ W , ∥w∥ ≤ W .
4. supx ∥ϕ(x)∥ ≤ DX , for any ϕ ∈ Φ.
5. For all t ∈ [D], Lt is λ-strongly convex in wt for ϕ∗.
The first assumption is indeed general. Since we care about the excess risk, in realizable problems we can compare to the unique minimizer of L in W◦Φ instead of w∗t ◦ϕ∗. The existence of a unique minimizer is necessary, otherwise tensor completion can lead to arbitrary errors. Assumptions 2-4 are common. Lastly, without strong convexity in the last assumption, one cannot derive the closeness of ŵt to w∗t from the closeness of the excess risk on source domains.

heading: 4.1 LEARNING COMMON REPRESENTATION
text: In this subsection, we discuss how to learn the shared representation. The proof follows Tripuraneni et al. (2020) with modifications to adopt to our setting. First we introduce some definitions that defines the divergence among the source domains and target domains.
Definition 4.1. For a function class W , T functions w1, . . . , wT , and data (xt, yt) ∼ Dt for any t ∈ [T ], the task-average representation difference (TARD) between representation ϕ and ϕ′ is defined as:
d̄W,w(ϕ ′;ϕ) =
1
T ∑ t∈[T ] inf w′∈W E Dt (ℓ(w′ ◦ ϕ′)− ℓ(wt ◦ ϕ)) .
Let w∗, ϕ∗ be the true underlying functions. Define the uniform absolute representation difference (UARD) to be
dW(ϕ ′;ϕ) = sup
t∈[D] sup wt∈W ∣∣∣∣EDt (ℓ(wt ◦ ϕ′)− ℓ(wt ◦ ϕ)) ∣∣∣∣ .
For W , we say w = {w1, . . . , wT } is (ν, ϵ)-diverse for a representation ϕ, if the following holds for all ϕ′ ∈ Φ:
dW(ϕ ′;ϕ) ≤ d̄W,w(ϕ′;ϕ)/ν + ϵ.
The notion of task-average representation difference was introduced by Tripuraneni et al. (2020). In their setting, they bound the worse-case representation difference (WCRD) between two representations ϕ, ϕ′ ∈ Φ which is defined as
sup w∈W inf w′∈W E (x,y)∼Pw◦ϕ
[ℓ(w′ ◦ ϕ′)− ℓ(w ◦ ϕ)],
using the task-average representation difference. One should note that WCRD is changing the data distribution, while UARD takes expectation over the true distribution Dt. We are saying that under the true distribution, the worst case difference between using ϕ vs. ϕ′, over both the choice of linear classifiers w and the domains, is not much larger than TARD. Intuitively, this says that our source domains and task domains are benign enough, such that the ERM ϕ̂ performs similarly to the true ϕ∗.
Although it seems that d̄W,w(ϕ′;ϕ) can be negative and dW(ϕ′;ϕ) is always positive, later we only consider d̄W,w∗(ϕ′;ϕ∗) and w∗t ◦ϕ∗ is assumed to be the minimizer. Hence, d̄W,w∗(ϕ′;ϕ∗) is always positive, and our notion of task diversity makes sense.
We cite the following theorem from Tripuraneni et al. (2020).
Theorem 4.1. Let ϕ̂ be the ERM in eq. (2). Under assumption 4.1, with probability at least 1 − δ, we have
d̄W,w∗(ϕ̂, ϕ ∗) ≤ 4096L [ WDX (nT )2 + log(nT ) · [ W ·GnT (Φ) +Gn(W) ]] + 8B √ log(2/δ) nT .

heading: 4.2 LEARNING DOMAIN SPECIFIC LINEAR LAYER AND TENSOR COMPLETION
text: Now we give results for learning the domain specific linear classification.
Theorem 4.2. Let ŵ, ϕ̂ be the ERM in eq. (2). Let assumption 4.1 holds. With probability at least 1− δ, we have
1 T ∑ t∈[T ] ∥ŵt − w∗t ∥2 = O (√ 2 λ ( L [ WDX (nT )2 + log(nT ) · [ W ·GnT (Φ) +Gn(W) ] ] + 8B √ log(2/δ) nT )1/2) .
The proof of Theorem 4.2 starts with showing that L(ŵt ◦ ϕ∗) is close to L(w∗t ◦ ϕ∗), while a normal ERM analysis only asserts L(ŵt ◦ ϕ̂) is close to L(w∗t ◦ ϕ∗). Such assertion holds by the (ν, ϵ)-diverse assumption. Intuitively, such diversity assumption makes sure our learning landscape is somehow smooth: ŵt should be stable such that if we perturb ϕ̂ to ϕ∗, the loss function does not alter too much. Together with strong convexity, these conditions guarantee ŵt is close to the true w∗t on average.
After we learn ŵt for all t ∈ [T ], we find another ERM T̂ by constructing p tensors T̂·,i for all i ∈ [p] separately as in eq. (3). We only observe the empirical tensor completion loss 1T ∑T t=1 |T̂t,i− T̃t,i| during training. With large enough T , by a uniform convergence argument, we can show that 1 T ∑T t=1 |T̂t,i − T̃t,i| can approximate 1 D ∑D t=1 |T̂t,i − T ∗t,i| fairly accurately. Lemma 4.1. Let XK be the class of rank-K tensor of shape d×M , its pseudo-dimension can be bounded by Pdim(XK) ≤ KdM2 log(8ed).
Pdim(XK) is computed by treating tensors as polynomials and counting the connected components of these polynomials. Even though any X ∈ XK has dM entries, its complexity only scales as poly(K, d,M). This assures that we only need to see polynomially many source tasks to perform well in unseen domains. Using the pseudo-dimension, we have the following uniform convergence result. Theorem 4.3. With probability at least 1− δ,
1
D ∑ t∈[D] ∥∥∥T̂t,· − T ∗t,·∥∥∥ ≤ 1T ∑ t∈[T ] ∑ j∈[p] ∣∣∣T̂t,j − T̃t,j∣∣∣+ p√KdM2 log (8ed) + log(p/δ) T + Õ(n−1/4).
(4)
The last O(n−1/4) term in eq. (4) comes from Theorem 4.2. This is the cost we pay for not knowing the true T ∗t,·. If in each source domains we have infinity number of training samples, then statistically Theorem 4.2 recovers the true T ∗t,·. In this case, we only need to observe T = poly(p,K, d,M) source domains.

heading: 4.3 MAIN THEOREM
text: We are now ready to show our main result. Theorem 4.4. Let assumption 4.1 holds and w∗ = {w∗1 . . . , w∗T } being (ν, ϵ)-diverse for representation ϕ∗. With probability at least 1− 3δ, the following holds:
1
D D∑ t=1 E (x,y)∼Dt [ℓ(ŵt ◦ ϕ̂(x), y)− ℓ(w∗t ◦ ϕ∗(x), y)] ≤ LDXW T ∑ t∈[T ] ∑ j∈[p] ∣∣∣ŵt,j − T̃t,j∣∣∣ + LDXWp √ KdM2 log (8ed) + log(p/δ)
T + Õ
( C(W)
n +
C(Φ)
nT
)1/4 .
The first two terms correspond to the cost of tensor completion and the last term corresponds to predicting with inaccurate ϕ̂. The term ∑ t∈[T ] ∑ j∈[p] ∣∣∣ŵt,j − T̃t,j∣∣∣ can be exactly computed on the training dataset. Recall ŵt is the learned by eq. (2) and T̂t,· is the estimated linear classifier after tensor completion. As n increases, this difference becomes smaller as ŵt becoming close to w∗t .

heading: 5 EXPERIMENTS
text: We empirically verify that our proposed model leads to better generalization performance than baseline model with vanilla representation learning on both a variant of MNIST dataset and a fiber sensing dataset. On both datasets, we use LeNet trained on all available training data as the baseline. According to Li et al. (2017; 2019), this is a simple yet strong baseline that outperforms most domain generalization methods. Our model is trained in an end-to-end fashion. Instead of finding ERMs in eq. (2) and perform tensor completion, we directly represent ŵt = ∑K k=1 ⊙Mm=1 α̂k,tm , and output
α̂k,tm , ϕ̂ = argmin ϕ∈Φ, αk,tm
1
nT T∑ t=1 n∑ i=1 ℓ
( (
K∑ k=1 M ⊙ m=1 αk,tm ◦ ϕ)(xt,i), yt,i
) . (5)
In this way, we can fully exploit the computational convenience of auto-differentiation rather than dealing with the algorithmic difficulty of tensor completion. All models are trained using the cross entropy loss. Since our theorem is a uniform convergence bound by nature, the sample complexity will also apply to the end-to-end trained model 1. See more discussion in the appendix. To prevent overfitting, we stop training of all models on the two-way MNIST dataset as soon as the last 50 iterations have average loss less than 0.05, and the training of all models on a four-way fiber sensing dataset is stopped once the last 100 iterations have average loss less than 0.05. Throughout the experiments, the Adam optimizer with default learning rate 10−3 is used. The sensitivity of the regularization parameter is investigated on MNIST data and we set it to 0.05 for all rest of the experiments. For MNIST dataset, the source and target domain data are augmented from MNIST training and test data respectively. For the fiber sensing dataset, the source and target domain data are collected in separate experimental rounds. Across all results tables, mean accuracy is outside the parenthesis, standard deviation is inside the parenthesis.

heading: 5.1 TWO-WAY MNIST
text: A variant of MNIST is created by rotation and translation operations. We rotate all MNIST digits by [−30,−15, 0, 15, 30] degrees, and translate all MNIST by [(−3, 0), (0,−3), (0, 0), (0, 3), (3, 0)] pixels, leading to 5× 5 domains. For our proposed method, we use a simplified low-rank structure on the last two layers of LeNet. Specifically, LeNet has the structure of conv1-pool1-conv2-pool2-fc1-relu-fc2-relu-fc3-sigmoid. We impose the low-rank structure on both fc2 and fc3.
We create 11 linear classifiers for each layer, denote as s1, . . . , s5, v1, . . . , v5, u. For task (i, j) ∈ 5× 5, we use si+vj+u for prediction. This formulation is just a special case of the general formulation in eq. (1). Indeed, let α1 = [s1, s2, s3, s4, s5,1,1,1,1,1], α2 = [1,1,1,1,1, v1, v2, v3, v4, v5], and α3 = [u, u, u, u, u,1,1,1,1,1], where each wi, vi, u,1 ∈ Rp and αk ∈ R10 × Rp. Then for any task at t = (i, j) ∈ 5 × 5, its classifier wt this can be formally written as wt =∑3
k=1 αk,i ⊙ αk,5+j , which is the same form as eq. (1). This is done for both fc2 and fc3, and each layer has its own distinct set of weights.
Similar idea has been previously proposed for domain generalization Yang & Hospedales (2017); Li et al. (2017). These previous works do not assume a tensor structure on the tasks. Instead, they put a low-rank tensor structure on the classifiers themselves. This fundamentally distinguishes our settings from previous ones. As a result, during test phase they have to use the common classifier u for different target domains, but we can incorporate more prior knowledge by using si + vj + u.
During training time, we collect training data from (i, i) entries for all i ∈ [5], and leave data in any other domains for test only. This is one of the designs requires the minimal number of source domains, and we can still successfully train all unknown classifiers s, v and u. Due to the excess amount of learnable parameters, it is easy to overfit on our method. To reduce model
1Some theorems require ŵt, ϕ̂ being the ERM of eq. (2). In those cases, we can simply modify ŵt to be the corresponding entries of the tensor T̂ formed by α̂k,tm and substitute eq. (5) for eq. (2). This is justified since we assume the learning problem is realizable.
complexity, we regularize all learnable classifiers to be close to their mean. That is, on each lowrank layer, let µ = 111 ( ∑ i vi + ∑ j sj + u), we add the following regularizer to the loss function
Ωλ(s, v, u) = λ 11 (∑ i ∥vi − µ∥2 + ∑ j ∥sj − µ∥2 + ∥u− µ∥2 ) .
We run the experiments 10 times and report the mean performances and standard deviations in Table 1. Since this method uses the domain description information (i, j) during testing, we refer to it as the domain-specific model. In addition, we also report the performance of using just the common classifier u in fc2 and fc3. This model uses no domain information during testing, and we call it the domain-agnostic model. The baseline model is LeNet trained with data pooled from all source domains together. Notice that each si + vj + ν corresponds to a unique task descriptor qi,j that serves as the coefficients for the combination of the linear layers, so for the ZSDA model, we further trained another descriptor network that outputs ReLU(Wq) as the new coefficients. This is done for both the last two layers. Our method almost uniformly dominates the baseline in every domain, sometimes by a large margin, and almost matches the performance of the ZSDA model, with less parameters. The domain-agnostic model achieves comparable performances to our proposed method. This shows that with the low-rank tensor structure, domain-agnostic models can also accommodate the domain shifts on this dataset. On most test domains, especially the ones that are “further away” from the training domains, our proposed algorithm consistently outperforms Fish (Shi et al., 2021), one of the state of the art domain generalization algorithms. Such results are expected as the Fish algorithm does not consider multi-way structure into consideration.
Another interesting observation is that the performances of all models are better near the diagonal, and getting worse away from the diagonal. This may provide insight into how we should design experiments under a fixed budget of data collection. A conjecture is that the performances on unseen target domains relate to the Manhattan distance of these domains to the seen source domains. Further discussion is deferred to the appendix.

heading: 5.2 FOUR-WAY FIBER SENSING DATASET
text: The distributed optic fiber sensing technique turns underground cable of tens of kilometers into a linear array of sensors, which could be used for traffic monitoring in smart city applications. In this paper, we aim to build a classifier for automatic vehicle counting and run-off-road event detection.
The objective is to classify whether the sensed vibration signal is purely ambient noise, or it contains vibration caused by a vehicle either driving normally or crossing the rumbling stripes alongside the road. The sensing data takes the form of a 2D spatio-temporal array that can be viewed as an
image - each pixel represents the vibration intensity at a particular time and location along the cable. Vehicles driving on the road, running-off-road, and ambient noise all create different patterns, which makes convolutional neural networks a natural choice for a 3-class classification model.
In experimental design, we consider several influencing factors representing the practical challenges faced after field deployment. These factors include weather-ground conditions (sunny-dry, rainywet), shoulder type (grass, concrete), sensing distance (0km, 10km, 15km), and vehicle type (van, sedan, truck), which produce combined effects on the data domain. In order to evaluate our approach, we spent efforts on collecting data with all possible combinations of the levels in the aforementioned factors in a lab testbed, resulting to a multiway data indexed by a 2 × 3 × 3 × 2 tensor. Under each condition, we conduct 20 ∼ 25 rounds for the run-off-road events and normal driving. The ambient noise data is collected when no vehicles are near the cable. The classes are balanced in both training and test data.
We evaluate model performance against number of source domains (5, 10, 15, or 20, each with 10 simulation runs) and results are shown in Figure 1(a). The performance increases with number of source domains as expected. In particular, Figure 1(b) summarizes the test performance for models trained with 10 source domains and tested on the rest. In each run, the observed source domains are randomly sampled. Among the 10 runs, ”rainy-sedan-15km-grass” happens to be always selected as the source domain, thus the test result is not available for this domain.
We add two additional low-rank models in the form of eq. (5) with K = 2 and 3 just in the last layer for comparison. Among the combination of factor levels, some scenarios are more challenging than others. For example, sedan is the lightest vehicle among the three, which generates much weaker vibration than a truck. Also the signal-to-noise ratio decays with increasing sensing distance. Results show that in most of the cases, our ZSDA models achieve improved performance over the baseline, and the margins over baseline are particularly large in several challenging scenarios.

heading: 6 CONCLUSION
text: In this work, we propose a particular domain adaptation framework where T out of D = dM total domains are observed during training. All D domains are parameterized by a common latent representation and their domain-specific linear functionals, which form a d×M -dimensional low-rank tensor. This multilinear structure allows us to achieve an average excess risk of order
Õ ((
TC(W)+C(Φ) nT
)1/4 + p ( KdM2
T
)1/2) . In addition to domain adaptation, our setting also sheds
light on more efficient experiment designs and data augmentations. Algorithms developed under our framework are empirically verified on both benchmark and real-world datasets.

heading: A PROOFS IN SECTION 4
text: Theorem 4.2. Let ŵ, ϕ̂ be the ERM in eq. (2). Let assumption 4.1 holds. With probability at least 1− δ, we have
1 T ∑ t∈[T ] ∥ŵt − w∗t ∥2 = O (√ 2 λ ( L [ WDX (nT )2 + log(nT ) · [ W ·GnT (Φ) +Gn(W) ] ] + 8B √ log(2/δ) nT )1/2) .
Proof. By a standard decomposition, we have with probability at least 1− 2δ 1
T ∑ t∈[T ] ( L(ŵt ◦ ϕ̂)− L(w∗t ◦ ϕ∗) ) = 1
T ∑ t∈[T ] ( EDt [ℓ(ŵt ◦ ϕ̂)]− EDt [(w∗t ◦ ϕ∗)] ) ≤ 1 T ∑ t∈[T ] EDt [ℓ(ŵt ◦ ϕ̂)]− 1 nT ∑ t∈[T ] ∑ i∈[n] ℓ((ŵt ◦ ϕ̂)(xt,i), yi)
+ 1
nT ∑ t∈[T ] ∑ i∈[n] ℓ((ŵt ◦ ϕ̂)(xt,i), yi)− 1 nT ∑ t∈[T ] ∑ i∈[n] ℓ((w∗t ◦ ϕ∗)(xt,i), yi)
+ 1
nT ∑ t∈[T ] ∑ i∈[n] ℓ((w∗t ◦ ϕ∗)(xt,i), yi)− EDt [ℓ(w∗t ◦ ϕ∗)]
≤2 sup w1,...,wT∈W,
ϕ∈Φ
∣∣∣∣∣∣ 1T ∑ t∈[T ] EDt [ℓ(wt ◦ ϕ)]− 1 nT ∑ t∈[T ] ∑ i∈[n] ℓ((wt ◦ ϕ)(xt,i), yi) ∣∣∣∣∣∣ ≤4RnT (ℓ(W⊗T ◦ Φ)) + 4B √ log(1/δ)
nT ≤8LRnT (W⊗T ◦ Φ) + 8B √ log(1/δ)
nT Use the fact that R̂n(H) ≤ √ π/2Ĝn(H) for any function class H and the decomposition of RnT (W⊗T ◦ Φ) introduced in Tripuraneni et al. (2020), we conclude that
1
T T∑ t=1 ( L(ŵt ◦ ϕ̂)− L(w∗t ◦ ϕ∗) ) ≤ 4096L [ WDX (nT )2 + log(nT ) · [ W ·GnT (Φ) +Gn(W) ]] + 8B √ log(2/δ)
nT︸ ︷︷ ︸ 1⃝
Meanwhile, by our assumption of uniform absolute representation difference and (ν, ϵ)-task diversity:
1
T T∑ t=1 ( L(ŵt ◦ ϕ∗)− L(ŵt ◦ ϕ̂) ) ≤ 1 T T∑ t=1 ∣∣∣L(ŵt ◦ ϕ∗)− L(ŵt ◦ ϕ̂)∣∣∣ ≤ dW(ϕ̂;ϕ∗) ≤ d̄W,w∗(ϕ̂, ϕ∗)/ν + ϵ, which gives
1
T T∑ t=1 (L(ŵt ◦ ϕ∗)− L(w∗t ◦ ϕ∗)) = 1 T T∑ t=1 ( L(ŵt ◦ ϕ∗)− L(ŵt ◦ ϕ̂) ) + 1 T T∑ t=1 ( L(ŵt ◦ ϕ̂)− L(w∗t ◦ ϕ∗) ) ≤ 1⃝+ 1⃝/ν + ϵ,
where we use dW,w∗(ϕ̂, ϕ∗) ≤ 1⃝ from Theorem 4.1. By strong convexity, we conclude for any T ∈ [D], ν ≤ 1:
1
T ∑ t∈[T ] ∥ŵt − w∗t ∥2 ≤ √ 2 λ  1 T ∑ t∈[T ] (L(ŵt ◦ ϕ∗)− L(w∗t ◦ ϕ∗)) 1/2
≤ √ 4
λν
( 4096L [WDX (nT )2 + log(nT ) · [ W ·GnT (Φ) +Gn(W) ] ] + 8B √ log(2/δ) nT + ϵ )1/2 .
Now we proceed to show the results related to tensor completion. The main idea is to treat a tensor as a polynomial, and count its connect components. This number restricts the complexity of the tensor.
Corollary A.1. The number of {±1, 0} sign configurations of r polynomials of degree at most d, over q variables, is at most (8edr/q)q for r > q > 2.
Lemma 4.1. Let XK be the class of rank-K tensor of shape d×M , its pseudo-dimension can be bounded by Pdim(XK) ≤ KdM2 log(8ed). Proof. Let fT (d,M,K) = ∣∣∣{sign(X − T ) ∈ {±1, 0}d×M : X ∈ XK}∣∣∣. It suffices to show that
fT (d,M,K) ≤ (8ed)KdM 2 . A rank K d×M tensor can be decomposed as:
Xt = K∑ k=1 M∏ m=1 Uk,tm
for t ∈ [d]×M . Then one can treat X−T as dM polynomials of degree at most M over the following entries:
(X − T )t = K∑
k=1 M∏ m=1 Uk,tm − Tt.
T is a fixed arbitrary tensor, so there are in total KdM variables. Applying Corollary A.1 yields the desired result.
Theorem 4.3. With probability at least 1− δ,
1
D ∑ t∈[D] ∥∥∥T̂t,· − T ∗t,·∥∥∥ ≤ 1T ∑ t∈[T ] ∑ j∈[p] ∣∣∣T̂t,j − T̃t,j∣∣∣+ p√KdM2 log (8ed) + log(p/δ) T + Õ(n−1/4).
(4)
Proof. The following equation holds with probability at least 1 − δ, and follows directly from the uniform convergence bound using covering number and bounding covering number using pseudodimension. See Srebro & Shraibman (2005) for detail.
1
D ∑ t∈[D] ∣∣∣T̂t,j − T ∗t,j∣∣∣ ≤ 1T ∑ t∈[T ] ∣∣∣T̂t,j − T ∗t,j∣∣∣+ √ KdM2 log (8ed)− log δ T . (6)
Then by triangle inequality and equivalence of norms in finite-dimensional spaces
1
D ∑ t∈[D] ∥∥∥T̂t,· − T ∗t,·∥∥∥ ≤ 1D ∑ t∈[D] ∑ j∈[p] ∣∣∣T̂t,j − T ∗t,j∣∣∣ ≤ 1
T ∑ t∈[T ] ∑ t∈[p] ∣∣∣T̂t,j − T ∗t,j∣∣∣+ p √ KdM2 log (8ed) + log(p/δ) T
≤ 1 T ∑ t∈[T ] ∑ t∈[p] ∣∣∣T̂t,j − T̃t,j∣∣∣+ p√KdM2 log (8ed) + log(p/δ) T + 1 T ∑ t∈[T ] ∑ t∈[p] ∣∣∣T̃t,j − T ∗t,j∣∣∣ ≤ 1
T ∑ t∈[T ] ∑ j∈[p] ∣∣∣T̂t,j − T̃t,j∣∣∣+ p√KdM2 log (8ed) + log(p/δ) T +O(p1/2n−1/4),
where the first step is from the fact that ∥ · ∥2 ≤ ∥ · ∥1 and union bounding eq. (6) over p events. The O(p1/2n−1/4) term follows from Theorem 4.2 and equivalence between norms. Note that p ≪ n hence asymptotically our conclusion holds.
Theorem 4.4. Let assumption 4.1 holds and w∗ = {w∗1 . . . , w∗T } being (ν, ϵ)-diverse for representation ϕ∗. With probability at least 1− 3δ, the following holds:
1
D D∑ t=1 E (x,y)∼Dt [ℓ(ŵt ◦ ϕ̂(x), y)− ℓ(w∗t ◦ ϕ∗(x), y)] ≤ LDXW T ∑ t∈[T ] ∑ j∈[p] ∣∣∣ŵt,j − T̃t,j∣∣∣ + LDXWp √ KdM2 log (8ed) + log(p/δ)
T + Õ
( C(W)
n +
C(Φ)
nT
)1/4 .
Proof.
1
D D∑ t=1 E (x,y)∼Dt [ℓ(ŵt ◦ ϕ̂(x), y)− ℓ(w∗t ◦ ϕ∗(x), y)]
= 1
D D∑ t=1 E (x,y)∼Dt
[ℓ(ŵt ◦ ϕ̂(x), y)− ℓ(ŵt ◦ ϕ∗(x), y)]︸ ︷︷ ︸ A
+ 1
D D∑ t=1
EDt [ℓ(ŵt ◦ ϕ∗(x), y)− ℓ(w∗t ◦ ϕ∗(x), y)]︸ ︷︷ ︸ B
Let d̄W,w∗(ϕ̂, ϕ∗) be as defined in definition 4.1. By our assumption of uniform absolute representation difference and (ν, ϵ)-diverse, we can upper bound A by d̄W,w∗(ϕ̂, ϕ∗)/ν+ϵ. The second term can be bounded by lipschitzness,
B ≤ 1 D ∑ t∈[D] EDt [L |ŵt ◦ ϕ∗(x)− w∗t ◦ ϕ∗(x)|]
≤ 1 D ∑ t∈[D] EDt [L∥ŵt − w∗t ∥∥ϕ∗(x)∥]
≤ LDX D ∑ t∈[D] ∥ŵt − w∗t ∥.
Plug in our approximation to dW,w∗(ϕ̂, ϕ∗) in Theorem 4.1, 1D ∑
t∈[D] ∥ŵt − w∗t ∥ in Theorem 4.4, and union bound, we conclude the theorem.

heading: B MORE DISCUSSION TO SECTION 5
text: We mention in Section 5.1 that the test accuracy on unseen domain might relate to the Manhattan distance between the seen and unseen domains. Here is another experiment in the same setting as in section 5.1, but the chosen observed entries are [(0,0), (1,3), (2,2), (3,1), (4,4)].
In both Table 2 and Table 1, every factor level has been observed exactly once. If the factors are categorical nominal, then permuting rows 2 and row 4 in Table 2 leads to the same balanced design with Table 1, and the performance shall be similar. However, the factors (rotation, translation) considered here are not nominal, for example, there is a ordinal relation between rotation −30 and rotation −15. Hence, the above-mentioned permutation seems prohibitive. Consequently, it makes sense to talk about Manhattan distances between observed and unobserved entries.
In Table 1, cell (4,0) is 4 units away from its closest observed cell in Manhattan distance (in the following we omit to mention the metric is Manhattan distance), but in Table 2, (4,0) is 2 units away from the closest observed entry. One can see the accuracy in that domain gets much better. However, the closest distance to the observed entry is not the only factor here. For example, (0,1) in Table 1 outperforms (0,1) in Table 2 a lot. Therefore, the average distance to the observed entries may also be a contributing factor.
It is an open question how to select the best subset of tensor entries to be observed, such that the overall performance in the unseen target domains can be optimized. This question may relate to the area of factorial experiment design, where many factors are involved and some have confounded interactions. One subject is to design minimal sets of experiments such that the effects of all factors can be studied. Our theory deals particularly with the case when the factor combinations are chosen uniformly at random, without assuming any particular tensor structure. With more prior knowledge, more efficient sampling algorithms can be designed. For instance, McKay et al. (2000) discussed how to use Latin hypercube sampling to achieve a smaller sample complexity. There are also some works that connect the dots between error coding theory and factorial experiment design Ben-Gal & Levitin (2001). There could be information theoretic understanding to the relation between our setting of experiment design and Manhattan distance as well. This can be an interesting research direction and beyond the scope of our paper.
Fish Algorithm The Fish algorithm was proposed in Shi et al. (2021) as a domain generalization method, which achieves state-of-the-art results on the WILDS benchmarks. Its intuition is that the model should be regularized (implicitly) during training such that the gradient steps on different domains are invariant, thus leading to an invariant feature representation across different domain. Comparing to the Fish algorithm, our proposed algorithm consistently outperforms Fish on most test domains, especially the ones that are “further away” from the training domains. Such results
are expected as the Fish algorithm does not consider multi-way structure into consideration. See the results in table 1.
Fish is used for the LeNet architecture. Its inner step is trained using an Adam optimizer with step size 10−2 and the meta step uses a learning rate of 0.5. The number of meta steps is set to be 5. We use the same hyperparameters in the GTOS experiment as well. During training, we found out that the Fish algorithm does not converge well if the batch size is too large. Hence we pick batch size 20. This is of the same magnitude as the batch size in Shi et al. (2021), but our proposed model and the ERM models exhibit better generalization when trained with larger batch size 200.
Hyperparameter Sensitivity Model selection in domain adaptation is tricky in general, since no data from the target domains is seen. One benefit of using the special low-rank formulation is that it has fewer number of tuning parameters than general low-rank formulations. In addition to tuning λ in the regularizer Ωλ, the form in eq. (5) also requires to choose rank K. We evaluate the sensitivity of λ on both the source and target domains. Observing data from (i, i) domains on the diagonal, we train on 5000 training data using λ ∈ [0.005, 0.01, 0.03, 0.05, 0.1, 0.5, 1], and test on 1000 data from both (i, i) source domains for i ∈ [5] and (i, j) task domains for i ̸= j ∈ [5]. Results show that the test performances on both source domains and target domains are insensitive to λ. The mean performances and standard deviations are reported in Table 3.

heading: C THREE-WAY GROUND TERRAIN IN OUTDOOR SCENES DATASET
text: To train a model invariant to domain shifts, one would either need to collect massive training data from many different domains such that the model is able to generalize (implicitly) to unseen cases, or build a mechanism allowing (explicitly) adaptation to new scenarios utilizing limited domain information. Our work belongs to the latter.
The proposed multi-way domain setup represents a combination of the environmental or experimental factors, which naturally arises in many real life applications and the levels of factors are pre-known. This setup is general enough for many tasks, especially those involving data collection experiments that are costly and limited by physical constraints. To make the applicability of our method more compelling, we present results on the GTOS (Ground Terrain in Outdoor Scenes) dataset (Xue et al., 2017), which a large-scale real-world dataset that naturally fits into our framework.
The task of outdoor ground material recognition is strongly influenced by the weather and lighting conditions, as well as the surface viewpoints. The GTOS dataset consists of over 30, 000 images covering 40 classes (cement, asphalt, brick, etc.). The multi-way domain structure include: 4 different weather conditions (cloudy dry, cloudy wet, sunny morning and sunny afternoon), 3 illumination conditions with different exposure times, and 19 viewpoints from differential angular imaging. As a result, each domain is indexed on a multidimensional array of size 4× 3× 19. Experimental results in table 4 show that our method outperforms both the ERM and the Fish algorithm.
For our model, we use the same architecture as described in the beginning of section 5.1: a simplified low-rank structure on the last two layers of LeNet. Specifically, LeNet has the structure of conv1pool1-conv2-pool2-fc1-relu-fc2-relu-fc3-sigmoid. We impose the low-rank structure on both fc2 and fc3. We create 27 linear classifiers for each layer, denote as si, uj , vk, h, for i ∈ [3], j ∈ [4], k ∈
[19]. For task (i, j, k) ∈ [3]× [4]× [19], we use si + uj + vk + h for prediction. The ERM model and Fish model both use LeNet.
Both our model and the ERM model are trained using Adam optimizers with learning rate 10−3 with batch size 200. The Fish model was trained with batch size 20, its inner step is trained with an Adam optimizer with learning rate 10−2 and the meta step has learning rate 0.5. We choose 5 for the meta steps N (this is the parameter that determines how many training domains the model sees at every iteration. The original paper tested N = 5, 10, 20 and found the performance insensitive to N ).
During training, we found that Fish tends to not converging with large batch size, hence we reduce the batch size from 200 to 20. For Fish to converge, we also need to increase the learning rate. One conjecture of this phenomenon is because the number of observed training domains is quite large, hence it is hard to match their gradients. As Shi et al. (2021) pointed out, Fish usually does not outperform ERM when the number of domains is enormous. This is consistent with our observation.

Review summaries:
The paper considers the problem of zero-shot domain adaptation. The contributions are two-fold. The authors propose a novel domain adaptation technique and provide bounds on the prediction error, which they provide proofs for. In addition, they provide empirical validation of their proposed approach, on two sets of datasets: one derived from MNIST, the second corresponding to sensors.

Short summary:   The authors propose a zero-shot domain adaptation method with the assumption of each domain having the same set of labels. They obtain finite sample complexity bounds that contain the number of samples(n) per class in the training, the number of seen(training) and unseen(test) tasks under regularity assumptions on the loss and mappings. They provide accuracy results for MNIST and MNIST with rotated digits.   Method:   First, a common linear mapping is used to obtain a common representation for tasks. Then each domain-specific classifer(linear) combines at each index as a rank K tensor. A tensor completion is applied at each index that would give classifier parameters for unseen data as well, that allows them to predict without any data from the target domain. They assume same number of samples and same input dimensions for each domain (the latter can directly be extended to different dimensions). For the experiments, they use LeNet and directly predicted decomposed tensors rather than training and applying tensor completion.  Contributions:   The authors extend Tripuraneni et al. (2020) method and proofs from transfer learning to zero-shot case. They show a uniform convergence bound that has polynomial complexity with respect to the # tasks, # dimensions and rank. They derive excess risk on the order of n^-1/4.  

This paper proposes a specific domain adaptation framework where a subset of all possible domains is are observed during training. Given sufficient training samples for the observed source domains, a common latent representation as well as a domain specific linear classifier is learned. Theoretical conditions under which the learned representations will be effective for unseen domains are provided. Experiments using two datasets are provided. 

The paper addresses the problem of domain generalization in the setting where each domain is indexed on a multidimensional array. It assumes that only a limited number of domains is observed during training and presents a technique for learning a classifier with provable good generalization performance on the unseen domains. The method consists of learning a common latent feature representation for all domains and domain-specific linear functionals, which are obtained by imposing a low-rank constraint on the tensor built by aggregating the functionals of all domains. The authors present a thorough theoretical analysis of the algorithm, including an upper bound for the excess risk on the target domain.