ManyDG: Many-domain Generalization for Healthcare Applications
Authors: Chaoqi Yang
M Brandon Westover
Jimeng Sun
Venue: ICLR 2023 poster (2023)
Keywords: Patient covariate shift
Domain Generalization
Healthcare
EEG
EHR

Abstract: The vast amount of health data has been continuously collected for each patient, providing opportunities to support diverse healthcare predictive tasks such as seizure detection and hospitalization prediction. Existing models are mostly trained on other patients’ data and evaluated on new patients. Many of them might suffer from poor generalizability. One key reason can be overfitting due to the unique information related to patient identities and their data collection environments, referred to as patient covariates in the paper. These patient covariates usually do not contribute to predicting the targets but are often difficult to remove. As a result, they can bias the model training process and impede generalization. In healthcare applications, most existing domain generalization methods assume a small number of domains. In this paper, considering the diversity of patient covariates, we propose a new setting by treating each patient as a separate domain (leading to many domains). We develop a new domain generalization method ManyDG, that can scale to such many-domain problems. Our method identifies the patient do- main covariates by mutual reconstruction, and removes them via an orthogonal projection step. Extensive experiments show that ManyDG can boost the generalization performance on multiple real-world healthcare tasks (e.g., 3.7% Jaccard improvements on MIMIC drug recommendation) and support realistic but challenging settings such as insufficient data and continuous learning. The code is available at https://github.com/ycq091044/ManyDG. 

Published as a conference paper at ICLR 2023
MANYDG: MANY-DOMAIN GENERALIZATION HEALTHCARE APPLICATIONS
FOR
Chaogi Yang', M. Brandon Westover Jimeng Sun
Universityy of Illinois Jrbana-Champaign Harvard Medical School
Beth Israel Deaconess Medical Center
{chaoqiy 2 e iiniisiii. .dd edu
ABSTRACT
The vast amount of health data has been continuously collected for each pa- tient, providing opportunities to support diverse healthcare predictive tasks such as seizure detection and hospitalization prediction. Existing models are mostly trained on other patients' data and evaluated might suffer from poor generalizability. One key reason can be overfitting due the unique information related patient identities and their data collection en- vironments, referred to as patien! covariates in the paper. These patient covariates usually do not contribute to predicting the targets but are often difficult remove. As a result, they can bias the model training process and impede generalization. In healthcare applications, most existing domain generalization methods assume a small number of domains. In this paper, considering the diversity patient covariates, we propose new setting by treating each patient as a separate domain (leading to many domains). We develop a new domain generalization method ManyDC that can scale such many-domain problems. Our method identifies the patient domain covariates by mutual reconstruction, and removes them via an orthogonal projection step. Extensive experiments show that Ma ManyDG the generalization performance on multiple real-world healthcare tasks (c.g., 3.7% Jaccard improvements on MIMIC drug recommendation) and support realistic but challenging settings such as insufficient data and continuous learning.
patients. Many of them
boost
INTRODUCTION
The remarkable ability of functional approximation (Hornik et al. 1989 can be a double-edged sword for deep neural nets (DNN). Standard empirical risk minimization (ERM) models that min- imize average training loss are vulnerable in applications where the model tends to learn spurious correlations (Liu al. 202 Wiles et al. 2022) between covariates (opposed the causal factor (Gulrajani & Lopez- Paz 2021 and the targets during training. Thus, these models often fail on new data that do not have the same spurious correlations. In clinical settings, (Perone al. (2019); Koh et al. (202T); Castro et al. (2020) have shown that prediction model trained on a set of hospitals often does not work well for another hospital due to covariate shifts, e.g., different devices, clinical procedures, and patient population.
Unlike previous settings, this paper targets the patient covariate shift problem in the healthcare ap- plications. Our motivation is that patient-level data unavoidably contains some unique personalized characteristics (namely, patient covariates), for example, different environments (Zhao et al. 2017) and patient identities, which are usually independent of the prediction targets, such as sleep stages (Zhao et al. 2017) and seizure disease types (Hirsch et al., (021). These patient covariates can cause spurious correlations in learning DNN model.
For example, in the electroencephalogram (EEG) sleep staging task, the patient ERG recordings may be collected from different environments, e.g., in sleep lab (Terzano al., 2002) at home (Kemp et al. (200)). These measurement differences (Zhao et al. 2017) can induce noise and biases. is also common that the label distribution per patient can be significantly different. A patient with
Code available at http:///jttaahcmmm/////0100a///a

---

Published as a conference paper at ICLR 2023
insomnia (Rémi et al. 2019) could have more awake stages than ordinary people, and elders tend to have fewer rapid eye movement (REM) stages than teenagers (Ohayon et al. 2004). Furthermore, these patient covariates can be even more harmful when dealing with insufficient training data.
In healthcare applications, recent domain generalization (DG) models are usually developed in cross-institute settings to remove each hospital's unique covariates (Wang al. 2020; Zhang al.
2021 Gao et al. 2021] Reps et al. 2022). Broader domain generalization methods were built with
various techniques, including style-based data augmentations (Nam et al. 2021 Kang et al.) 2022 2018), episodic meta-learning strategies (Li et al.
Volpi et al.
2018a; Balaji et al., 2018 Li et al. and domain- -inmaiinn feature learning (Shao al. 2019) by heuristic metrics (Muandet al. Ghifary et al. (2016) or adversarial learning (Zhao et al. (017).. Most of them (Chang et al.
2019
2013
2019
Zhou et al. 2021) limit the scope within CNN-based models (Bayasi et al. 2022) and hatch
normalization architecture (Li et al. 2017) on image classification tasks.
Unlike previous works that assume a small number of domains, this paper considers a new setting for learning generalizable models from many more domains. To our best knowledge, we are the first to propose the many-domain generulization problem: In healthcare applications, we handle the diversity of patient covariates by modeling each putient separate domain. For this new many- domain problem, we develop an end-to-end domain generalization method, which is trained on a pair of samples from the same patient and optimized via Siamese-type architecture. Our method combines mutual reconstruction and orthogonal projection to explicitly remove the patient covariates for learning (patient-ing innarrnnti label representations. We summarize our main contributions below:
We propose a new many-domain generalization problem for healthcare applications by treating each patient as a domain. Our setting challenging: We handle many more domains (e.g.. 2,702
in the seizure detection task) compared to previous works (e.g., six domains in Li et al. 22200)
We propose a many-domain generalization method ManyDG for the new setting, motivated by a latent data generative model and a factorized prediction model. Our method explicitly captures the domain and
label representation via orthogonal projection.
We evaluate our method ManyDG on four healthcare datasets and two realistic and common clinical settings: (i) insufficient labeled data and (ii) continuous learning on newly available data. Our method achieves consistently higher performance against the best baseline (e.g., 3.7% Jaccard improvements in the benchmark MIMIC drug recommendation task).
2 RELATED WORKS
Domain Generalization (DG) The main difference between DG (Wang et al. 2022) (also called
multi-source domain generalization, MSDG) and domain adaptation (Wilson & Cook| 2020 is that the former cannot access the test data during training and is thus more challenging.
This paper focuses on the DG setting, for which recent methods are mostly developed from im- age classification. They can be broadly categorized into three clusters (Yao et al.) 2022): (i) Style augmentation methods (Nam et al., [021; Kang et al. 2022) assume that each domain is associ- ated with particular style, and they mostly manipulate the style of raw data (Volpi et al. 2018 Zhou et al. 2020b) or the statisties of feature representations (the mean and standard deviations) (Li et al. 2017 Zhou et al.] (021) and enforces to predict the same class label; (ii) Domain-invariant feature learning (Li et al. 2018b Shao et al. 2019) aims to remove the domain information from the high-level features by heuristic objectives (such as MMD metric (Muandet et al. 2013 Ghifary
ct al. 2016), Wasserstein distance (Zhou et al. (020aa), conditional adversarial learning (Zhao et al.) 2017 Li et al., 2018c) and contrastive learning (ao et al. 2022); ; (iii) Meta learning methods (Li ct al. 2018a) simulate the train/test domain shift during the episodic training (Li et al.) 2019) and optimize meta objective (Balaji et al. 2018) for generalization. /Zhou et al. (2020a) used en- semble of experts for this task. For a more holistic view, two recent works have provided systematic evaluations (Gulrajani & Lapez-Paz (02II) and analysis (Wiles et al., 2022) on existing algorithms.
Our paper considers new setting by modeling each patient as separate domain. Thus, we deal with many more domains compared to all previous works (Peng al., 2019). This challenging setting also motivates us to capture the domain information explicitly in our proposed method.
Domain Generalization in Healthcare Applications Many healthcare tasks aim to predict some clinical targets of interest for one patient: During each hospital visit, such as estimating the risk of developing Parkinson's 's disease (Makarious et al. 2022) and sepsis (Gao et al. (021). predicting the
2

---

Published as a conference paper at ICLR 2023
endpoint of heart failure (Chu et al. 2020). recommending the preseriptions based the diagnoses
Yang et al. 2021a bi Shang et al. 2019); During each measurement window, such as identifying the
sleep stage from a 30- second EEG signal (Biswal et al. 2018 Yang et al. 2021c), detecting the IIIC seizure patterns Jing et al. 2018); : Ge et al.
(2021). In such tasks, every patient can generate multiple data samples, and each data unavoidably contains patient-unique covariates, which may bias the training performance. Most existing works (Wang et al. 2020; Zhang et al., [202]] Gao et al.) 2021 consider model generalization
adaptation across multiple clinical institutes (Reps et al., 2022
Zhang et al., 2021) or different time frames (Guo et al. 2022) with heuristic assumptions such as linear dependency (Li et al.) 2020) in the feature space. Fewer works attempt to address the patient covariate shift. For example, Zhao et al. (2117) trained conditional adversarial architecture with multi-stage optimization to mitigate environment noise for radio frequency (RF) signals. However, their approach requires a large number of parameters (linear to the number of domains). In our setting with more patient domains, their method can be practically less effective, as we will show in the experiments. Compared to Zhao et al. (2017), our method can handle many more domains with a fixed number of learnable parameters and follows end-to-end training procedures.
3 MANY-DOMAIN GENERALIZATION FOR HEALTHCARE APPLICATIONS
The section is organized by: (i) We first formulate the main-domain generalization problem in Sec- tion 3.1 (ii) Then, we motivate our model design by assuming the data generation process in Sec-
tion (iii) In Section 3.3 we simultaneously develop model architecture and objectives they
are interdependent; (iv) We summarize the training and inference procedure in Section 3.4
3.1 PROBLEM DEFINITION; MANY-DOMAIN CENERALIZATION
We denote D as the domain set of training (e.g,, a set of training patients, each as a domain). In the setting, we assume the size of 'D is large, e.g., [D] > 50. Each domain d E 'D has multiple data (c.g., one patient can generate many data samples), and thus we use S to denote the sample set of domain d. The notation x represents the i-th sample of domain d (e.g.. a 30-second EEG sleep signal), which is associated to label uf (e.g., the "rapid eye movement" sleep stage). The many-domain generalization problem asks to find mapping, f : x > y, based on the training set ((x), uf)) i E Sd d E D), such that given new domains D' (e.g., new set of patients), we can infer the labels of (xq" i E Sd d' E D'). We provide notation table in Appendix A.1
3.2 MOTIVATIONS METHOD ARCHITECTURE DESIGN
This paper targets the many-domain generalization problem in healthcare applications by treating each patient as an individual domain. The problem is challenging since we deal with many more domains than previous works. Our setting is also unique: All the domains are induced by individual patients, and thus they naturally follow a meta domain distribution formulated below.
Data Generative Model We assume the training data is generated from a two-stage process. First, each domain is modeled as a latent factor sampled from some meta domain distribution p(-); Second, each data sample from a sample distribution conditioned on the domain and class y::
a ~ p()) x p( (1)
Factorized Prediction Model Given the generated sample x, we want to uncover its true label using the posterior p(y) The quantity can be factorized by the domain factor z as
p(ulx)= = f ply. z/x)dz
/ p(v/2 2)p(z|x)dz.
(2)
Motivations on Method Architecture Design Thus, straightforward solution for addressing the many-domain generalization problem is: Given a data sample x in the training set, we first identify the latent domain factor and then build a factorized prediction model to uncover the true label y in consideration of the underlying data generative model.
Motivation 1: By the form of the prediction model, need (i) domain encoder p(z[x); (ii) label predictor ply|x, z). Cascading the encoder and predictor can generate the posterior label y. which motivates the forward architecture of our method.
3

---

Published as a conference paper at ICLR 2023
Motivation 2: To guide the learning process of (i.e.. ensuring it is domain representation), consider reconstruction (inspired by VAE (Kingma & Welling 2013)). By the form of the data generative model p(x' |z, y'), we and another sample (x', to calculate reconstruction loss.
Z
Viz
b
9p()
R
X
STEP feature
STEP 2:
STEP3 (post-step): label predictor
domain encoder
Vitx
STEP (pre-step) : orthagonal projection
Two samples from
y' [label sample x')
Motivation by the Factorized Prediction Model
data decoder Py()
Training phase:
input x' and follow three steps under Siamese-tye tayeeseeeepeeeeee architecture
X
Motivation 2 the Data Generative Model
Inference phase:
Input x and follow three steps
Figure ManyDG Framework. The forward architecture (solid lines) for both training and infer- ence follows three steps (inspired by the factorized prediction model): feature extraction, domain encoding, and label prediction via orthogonal projection. During training, we input two samples from the same domain, unique design in method is that use the estimated domain (from x) and the true label y' (from x') to reconstruct the encoded feature (from x'). Conversely, we re- construct v by z' and y. This mutual reconstruction design enables learn better domain factors z, z'. The feature v encode domain and label information along approximately different embedding dimensions, which can be decomposed into V/ and Viz respectively via orthogonal projection.
3.3 MANYDG: METHOD TO HANDLE MANY-DOMAIN GENERALIZATION
We are motivated to develop our method ManyDG (shown in Figure in principled way.
STEP 1:
Universal Feature Extractor Before building the prediction model, it is common to first apply a learnable feature extractor, ha(+) x + v, with parameter 0, on the input sample x. The output feature representation is
ha (x).
(3)
The encoded feature v can include both the domain information (i.e., patient covariates in our ap- plications) and the label information. Also, hn(-) could be any neural architecture. such as RNN (Rumelhart et al. 1985 Hochreiter & Schmidhuber 1997| Chung et al., 2014), CNN (LeCun al., | Krizhevsky et al. 2017). GNN (Gilmer et al. 2017 Kipf & Welling, 2016) or Transformer Vaswani et al. 2017). In our experiments, we specify the choices of feature encoder networks based on the healthcare applications.
STEP 2: Domain Encoder Following Motivation 1, we parameterize the domain encoder p(z x) by encoder network (.(-) with parameter ő. Since ho(-) already encode the feature embedding v, we apply (-).) on (not the raw input x) to estimate the domain factor,
z = (v)...
Note that though Equation has probabilistic form, we use deterministic three-layer neural network (.) for the prediction task. We ensure that v and z have the same dimensionality.
Objective 1: Mutual Reconstructions To ensure that represents the true latent domain of postpone the forward architecture design. This section proposes a mutual reconstruction task as our first objective to guide the learning process of z, following Motivation 2:

---

Published as a conference paper at ICLR 2023
For the current sample (x, y) with feature v and domain factor z, take new sample (x', y²)
from the same domain/patient in the training set.
We obtain the feature and the domain factor of this new sample, denoted by v', z':
hx(x)) z' q (v').
(5)
Since x and x' share the same domain, we want to use the domain factor of x and the label of x' reconstruct the feature of x'. We utilize the decoder p(x (xx22,y)) y), parameterized by (*)
= =Po(z,y':
(6)
Note that, consider reconstructing the feature vector v' not the raw input x'. Here, the decoder (.)() is also a non-linear projection. We implement it as a three-layer neural network in the experiments. Conversely, reconstruct by the domain factor of x' and the label of x,
P (z', y)-
The reconstruction loss is formulated as mean square error (MSH), commonly used for raw data reconstruction (Kingma & Welling, 2013). In our case, we reconstruct parameterized vectors and further follow (Grill al. (020) use the Lg-nomaalized MSE, equivalent the cosine distance,
Cree
|
M
Here, (5 the notation for vector inner product and ||- || is for L2-norm.
Remark for Mutual Reconstruction We justify that this objective guide be the true domain factor of x. Follow Equation (6: First, the reconstructed v' should contain the domain information (which y' as input cannot provide). and thus
another input will strive to preserve 4 for the reconstruction; Second, if two samples
the domain information from v (in Equation have different labels (i.e..)) y + y/), then z will not preserve label information from since it is not useful for the reconstruction: Third, even if two samples have the same labels (i.e., y = y'), the input y' in Equation (6) will provide more direct and all necessary label information for reconstruction and thus discourages to inherit any label-related information from v. Thus, z is conceptually the true domain representation. Empirical evaluation verifies that z satisfies the properties of being domain representation, as we show in Section 4.4 and Appendix B.4
Objective 2: Similarity of Domain Factors Further, to ensure the consistency of the learned latent domain factors, we enforee the similarity of and z' (from x, respectively), since they refer to the same domain. Here, we also use the cosine distance to measure the similarity of two latent factors,
z'
Caim
After designing these objectives, we go back and follow Motivation again to finish the architecture design. So far, for the given sample x, we have obtained the universal feature vector v that contains both the domain and label semantics, and the domain factor 2 that only encodes the domain informa- tion. Previous work (Bousmalis et al., (0166) suggests that explicitly modeling domain information can improve model's ability for learning by this, the designing goal of our label predictor p(y) |x, z) is to extract the information from with the help of for uncovering the true label xf x. For the label predictor p(yl x, 2). we also start from the feature space v (not raw input x) and parameterize it as a predictor network, gg (-) v. y, with parameter &. To achieve this goal, rely on the premise that and z. are in the same embedding space, which requires Objective 3 below.
-nmaiinnnvvaiintt features (i.c., label information). Inspired label
Objective 3: Maximum Mean Discrepancy The Maximum Mean Discrepancy (MMD) loss is
commonly used to reduce the distribution gap MMaaneet et al. 2013) Ghifary et al., 2016 Li et al. 2018b Kang et al. 2022). In our model, we use for aligning the embedding space of and z. We consider a normalized version by using the feature norm to re-scale the magnitude in optimization,
2MD (Zy: v,,) Iz, V 1 |s
LMMD
(10)
||
Here, sg(+) means to stop gradient back peokk-rapagation for this quantity. We use the norm F induced by the inner product. The mean values are calculated over the data batch zy = B[z], Vp Elv).
5

---

Published as a conference paper at ICLR 2023
STEP 3: Label Predictor via Orthogonal Projection To this end, can proceed to design the label predictor network (.)-) and complete the forward architecture. To obtain the robust transfer- able features that invariant to the domains, [Bousmalis al. (2016) uses soft constraints to learn orthogonal domain and label subspaces in domain adaptation settings. A recent paper (Shen et al.) 2022) further shows that the universal feature representation learned from contrastive pre-training contains domain and label information along approximately different dimensions.
Inspired by this, consider the orthogonal projection pre-step of the predictor (as shown in Figure T. We visually illustrate the orthogonal projection step in Figure 2
Since and are in the same space, we decompose into parts (by basic vector arithmetics): A component parallel to z, denoted as Vila which will only contain the domain information,
lorthagonal
Viz
Vilx to
VI22
|z]|
(11)
Another component orthogonal to z, denoted as viz. which contains the remaining information, i.e., the label representation,
Figure 2: Decomposition
(12)
This orthogonal projection step is non- non-parametric. The rationale of this step that we empirically find our universal feature extractor ha(-) tends to generate v that contains both domain and label in- formation approximately in different embedding dimensions (shown Section 4.4). The orthogonal projection step can leverage this property to remove domain covariate information and extract better invariant features Viz for prediction. Note that the orthogonal projection step is also suitable for use with Objective 2 since only the angle of vector z is needed for finding the orthogonal component.
After orthogonal projection, we apply the predictor network g: (-) (operates on space v) as a post- step to parameterize the label predictor x z), which completes the forward architecture,
p(y|x, z) = gg (V1z).
(13)
In the experiment, we implement g-(-) as one fully connected (FC) layer without the bias term. which essentially a parameter matrix. We also use temperature hyperparameter 7 (He et al. 2020) to re-scale the output vector before the softmax activation.
Objective 4: Cross-entropy Loss the domain factor z. Finally, we consider the cross cross-entropy loss, which adds label supervision.
The above objective functions are essentially used regularize
Coup
log ()))
(14)
Given that all the objectives are scaled properly, we choose their unweighted linear combination as the final loss to avoid extra hyperparameters. In Appendix [.5 we show that the weighted version can have marginal improvements over our unweighted version.
Linal Coup LMMD + Lree + Csim.
(15)
3.4 TRAINING AND INFERENCE PIPELINE OF MANYDG
During training, we input a pair of data x' from the same domain and follow three steps under Siamese-type architecture. Four objective functions are computed batch-wise on two sides (imple- mentation of our "double" training loader can refer to Appendix A.2) to optimize parameters 6, o, ç. and tb. During inference, we directly follow three steps to obtain the predicted labels.
EXPERIMENTS
This section presents the following experiments evaluate our model comprehensively. Data pro- cessing files, codes, and instructions are provided in
Evaluation on health monitoring data: We evaluate our ManyDG on multi-channn EEG seizure detection and sleep staging tasks. Both are formulated as multi-class classifications.

---

Published as a conference paper at ICLR 2023
We conduct visit-level drug recommendation and readmission pre- diction on EHRs. The former is multi-label classification, and the latter is binary classification.
Evaluation on EHR data:
Verifying the orthogonality property: We quantitatively show that the encoded features from ho(-) indeed contain domain and label information approximately along different dimensions.
Two realistic healthcare scenarios: We further show the benefits of our ManyDG when (i) train- ing with insufficient labeled data and (ii) continuous learning on newly collected patient data.
4.1 EXPERIMENTAL SETUP
Baselines We compare our model against recent baselines that are designed from different per- spectives. All models use the same backbone network the feature extractor. We add non-linear prediction head after the backbone to be the (Base) model. Conditional adversarial net (CondAdv) (Zhao et 2017) concatenates the label probability and the feature embedding predict domains in an adversarial way. Domain- adversaraa neural networks (DANN) (Ganin et al. 2016) use gradient reversal layer for domain adaptation, and we adopt it for the generalization setting by letting the dis- criminator only predict training domains. Invariant risk minimization (IRM) (Arjovsky et al. 2019)
learns domain invariant features by regularizing squared gradient norm. Style-agnostic network (SagNet) (Nam et al. (021) handles domain shift by perturbing the mean and standard deviation statistics of the feature representations. Proxy-based contrastive learning (PCL) (Yao et al., (222)) build new supervised contrastive loss from class proxies and negative samples. Meta-learning for domain generalization (MLDG) (Li al. 2018a) adopts the model -onel-agnostic meta learning (MAML) (Finn al. 2017) framework for domain generalization.
Environments and Implementations The experiments are implemented by Python 3.9.5, Torch 1.10.2 on a Linux server with 512 GB memory, 64-core CPUs (2.90 GHz, 512 KB cache size each), and two A100 GPUs (40 GB memory each). For each set of experiments in the following, we split the dataset into train/ validation/ test by ratio 50%:10%::00% under five random seeds and re-run the training for calculating the mean and standard deviation values. More details, including backbone architectures, hyperparameters selection and datasets, are clarified in Appendix A.4
4.2 RESULTS ON HEALTH MONITORING DATA: SEIZURE DETECTION AND SLEEP STAGING
Healthcare Monitoring Datasets Electroenceehhllogras (EEGs) are multi-channel monitoring signals, collected by placing measurable electronic devices on different spots of brain surfaces. Seizure dataset is from Jing et al.) 22018); Ge et al. (202T) for detecting ictal-interictal-innuyy continuum (IIIC) seizure patterns from electronic recordings. This dataset contains 2,702 patient recordings collected either from lab setting or patients' home, and each recording can be split into multiple samples, which leads to 165,309 samples in total. Each sample is a 16-channel 10- second signal, labeled as one of the six seizure disease types: ESZ, LPD, GPD, LRDA, GRDA, and OTHER, by well-trained physicians. Sleep-EDF Cassette (Kemp et al.) 2000 has in total 78 subject overnight recordings and can be further split into 415,089 samples of 30-second length. The recordings are sampled at 100 Hz. at home, and we extract the Fpz-C7/Pz-Oz channels as the raw inputs the model. Each sample is classified into one of the five stages: awake (Wake), rapid eye movement (REM), and three sleep states (N1, N2, N3). The labels are downloaded along with the dataset.
Backbone and Metrics We use short-time Fourier transforms (STFT) for both tasks to obtain the spectrogram and then cascade convolutional blocks the backbone. adjusted from Biswal et al. 2018): Yang et al.] (201c)). Model architecture is reported in Appendix A.4] We use Accuracy, Cohen's Kappa score and Avg. Fl score over all classes (equal weights for each class) the metrics.
The results are reported in Table (we also report the running time in Appendix B.2). We can conclude that on the seizure detection task, our method gives around 1.8% relative improvements on Kappa score against the best baseline and mild improvements on sleep staging. SagNet and PCL two very recent and-to-end baselines that relatively perform better among all the baselines. The Base model also gives decent performance, which agrees with the findings in Gulrajani & Lopez-Paz 2021) that vanilla ERM models may naturally have strong domain generalization ability.
Results
7

---

Published as a conference paper at ICLR 2023
Table Result comparison on health monitoring datasets
Seizure Detection
Sleep Staging
Models
Accuracy
Kappa
Avg. F1
Accuracy
Kappa
Avg. F1
Base
0.6450 + 0,0102
0,5316 + 0,0190
0.5587 + 0,0265
0.8958 + 0,0108
0.7856 + 0,0108
0.6992 + 0,0090
CondAdv
0.6437 + 0.0174
0.5363 = 0.0227
0.5571 +: 0.0132
0.8976 + 0.0030
0.7898 + 0.0198
0.6875 + 0.0130
DANN
0,6480 +: 0.0091
0.5351 + 0.0162
0.5679 +: 0.0030
0.8942 + 0.0120
0.7852
0.0031
0.6996 + 0.0071
IRM
0.6479 + 0.0153
0,5422 + 0.0101
0,5750 +: 0.0100
0.8864 + 0.0084
0.7821
+ 0.0187
0.7004 + 0.0192
SagNet
0.6532 + 0.0083
0.5508
0.5812 +:
0,90/24 0.0132
0.7990
0.7053 +
PCL
0,6588 + 0.0146
0.5528
+ 0.0156
0,5830 + 0.0131
0,8971 + 0.0165
0.7909 + 0.0098
0.7026 + 0.0253
MLDG
0.6524 + 0.01
0.5476
0.0091
0.5734 + 0.0148
0.8890 + 0.0122
0.7743 + 0.0102
0.6904 + 0.0137
ManyDG
0.6754 + 0.0079
0.5627 + 0.0066
0.6015 + 0.0120
0.9055 + 0.0054
0.7998 + 0.0124
0.7015 + 0.0027
Bold for the best and underscore for the second best model. Our improvements are mostly significant tested in Appendix B33
4.3 RESULTS ON EHRS: DRUG RECOMMENDATION AND READMISSION PREDICTION
EHR Databases Then, we evaluate our model using electronic health records (EHRs) collected during patient hospital visits, which contain all types of clinical events, medical codes, and values. MIMIC-III (Johnson et al., 2016) is a benchmark EHR database, which contains more than 6,000 patients and 15,000 hospital visits, with 1.958 diagnosis types, 1,430 procedure types, 112 medi- cation ATC-4 classes. We conduct the drug recommendation task on MIMIC-III Following |Shang eet al. (2019; Yang et al.] (2021a b). the task is formulated as multi-label classification predict- ing the prescription set for the current hospital visit based on longitudinal diagnosis and procedure medical codes. We adjust our decoder (-) to fit into the multi-labo setting. Details can refer to Appendix A.44 The multi-center eICU dataset (Pollard et al. 2018) contains more than 140,000 pa- tients' hospital visit records. We conduct a readmission prediction task on eICU, which is binary classification task (Choi et al., 2020 Yang et al.] (002b)) predicting the risk of being readmitted into ICU in the next 15 days based on the clinical activities during this ICU stay. We include five types of activities to form the heterogeneous sequence: diagnoses, lab tests, treatments, medications, and physical exams, extended from Choi et al. (2020), which only uses the first three types.
Backbone and Metrics For the multi-label drug recommendation task, we use recent model GAMENet (Shang et al. 2019) as the backbone and employ the Jaccard coefficient, average area under the precision-recall curve (Avg. AUPRC) and Avg. Fl over all drugs as metrics. Similarly, for the readmission prediction task, we consider the Transformer encoder (Vaswani et al. (017) as backbone and employ the AUPRC, Fl and Cohen's Kappa score as the metrics. Since both backbones do not have CNN structures, drop SagNet in the following. Drug recommendation is not a multi-class classification, and we thus drop PCL as it does not fit into the setting.
The comparison results are shown in Table 2 Our ManyDG gives the best performance among all models, around 3.7% Jaccard and 1.2% AUPRC relative improvements against the best baseline on two tasks, respectively. We find that the meta-learning model MLDG gives poor per- formance. The reason might be that each patient has fewer samples in EHR databases compared to health monitoring datasets, and thus the MI.G episodic training strategy can be less effective. Other baseline models all have marginal improvements over the Base model.
Results
Table 2: Result comparison on open EHR databases
Models
Drug Recommendation
Readmission Prediction
Jaccard
Avg. AUPRC
Avg. Fl
AUPRC
Fl
Kappa
Base
0.4858 + 0.0139
0.7440 : 0.0115
0.6443 + 0.0076
0.7040 : 0.0120
0.6554 : 0.0089
0.5210 +:: 0.0087
CondAdv
0.4990 + 0.0144
0,7570 # 0.0052
0.6568
0.0131
0.7047 : 0.0045
0.6709
+ 0.0035
0.5348 0.0135
DANN
0.4886 1 0.0267
0,7519
1 0.0137
0.6595
1 0.0206
0.7152 1 0.0076
0.6671 1 0.0051
0.5309 1 0.0050
IRM
0.4933 + 0.0083
0.7537
: 0.0096
0.6519 0.0056
0.7174 + 0.0138
0.6614
0.5362 + 0.0114
PCL
/
/
0,7089 1 0.0143
0.6575
0.0126
0.5279 1 0.0274
MLDG
0.4619 + 0.0100
0.7051 + 0.0216
0.6269 + 0.0239
0.6701 + 0.0209
0.6215
: 0.0256
0.5178 + 0.0318
ManyDG
0.5175 1: 0.0130
0.7746 : 0.0035
0.6737 1 0.0141
0.7258 : 0.0132
0.6752 : 0.0025
0.5531 : 0.0144
4.4 VERIFYING THE ORTIIOGONALITY OF EMBEDDING SUBSPACES
Experimental Settings This section provides quantitative evidence to show that the learned uni- versal features stores domain and label information along approximately different dimensions:
First, we load the pre-trained embeddings from the v, VIlz (equivalently 2), and V 1z spaces;
8

---

Published as a conference paper at ICLR 2023
696
6.56
Crrclcs
6-5
-Q- Mire00
1222 LSE 2.0: sed. 1822 Los use J0ss
1227 LS8 1820 1488 1682 L.0. 1988 2000 Number ofThaing Parients
1110 2.07 1408 seb 1882 1807 LS58 2000
Numbert Traning heieets
Figure 3: Continuous learning new patients
Then, following Shen et (2022), we learn linear model (e.g., logistic regression) on the fixed embeddings to predict the domains and labels, formulated as multi-class classifications.
The cosine similarity of the learned weights is reported for quantifying feature dimension overlaps.
To ensure that each dimension comparable, we normalize V, z and Viz dimension wise by the standard deviation values before learning the linear weights. The results are shown in Table
Recall that is the learned domain representation, v decomposed into V/Iz and Viz via orthogonal projection and they satisfy v = VIlz -Viz, where VIla (Vix) is parallel (orthogonal) to z. In Table the first two rows give relatively higher similarity and imply the domain and label information are separated from into VII= (equivalently z) and Viz, respectively. The third row has very low similarity (or even negative value), which indicates that the feature dimensions used for predicting (i) labels and (ii) domains are largely non-overlapped in Note that the cosine similarity values from different tasks are not comparable. We provide more explanations in Appendix B.8
Table 3: Cosine similarity of linear weights on V, Vi[2> Viz
Cosine Similarity
Seizure Detection
Sleep Staging
Drug Recom-
mendation
Readmission Prediction
Average
Me (vight(v - labels) and Ne iigh (V - Jabels)
0.8789
0,8251
0.5714
0.4627
0.6845 + 0. 0.129
Wai gh domains) Waightiv iz - domains)
0.2462
0.1987
0.2111
0.0510
We Weight(V - labels) and Ne (ightv domains)
0.0182
0.0276
0.0445
-0.01
0.019 + 0.0204
Keight(V labels) and Weight(V + labels)
0.1151
0.0773
0.0695
0.0524
0.0785 0.0229
Waight([] [-] denotes the learned lincar weights. For example, Ne gV -> lahels) means that we train a linear model on to predict the labels and then output the learned weights. Cosine similurity values averaged over all classes the training
4.5 CASE STUDIES: CONTINUOUS LEARNING ON NEW LABELED DATA
We simulate a realistic clinical setting in this section: continuous learning on newly available data. Another common setting is using insufficient labeled data, which is discussed in appendix B.1
common in healthcare that new patient data labeled gradually, and pre-trained predictive models will further optimize the accuracy based on these new annotations, instead of training on all existing data from scratch. We simulate this setting on the seizure detection task by sorting patients by their ID) (smaller ID) comes to the clinics first) in ascending order. Specifically, we pre-train each model on the first 1,000 patients. Then, we add 100 new patients at step following the order. We fine-tune the models on these new patients and small subset of previous data (we randomly select four samples from each previous patient and add them to the training set), Note that, without this small subset of existing data, all models will likely fail due to dramatic data shifts. The result of 10 consecutive steps is shown in Figure 3 Our model consistently performs the best during the continuous learning process. It is also interesting that MLDG improves slowly compared other methods. The reason might be similar to what we have explained in Section that the existing patients have only few (c.g., 4) samples.
CONCLUSION
This paper proposes a novel many-domain generalization setting and develops a scalable model ManyDG for addressing the problem. We elaborate our new designs in healthcare applications by assuming each patient a separate domain with unique covariates. Our ManyDG method is built on latent generative model and factorized prediction model. It leverages mutual reconstruction and orthogonal projection to reduce the domain covariates effectively. Extensive evaluations on four healthcare tasks and two challenging scenarios show Ma ManyDG has good generalizability.

---

Published as a conference paper at ICLR 2023
ACKNOWLEDGEMENTS
This work was supported by NSF award SCH-2205289, SCH-2014438, IS-1188042, NIH award RO1 IROINS107291-01.
REFERENCES
Martin Arjovsky, Léon Bottou, Ishaan Guirajani, and David Lopez-Pase Invariant risk minimization. arXiv preprint arXiv:/97.0028)) 2019.
Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain gener- alization using meta-regularization. Advances in neural information processing systems, 2018.
Nourhan Bayasi, Ghassan Hamarneh, and Rafeef Garbi. Boosternet: Improving domain gener- alization of deep neural nets using aulpability-rankee features. Proceedings of the IEEE/CVF Conference Computer Vision and Pattern Recognition (CVPR), pp. 538-548, June 2022.
Siddharth Biswal, Haoqi Sun, Balaji Goparaju, M Brandon Westover, Jimeng Sun, and Matt T Bianchi. Expert-level sleep scoring with deep neural networks. Journal of the American Medical Informatics Association, 25(12):1633-1653 2018.
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan.
Domain separation networks. Advances in neural information processing systems, 29, 2016.
Daniel C Castro, Ian Walker, and Ben Glocker. Causality matters in medical imaging.
Nature
Communications, 11(1):1-10, 2020.
Woong-Gi Chang, Tackgeun You, Seonguk Sco, Suha Kwak, and Bohyung Han. Domain-specifer batch normalization for unsupervised domain adaptation. In Proceedings of the IEEE/CVF con- ference on Computer Vision and Pattern Recognition, pp. 7354-7362, 2019.
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference machine learning. pp. 1597-1607. PMLR, 2020.
Edward Choi, Zhen Xu, Yujia Li, Michael Dusenberry, Gerardo Flores, Emily Xue, and Andrew Dai. Learning the graphical structure of electronic health records with graph convolutional transformer. In Proceedings of the AAAI conference on artificial intelligence, pp. 606-613, 2020.
Jiebin Chu, Wei Dong, and Zhengxing Huang. Endpoint prediction of heart failure using electronic health records. Journal of Biomedical Informatics, 109:1035 100510318, 103518,,0 2020.
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks sequence modeling. arXiv preprint arXiv:1412.3555. 2014.
David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from single image using a multi-scale deep network. Advances in neural information processing systems, 27, 2014.
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference machine learning, pp. 1126-1135, PMLR, 2017.
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversse training of neural net- works. The journal of machine learning research, 17(1):299-20300, 2016.
Jifan Gao, Philip L Mar, and Guanhua Chen. More generalizable models for sepsis detection under covariate shift. AMIA Summits on Translational Science Proceedings, 2021:220, 2021.
Wendong Ge, Jin Jing, Sungtae An, Aline Herlopian, Marcus Ng, Aaron F Struck, Brian Appavu, Emily I. Johnson, Gamaleldin Osman, Hiba Haider, et al. Deep active learning for interictal ictal injury continuum eeg patterns. Journal of neuroscience methods, 351:108966, 2021.
Muhammad Ghifary, David Balduzzi, W Bastiaan Kleijn, and Mengjie Zhang. Scatter component analysis: A unified framework for domain adaptation and domain generalization. IEEE transac- fions on pattern analysis and machine intelligence, 39(7):1414-)) 141--1430. 2016.
10

---

Published as a conference paper at ICLR 2023
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International conference on machine learning. pp- 1263-1272. PMLR, 2017.
dean-Bastinn Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bemardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervvsed learning. Advances in neural information processing systems, 33:21271-21 2020.
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In International Conference Learning Representation (ICIR), 2021.
Lin Lawrence Guo, Stephen R Pfohl, Jason Fries, Alistair EW Johnson, Jose Posada, Catherine Aftandilian, Nigam Shah, and Lillian Sung. Evaluation of domain generalization and adaptation on improving model robustness to temporal dataset shift in clinical medicine. Scientific reports, 12(1):1-10, 2022.
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the /EEE/CVF conference computer vision and pattern recognition, pp. 9729-9738, 2020.
Lawrence J Hirsch, Michael WK Fong, Markus Leitinger, Suzette M LaRoche, Sandor Beniczky, Nicholas S Abend, Jong Woo Lee, Courtney J Wusthoff, Cecil Hahn, M Brandon Westover, et al. American clinical neurophysiology society's standardized critical care eeg terminology: 2021 version. Journal of clinical neurophysiology: official publication of the American Elec- troencephalographic Society, 38(1):1, 2021.
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):
1735-1780, 1997.
Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are uni- versal approximators. Neural networks, 2(5):359-366, 1989.
Jin Jing and et al. Development of expert-level classification of seizures and seizure-like events during eeg interpretation. Neurology, 2023.
Jin Jing, Emile Angremonn, Sahar Zafar, Eric S Rosenthal, Mohammad Tabaeizadeh, Senan Ebrahim, Justin Dauwels, and M Brandon Westover. Rapid annotation of seizures and interictal- ictal continuum eeg patterns. In 2018 40th Annual International Conference of the IEEE Engi- neering Medicine and Biology Society (EMBC), pp. 3394-3397. IEEE, 2018
Alistair EW Johnson, Tom J Pollard, Lu Shen, Li-wei Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. Mimic-iii, a freely accessible critical care database. Scientific data, 3(1):1-9, 2016.
Juwon Kang, Sohyun Lee, Namyup Kim, and Suha Kwak. Style neophile: Constantly seeking novel styles for domain generalization. In Proceedings of the IEEE/CVE Conference on Computer Vision and Paltern Recognition (CVPR), 2022.
Bob Kemp, Aeilko H Zwinderman, Bert Tuk, Hilbert AC Kamphuisen, and Josefien JL Oberye. Analysis of sleep-dependent neuronal feedback loop: the slow-wave microcontinuity of the eeg. 2000.
IEEE Transactions on Biomedical Engineering,
Prannay Khosla, Piotr Teterwak, Chen Wang. Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. Advances in Neural Information Processing Systems, 33:18661-18673, 2020.
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv: 1312.61144 2013.
arXiv preprint
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional net- works. arXiv preprint arXiv: 16dp.02099.00 2016.

---

Published as a conference paper at ICLR 2023
Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Bal- subramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference Machine Learning, pp- 5637-5664. PMLR, 2021.
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convo- lutional neural networks. Communications of the ACM, 60(6):84-90, 2017.
Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 33)1(10):199,, 1995.
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales, Learning to generalize; Meta- learning for domain generalization. In Proceedings of the AAAI conference artificial intel- ligence, 2018a.
Da Jianshu Zhang, Yongxin Yang, Cong Liu, Yi-Zhe Song, and Timothy M Hospedales. Episodic training for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1446-1455, 2019.
Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adver- sarial feature learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5400-5409, 2018b.
Haoliang Li, YuFei Wang, Renjie Wan, Shiqi Wang. Tie-Qiang Li, and Alex Kot. Domain gener- alization for medical imaging classification with linear-dependency regularization. Advances in Neural Information Processing Systems, 33:3118-3129 2020.
Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 624 0399,,9,44 2018c.
Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normaliza- tion for practical domain adaptation. In International Conference on Learning Representations (ICLR), 2017.
Evan Z Liu, Behzad Haghgoo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just train twice: Improving group robustness without training group information. International Conference on Machine Learning. PMLR, 2021.
Mary B Makarious, Hampton L Leonard, Dan Vitale, Hirotaka Iwaki, Lana Sargent, Anant Dadu, Ivo Violich, Elizabeth Hutchins, David Saffo, Sara Bandres-Ciga, al. Multi-modality machine learning predicting parkinson's 's disease. npj Parkinson's 's Disease, 8(1):1-13, 2022.
Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning. PMLR, 2013.
Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing do- main gap by reducing style bias. In Proceedings the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8690-8699, 2021.
Maurice M Ohayon, Mary A Carskadon, Christian Guilleminault, and Michael V Vitiello. Meta- analysis of quantitative sleep parameters from childhood to old age in healthy individuals: devel- oping normative sleep values across the human lifespan. Sleep. 27(7): 1273, 2004.
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In IEEE International Conference Computer Vision, 2019.
Christian Perone, Pedro Ballester, Rodrigo C Barros, and Julien Cohen-Adad. Unsupervised domain adaptation for medical imaging segmentation with self-ensembling Neurolmage, 2019,
Tom J Pollard, Alistair EW Johnson, Jesse D Raffa, Leo A Celi, Roger G Mark, and Omar Badawi. The eicu collaborative research database, a freely available multi-center database for critical care research. Scientific data, 5(1):1-13, 2018.
12

---

Published as a conference paper at ICLR 2023
Jan Rémi, Thomas Pollmächer, Kai Spiegelhalder, Claudia Trenkwalder, and Peter Young. Sleep- related disorders in neurology and psychiatry. Deutsches Arztelattt International, 2019.
Jenna Marie Reps, Ross D Williams, Martijn J Schuemie, Patrick B Ryan, and Peter R Rijnbeek. Learning patient-level prediction models across multiple healthcare databases: evaluation of en- sembles for increasing model transportability. BMC medical informaties and decision making, 22 (1):1-14, 2022.
David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning internal representations by error propagation. Technical report, California Univ San Diego La Jolla Inst for Cognitive Science, 1985.
Junyuan Shang, Cao Xiao, Tengfei Ma, Hongyan Li, and Jimeng Sun. Gamenet: Graph augmented memory networks for recommending medication combination. In proceedings of the AAAI Con- ference on Artificial Intelligence, 2019.
Rui Shao, Xiangyuan Lan, Jiawei Li, and Pong C Yuen. Multi-adversarial discriminative deep domain generalization for face presentation attack detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10023-10031, 2019.
Kendrick Shen, Robbie M Jones, Ananya Kumar, Sang Michael Xie, Jeff Z HaoChen, Tengyu Ma, and Percy Liang. Connect, not collapse: Explaining contrastive learning for unsupervised domain adaptation. In International Conference on Machine Learning, pp. 19847-19878. PMLR, 2022.
Mario Giovanni Terzano, Liborio Parrino, Arianna Smerieri, Ronald Chervin, Sudhansu Chokroverty, Christian Guilleminault, Max Hirshkowitz, Mark Mahowald, Harvey Moldofsky, Agostino Rosa, et al. Atlas, rules, and recording techniques for the scoring of cyclic alternating pattern (cap) in human sleep. Sleep medicine, 3(2):187-199, 2002.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Eukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural informa- fion processing systems, 30, 2017.
Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. NeurIPS, 31, 2018.
Hao Wang, Hao He, and Dina Katabi. Continuously indexed domain adaptation. In International Conference on Machine Learning, 2020.
Jindong Wang. Cuiling Lan, Chang Liu, Yidong Ouyang, Tao Qin, Wang Lu, Yiqiang Chen, Wenjun Zeng, and Philip Yu. Generalizing to unseen domains: survey on domain generalization. JEEE Transactions Knowledge and Data Engineering, 2022.
Olivia Wiles, Sven Gowal, Florian Stimberg, Sylvestre Rebuff, Ira Ktena, Taylan Cemgil, et al. A fine- grainer analysis distribution shift. In ICLR, 2022.
Garrett Wilson and Diane J Cook. A survey unsupervised deep domain adaptation. ACM Trans- actions Intelligent Systems and Technology (TIST), 11(5):1-46, 2020.
Chaoqi Yang, Cao Xiao, Lucas Glass, and Jimeng Sun. Change matters: Medication change predic- tion with recurrent residual networks. 2021a.
Chaoqi Yang, Cao Xiao, Fenglong Ma. Lucas Glass, and Jimeng Sun. Safedrug: Dual molecular graph encoders for recommending effective and safe drug combinations. In IJCAI, 2021b.
Chaoqi Yang. Danica Xiao, M Brandon Westover, and Jimeng Sun. Self-supervised eeg representa- tion learning for automatic sleep staging. arXiv preprint arXiv:2110.15277 2021c.
Chaoqi Yang, Cheng Qian, Navjot Singh, Cao Xiao, M Brandon Westover, Edgar Solomonik, and Jimeng Sun. ATD: Augmenting CP tensor decomposition by self supervision. In Advances in Neural Information Processing Systems, 2022a.
forum?
Td=O7kdFAVPduJ
13

---

Published as a conference paper at ICLR 2023
Chaoqi Yang. Zhenbang Wu, Patrick Jiang, Zhen Lin, and Jimeng Sun. PyHealth: A deep learn ing toolkit for healthcare predictive modeling, 09 2022b. URL https: /git:b///tthbb.... com/
Su.labiiuccPP/eelhh
Xufeng Yao, Yang Bai, Xinyun Zhang. Yuechen Zhang, Qi Sun, Ran Chen, Ruiyu Li, and Bei Yu. Pel: Proxy-based contrastive learning for domain generalization. In Proceedings of the TEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022.
Haoran Zhang, Natalie Dullerud, Laleh Seyyed- Kalantari, Quaid Morris, Shalmali Joshi, and Marzyeh Ghassemi. An empirical framework for domain generalization in clinical settings. In Proceedings of the Conference on Health, Inference, and Learning, pp. 279-290, 2021.
Mingmin Zhao, Shichao Yue, Dina Katabi, Tommi Jaakkola, and Matt Bianchi. Learning sleep stages from radio signals: A conditional adversarial architecture. In International Conference Machine Learning, pp. 4100-4109. PMLR, 2017.
Fan Zhou, Zhuqing Jiang, Changjian Shui, Boyu Wang, and Brahim Chaib-draa, Domain general- ization with optimal transport and metric learning. arXiv preprint arXiv:2007.1057: 2020a.
Kaiyang Zhou, Yongxin Yang, Timothy Hospedales, and Tao Xiang. Learning to generate novel domains for domain generalization. In European conference computer vision. Springer, 2020b.
Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. In International Conference on Learning Representations (ICLR), 2021.
14

---

Published as a conference paper at ICLR 2023
A DETAILS FOR NOTATIONS, IMPLEMENTATIONS AND DATASETS
A.1 NOTATION TABLE
For clarity, we have attached notation table here, summarizing all symbols used in the main paper. This paper uses the generic notation x to denote the input features. We use plain letters for scalars, such d, p. y; boldface lowercase letters for vectors vector-valued functions, e.g., V, z, h (-), qs (-), ge (+), Ps (-), and they have the same dimensionality; Euler script letters for sets, e.g., D, S.
Table 4: Notations used in ManyDG
Symbols
Descriptions
d D. d' E I S
patient/domain set in training and test data sample set of patient/domain d the i-th (sample, class label) for patient/domain d
xf, vt
p()
meta domain distribution
domain latent factor (representation)
P(2lz,3) v)
sample distribution conditioned on patient domain z and class label y
x)
generic notation for posterior of label probability given sample x generic notation for posterior of domain factor given sample generic notation for posterior of label probability given sample and domain
x(Z
P(y x,
V
the feature representation of reconstructed feature representation of x the component of v that is parallel to or orthogonal to z space lcarnable feature extractor with parameter set / learnahle encnder network for p(z x) (on top of ho)-)) with parameter set ø learnable predictor network for p(y xx 2) (on top of ha²()) with parameter
V
Milas Viz
ho(-): x + v
9a(-) v +
Be(") V, y
(+( 2. H
learnable decoder network for p( (,, y) with parameter set
vector inner product
||=: I:11
vector norm induced by measure L2-norm the learned weight of a logistic regression task
(eight()
A.2 IMPLEMENTING OUR DOUBLE DATA LOADER FOR TRAINING
Our method is trained end-to-end in mini-batch fashion. We build new data loader at each epoch. First, during each training epoch, we will randomly shuffle the data samples within each patient domain. Second, for building the data loader, will fold each patient data list into two half-lists and append them to two global data lists respectively matient-by-patient These two global lists have the same length and will be used to build the data loader. Upon using it, the data loader will output two data batches simultaneously (for the Siamese type architecture), where the same indices correspond to the samples from the same patient. At every epoch, only one pairing combination is used for the data from each patient, and the shuffle and re-build steps between epochs ensure that every data pair within the same patient can have the chance to be trained together with equal probability. Our double data loader building procedure does not incur extra time consumption compared to the model training time. Our model's ' space and time complexity are asymptotically the same as training the Base model, shown in Appendix B.2
A.3 DETAILS IN IMPLEMENTING THE LABEL. PREDICTOR AND DATA DECODER
Prototype-base Predictor As mentioned in the main text, we use a fully connected (FC) layer without the bias term to be the predictor, which is essentially a parameter matrix W. Each row in the parameter matrices {W 1 k= has the same dimensionality as v and can be viewed as the prototype for the class k E {1, K). J. We can construct one positive pair between the data representation and the corresponding class prototype and (K 1) negative pairs with the prototypes from other classes (in Figure 4p. The final label probability is given by the softmax activation form,
Softmax function
Inppative mainl
(V.. Ma)
(fau (Pa.
class prototype
non-olass protobype
representation Vige
expl/W<, Viz)/T) expl(Ws.VLa\/T))
p'y k|x, z) Be, (v1z) exp((w., Ex (1a)/77
(16)
Figure 4: Predictor
15

---

Published as a conference paper at ICLR 2023
Sore 35.22
Cam,
Soroam H.
Enponaree
Bitchler
20 O66.
V
Futten
Figure 5: Shared backbone for seizure detection task
Here, (.. is the notation for vector inner product, and is the tempera- ture (He et al. 2020). With the prototype-basee design, our predictor also amenable for use with recent supervised contrastive loss Yao et al. 2022 Khosla et al. 2020); however, we leave this as future work.
Prototype-base Data Decoder In the main text, we use a decoder network Pu (-|z, to recon- struct another sample from the same domain based the domain factor and the class label y- In the implementation, we do not directly input a combination of z and the categorical label y- For parameterizing the class label, also the prototype wy the class label information and concatenate it with the domain factor z for reconstruction.
A.4 MORE INFORMATION FOR DATASETS AND IMPLEMENTATION
IIC Seizure requested from (Jing
2018 Ge et al. 2021 Jing & al. 2023 We could
find the license, as stated in Jing et al. (2018) "the local TRB waived the requirement for informed consent for this retrospective analysis of EEG data".
We use 16-channel 10-second signals sampled at 200Hz. Thus, the raw data inputs are a matrix 16x 2000, and the values are measurement amplitudes. We use torch.stfi implement the short-time Fourier transform (STFT) for obtaining the spectrogram. The FFT window size is 64, the hop length (overlapping window) is 32, and the imaginary and real parts are square-summed density in the frequency domain. After STFT, the sample size is 16 x 33 x 63. We further normalize the values and take the logarithm on one side of the spectrogram as the input to the backbone model. The data processing steps largely followed et al. (2018). Seizure detection is six-class classification problem, and we use some common combinations of hyperparameters: 128 as the
be the energy
size of an epoch
batch size, 128 as the hidden representation size, as the training epochs (50 size of an episode the number of episodes for MIDG baseline, which follows MAML, the same setting for other datasets), 10-1 as the learning rate with Adam optimizer and x 10-5 as the weight decay for all models. Our model uses - 0.5 as the temperature (the same for other datasets). Other hyperparameters in baselines are mostly following their original default values. Some other variants of hyperparameter combinations have also been tested with the validation set (on the following three datasets, we also do the same procedures). which do not show significant differences. We report our backbone model Figure
The original dataset provides vote count distribution over six labels the targets in Seizure. We filter out the data that have fewer than five expert votes. We use the vote counts for calculating the following customized cross entropy loss (CEL) and use the majority label (that has the most significant vote) for calculating the evaluation metrics.
For calculating the supervised loss in Seizure, use customized version of cross entropy loss. Our customized CEL weighted average form of the standard CEL for the classification task.
We employ the customized CEL form here, considering that for Seizure (and some other expert- annotated datasets), the labeling experts might have disagreements on the true label of ambiguous samples and thus usually resulting in vote count distribution instead of single label. The cus-
16

---

Published as a conference paper at ICLR 2023
Sin
Mortol
0.Shapert
Rattes
Figure 6: Shared backbone for sleep staging task
tomized CEL can capture more information (e.g., how hard the sample is) than the standard CEL in such cases. The customized CEL will reduce to the standard CEL if without labeling disagreements. We give the definition of our customized CEL below,
L 4= Σ KES SS]
logp(y = k|xx, z).
(17)
where C {1.-.., K} includes all class indices that have more votes than half of the maximum class votes. For example, if the votes for sample are [8, 5, 3, 2, 1]. then S {1,3} where 8 and are viewed as valid votes, and other classes are considered minor classes, which will not be used for calculating the loss. For common classification task with single labels, =
Sleep-EDF Kemp et al. 2000 We use the cassette portion. This dataset is under Open BSD 3.0 License It contains other Polysomnography (PSG) signals such as (horizontal) EOG, and submental chin EMG. We only use two EEG channels, Fpz-Cz and Pz-Oz, and a raw 30-second sample has size 2 3000. We also do STFT with FFT window size of 256, hop length of 64 and normalize and logarithm operations on one side of the spectrogram. The data processing stepf" largely follows Yang et al. (2021c 2022a). The final size of sample 2 129 x 43. We integrated the data cleaning and processing pipeline into PyHealth Yang et al. (022b)). We select combinations of hyperparameters: 256 as the batch size, 128 as the hidden representation size, 50 as the training epochs, 5 10 as the larning rate with Adam optimizer, and x 10 as the weight decay for all models. The backbone model reported in Figure 6
MIMIC-III (Johnson et al. 2016) This dataset is under PhysioNet Credentialed Health Data License 1.5. The dataset is publicly available with patients who stayed in intensive care unit (CCU) in the Beth Israel Deaconess Medical Center for over 11 years. It consists of 50,206 medical encounter records. Following the preprocessing step from Yang et al. (202 b); Shang et al.) (2019). We filter out the patients with only one visit. Diagnosis, procedure and medication information is extracted in AAAANOOEESICC.C...
"PROCEDURES.CC IIDEESsCCcss" and "PRESCRIPTIONS.C. from original MIMIC database. We merge these three sources by patient id and visit id. After the merging, diagnosis and procedure are ICD-9 coded, and they will be transformed into multi-hot vectors before training. There are in total 6,350 patients, 15,032 visits, 1,958 types of diagnoses, 1,430 types of procedures, and 112 ATC-4 coded medications. For each visit, we use the diagnosis and procedure information (two ICD code sets) and previous visit information (two ICD code sets and one ATC code set per visit) to predict the current medication set, which is a sequential multi- label prediction task. Later on, we integrate the MIMIC-III processing pipeline into PyHealt? Yang al. (2022b). In this task, Yang et al. (2021ab)) b): Shang et al. (2019) and then aggregate the loss. The backbone model is
binary cross entropy loss for each medication, following
https///wwwwwyyyyyo...c/////oort 1.000/
https:/pyhealth..caatthhho.
17

---

Published as a conference paper at ICLR 2023
Feature Encoder
Transformer Encoder
e99
Feed
000
Mult-HHead
Posttional Encoding
82
Input Embodkling
Inputs
timelliee
same-length embeddings
inputs
Figure Shared backbone for the readmission prediction task. Different colored circles mean different event types and different feature inputs.
borrowed from a recent paper Shang et al. (2019) with the same model hyperparameter set. For other hyperparameters, we use 64 as the batch size, 64 as hidden representation, 100 the training epochs, 1 x 10-3 as the learning rate with Adam optimizer and I 10-5 as the weight decay for all models. We adjust the conditional mutual reconstruction part of our model by using the average of class prototypes as the label information for this setting.
eICU (Pollrdd et al. 2018) This dataset is under PhysioNet Credentialed Health Data License 1.5.0 This data covers patients admitted to critical care units from 2014 to 2015. We define each encounter as identified by patientumisstayid in the data tables. Data processing step largely follows Choi et al. (2020). We consider the following five event categories and the features: (i) diagnosis:
diagnosis string features (in total 3,845 types) and the ICD-9 codes (in total 1,195 types); (ii) lab test: lab test types (in total 158 types) and the corresponding numeric results; (iii) medication: medication names (in total 291 types), prescription and the pick list frequency with which the drug taken; (iv) physical exam: the system root path of the physical exam (in total 462 types), which indicates the types; (v) treatment: the path of the treatment (in total 2,695 types). The "offset" time raw data tables used as the timestamp for each event since they are offset with respect to the admission time. For each encounter, we can collect a heterogeneous event sequence following time order for predicting the risk of re-admitted into ICU (rephospitalized) within next 15 days (Choi et al., 2020). We integrated the data cleaning and processing pipeline into PyHealth Yang et al. (2022b). In this task, we learn two class prototypes and finally feed the first column of the output softmax logits for the binary cross entropy loss (which only takes batch_size in torch.nn, cooi.nn.fincctonna cenectiona.binayyccrr binary_cross. cetrosssentopyoosss size, 128 as hidden representation, 50 as the training epochs.
format input For hyperparameters, we use 256 as the batch
10 the learning rate with Adam optimizer, and 1 x 10-5 as the weight decay for all models. The backbone model is based on 3-layer Transformer encoder blocks, before which we first use separate encoders for encoding different types of events into the same-length embeddings. We show an illustration in Figure 7
We report the label distribution information in Table
18

---

Published as a conference paper at ICLR 2023
Table 5: Label information of four datasets
Dataset
Task
Label Distribution
Seizure
multi-class multi-class
OTHER: 26.4%, ESZ: 3.7%. LPD: 19.7%, GPD: 24.2%, LRDA: 14.4%, GRDA: 11.7% Wake: 68.8%, N1: 5,2%, N2: 16.6%, N3: 3.2%, REM: 6.2% max # of med. is 64, # of med. is 11.65 hospitalized: 83.78 83.78%, non-hospitalized: 16.22%
Sleep-EDF MIMIC-II
multi-label
eICU
binary
6--
Seglet
MUBG
1929
3000
350
VG
120
1993
2000
1993
Figure Varying number of training patients
B ADDITIONAL EXPERIMENTAL RESULTS
We present additional experiments in this appendix section due space limitations.
B. BETTER GENERALIZATION ABILITY ON SMALL TRAINING DATA
Train Small Data. Here, mimic the critical situation where the labeling cost is very high (such as seizure detection (Jing et al.) 2018)) and only limited training data is available. We rely on EEG seizure detection tasks and evaluate all models insufficient labeled data. We limit the training number patients to 2,000, 1,500, 1,000, 500, 100 and use the same test group for evalu- ation. The results reported in Figure 8 which suggests that: (i) the performance of all models deteriorates with less labeled data; (ii) our ManyDG consistently outperforms the baselines.
B.2 RUNNING TIME COMPARISON
This section compares the running time of all models four healthcare tasks. As mentioned before, all models use the same backbone and batch size. When recording the running time, we duplicated the environment mentioned in Section 4.1 stopped other programs, and ran all the models one by one GPU. We record the first 23 epochs of all models and drop the first three epochs (since they might be unstable). We report the mean time cost per epoch in Table. MLDG uses an episodic training strategy, different from epoch-based training. Thus, calculate the equivalent running time for MLDG, which is that we first average the episode time by the sample size and then multiply the per-sample time by the overall training data size.
We report the results in Table 6 which shows our method is as efficient as the Base model in each task. CondAdv and DANN are adversarial training models which rely on additional domain discriminator. In our cases with matient-induces domains, we have more domains to deal with (than previous domain generalization settings). Thus, their discriminator can be less effective and will cost more time.
Table 6: Running time comparison (seconds per epoch)
Model
Seizure Detection
Sleep Staging
Drug Recommendation
Readmission Prediction
Base
7.128 0.4000
17.91 + 0.1885
3.306 0.0219
541.4 12.36
CondAdv
19,95 0.1673
20.60 0.1498
3.472 0.0248
580.1 16.87
DANN
11.71 0.3037
18.29
1.0210
3.518 0.0256
585.3 8.282
IRM
7.598 + 0.3639
19.23 + 0.5725
3.416 0.0022
558.2 + 4,022 /
SagNet
12.75 +: 0.4110
35.57 1 0.0186
PCL
8.743 0.4869
21.70 + 0.3514
$77.9 + 10.24
MLDG (equivalent)
13.87 0.4965
31.89 1 0.2578
4,210 0.0448
663.6 1 14.05
ManyDG
7.996 0.2862
19.23 + 0.2744
3.462 0.0648
558.1 + 14.27
19

---

Published as a conference paper at ICLR 2023
B.3 STATISTICAL TESTING WITH P-LLLE
We also conduct T-tests on the results in Section 4.2 and Section 4.3 and calculated the p-values
in the following Table 7 and Table Commonly, a p-value smaller than 0.05 would be consid- ered significant. We use bold font for p-values that is larger than 0.05. We can conclude that our performance gain is significant over the baselines in most of the cases.
Table 7: p-values under T-test biosignal classification tasks
Seizure Detection
Sleep Staging
Comparison
Accuracy
Kappa
Avg. Fl
Accuracy
Kappa
Avg. F1
Base ManyDG
L8277c-04
2.3857c-03
3.1177c-03
3.9742o-02
3.1450c-02
2.7878c-01
CondAdy vs ManyDG
L6107c-03
1.1745e-02
1.2661e-04
6,3333e-03
1.5790e-01
1.4948c-02
DANN ManyDG
2.3134e.04
0.
6.9548:005
3.2066e
100466
2.7459e-01
IRM vs ManyDG
1.9953-003
1.4039-033
1.4164c-03
6.9382c-04
4.2033e-02
4.45366-01
SagNet ManyDG
6.4119e.04
7.1616e
5.2789c-02
3.0083e
4.5421e-01
7.3663e-01
PCL vs ManyDo
1.8422-02
9.1054e-02
1.5726e-02
1,3048c-011
9.8423e-02
5.41700e-0
MLDG ManyDG
9.1763e-03
4.9798c
3.0785e
7.4243e
2.0582e
4.1056e
Table 8: p-values under T-test on EHR classification tasks
Drug Recommendation
Readmission Prediction
Comparison
Jaccard
Avg. AUPRC
Avg. F1
AUPRC
F1
Kappa
Base vs ManyDG
1.5738c-03
1.0867e-04
8.9086e-04
7.8500e-03
3.4105e-04
7.0435e-04
CondAdv ManyDG
2.2134c-02
5,5230e-05
2.9717e-02
2.6847c-03
1.8490e-02
2.4544e-02
DANN ManyDG
2.0507e-02
1,9382e-03
9.6398e-02
6.00440e-12
3.6720e-03
3,2901e-03
IRM vs ManyDG
2.2013c-03
4.5726c-04
3.5304e-03
1.1173-01
8.1280c-03
2,5219c-02
PCL ManyDG
153115
4.3811e-03
3.8113e-02
MLDG vs ManyDG
1,4382c-05
2.3040c-05
1,4652e-03
2,4545e-04
4.0163e-04
1,7682e-02
B.4 COSINE SIMILARITY DOMAIN REPRESENTATIONS
In this section, we load the tre-tr embedding from four healthcare tasks. To give more insights into the learned domain factor z, we compute the cosine similarity of the estimated z with the same domains and the cosine similarity of cross domains. We average the computed cosine similarity values over each embedding pair and show the results in Table
Table Cosine similarity of within-domen and cross -ooss-n factors z
Seizure Detection
Sleep Staging
Drug Recom- mendation
Readmission Prediction
Cosine Similarity
Average
Avg. of within-domain z
0.9789
0.9672 0.9584
0.9993 0,9965
0.9619
0.9768 + 0.0144
Avg. of cross-domain z 0,9685
0.9523
0.9689 = 0.0169
is interesting that both the within-domain and cross-doman similarity are pretty high, e.g., larger than 0.95. The second finding that within-domain similarity is larger than cross-domain similarity (though it seems insignificant, we will explain why this phenomenon is normal and our design is however useful). The reason is that we only enforce the similarity of from the same domain one objective Esim but never enforce the dissimilarity of from different domains (if we did, then the values in second row of the table are expected decrease).
A very similar phenomenon has been observed in Grill et al. (0200) from the self-supervised con- trastive learning area. Before the proposal of Grill et al. (022)), researchers will simultaneously enforce the similarity of positive samples and the dissimilarity of negative samples et al. (2020); Chen et al. (2020) for learning unsupervised features invariant to data augmentations. However, Grill al. (2020) claims that enforcing the similarity of positive pairs along is empirically good enough for learning unsupervised features.
the implementation. the cosine similarity positive pairs is learned to approach 1.0, and the negative pairs will chase after achieve slightly lower score (often times higher than 0.95). They show better results on ImageNet against previous approaches He et al. (2020): Chen et al. 2020) (that enforces both similarity and dissimilarity).
20

---

Published as a conference paper at ICLR 2023
Our method empirically also works well four datasets. Further discussion on this topic is beyond the main scope of the paper. We will explore this direction for future work.
B.5 ABLATION STUDY ON OBJECTIVES AND THEIR COMBINATIONS
Ablation Study on Combinations of Objectives First, we design ablation studies to test the ef- fectiveness of each objective. Recall that, have used the following final loss in the main text:
Lfnal Laup LMMD + Free Lsim.
(18)
Here, Sup is the supervised cross entropy loss, LMMD is the loss to enforce v and to be in the same space, free is the mutual reconstruction loss between two data samples, and Csim enforces the similarity of two latent factors from the same patient.
In this section, we test the following loss combinations on the seizure detection task: (i) Case 1: Only Lsup: (ii) Case 2: Suu and LMMD: (iii) Case 3: Leup and Creci (iv) Case 4: Csup= LMDD and Cree- We show the final performance results and the learning curve of each objective in Figure 9 The results prove the necessity of all objectives. We provide discussions and insights the effectiveness of individual objectives:
With different objectives, the overall losses all decrease, which means the model trains success- fully in each case.
In case 1 (only Loups LMMD, Lrees Lssm), there is interaction between two sides of the Siamese architecture. Our method performs similarly to the Base model. Reflected on the loss curves: Ssim -0.17 (domain factors not similar, ideal value is -1.0); free 0 (no reconstruction effect, ideal value is -2.0;; LMDD = 2.0 (embedding spaces are not aligned, ideal value is 0).
In case (only Csups LMMD, Lrees Laim): ) There no interaction between sides of the Siamese architecture. Our method performs similarly to the Base model. However, the MMD objective improves the orthogonal projection, which explains the slight improvements over case 1. Reflected on the loss curves: Leim -045 (domain factors are somewhat similar, ideal value is -1.0); free (no reconstruction effect, ideal value is -2.0); LMMD = 0 (embedding spaces are aligned, ideal value is 0).
In case 3 (only Leaps Lreey no LMMD, Lsim): The reconstruction objective ensures the inter- actions between two-sided pipeline, which is essential for learning the domain and domain- invariance representations. We find that without LMMD. our model can learn to align the and embedding spaces and use orthogonal projection for prediction. According to the bar chart in Figure 9, **the Free brings the most performance gains** compared to other objectives (ex- clude Ssup). Reflected on the loss curves: Leim = -0.45 (domain factors are somewhat similar, ideal value is -1.0); Cree -1.4 (reconstruction effect, ideal value is -2.0); LMDD 0.15 (embedding spaces are nearly aligned, ideal value is 0).
In case 4 (Leups frees LMMD, no Lsim): Adding LMMD can ensure the perfect alignment of the and embedding spaces and brings further improvements over case 3. Reflected the loss curves: Leim = -0.45 (domain factors are somewhat similar, ideal value is -1.0); Cree - -1.4 (reconstruction effect, ideal value 220); LMDD (embedding spaces are aligned, ideal value is 0).
Adding Leim for case 4 leads to the final objective in our method. Lsim maximizes the similarity of the domain factors and brings further accuracy improvements.
In summary, Loup brings the label supervision (the most important one), Cree brings additional information (tells the model that two samples are from the same domain), LMMD improves the orthogonal projection (for better disentanglement), and Luim improves the learned domain factor (for better orthogonal projection).
Abltion Study on Combinations of Weights Next, on the seizure detection task, we add weights hyperparameters λι, A2, Ag > 0 to combine our proposed objectives,
Linal
Loup + X LAMD d2 Lroe + ds Lsim-
(19)
21

---

Published as a conference paper at ICLR 2023
Ovanall Loss
Iup
2.6-
3.-
2.5
2.5
6.7
2.0
Cart
2.6
0.0
24-
1.0
-0.
Acaency
Tapps
Cun
Lec
2.-
-04
00.6-
-16-
1.0
-12
Figure 9: Results of ablation studies different objective combinations
EA4
PA4
0.56
2364
664
-On Aoams
0.54
-0 Aut 2a1y
662
0.42
0.38
0.2
0.54
Westrkk
We
Figure 10: Results on individual weight variation
By default, we use A = A2 = A = 1.0 the experiments of main text. This section first tests different variations of 'ι, A2, A3 individually. The results are shown in Figure TO When increasing one of the weights from 0.1 to 10.0 and fix the others, we find that all three metrics will follow similar pattern: first become better and then slightly decreases. From the figure,
conclude that using ê = X À3 1.0 is indeed a decent choice without using exhaustive search. However, there are minor variations in performance, and apparently we can find (slightly) better combination than default.
Based on the individual performance, we guess that A 0.2, 0.2, A3 2.0 might better combination from greedy perspective. Thus, we train the model again on this combination and find that it gives marginal improvements over our default choice, shown in Table
Table 10: Comparison with greedy weight combination
Weights
Accuracy
Kappa
Avg.
A Ae
0.6754 0.0099
0.5627
0.0120
A 02 02
0.6785
0.0045
0.5654 + 0.0062
0.6031 + 0.0089
B.6 SCATTER PLOT OF V Vi
To provide more insights on the learned embeddings, we plot the L2- L2-norm statistics V V|Ix on four tasks for both training and test. Specifically, draw scatter plot using L22norm of vıx as x-axis and L2- nonm of V|aa as y-axis.
For IIIC seizure dataset, randomly select 25 batches (3,200 samples) from the training set and select 25 batches (3,200 samples) from the test set. For Sleep-EDE sleep staging dataset, we ran- domly select 25 batches (3,200 samples) from the training set and 25 batches (3,200 samples) from
22

---

Published as a conference paper at ICLR 2023
Selaure (Tralning)
(Tairing)
Drup (Training)
Hosp (Traming))
12
L2 sorm of Seioum (Test)
12 Vf
12 L2num df Drug (Test)
Step (Test)
Imophiiiiioon (Test)
norn ofter
EART Mf
22
03 33
Figure Il: Scatter plot of v and VII2
the test set. For MIMIC-III drug recommendation dataset, we randomly select batches (1,600 samples) from the training set and 25 batches (1,600 samples) from the test set. For eICU hospital readmission prediction dataset, we randomly select 25 batches (1,600 samples) from the training set and 10 batches (640 samples) from the test set. The results shown in Figure I1
we can roughly come up with three findings: (i) The scatter plot distributions for training and test look similar on all datasets and tasks, which means approach well-trained and generaliable (at least on the norm space); (ii) The magnitude (norm) of VI(a is generally larger than vix all datasets, which means the domain information Vilz is indeed large component on the extracted features This finding again verifies the necessity of removing the domain information during the prediction; (iii) The correlations between norms of Vll= and Viz are slightly different across different tasks. In the IIIC seizure prediction task and drug MIMIC recommendation task, their norms seem bit positively correlated. In Sleep-EDF sleep staging task, their norms seem uncorrelated. In eICU hospitalization prediction task, their norms seem bit negative correlated. We conclude that the norm correlations are highly dependent on the dataset characteristics.
Result Analysis From Figure 11
B.7 PERFORMANCE COMPARISON WITH SIMPLE DECOMPOSITION MODEL
In this section, we compare our model performance with two simple decomposition models. They have the same architectural designs with different objective functions. We describe the architecture:
We assume the model has feature encoder from x + v, and v contains both domain informa- tion and domain-invariant label information.
We assume the model has a domain information encoder that maps v into a domain representa- tion and has label information encoder that maps into a label representation
There are four loss objectives, which (i) (supervised loss) minimizes the supervised prediction loss with final prediction layer on similarity mizes the discrepancy between v and the reconstructed v from z, u, similarity for v' and v from z', u'; (iii) (domain similarity loss) maximizes the similarity of and z between two samples the same patient domain; (iv) (orthogonality loss) enforces the orthogonality z, u and the orthogonality of z' u'.
well; (ii) (reconstruction loss) mini-
For the first simple decomposition (SimD1) model, we follow this domain adaptation work (Bous- malis et al. 2016), which also learns the domain-speciff information and domain- shared informa- tion separately by two neural networks. It uses (i) cross-entrops loss the supervised loss; (ii) mean square error (MSE) as the reconstruction loss; (iii) scale-invariant MSE (Eigen et al. 2014 the domain similarity loss; (iv) Frobenius norm the orthogonality loss.
23

---

Published as a conference paper at ICLR 2023
For the second simple decomposition (SimD2) model, we use the loss design from approach and use (i) cross-entropy loss as the supervised loss; (ii) normalized cosine similarity as the recon- struction loss; (iii) normalized cosine similarity the domain similarity loss; (iv) Frobenius norm as the orthogonality loss.
Result Analysis We show the performance compared of these two simple decomposition models with our proposed ManyDG in Table 11 and Table[ In summary, our ManyDG outperforms two simple decomposition models significantly, which shows the effectiveness of our mutual reconstruc- tion and orthogonal projection steps. The SimD2 model also performs better than SimD1 model consistently. The only differences between them are metrics used for each objective design. We find that SimDI needs to carefully find the hyperparameter weights for balancing different objec- tives, while the objectives in SimD2 are all well-scaled and can be used together without weights. Though we have selected decent weight combinations for SimD1, it is still inferior to SimD2.
Table 11: Result comparison on health monitoring datasets
Seizure Detection
Sleep Stuging
Models
Accuracy
Kappa
Avg. F1
Accuracy
Kappa
Avg. F1
SimD1
0,5954 + 0.0127
0.4792
0.0197
0.499% + 0.0242
0.8862 + 0.0015
0.7855
0.0149
0.6962
0.0025
0.6499 0.0153
0.5485 0.0065
0.5686 0.0092
0.9017 0.0073
0.7978
0.6989
0.0114
ManyDG
0.6754 : 0.0079
0.5627 0.0066
0.6015 0.0120
0.9055 0.0054
0.7998
0.0124
0.7015
0.0027
Table 12: Result comparison on open EHR databases
Drug Recommendation
Readmission Prediction
Models
Jaccard
Avg. AUPRC
Avg.
AUPRC
Kappa
ShmD1
0,4894 0,0087
0.7472
0.0065
0.6482
0.0192
0.6985 0.01S3
0.6368 0.0026
0.5079
0.0118
SimD2
0.4901 = 0.0091
0.7536 0.0115
0.6534 + 0.0127
0.7047 + 0.0105
0.6584
0.0048
0.5260
0.0103
ManyDG
0.5175 0.0130
0.7746 0.0035
0.6737 0.0141
0.7258 0.0132
0.6752 0.0025
0.5531 0.0144
B.8 MORE EXPLANATIONS ON THE LEARNED LINEAR WEIGHTS
In this section, we discuss the relatively low cosine similarity in Table 3 Compared to the first row (predicting the labels, e.g., 6-class classification in seizure detection), the second row corresponds to predicting one of the many domains (e.g., 2,702-class classification in seizure detection). Using the linear prediction model, the performances of the second row are naturally not as good as the first row. As a result, the learned coefficients in the second row are less similar than those learned in the first row. This may also explain why sleep staging has the highest similarity in the second row (since this task only has 78 domains).
24


Reviews:
[{"review_id": "oEgHX6twT9", "reviewer": "Reviewer_TUM8", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "Paper introduces a many-domain generalization approach, a siamese-type architecture that takes in paired samples from the same domain (e.g. patient) which learns sample as well as domain embedding and in the end predicts the label. The architecture is trained through optimization of a 4-part objective which aims to 1) mutually reconstruct the samples, 2) make domain representation similar, 3) try to align the sample and domain embeddings and 4) get accurate predictions. Extensive evaluation was performed on 4 datasets, plus two studies of effects of small datasets and continuous learning. Framework shows favorable results compared against several relevant competitors.", "summary_of_the_review": "Based on the perceived novelty of the framework and thorough empirical evaluation with compelling results, I am on a positive side wrt this paper.", "strength_and_weaknesses": "Strengths\nAs mentioned, compelling empirical evaluation, with favorable results against relevant contemporary approaches.\nThe architecture appears fairly novel, and scaling up the number of domains seems like a very relevant direction. To add just one comment, “many-domain” prefix does not do justice to the real scale of the tackled problem, as previous approaches also tackled many domains (eg six in Li et al. (2020)). To borrow a term from “multi-label classification” area, thousands of labels there would make the problem “extreme multi-label classification”, so maybe “extreme multi-domain” would fit here too. \n\nWeakness\nAblation studied impact on loss function pattern only, but have not provided insight on how that impacts supervised task performance downstream. \nIn the “Remark for mutual reconstruction”, stating that z would not be incentivised to preserve label information requires a bit more support. \n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "L4OaWlCic2", "reviewer": "Reviewer_e35g", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "The authors propose a way to encode patient's data such that domain and personalized (or label) information are separated. This is achieved through domain generalization that assumes each patient as a domain. The method has multiple components, the first component to embed patients data into a different representation v. The second component extracts the domain information from v; this is learned through two objective functions: one for mutual reconstruction and the other for domain similarity. Then, by projecting v on z and removing the domain information from v, it can be used for predicting the label. \n\n  ", "summary_of_the_review": "Read the strength and weakness section. ", "strength_and_weaknesses": "Strength: \n- The paper is easy to read (except in some paragraphs)\n- The method is simple \n\nComments: \nThe paper is nice to read, however, I have the following comments: \n\nSec 3.1: the method is applicable only if there is a label for each sample and this is not necessarily the case for healthcare application. In other words, there is one y^d for all samples x_i^d.\n\nSec 3.2: Motivation 2 was not lear at the beginning but after finishing step 2 it became clear. Maybe rewriting that part would be beneficial.  \n\nSec 3.3: \n  - what does this sentence mean \"sg(·) means to stop gradient back-propagation for this quantity\"? does it mean that you do not update v_mu and only update z? \n  -  equation 11, should the denominator be norm(z)^2? \n\nExperiments:\n  - In table 3, is there any explanation why the second row has low similarity?\n  - Results in Figure 3 and the message \"our ManyDG consistently outperforms the baselines and shows increasing improvements as the number of labels decreases.\" are not convincing as the \"rate\" of deterioration is similar across all models.  ", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "FdyhMPjFQe", "reviewer": "Reviewer_FdB9", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper proposes to treat each patient as a domain and multiple observation of covariates as samples from the same domain. Consequently, one attempts to isolate the domain and sample specific features in the process of representation learning. Experiments on two datasets demonstrate competitive results compared with SOTA. This idea seems also generalizable beyond healthcare to other applications where such hierarchical assumption on the covariates may apply. \n\n-----------------------------------------------------------------\nUpdate: I very much appreciate the informative and detailed feedback from the authors. ", "summary_of_the_review": "In general this is a fairly good paper implementing assumptions on the data situation into the representation learning, which is highly generalizable beyond patient data.  ", "strength_and_weaknesses": "This paper is firstly very well structured, and the idea has been explained very clearly. \n\nThe introduced idea seems novel to me and I’m convinced of its application in such non i.i.d. data situations. I also appreciate the quantitative verification and the ablation study. \n\nWhat I found less intuitive is the procedure of first learning v from x, z from v and then trying to decompose v into two directions parallel and orthogonal to z, respectively, since v is supposed to contain all information about z already. I’m wondering if one could simply decompose\n\nv=z+u, v’=z+u’ \n\nwhere z encodes the domain information and u encodes the sample information - similar to the factor analysis. \nTechnically, we could use two objectives: \n\nThe similarity between encoder_z(x), encoder_z(x’) is to be minimized, and\n\nThe orthogonality between encoder_u(x) and encoder_u(x’) is to be maximized. \n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "AQuQrTCT5uV", "reviewer": "Reviewer_Snq3", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper addresses the many-domain generalization problem by treating each patient as a domain in healthcare applications. The paper proposes a model MANYDG to capture the domain and domain-invariant label representation by combining mutual reconstruction and orthogonal projection to explicitly remove the patient covariates. Experiments on four real-world datasets demonstrate the effectiveness of MANYDG.\n", "summary_of_the_review": "Below the acceptance threshold. \nPlease see Strength And Weaknesses for detail.\n", "strength_and_weaknesses": "S1: The methodology part is written in a clear way and well addressed the main claims in the introduction part. \n\nS2: It is an interesting idea to treat each patient as a domain and address the more general many-domain generalization propblem.\n\nS3: The extensive experiments on four healthcare datasets and two realistic and common\nclinical settings demonstrates the effectiveness of the proposed model.\n\nW1: It's concerned to involve the label information in steps 1 and 2, which causes higher prediction performance due to label information leakage.\n\nW2: It is better to provide theoretical analysis, followed by Data Generative Model and Factorized Prediction Model. \n\nW3: It is better to clarify mutual Reconstructions in section 3.3 about the features v′ hat and v hat.\n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "49OQwX0Zmw", "reviewer": "Reviewer_xtPR", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "The paper assumes that each patient belongs to different domains given by some unobserved covariates. Mutual reconstruction is used to learn the domain covariates, which are then removed by orthogonal projection.  The proposed methods improve prediction performance on healthcare monitoring and EHR datasets.", "summary_of_the_review": "The paper proposes an interesting method that treats each patient as a domain. However, different components of the model are not well explained.  E.g. what does z looks like? what does the model want to disentangle from the direction of z? Also, the writing is not rigours in maths.", "strength_and_weaknesses": "\nStrength:\n\n- There's an ablation study shows the contribution of each loss to the model performance.\n- The paper experiments on several interesting datsets and applications.\n\nWeakness:\n\n- No definition of any of the variables. What dimensions they are? \n- The mutual reconstruction seems unclear to me. \"we take a new sample and its label (x',y') from the same domain as x\".  Isn't the model \"treating each patient as an individual domain\"? Is the assumption of one patient having multiple samples mandetory?\n- The motivation is unclear. The proposed predictor does not marginalize over z. Where does equation 2 come from? Also, why consider p(x|z,y) in motivation 2? It's irrelvant to motivation 1 and equation 2. \n- It's unclear what the magnitudes of decomposed two orthogonal vectors are for each sample. It would be interesting to see a scatter plot for that.\n- Suppose there is a strong spurious correlation between domain and labels. E.g. all the samples from some patients are all negative/positive, which actually happens a lot. In this case, the domain representation z should be able to predict the label very well. Will that cause a problem when you use the vector orthogonal to z?\n\n\n\n\n\n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}]

Author rebuttal:

Decision: Accept: poster