2022

These authors contributed equally to this work.

These authors contributed equally to this work.

[1]Michael Roberts

1]Department of Applied Mathematics and Theoretical Physics, University of
Cambridge, Wilberforce Road, Cambridge, CB3 0WA, United Kingdom

2]Addenbrooke’s Hospital, Cambridge University Hospitals, Cambridge, CB2 0QQ,
United Kingdom

3]A list of authors and their affiliations appears at the end of the paper

4]Department of Pure Mathematics and Mathematical Statistics, University of
Cambridge, Wilberforce Road, Cambridge, CB3 0WA, United Kingdom

5]Department of Medicine, University of Cambridge, Cambridge, UK

6]Barts Health NHS Trust, London, UK

7]Department of Haematology, University of Cambridge, Puddicombe Way,
Cambridge Biomedical Campus, Cambridge, CB2 0AW, United Kingdom

8]NHSBT, Long Road, Cambridge, CB2 0PT, United Kingdom

# Dis-AE: Multi-domain & Multi-task Generalisation on Real-World Clinical Data

Daniel Kreuter  Samuel Tull  Julian Gilbey  Jacobus Preller  BloodCounts!
Consortium  John A.D. Aston  James H.F. Rudd  Suthesh Sivapalaratnam  Carola-
Bibiane Schönlieb  Nicholas Gleadall<EMAIL_ADDRESS>[  [  [  [  [  [  [  [

###### Abstract

Clinical data is often affected by clinically irrelevant factors such as
discrepancies between measurement devices or differing processing methods
between sites. In the field of machine learning (ML), these factors are known
as domains and the distribution differences they cause in the data are known
as domain shifts. ML models trained using data from one domain often perform
poorly when applied to data from another domain, potentially leading to wrong
predictions. As such, developing machine learning models that can generalise
well across multiple domains is a challenging yet essential task in the
successful application of ML in clinical practice. In this paper, we propose a
novel disentangled autoencoder (Dis-AE) neural network architecture that can
learn domain-invariant data representations for multi-label classification of
medical measurements even when the data is influenced by multiple interacting
domain shifts at once. The model utilises adversarial training to produce data
representations from which the domain can no longer be determined. We evaluate
the model’s domain generalisation capabilities on synthetic datasets and full
blood count (FBC) data from blood donors as well as primary and secondary care
patients, showing that Dis-AE improves model generalisation on multiple
domains simultaneously while preserving clinically relevant information.

###### keywords:

Domain Generalisation, Full Blood Count, Domain Shift, Machine Learning

##  1 Introduction

Machine learning has promised to revolutionise healthcare for several years
sadegh-zadehDubioProAegro1990 ; handelmanEDoctorMachineLearning2018 .
Moreover, while there is an extensive literature describing high-performing
machine learning models trained on immaculate benchmark datasets
milletariVNetFullyConvolutional2016 ; hanMADGANUnsupervisedMedical2021 ;
caoSwinUnetUnetlikePure2021 , such promising approaches rarely make it into
clinical practice teodoridisWhyAIAdoption2022 . Often, this is because of an
unexpected drop in performance when deploying the model on unseen test data
due to domain shift rechtImageNetClassifiersGeneralize2019 ; moreno-
torresUnifyingViewDataset2012 , i.e. there is a change in the data
distribution between the dataset a model is trained on (source data) and that
which it is deployed against (target data). Most common machine learning
algorithms rely on an assumption that the source and target data are
independent and identically distributed (i.i.d.)
bishopPatternRecognitionMachine2006 . However, with domain shift, this
assumption no longer holds, and model performance can be significantly
affected. For medical datasets, domain shift is widespread, resulting from
differences in equipment and clinical practice between sites
liuSemisupervisedMetalearningDisentanglement2021 ; taoDeepLearningBased2019 ;
thiagarajanUnderstandingBehaviorClinical2019 ; rolandDomainShiftsMachine2022 ,
and models are vulnerable to associating clinically irrelevant features
specific to the domain with their predictions, known as shortcut learning
geirhosShortcutLearningDeep2020 , which may lead to poor performance on target
data.

For most medical applications, target data is rarely available prior to real-
time deployment; thus, a domain adaptation approach, where pre-trained models
are fine-tuned on data from the target distribution is not feasible. Domain
generalisation techniques that focus on mitigating domain shift and improving
model performance on unseen target data zhouDomainGeneralizationSurvey2022
are more practical approaches. Various techniques have been developed in
recent years: data augmentation otaloraStainingInvariantFeatures2019 ;
zhouLearningGenerateNovel2020 , where pre-processing is applied to source data
in hopes of increasing data diversity; domain alignment
liDomainGeneralizationMedical2020 ; huDomainGeneralizationMultidomain2020 ,
where domain shift is minimised by appropriate feature transformations which
re-align the data before model training, and ensemble learning
dingDeepDomainGeneralization2018 ; xuExploitingLowRankStructure2014 ;
wangDoFEDomainOrientedFeature2020 ; nozzaDeepLearningEnsemble2016 , where an
average of multiple models trained on different source distributions is taken.
In medical datasets, particularly for tabular data, the extent and effect of
unseen domains is often unknown, making alignment and augmentation
impractical. For on-site deployment on non-specialised hardware, ensemble
learning can often prove too expensive in terms of memory or computational
time bifetNewEnsembleMethods2009 , particularly for deep neural network
models.

Furthermore, in the sizeable domain generalisation literature, there is very
little research into the problem of multiple interacting domains within any
given dataset. In Figure 1, we indicate such a separation for some example
domain shifts we observe in real-world datasets. Authors in the literature
often refer to ”domains” based solely on sample origin, rather than
considering actual distribution-influencing effects causing domain shifts.

In this paper, we propose a deep learning model architecture based on feature
disentanglement pmlr-v37-ganin15  to perform scalable domain generalisation
for multiple interacting domains on tabular medical data. Such methods use
multi-task learning to learn features useful for the desired task but penalise
for learning features that can identify the sample’s domain label.
Importantly, no prior knowledge of the expression of the domain shift is
required. Our novel approach allows for multiple domains and tasks, both
continuous and categorical, creating a truly disentangled embedding that can
be used for multiple classification tasks. We test the model on both synthetic
and real-life clinical datasets, with the goal of retaining high performance
on data not used in training. The proposed architecture can be easily applied
to other tabular data or images by adapting the corresponding model
components.
Our novel contributions presented in this paper are:

  * •

We introduce a domain-instance grouping that goes beyond the current domain
generalisation literature by identifying and separating effects that cause
domain shift in the data (e.g. Figure 1).

  * •

We propose a novel disentangled autoencoder (Dis-AE) neural network model
architecture to find a domain-agnostic lower-dimensional representation of the
data. Dis-AE is easily scalable to multiple domains and classification tasks.

  * •

We conduct experiments of Dis-AE, comparing it to a regular autoencoder on
synthetic and real-life clinical data. We show that Dis-AE achieves high
domain generalisation performance when using the same width and depth as the
regular autoencoder.

Figure 1:  Schematic displaying the proposed domain-instance grouping. As an
example, labels for medical data are shown. Notably, domains can either be
characterised by continuous values or be made up of categorical instances.

##  2 Materials & Methods

### Datasets

We evaluate our model’s domain generalisation performance on four synthetic
datasets, data from two clinical studies, and hospital patient data.

Synthetic datasets The synthetic datasets A, B, and C represent a
classification problem with increasing difficulty. Dataset A includes one task
and one domain; dataset B adds multiple dependent continuous domains; dataset
C adds two additional tasks (see Figure 2). The data was first generated using
scikit-learn’s scikit-learn  make_classification (A, B) and
make_multilabel_classification (C) functions. Afterwards, we added the
artificial domains using simple transformations on some features of the data.
Dataset A and Dataset B consist of $13\,000$ samples each, focusing on a
single task with two balanced classes. Dataset C, on the other hand, comprises
$26\,000$ samples involving three distinct tasks, each with two classes. While
Task 2 maintains class balance, Task 1 and Task 3 exhibit imbalanced classes
with a ratio of $5:2$. To simulate domain shifts, we employed five affine
instances in our datasets. These instances were created with a ratio of
$5:5:1:1:1$, ensuring that the majority of samples belong to the two instances
used as source data. Additionally, other domain shifts in Dataset B and
Dataset C were uniformly distributed across all samples.
To explore the generalisation limits of our model, we used the same procedure
to make the Many Affines dataset, which includes a large number of instances
on one domain and a single task. The dataset contains a large-scale collection
of $500\,000$ samples, focusing on a single task with two balanced classes.
Notably, these samples are evenly distributed among 70 distinct affine
instances, offering a diverse range of transformation patterns for robust
analysis.
The synthetic datasets and the applied domain transformations are summarised
in Figure 2 (bottom) and Appendix A.

Figure 2:  Top: Examples of domain shifts found in real-world full blood count
data from the INTERVAL trial. These shifts inspired the three transformations
used in the synthetic datasets. (LY-WZ: Forward-scattered light distribution
width of the LYMPH area on the white cell differential fluorescence
scattergram. In the blue line plots, the line and shaded area show the mean
and $95\text{\,}\mathrm{\char 37\relax}$ confidence interval of the data.)
Bottom: Schematic describing the synthetic datasets and their task and domain
properties.

Clinical datasets We conduct experiments on multiple clinical datasets of
haematological measurements. Specifically, we conduct experiments on features
corresponding to standard high-level full blood count (HL-FBC) measurements,
as well as further research and clustering parameters recorded by the
haematology analyser machine during a full blood count. We refer to this data
with additional features as rich full blood count (R-FBC) data. The parameters
are described in Appendix B.
The datasets from INTERVAL angelantonioEfficiencySafetyVarying2017  and
COMPARE bellComparisonFourMethods2020  contain R-FBC data from their
respective clinical trials. These real-world datasets show natural domain
shifts that occur when collecting R-FBC data in clinical practice (some shown
in Figure 2). The studies collected samples from $48\,460$ and $29\,029$
donors, respectively. After pre-filtering (see Appendix C), we are left with
$15\,438$ and $12\,064$ R-FBC samples, respectively. Sysmex XN-2000
haematology analysers were used for both blood donor studies, with two
separate machines used for INTERVAL’s analysis. The shift between analysers
within the studies is strongly pronounced, as seen in Figure 2. Each
measurement includes the times of both the donation appointment and the
subsequent analysis in the corresponding haematology analyser. Additional
information, such as the delay between venepuncture and measurement as well as
the date of donation, can be determined from these times. Therefore, we
consider the analyser, the delay between venepuncture and measurement, and
time into the year (seasonal shifts) as our three domains of interest which
result in a shift in the data but should not have an influence on our
classification tasks. The analyser domain contains three instances since two
Sysmex XN-2000 analysers were used in INTERVAL and one in COMPARE, while
continuous time values represent the other two domains. As classification
tasks, we selected subject sex, BMI bracket, and age bracket. While arguably
lacking practical clinical value, we mainly chose these classification
objectives to illustrate our proposed method’s performance and because they
are clearly definable. The sample distributions for domains and tasks are
displayed in Appendix C.
The dataset from Cambridge University Hospitals (CUH) EpiCovVersion1a
contains HL-FBC data from real-life clinical practice, including primary and
secondary care data from $438\,483$ patients between 2016 and 2022. After pre-
filtering (see Appendix D), we are left with $1\,036\,709$ HL-FBC samples from
$376\,056$ patients. The data at CUH was recorded on 5 ADVIA 2120 analysers
which were gradually replaced with ADVIA 2120i machines throughout 2021 and
2022. Since one analyser at CUH is used exclusively for emergency cases, we
chose to exclude all samples from the emergency 2120 and 2120i machines,
leaving 8 analyser instances. Here too, the distribution difference between
analysers is significant (Kolmogorov-Smirnoff test with statistic of 0.42 and
$\text{p-value}\ll 0.001$ on RDW distributions). We again consider the
previously mentioned delay between venepuncture and measurement and the time
into the year as continuous domains. As classification tasks, we selected
patient sex, age bracket, and care setting (i.e. whether they are treated in
primary or secondary care). The sample distributions for domains and tasks are
displayed in Appendix D.

### Proposed Disentangled Autoencoder Model

Figure 3:  The proposed disentangled autoencoder (Dis-AE) architecture
includes an autoencoder as well as multiple task and domain heads attached to
the autoencoder latent space. We train the model to maximise the performance
of the task heads and decoder reconstruction while making the domain label
prediction of the domain heads as difficult as possible. This adversarial
training enables the model to learn a disentangled representation for multiple
domains while ensuring good classification performance on multiple tasks.

We seek to achieve domain generalisation using a domain-adversarial learning
approach. In such an approach, adversarial learning is used to find domain-
agnostic features from which the source domain label of the data can no longer
be predicted. We chose this method as we found it flexible, allowing for
multiple domains and tasks. This framework also allows us to introduce an
autoencoder architecture, thereby ensuring that the domain-agnostic learned
embeddings of the data are also meaningful. Such embeddings cluster
semantically similar inputs, making them valuable across various downstream
models. Our proposed disentangled autoencoder (Dis-AE) model is largely
inspired by Ganin & Lempitsky pmlr-v37-ganin15 , who proposed a model for
domain adaptation purposes. They trained an adversarial model where a feature
extractor and a class label predictor attempt to fool a domain classifier,
reminiscent of other adversarial model concepts
goodfellowGenerativeAdversarialNetworks2020 . The key difference to other
adversarial training schemes was the introduction of a gradient reversal layer
which enables training all model parameters in one optimisation step rather
than alternating between the adversarial parties. Trivedi et al.
trivediDeepLearningModels2022  later repurposed this general idea for domain
generalisation for medical images to obtain disentangled image representations
which do not contain image source information.
We extend this concept to tabular medical data and expand its capabilities in
two major ways. Firstly, we incorporate a decoder network mirroring the
feature extractor, to ensure the model learns to extract meaningful
representations from the data. Secondly, we consider a more realistic
separation when describing a dataset’s domain shift (see Figure 1) and
introduce the option to add multiple domain classifier heads to the latent
space of the model. Each domain head trains simultaneously and attempts to
predict the corresponding domain label. Crucially, we allow for the
classification of categorical or ordinal instance labels and regression to a
continuous value label by discretising continuous domains into bins. We
similarly propose adding multiple task classifier heads to the latent space,
representing multiple classification tasks on the data. Figure 3 shows our
proposed model architecture.
More formally, we consider our input space to be made up of $N$ samples
$\mathbf{x}\in X\subset\mathbb{R}^{k}$, which are one-dimensional vectors of
tabular data with $k$ features. We also assume that each sample
$\mathbf{x}_{i}$ has associated task labels $\\{t_{i,1},\ldots,t_{i,T}\\}$ and
domain labels $\\{d_{i,1},\ldots,d_{i,D}\\}$, where $T$ and $D$ are the number
of tasks and domains, respectively. Tasks are outcomes of interest (e.g.
sample classification, patient illness) while domains are covariates of the
data irrelevant to the tasks (see also Figure 1). We aim to obtain a domain-
agnostic data representation. We assume, as is standard in the literature,
that the data’s source and target distribution are similar but distinct and
only differ by the domain shifts zhouDomainGeneralizationSurvey2022 . At
training time, the model only has access to source domain distributions. We
aim to train a model with high classification performance on the task labels
and low autoencoder reconstruction error when given only samples from the
target distribution.
For the proposed encoder $G_{\text{enc}}$, decoder $G_{\text{dec}}$
architecture, with task heads $\\{G_{t_{j}}\\}$ and domain heads
$\\{G_{d_{j}}\\}$, we consider the empirical error

$\displaystyle
E(\theta_{\text{enc}},\theta_{\text{dec}},\\{\theta_{t}\\},\\{\theta_{d}\\})=\;$
$\displaystyle\alpha\cdot\underbrace{\sum_{i=1}^{N}L_{\text{MSE}}\left(G_{\text{dec}}\left(G_{\text{enc}}(\mathbf{x}_{i}\mathchar
24635\relax\;\theta_{\text{enc}})\mathchar
24635\relax\;\theta_{\text{dec}}\right),\mathbf{x}_{i}\right)}_{\text{reconstruction
loss}}$
$\displaystyle+\beta\cdot\sum_{j=1}^{T}\underbrace{\sum_{i=1}^{N}L_{t_{j}}\left(G_{t_{j}}\left(G_{\text{enc}}(\mathbf{x}_{i}\mathchar
24635\relax\;\theta_{\text{enc}})\mathchar
24635\relax\;\theta_{t_{j}}\right),t_{i,j}\right)}_{\text{task loss for task
$j$}}$
$\displaystyle+\sum_{j=1}^{D}\underbrace{\sum_{i=1}^{N}L_{d_{j}}\left(G_{d_{j}}\left(R_{\lambda}\left(G_{\text{enc}}(\mathbf{x}_{i}\mathchar
24635\relax\;\theta_{\text{enc}})\right)\mathchar
24635\relax\;\theta_{d_{j}}\right),d_{i,j}\right)}_{\text{domain loss for
domain $j$}}$ $\displaystyle\equiv$
$\displaystyle\;\mathcal{L}_{\text{rec.}}+\mathcal{L}_{\text{task}}+\mathcal{L}_{\text{domain}}\;,$
(1)

where $R_{\lambda}$ is the gradient reversal layer that is defined by the
pseudo-function

$\displaystyle R_{\lambda}(\mathbf{x})$ $\displaystyle=\mathbf{x}$ (2)
$\displaystyle\frac{\mathrm{d}R_{\lambda}}{\mathrm{d}x}$
$\displaystyle=-\lambda\mathbf{I}\;,$ (3)

where $\mathbf{I}$ is the identity matrix pmlr-v37-ganin15 . The $L_{t_{j}}$
and $L_{d_{j}}$ terms represent the loss function of the $j$-th task and
domain, respectively. For the classification objectives (i.e. task and domain
labels), we use cross entropy loss with a softmax activation (we have not used
ordinal losses in this work, though implementation would be trivial), while
for autoencoder reconstruction, we use the mean-squared error loss
$L_{\text{MSE}}$. The tuneable hyperparameters $\alpha$, $\beta$, and
$\lambda$ control the importance of each of the three training objectives. We
aim to find a saddle point of $E$ such that

$\displaystyle\hat{\theta}_{\text{enc}}$
$\displaystyle=\operatorname*{arg\,min}_{\theta_{\text{enc}}}\;\mathcal{L}_{\text{rec.}}+\mathcal{L}_{\text{task}}-\mathcal{L}_{\text{domain}}$
(4) $\displaystyle\hat{\theta}_{\text{dec}}$
$\displaystyle=\operatorname*{arg\,min}_{\theta_{\text{dec}}}\;\mathcal{L}_{\text{rec.}}$
(5) $\displaystyle\\{\hat{\theta}_{t}\\}$
$\displaystyle=\operatorname*{arg\,min}_{\\{\theta_{t}\\}}\;\mathcal{L}_{\text{task}}$
(6) $\displaystyle\\{\hat{\theta}_{d}\\}$
$\displaystyle=\operatorname*{arg\,min}_{\\{\theta_{d}\\}}\;\mathcal{L}_{\text{domain}}\;.$
(7)

The inclusion of gradient reversal layers allows running gradient descent-
based minimisation on
$\mathcal{L}_{\text{rec.}}+\mathcal{L}_{\text{task}}+\mathcal{L}_{\text{domain}}$
with respect to all parameters
$\left(\theta_{\text{enc}},\theta_{\text{dec}},\\{\theta_{t}\\},\\{\theta_{d}\\}\right)$
at once to find the optimal parameters (4)–(7) pmlr-v37-ganin15 .

### Out-of-Distribution Evaluation

Ye et al. yeTheoreticalFrameworkOutofDistribution2021  developed a theoretical
framework on what it means for an out-of-distribution (OOD) problem to be
learnable by a model. We adapt their model selection method and use their
definition of model variation as a baseline for our reliability assessment.

#### Measuring Disentanglement

For a feature $\phi(\mathbf{x})$ in the latent space generated by
$G_{\text{enc}}(\mathbf{x})$ and a dataset with domain and task labels as
described above, the variation of feature $\phi$ for task $\tau$ across domain
$\delta$ is given by

$\displaystyle\mathcal{V}(\phi,\tau,\delta)$
$\displaystyle:=\max_{(y,e,e^{\prime})\in\\{t_{\tau}\\}\times\\{d_{\delta}\\}\times\\{d_{\delta}\\}}\;\rho\left(P(\phi^{e}|y),P(\phi^{e^{\prime}}|y)\right)\;,$
(8)

where $\phi^{e}$ is the latent feature $\phi$ of all data with label $e$ for
domain $\delta$, $\rho(P,Q)$ is a symmetric function with which we measure
dissimilarity between distributions $P$ and $Q$, and $\\{t_{\tau}\\}$ and
$\\{d_{\delta}\\}$ are the unique labels of task $\tau$ and domain $\delta$,
respectively. For the purpose of model selection, we use the 1-dimensional
Wasserstein-2 ($\rho_{\text{W}_{2}}$) metric, implemented in the Python
Optimal Transport (POT) flamary2021pot  package,

$\displaystyle\rho_{\text{W}_{2}}(P,Q)$
$\displaystyle=\sqrt{\min_{\gamma\in\mathbb{R}^{m\times
n}_{+}}\sum_{i,j}\gamma_{ij}(x_{i}-y_{j})^{2}}$ (9)
$\displaystyle\text{s.t.}\;\gamma\mathbf{I}=P\mathchar
24635\relax\;\gamma^{\top}\mathbf{I}=Q\mathchar 24635\relax\;\gamma\geq 0\;,$
(10)

where $x\in P$, $y\in Q$ and $m$ and $n$ are the number of data points in $P$
and $Q$, respectively. We use $\rho_{\text{W}_{2}}$ for this task since it
monotonically increases with the distance between distributions. In contrast,
other metrics such as the total variation distance saturate as soon as the
distributions no longer overlap. Due to the use of this metric in
hyperparameter tuning, a continuous dependence on the distance between
distributions is desirable. Overall, $\mathcal{V}_{\rho}(\phi,t,d)$ describes
the variation of a feature in the latent space across a domain. Hence,
$\mathcal{V}$ should be small in a disentangled representation. Due to various
scales within features, in practice, we first normalise the feature
distribution to zero-mean and unit standard deviation, and then calculate
$\rho\left(P(\phi^{e}|y),P(\phi^{e^{\prime}}|y)\right)$.
Since Ye et al. yeTheoreticalFrameworkOutofDistribution2021  only consider one
task and domain, we define feature variation across all tasks and domains as

$\displaystyle V(\phi)$
$\displaystyle:=\max_{\begin{subarray}{c}\tau\in\\{1,\ldots,T\\}\\\
\delta\in\\{1,\ldots,D\\}\end{subarray}}\mathcal{V}(\phi,\tau,\delta)\;.$ (11)

To get a measure of the variation over the full latent space, we use the model
variation of the encoder:

$\displaystyle V^{\sup}(G_{\text{enc}})$
$\displaystyle:=\sup_{u\in\mathcal{S}^{m-1}}V(u^{\top}G_{\text{enc}}(\mathbf{X}))\;,$
(12)

where $G_{\text{enc}}(\mathbf{X})$ is the list of latent space representations
of all $\mathbf{x}\in\mathbf{X}$, $m$ is the latent space dimension, and
$\mathcal{S}^{m-1}$ is the unit $(m-1)$-sphere, and therefore
$u^{\top}G_{\text{enc}}(\mathbf{X})$ is a vector. We can use
$V^{\sup}(G_{\text{enc}})$ as an intuitive measure of how much the latent
space varies across source domains. This allows us to measure how successfully
domains have been disentangled.

#### Model Selection Score

To select the best-performing model hyperparameters, we required a combined
measure of how well a model performs on all three training objectives
(reconstruction, task classification, domain disentanglement). Ye et al.
yeTheoreticalFrameworkOutofDistribution2021  suggest a score comprised of a
model’s classification performance and its variation as a metric for model
selection. Since we additionally aim for good reconstruction performance, our
proposed Selection Score for a model $f$ instead consists of three terms:

$\displaystyle\text{Score}(f):=\underbrace{\frac{1}{T}\sum_{\tau\in\\{1,\ldots,T\\}}\text{Acc}_{\tau,f}}_{\text{mean
task
accuracy}}-\underbrace{\frac{V^{\sup}(G_{\text{enc},f})}{V^{\sup}(\mathbf{I})}}_{\text{rel.
model
variation}}-\underbrace{\sqrt{\frac{\text{MSE}(\mathbf{X},\tilde{\mathbf{X}})}{\mathbb{E}(\mathbf{X}^{2})}}}_{\text{rel.
rec. error}}\;,$ (13)

where $\text{MSE}(\mathbf{X},\tilde{\mathbf{X}})$ is the mean-squared error
between input data $\mathbf{X}$ and its reconstruction $\tilde{\mathbf{X}}$ by
the model and $\mathbb{E}(\mathbf{X}^{2})$ is the mean of all squared samples
$\lVert\mathbf{x}\rVert_{2}^{2}$. $V^{\sup}(\mathbf{I})$ gives the domain
variation of the data without any embedding transformation.
Since the second and third terms in Eq. (13) are unbounded (depending on
choice of $\rho$), $\text{Score}(f)\in(-\infty,1]$, where a score close to 1
is desirable.

#### Reliability Assessment

The variation of a model, as defined in Eq. (12), can be used to quantify the
dissimilarity between domains for any dataset, whether it is in full-
dimensional space or a lower-dimensional embedding space. A successful domain
generalisation model should maintain similar model variation on source and
target data. For reliability assessment experiments, we used the Jensen-
Shannon divergence

$\displaystyle\rho_{\text{JSD}}(P,Q)$
$\displaystyle=\frac{1}{2}D(P,M)+\frac{1}{2}D(Q,M)\;,$ (14)

instead of the Wasserstein distance in the calculation of $V^{\sup}$. Here,
$D(P,Q)$ is the Kullback-Leibler divergence CoverT.M.2006Eoit  and
$M=\frac{1}{2}(P+Q)$. This was chosen as $\rho_{\text{JSD}}(P,Q)$ is the
reduction in uncertainty of a random variable $X$, given knowledge of whether
it originated from $P$ or $Q$ (mutual information CoverT.M.2006Eoit ). Using
the Jensen-Shannon divergence in the calculation of $V^{\sup}$ is thus a
direct measurement of how much domain information is contained within our data
representation. For $V^{\sup}$ close to 0, there is no domain shift; for
$V^{\sup}$ close to 1, the distributions are completely separated.

### Architecture Selection for Dis-AE

The Dis-AE architecture may be viewed as a “vanilla” autoencoder (AE) with
task and domain heads. Therefore, to determine an optimal Dis-AE architecture,
we begin by identifying the best AE structure. In all experiments, we perform
hyperparameter tuning on a vanilla AE with fully-connected layers to optimise
the network’s depth and width. We then optimise the hyperparameters of the
Dis-AE model with respect to the selection score from Eq. (13), while keeping
the network architecture (i.e., depth and width) the same as the vanilla AE.
The AE consists of fully-connected linear layers, ReLU activations, and a
learning rate scheduler that reduces the learning rate when the validation
loss reaches a plateau. We perform hyperparameter tuning of the Dis-AE model
for the $\alpha$, $\beta$, and $\lambda$ parameters (see Eq. (1)) and an
L2-regularisation parameter. We perform hyperparameter tuning using the
Weights and Biases wandb  framework and the Cambridge Service for Data-Driven
Discovery (CSD3) high-performance computing platform, exhaustively searching
among parameter combinations.
Throughout this work, all reported experimental results were obtained as the
average of a 5-fold cross-validation experiment. Additionally, we trained the
models 5 times per fold and selected the best performing models for each fold.
This was done to mitigate differences due to weight initialisation.

##  3 Results

### Performance of the Proposed Model

Data | Model | Acc. Term | Var. Term | Rec. Term | Score
---|---|---|---|---|---
Data A | Vanilla AE | 0.97 | 1.011 | 0.05 | -0.09
| Dis-AE | 0.98 | 0.003 | 0.08 | 0.89
Data B | Vanilla AE | 0.96 | 0.693 | 0.06 | 0.21
| Dis-AE | 0.98 | 0.011 | 0.17 | 0.80
Data C | Vanilla AE | {0.77, 0.73, 0.71} | 0.633 | 0.24 | -0.14
| Dis-AE | {0.81, 0.77, 0.73} | 0.074 | 0.37 | 0.33
INTERVAL | Vanilla AE | {0.85, 0.28, 0.51} | 1.993 | 0.16 | -1.61
| Dis-AE | {0.85, 0.28, 0.50} | 0.219 | 0.21 | 0.11
CUH | Vanilla AE | {0.75, 0.24, 0.77} | 1.089 | 0.02 | -0.52
| Dis-AE | {0.75, 0.24, 0.74} | 0.631 | 0.14 | -0.19
Table 1: Task classification accuracy, relative model variation, and relative
reconstruction error, combined to give selection score (Eq. (13)). The results
were obtained from experiments on various datasets using a vanilla AE and the
Dis-AE model. For the synthetic datasets, instances 1&2 of domain 1 were
selected as source data (see Section 2). For multi-task problems, the accuracy
per task is displayed. The tasks for the INTERVAL dataset are subject {sex,
age bracket, and BMI bracket}. For the CUH dataset, the two analysers with the
highest variation HL-FBC data were selected as source data. The tasks for the
CUH dataset are patient {sex, age bracket, and care setting}. During training,
we used weighted random sampling to create batches with balanced care setting
numbers.

The selection score given in Eq. (13) (and its constituent terms) give an
illustrative metric of the model’s performance. Table 1 displays these terms
for both the vanilla AE and Dis-AE models for all datasets. Further
experimental results, including task classification accuracies for the various
datasets, are included in Appendix E, where we see similar behaviour. An
illustration of generalisation performance is given by Table 2, where domain
generalisation performance on INTERVAL (source) and COMPARE (target) data is
displayed using the model variation (Eq. 12).

|  | Variation $V^{\sup}$
---|---|---
Representation | Domain | Within source | Source and target
|  | (INTERVAL) | (INT $\cup$ COM)
| Analyser | 0.50 | 0.89
(A) Raw data | Sample age | 0.90 | 0.86
| Time of year | 0.77 | 0.91
| Analyser | 0.46 | 0.67
(B) Vanilla AE | Sample age | 0.84 | 0.83
| Time of year | 0.62 | 0.85
| Analyser | 0.24 | 0.31
(C) Dis-AE | Sample age | 0.59 | 0.61
| Time of year | 0.66 | 0.74
Table 2: Variation of rich FBC data from the INTERVAL and COMPARE studies in
different representations. The three representations are: (A) the unmodified
data, (B) the latent space of a vanilla AE and (C) the latent space of the
Dis-AE model. The variation $V^{\sup}$, calculated using $\rho_{\text{JSD}}$,
is shown per domain to show each covariate’s contribution to the data’s domain
shift.

Figure 4 displays Potential of Heat diffusion for Affinity-based Transition
Embedding (PHATE) moonVisualizingStructureTransitions2019  visualisations of
the three representations of the rich FBC data of the INTERVAL and COMPARE
studies. We trained the Dis-AE model on three tasks: subject sex, age, and
BMI; and three domains: haematology analyser, the delay between venepuncture
and analysis, and time of year.

(a)

(b)

(c)

(d)

(e)

(f)

Figure 4: Rich FBC donor data PHATE moonVisualizingStructureTransitions2019
visualisation of normalised raw data (row 1) and latent spaces of a vanilla AE
(row 2) and the Dis-AE model (row 3). The images in the left column are
coloured by subject sex (example task), while those in the right column are
coloured by haematology analyser (example domain). The machine learning models
were only trained on data from INTERVAL.

### Robustness Evaluation

We want to understand the extent to which the target data distribution can
differ from the source distributions while preserving model robustness. To
this end, we trained a vanilla AE and the Dis-AE model multiple times, varying
the number of instances included in the source data to evaluate the robustness
on the target data, using the Many Affines dataset. Figure 5 shows both
models’ variation $V^{\sup}$ on increasingly distant target data and
classification accuracy on the synthetic task.

Figure 5: Results of evaluating vanilla AE and Dis-AE model performance for a
dataset with many instances with affine domain shift. The diversity and size
of the source dataset were varied for different runs to investigate the effect
on target data generalisation. The quantities shown are $V^{\sup}$ using
$\rho_{\text{JSD}}$ (Eq. (14)) and the task accuracy.

As mentioned in Section 2, we used the Jensen-Shannon divergence to calculate
$V^{\sup}$ to measure mutual information between the latent space
representations of the data and the source and target distributions. From the
right column in Figure 5, it is visible that training the Dis-AE model on more
diverse source data results in a slower decay in task and generalisation
performance. A vanilla AE does not reflect this behaviour (left column in
Figure 5).

##  4 Discussion

Our goal was to develop an approach to obtain lower-dimensional data
representations that preserve informative features for outcomes of interest
while eliminating influences on the data known to be irrelevant covariates.
This approach could be used in a medical setting, for example, to retain
clinically relevant features within the data representation while ignoring
irrelevant ones, enabling training of classifiers which generalise across
multiple domains. We proposed the disentangled autoencoder (Dis-AE) model as
this approach and used the proposed model selection score from Eq. (13) to
illustrate its performance. Table 1 displays the results, with the accuracy
term representing the model’s ability to maintain informative features within
its latent space. The task performance is comparable to that of a vanilla AE.
However, as supported by the results in the model variation term, Dis-AE can
maintain high task performance while drastically reducing domain shift within
its representation space. This improvement over a classical embedding model
(vanilla AE) and the raw data is also evident from the PHATE visualisations in
Figure 4. Additionally, Table 2 demonstrates Dis-AE’s ability to maintain low
model variation in the latent space on unseen data, even when the variation
increases on the raw data.
We investigated the Dis-AE model’s OOD robustness by measuring its performance
on increasingly distant OOD target data. As seen in Figure 5, Dis-AE maintains
high task and generalisation performance even on highly OOD data, given enough
diversity in the source data. This behaviour strongly suggests that using data
from multiple sources can significantly increase model robustness in a real-
world deployment setting.
Dis-AE stands out from current domain generalisation approaches as it, for the
first time, considers multiple domains and tasks within its design and, as
such, can separate multiple independent domain shift influences on the data.
Dis-AE is scalable to many domains and tasks and can be easily modified by
adding or removing classifier heads from its latent space. Including the
gradient reversal layer ensures fast convergence, enabling single-step updates
to all model parameters. The Dis-AE framework can be adapted to other model
architectures by modifying the autoencoder part of the model to include, e.g.
convolutional layers or skip-connections. Dis-AE will open up future research
on data where domain shift is expected to be caused by many domains and where
the exact nature of the shift is unknown. In particular, it allows for joint
data embeddings where the data originated from multiple sources.
The proposed model has several limitations. As seen in Table 1, Dis-AE’s
reconstruction quality is lower than that of a vanilla AE due to conflicting
objectives: removing domain information from the latent space while preserving
it in the reconstruction. To overcome this, future work could involve
providing the decoder with explicit domain labels, such that the decoder can
rely on this additional information alongside the latent space to produce
accurate reconstructions of the input data. Additionally, Dis-AE training
proved somewhat unstable, converging to unsatisfactory results around 20% of
the time. Adversarial training schemes, like the one used, are notoriously
unstable meschederNumericsGANs2017 ; arjovskyPrincipledMethodsTraining2017 .
Improving convergence reliability will require further research. Fortunately,
in our experiments, model training consistently completed within 10 minutes on
a modern laptop, minimising concerns about re-training.

##  5 Conclusion

In this paper, we propose a novel model architecture for domain
generalisation, namely a disentangled autoencoder (Dis-AE). Unlike previous
work, we propose a new hierarchy for domain shift problems where we consider
domains as distinct covariates which cause a shift in the data. Domains can
either be characterised by continuous values (e.g. time) or consist of
categorical instances (e.g. measurement device). The Dis-AE framework includes
a gradient reversal layer for fast convergence and is easily adaptable to
other model architectures. We compare the performance of Dis-AE to a “vanilla”
autoencoder on multiple synthetic datasets and real-life clinical data. The
results of the experiments demonstrate the significantly increased
generalisation performance of our model and provide evidence that the Dis-AE
design encourages increased model robustness when trained on more diverse
training data.

Dis-AE provides a scalable solution for future research on large collaborative
medical datasets suffering from domain shift on many domains. This may be
particularly useful in multi-centre studies and trials using repeated
measurements.

### Code availability

The code is publicly available at [inserted on acceptance].

### Availability of data and materials

The synthetic datasets are available in the above GitLab repository. The
INTERVAL and COMPARE datasets are both available from the respective study
teams on reasonable request. The Epicov dataset is a private dataset held by
Cambridge University Hospitals NHS Trust and is not available publicly.

## References

  *   * (1) Sadegh-Zadeh, K.: In dubio pro aegro. Artificial Intelligence in Medicine 2(1), 1–3 (1990). https://doi.org/10.1016/0933-3657(90)90012-G
  * (2) Handelman, G.S., Kok, H.K., Chandra, R.V., Razavi, A.H., Lee, M.J., Asadi, H.: eDoctor: Machine learning and the future of medicine. Journal of Internal Medicine 284(6), 603–619 (2018). https://doi.org/10.1111/joim.12822
  * (3) Milletari, F., Navab, N., Ahmadi, S.-A.: V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation. In: 2016 Fourth International Conference on 3D Vision (3DV), pp. 565–571 (2016). https://doi.org/10.1109/3DV.2016.79
  * (4) Han, C., Rundo, L., Murao, K., Noguchi, T., Shimahara, Y., Milacski, Z.Á., Koshino, S., Sala, E., Nakayama, H., Satoh, S.: MADGAN: Unsupervised medical anomaly detection GAN using multiple adjacent brain MRI slice reconstruction. BMC Bioinformatics 22(2), 31 (2021). https://doi.org/10.1186/s12859-020-03936-1
  * (5) Cao, H., Wang, Y., Chen, J., Jiang, D., Zhang, X., Tian, Q., Wang, M.: Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation. arXiv (2021). https://doi.org/10.48550/arXiv.2105.05537
  * (6) Teodoridis, F., Goldfarb, A.: Why Is AI Adoption in Health Care Lagging? (2022)
  * (7) Recht, B., Roelofs, R., Schmidt, L., Shankar, V.: Do ImageNet Classifiers Generalize to ImageNet? In: Proceedings of the 36th International Conference on Machine Learning, pp. 5389–5400. PMLR, ??? (2019)
  * (8) Moreno-Torres, J.G., Raeder, T., Alaiz-Rodríguez, R., Chawla, N.V., Herrera, F.: A unifying view on dataset shift in classification. Pattern Recognition 45(1), 521–530 (2012). https://doi.org/10.1016/j.patcog.2011.06.019
  * (9) Bishop, C.M.: Pattern Recognition and Machine Learning. Information Science and Statistics. Springer, New York (2006)
  * (10) Liu, X., Thermos, S., O’Neil, A., Tsaftaris, S.A.: Semi-Supervised Meta-learning with Disentanglement for Domain-generalised Medical Image Segmentation (2021). https://doi.org/10.48550/arXiv.2106.13292
  * (11) Tao, Q., Yan, W., Wang, Y., Paiman, E.H.M., Shamonin, D.P., Garg, P., Plein, S., Huang, L., Xia, L., Sramko, M., Tintera, J., de Roos, A., Lamb, H.J., van der Geest, R.J.: Deep Learning–based Method for Fully Automatic Quantification of Left Ventricle Function from Cine MR Images: A Multivendor, Multicenter Study. Radiology 290(1), 81–88 (2019). https://doi.org/10.1148/radiol.2018180513
  * (12) Thiagarajan, J.J., Rajan, D., Sattigeri, P.: Understanding Behavior of Clinical Models under Domain Shifts. arXiv (2019). https://doi.org/10.48550/arXiv.1809.07806
  * (13) Roland, T., Böck, C., Tschoellitsch, T., Maletzky, A., Hochreiter, S., Meier, J., Klambauer, G.: Domain Shifts in Machine Learning Based Covid-19 Diagnosis From Blood Tests. Journal of Medical Systems 46(5), 23 (2022). https://doi.org/10.1007/s10916-022-01807-1
  * (14) Geirhos, R., Jacobsen, J.-H., Michaelis, C., Zemel, R., Brendel, W., Bethge, M., Wichmann, F.A.: Shortcut Learning in Deep Neural Networks. Nature Machine Intelligence 2(11), 665–673 (2020) arxiv:2004.07780 [cs, q-bio]. https://doi.org/10.1038/s42256-020-00257-z
  * (15) Zhou, K., Liu, Z., Qiao, Y., Xiang, T., Loy, C.C.: Domain Generalization: A Survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1–20 (2022). https://doi.org/10.1109/TPAMI.2022.3195549
  * (16) Otálora, S., Atzori, M., Andrearczyk, V., Khan, A., Müller, H.: Staining Invariant Features for Improving Generalization of Deep Convolutional Neural Networks in Computational Pathology. Frontiers in Bioengineering and Biotechnology 7 (2019)
  * (17) Zhou, K., Yang, Y., Hospedales, T., Xiang, T.: Learning to Generate Novel Domains for Domain Generalization. In: Vedaldi, A., Bischof, H., Brox, T., Frahm, J.-M. (eds.) Computer Vision – ECCV 2020. Lecture Notes in Computer Science, pp. 561–578. Springer International Publishing, Cham (2020). https://doi.org/10.1007/978-3-030-58517-4_33
  * (18) Li, H., Wang, Y., Wan, R., Wang, S., Li, T.-Q., Kot, A.: Domain Generalization for Medical Imaging Classification with Linear-Dependency Regularization. In: Advances in Neural Information Processing Systems, vol. 33, pp. 3118–3129. Curran Associates, Inc., ??? (2020)
  * (19) Hu, S., Zhang, K., Chen, Z., Chan, L.: Domain Generalization via Multidomain Discriminant Analysis. In: Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, pp. 292–302. PMLR, ??? (2020)
  * (20) Ding, Z., Fu, Y.: Deep Domain Generalization With Structured Low-Rank Constraint. IEEE Transactions on Image Processing 27(1), 304–313 (2018). https://doi.org/10.1109/TIP.2017.2758199
  * (21) Xu, Z., Li, W., Niu, L., Xu, D.: Exploiting Low-Rank Structure from Latent Domains for Domain Generalization. In: Fleet, D., Pajdla, T., Schiele, B., Tuytelaars, T. (eds.) Computer Vision – ECCV 2014. Lecture Notes in Computer Science, pp. 628–643. Springer International Publishing, Cham (2014). https://doi.org/10.1007/978-3-319-10578-9_41
  * (22) Wang, S., Yu, L., Li, K., Yang, X., Fu, C.-W., Heng, P.-A.: DoFE: Domain-Oriented Feature Embedding for Generalizable Fundus Image Segmentation on Unseen Datasets. IEEE Transactions on Medical Imaging 39(12), 4237–4248 (2020). https://doi.org/10.1109/TMI.2020.3015224
  * (23) Nozza, D., Fersini, E., Messina, E.: Deep Learning and Ensemble Methods for Domain Adaptation. In: 2016 IEEE 28th International Conference on Tools with Artificial Intelligence (ICTAI), pp. 184–189 (2016). https://doi.org/10.1109/ICTAI.2016.0037
  * (24) Bifet, A., Holmes, G., Pfahringer, B., Kirkby, R., Gavaldà, R.: New ensemble methods for evolving data streams. In: Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. KDD ’09, pp. 139–148. Association for Computing Machinery, New York, NY, USA (2009). https://doi.org/10.1145/1557019.1557041
  * (25) Ganin, Y., Lempitsky, V.: Unsupervised domain adaptation by backpropagation. In: Bach, F., Blei, D. (eds.) Proceedings of the 32nd International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 37, pp. 1180–1189. PMLR, Lille, France (2015)
  * (26) Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., Duchesnay, E.: Scikit-learn: Machine learning in Python. Journal of Machine Learning Research 12, 2825–2830 (2011)
  * (27) Angelantonio, E.D., Thompson, S.G., Kaptoge, S., Moore, C., Walker, M., Armitage, J., Ouwehand, W.H., Roberts, D.J., Danesh, J., Angelantonio, E.D., Thompson, S.G., Kaptoge, S., Moore, C., Walker, M., Armitage, J., Ouwehand, W.H., Roberts, D.J., Danesh, J., Armitage, J., Danesh, J., Angelantonio, E.D., Donovan, J., Ford, I., Henry, R., Hunt, B.J., Huray, B.L., Mehenny, S., Miflin, G., Moore, C., Ouwehand, W.H., Green, J., Roberts, D.J., Stredder, M., Thompson, S.G., Walker, M., Watkins, N.A., McDermott, A., Ronaldson, C., Thomson, C., Tolkien, Z., Williamson, L., Allen, D., Danesh, J., Angelantonio, E.D., Henry, R., Mehenny, S., Moore, C., Ouwehand, W.H., Roberts, D.J., Sambrook, J., Walker, M., Hammerton, T., Thomson, C., Tolkien, Z., Allen, D., Bruce, D., Choudry, F., Angelantonio, E.D., Ghevaert, C., Johnston, K., Kelly, A., King, A., Mehenny, S., Miflin, G., Mo, A., Moore, C., Ouwehand, W.H., Page, L., Richardson, P., Roberts, D.J., Sambrook, J., Senior, P., Umrania, Y., Walker, M., Wong, H., Kaptoge, S., Murphy, G., Newland, A.C., Wheatley, K., Greaves, M., Turner, M., Aziz, T., Brain, R., Davies, C., Turner, R., Wakeman, P., Dent, A., Wakeman, A., Anthony, B., Bland, D., Parrondo, W., Vincent, H., Weatherill, C., Forsyth, A., Butterfield, C., Wright, T., Ellis, K., Johnston, K., Poynton, P., Brooks, C., Martin, E., Littler, L., Williams, L., Blair, D., Ackerley, K., Woods, L., Stanley, S., Walsh, G., Franklin, G., Howath, C., Sharpe, S., Smith, D., Botham, L., Williams, C., Alexander, C., Sowerbutts, G., Furnival, D., Thake, M., Patel, S., Roost, C., Sowerby, S., Appleton, M.J., Bays, E., Bowyer, G., Clarkson, S., Halson, S., Holmes, K., Humphries, G., Johnston, K., Parvin-Cooper, L., Towler, J., Addy, J., Barrass, P., Stennett, L., Burton, S., Dingwall, H., Henry, R., Clarke, V., Potton, M., Thomson, C., Bolton, T., Daynes, M., Halson, S., Spackman, S., Walker, M., Momodu, A., Fenton, J., King, A., Muhammed, O., Oates, N., Peakman, T., Ryan, C., Spreckley, K., Stubbins, C., Williams, J., Brennan, J., Mochon, C., Taylor, S., Warren, K., Kaptoge, S., Thompson, S.G., Angelantonio, E.D., Moore, C., Mant, J., Ouwehand, W.H., Thompson, S.G., Danesh, J., Roberts, D.J.: Efficiency and safety of varying the frequency of whole blood donation (INTERVAL): A randomised trial of 45 000 donors. The Lancet 390(10110), 2360–2371 (2017). https://doi.org/10.1016/s0140-6736(17)31928-1
  * (28) Bell, S., Sweeting, M., Ramond, A., Chung, R., Kaptoge, S., Walker, M., Bolton, T., Sambrook, J., Moore, C., McMahon, A., Fahle, S., Cullen, D., Mehenny, S., Wood, A.M., Armitage, J., Ouwehand, W.H., Miflin, G., Roberts, D.J., Danesh, J., and, E.D.A.: Comparison of four methods to measure haemoglobin concentrations in whole blood donors ( COMPARE ): A diagnostic accuracy study. Transfusion Medicine 31(2), 94–103 (2020). https://doi.org/10.1111/tme.12750
  * (29) EpiCov Version1.0. https://www.hra.nhs.uk/planning-and-improving-research/application-summaries/research-summaries/epicov-version10/
  * (30) Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial networks. Communications of the ACM 63(11), 139–144 (2020). https://doi.org/10.1145/3422622
  * (31) Trivedi, A., Robinson, C., Blazes, M., Ortiz, A., Desbiens, J., Gupta, S., Dodhia, R., Bhatraju, P.K., Liles, W.C., Kalpathy-Cramer, J., Lee, A.Y., Ferres, J.M.L.: Deep learning models for COVID-19 chest x-ray classification: Preventing shortcut learning using feature disentanglement. PLOS ONE 17(10), 0274098 (2022). https://doi.org/10.1371/journal.pone.0274098
  * (32) Ye, H., Xie, C., Cai, T., Li, R., Li, Z., Wang, L.: Towards a Theoretical Framework of Out-of-Distribution Generalization. In: Advances in Neural Information Processing Systems, vol. 34, pp. 23519–23531. Curran Associates, Inc., ??? (2021)
  * (33) Flamary, R., Courty, N., Gramfort, A., Alaya, M.Z., Boisbunon, A., Chambon, S., Chapel, L., Corenflos, A., Fatras, K., Fournier, N., Gautheron, L., Gayraud, N.T.H., Janati, H., Rakotomamonjy, A., Redko, I., Rolet, A., Schutz, A., Seguy, V., Sutherland, D.J., Tavenard, R., Tong, A., Vayer, T.: POT: Python optimal transport. Journal of Machine Learning Research 22(78), 1–8 (2021)
  * (34) Cover, T.M.: Elements of information theory thomas M. Cover, joy A. Thomas. In: Elements of Information Theory, 2nd ed. edn. Wiley-Interscience, Hoboken, N.J. (2006)
  * (35) Biewald, L.: Experiment Tracking with Weights and Biases (2020)
  * (36) Moon, K.R., van Dijk, D., Wang, Z., Gigante, S., Burkhardt, D.B., Chen, W.S., Yim, K., van den Elzen, A., Hirn, M.J., Coifman, R.R., Ivanova, N.B., Wolf, G., Krishnaswamy, S.: Visualizing structure and transitions in high-dimensional biological data. Nature Biotechnology 37(12), 1482–1492 (2019). https://doi.org/10.1038/s41587-019-0336-3
  * (37) Mescheder, L., Nowozin, S., Geiger, A.: The Numerics of GANs. In: Advances in Neural Information Processing Systems, vol. 30. Curran Associates, Inc., ??? (2017)
  * (38) Arjovsky, M., Bottou, L.: Towards Principled Methods for Training Generative Adversarial Networks. arXiv (2017). https://doi.org/10.48550/arXiv.1701.04862
  * (39) Vis, J.Y., Huisman, A.: Verification and quality control of routine hematology analyzers. International Journal of Laboratory Hematology 38, 100–109 (2016). https://doi.org/10.1111/ijlh.12503
  * (40) Chen, T., Guestrin, C.: XGBoost: A Scalable Tree Boosting System. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 785–794 (2016). https://doi.org/10.1145/2939672.2939785

##  Appendix A Synthetic dataset generation

Figure 6:  Overview of the method for generating the synthetic datasets. Each
dataset has at least one artificial classification task and domain shift. The
added domains are based on simple transformations of some data features.

##  Appendix B Haematological parameters

The FBC parameters used in this work were taken directly from the
corresponding datasets. Tables 3, 4 and 5 list and describe the used HL-FBC
and R-FBC parameters. The parameters correspond to standard FBC measurements
as well as additional research and clustering parameters recorded by the
Sysmex XN-2000 haematology analysers of the INTERVAL and COMPARE trials (see
also Section 2).

Table 3: List of used platelet features. (HL-FBC features in bold) Sysmex Abbreviation |  Long Name | Unit
---|---|---
PLT |  Platelet count | per nL
PDW |  Platelet distribution width | fL
MPV |  Mean platelet volume | fL
P-LCR |  Platelet - large cell ratio | %
PCT |  Plateletcrit | %
IPF |  Immature platelet fraction | -
PLT-I |  PLT count calculated from the PLT particle size distribution | per nL
PLT-O |  PLT count calculated from the RET channel | per nL
PLT-F |  PLT count calculated from the PLT-F channel | per nL
H-IPF |  High fluorescence immature platelet fraction | -
IPF# |  Immature platelet count | per nL
|  |
Table 4: List of used red cell features. (HL-FBC features in bold) Sysmex Abbreviation |  Long Name | Unit
---|---|---
RBC |  Red blood cell count | per pL
HGB |  Haemoglobin concentration | g/dL
HCT |  Haematocrit | %
MCV |  Mean corpuscular volume | fL
MCH |  Mean corpuscular haemoglobin | pg
MCHC |  Mean corpuscular haemoglobin concentration | g/dL
RDW-SD |  Red cell distribution width (standard deviation) | fL
RDW-CV |  Red cell distribution width (coefficient of variation) | %
RET% |  Reticulocyte percent | %
RET# |  Reticulocyte count | per pL
IRF |  Immature reticulocyte fraction | %
LFR |  Low fluorescence ratio | %
MFR |  Medium fluorescence ratio | %
HFR |  High fluorescence ratio | %
RET-He |  Reticulocyte haemoglobin equivalent | pg
MicroR |  Micro RBC ratio | %
MacroR |  Macro RBC ratio | %
RBC-O |  RBC count calculated from the RET channel | per pL
RBC-He |  Red blood cell haemoglobin equivalent | pg
Delta-He |  Delta of the haemoglobin equivalents | pg
RET-Y |  Forward-scatter in RET area of RET scattergram | ch
RET-RBC-Y |  Forward-scatter in RBC area of RET scattergram | ch
IRF-Y |  Forward-scatter in IRF area of RET scattergram | ch
Hypo-He |  Hypo-haemoglobinised percentage of red cells | %
Hyper-He |  Hyper-haemoglobinised percentage of red cells | %
RPI |  Reticulocyte Production Index | -
RET-UPP |  Count in the UPP area of the RET scattergram | -
RET-TNC |  Count in the TNC area of the RET scattergram | -
|  |
Table 5: List of used white cell features. (HL-FBC features in bold)

Sysmex Abbreviation |  Long Name | Unit
---|---|---
WBC |  White blood cell count | per nL
NEUT# |  Neutrophil count | per nL
LYMPH# |  Lymphocyte count | per nL
MONO# |  Monocyte count | per nL
EO# |  Eosinophil count | per nL
BASO# |  Basophil count | per nL
NEUT% |  Neutrophil percent | %
LYMPH% |  Lymphocyte percent | %
MONO% |  Monocyte percent | %
EO% |  Eosinophil percent | %
BASO% |  Basophil percent | %
IG# |  Immature granulocyte count | per nL
IG% |  Immature granulocyte percent | %
TNC |  Total nuclear cell count | per nL
WBC-N |  WBC count calculated from WNR channel | per nL
TNC-N |  Total nuclear cell count calculated from WNR channel | per nL
BA-N# |  Basophil count calculated from the WNR channel | per nL
BA-N% |  Basophil percent calculated from the WNR channel | %
WBC-D |  WBC count calculated from WDF channel | per nL
TNC-D |  Total nuclear cell count calculated from WDF channel | per nL
NEUT#& |  Subtraction of IG# from NEUT# | per nL
NEUT%& |  Ratio of NEUT#& to WBC | %
LYMP#& |  Subtraction of the upper LYMPH AWS from LYMPH# | per nL
LYMP%& |  Ratio of LYMP#& to WBC | %
BA-D# |  Basophil count calculated from the WDF channel | per nL
BA-D% |  Basophil percent calculated from the WDF channel | %
NE-SSC |  Lateral scattered light intensity of the NEUT AWS | ch
NE-SFL |  Fluorescent light intensity of the NEUT AWS | ch
NE-FSC |  Forward-scattered light intensity of the NEUT AWS | ch
LY-X |  Lateral scattered light intensity of the LYMPH AWS | ch
LY-Y |  Fluorescent light intensity of the LYMPH AWS | ch
LY-Z |  Forward-scattered light intensity of the LYMPH AWS | ch
MO-X |  Lateral scattered light intensity of the MONO AWS | ch
MO-Y |  Fluorescent light intensity of the MONO AWS | ch
MO-Z |  Forward-scattered light intensity of the MONO AWS | ch
NE-WX |  Lateral scattered light distribution width of the NEUT AWS | ‰
NE-WY |  Fluorescent light distribution width of the NEUT AWS | ‰
NE-WZ |  Forward-scattered light distribution width of the NEUT AWS | ‰
LY-WX |  Lateral scattered light distribution width of the LYMPH AWS | ‰
LY-WY |  Fluorescent light distribution width of the LYMPH AWS | ‰
LY-WZ |  Forward-scattered light distribution width of the LYMPH AWS | ‰
MO-WX |  Lateral scattered light distribution width of the MONO AWS | ‰
MO-WY |  Fluorescent light distribution width of the MONO AWS | ‰
MO-WZ |  Forward-scattered light distribution width of the MONO AWS | ‰
|  |

00footnotetext: AWS: area on the white cell differential fluorescence
scattergram

##  Appendix C Preparation of FBC data from the INTERVAL and COMPARE trials

The pre-filtering on the available rich FBC data from the INTERVAL and COMPARE
trials is outlined in Figure 7. The distributions of the various task and
domain labels in the pre-filtered dataset are displayed in Figure 8.

Figure 7:  Flowchart of the pre-filtering of the available rich FBC data from
the INTERVAL and COMPARE trials for the experiments in this paper. We used Vis
& Huisman’s visVerificationQualityControl2016  suggested reliability limits
for FBC quality control as exclusion criteria. Similarly, we only considered
samples with a subject height within 12.2, subject weight within 45200, and
subject BMI less than 60. We only used first-visit donations per donor.
Figure 8:  Histogram plots of the various task and domain label distributions
in the pre-filtered rich FBC data from the INTERVAL and COMPARE trials,
coloured by blood donor study of origin.

##  Appendix D Preparation of FBC data from the Cambridge University Hospitals
dataset

The pre-filtering on the available high-level FBC data from the CUH dataset is
outlined in Figure 9. The distributions of the various task and domain labels
in the pre-filtered dataset are displayed in Figure 10.

Figure 9:  Flowchart of the pre-filtering of the available high-level FBC data
from the CUH dataset for the experiments in this paper. We chose to only
include the first FBC per year per patient so as to not create a large bias
towards very ill patients who would have many more FBCs in a short time
interval than comparatively healthier ones.  Figure 10:  Histogram plots of
the various task and domain label distributions in the pre-filtered high-level
FBC data from the CUH dataset, coloured by patient care setting.

##  Appendix E Supplementary: Dis-AE experiment results

###  E.1 Synthetic datasets experiments

The quantitative performance for both task and domain objectives was measured
using the classification accuracy of an XGBoost chenXGBoostScalableTree2016
model and the variation $V^{\sup}$ on various representations of the data.
Results for datasets A, B and C are displayed in Tables 6 and 7.
It is visible that instance 5, being different from the other ones on
different features, showed a drop in performance in all representations.
Particularly the Dis-AE model seems to have difficulties as it is only trained
to ignore differences in the features where instances 1 and 2 differ. This
gives an early indication that the robustness of the model depends heavily on
the domain diversity of its source data.

|  | Classification Accuracy
---|---|---
Model | Task | Source | Target
|  | Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | Task 1 | 97 % | 97 % | 96 % | 72 %
Vanilla AE | Task 1 | 97 % | 95 % | 84 % | 50 %
Dis-AE | Task 1 | 98 % | 98 % | 97 % | 53 %
(a) Dataset A

|  | Classification Accuracy
---|---|---
Model | Task | Source | Target
|  | Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | Task 1 | 97 % | 97 % | 96 % | 71 %
Vanilla AE | Task 1 | 96 % | 94 % | 76 % | 51 %
Dis-AE | Task 1 | 98 % | 97 % | 96 % | 53 %
(b) Dataset B

|  | Classification Accuracy
---|---|---
Model | Task | Source | Target
|  | Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | Task 1 | 83 % | 80 % | 75 % | 75 %
| Task 2 | 81 % | 79 % | 65 % | 76 %
| Task 3 | 74 % | 68 % | 66 % | 67 %
Vanilla AE | Task 1 | 68 % | 69 % | 68 % | 64 %
| Task 2 | 73 % | 73 % | 73 % | 68 %
| Task 3 | 67 % | 63 % | 67 % | 63 %
Dis-AE | Task 1 | 75 % | 76 % | 74 % | 57 %
| Task 2 | 77 % | 78 % | 76 % | 70 %
| Task 3 | 70 % | 69 % | 67 % | 62 %
(c) Dataset C

Table 6: Accuracy of an XGBoost chenXGBoostScalableTree2016  classifier on
various representations of the synthetic datasets. The representations are the
raw datasets, the embedding of a regular autoencoder and the embedding of our
Dis-AE model. Target data performance is given for a classifier only trained
on the full source data.

| Variation $V^{\sup}$
---|---
Model | Within source | Source + target
| Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | 3.3 | 3.9 | 11.5 | 11.4
Vanilla AE | 3.6 | 4.0 | 9.8 | 17.4
Dis-AE | 0.01 | 0.04 | 0.1 | 8.5
(a) Dataset A

| Variation $V^{\sup}$
---|---
Model | Within source | Source + target
| Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | 10.4 | 10.4 | 12.2 | 11.8
Vanilla AE | 7.0 | 6.9 | 10.0 | 12.2
Dis-AE | 0.1 | 0.1 | 0.3 | 8.4
(b) Dataset B

| Variation $V^{\sup}$
---|---
Model | Within source | Source + target
| Inst. 1&2 | Inst. 3 | Inst. 4 | Inst. 5
Raw data | 10.4 | 10.4 | 12.2 | 11.8
Vanilla AE | 6.4 | 6.5 | 6.5 | 5.9
Dis-AE | 0.7 | 0.8 | 3.8 | 2.4
(c) Dataset C

Table 7: Variation $V^{\sup}$ of various representations of the synthetic
datasets. The representations are the raw datasets, the embedding of a regular
autoencoder and the embedding of our Dis-AE model. $V^{\sup}$ gives a measure
of the maximum domain shift in each representation. (We used
$\rho_{\text{W}_{2}}$ for the calculation of $V^{\sup}$ as the domain shift in
the synthetic datasets is so large that $\rho_{\text{JSD}}$ always returns 1
on the raw data and vanilla AE latent space.)

###  E.2 Rich FBC data experiments

This appendix section displays further more detailed results on the per-class
accuracies for the rich FBC data experiments. It is worth noting that all
classes which have $0\text{\,}\mathrm{\char 37\relax}$ classification accuracy
across the board were only represented by very few data points (1-10).

|  | Class Accuracy
---|---|---
Sex | Representation | Source | Target
|  | INTERVAL | COMPARE
| Raw data | 85 % | 76 %
Male | Vanilla AE | 83 % | 74 %
| Dis-AE | 83 % | 70 %
| Raw data | 89 % | 93 %
Female | Vanilla AE | 87 % | 92 %
| Dis-AE | 87 % | 93 %

|  | Class Accuracy
---|---|---
BMI | Representation | Source | Target
|  | INTERVAL | COMPARE
| Raw data | 0 % | 0 %
$\leq$ 18.5 | Vanilla AE | 0 % | 0 %
| Dis-AE | 0 % | 0 %
| Raw data | 64 % | 72 %
18.5-25 | Vanilla AE | 63 % | 69 %
| Dis-AE | 62 % | 67 %
| Raw data | 53 % | 41 %
25-30 | Vanilla AE | 51 % | 45 %
| Dis-AE | 51 % | 46 %
| Raw data | 24 % | 22 %
$\geq$ 30 | Vanilla AE | 21 % | 18 %
| Dis-AE | 20 % | 21 %

Table 8: Performance on rich FBC datasets (part 1/2).
Tasks: sex, age bracket, BMI range
Domains: haem. analyser, delay between venepuncture and analysis, time of year |  | Class Accuracy
---|---|---
Age | Representation | Source | Target
|  | INTERVAL | COMPARE
| Raw data | 1 % | 1 %
$\leq$ 20 | Vanilla AE | 2 % | 1 %
| Dis-AE | 0 % | 1 %
| Raw data | 35 % | 52 %
20-30 | Vanilla AE | 32 % | 53 %
| Dis-AE | 25 % | 42 %
| Raw data | 17 % | 17 %
30-40 | Vanilla AE | 15 % | 17 %
| Dis-AE | 14 % | 16 %
| Raw data | 30 % | 25 %
40-50 | Vanilla AE | 29 % | 21 %
| Dis-AE | 28 % | 22 %
| Raw data | 45 % | 31 %
50-60 | Vanilla AE | 45 % | 28 %
| Dis-AE | 45 % | 34 %
| Raw data | 30 % | 20 %
60-70 | Vanilla AE | 27 % | 20 %
| Dis-AE | 24 % | 18 %
| Raw data | 1 % | 0 %
$\geq$ 70 | Vanilla AE | 0 % | 0 %
| Dis-AE | 0 % | 0 %
Table 9: Performance on rich FBC datasets (part 2/2).
Tasks: sex, age bracket, BMI range
Domains: haem. analyser, delay between venepuncture and analysis, time of year

###  E.3 Cambridge University Hospitals data experiments

This appendix section includes experiment results from the CUH dataset
experiments. The results are presented similarly to those of the other
datasets and are included for sake of completeness. Interestingly, comparing
Table 1 and Table 10, we see that the Dis-AE model struggles to achieve good
generalisation and classification performance on the care setting task and the
sample age domain. Indeed we found that sample age distributions between
primary and secondary care patients barely overlapped and hence this task and
domain are highly correlated. In trying to remove domain information for
sample age the model inadvertently dampened the classification performance of
the care setting task. Optimising this task and domain performance is non-
trivial and requires careful tuning of the $\alpha$ and $\lambda$
hyperparameters in the model loss function.

(a)

(b)

(c)

(d)

(e)

(f)

Figure 11: HL-FBC hospital patient data PHATE moonVisualizingStructureTransitions2019  visualisation of normalised raw data (row 1) and latent spaces of a vanilla AE (row 2) and the Dis-AE model (row 3). The images in the left column are coloured by patient care setting (example task), while those in the right column are coloured by haematology analyser (example domain). The machine learning models were only trained on data measured on the ADVIA 2120I 2 and ADVIA 2120I 3 analysers. In all plots, 2000 points per class were randomly selected from the calculated PHATE representation. |  | Variation $V^{\sup}$
---|---|---
Representation | Domain | Within source | Source and target
|  | (2120I 2 & 3) | (All analysers)
| Analyser | 0.28 | 0.56
(A) Raw data | Sample age | 0.64 | 0.49
| Time of year | 0.19 | 0.83
| Analyser | 0.15 | 0.39
(B) Vanilla AE | Sample age | 0.78 | 0.53
| Time of year | 0.19 | 0.68
| Analyser | 0.04 | 0.37
(C) Dis-AE | Sample age | 0.64 | 0.46
| Time of year | 0.17 | 0.71
Table 10: Variation of HL-FBC data from the Cambridge University Hospitals
patient dataset in different representations. The three representations are:
(A) the unmodified data, (B) the latent space of a vanilla AE and (C) the
latent space of the Dis-AE model. The variation $V^{\sup}$, calculated using
$\rho_{\text{JSD}}$, is shown per domain to show each covariate’s contribution
to the data’s domain shift.

|  | Class Accuracy
---|---|---
Sex | Representation | Source | Target
|  | 2120I 2 & 3 | (all other analysers)
| Raw data | 64 % | 65 %
Male | Vanilla AE | 63 % | 64 %
| Dis-AE | 63 % | 65 %
| Raw data | 83 % | 83 %
Female | Vanilla AE | 83 % | 83 %
| Dis-AE | 83 % | 83 %

|  | Class Accuracy
---|---|---
Care Setting | Representation | Source | Target
|  | 2120I 2 & 3 | (all other analysers)
| Raw data | 90 % | 92 %
Primary | Vanilla AE | 90 % | 91 %
| Dis-AE | 90 % | 91 %
| Raw data | 53 % | 46 %
Secondary | Vanilla AE | 52 % | 46 %
| Dis-AE | 41 % | 38 %

Table 11: Performance on HL-FBC dataset (part 1/2).
Tasks: sex, age bracket, care setting
Domains: haem. analyser, delay between venepuncture and analysis, time of year |  | Class Accuracy
---|---|---
Age | Representation | Source | Target
|  | 2120I 2 & 3 | (all other analysers)
| Raw data | 3 % | 2 %
$\leq$ 20 | Vanilla AE | 3 % | 2 %
| Dis-AE | 3 % | 2 %
| Raw data | 9 % | 5 %
20-30 | Vanilla AE | 9 % | 5 %
| Dis-AE | 7 % | 5 %
| Raw data | 28 % | 21 %
30-40 | Vanilla AE | 27 % | 20 %
| Dis-AE | 26 % | 21 %
| Raw data | 11 % | 10 %
40-50 | Vanilla AE | 11 % | 9 %
| Dis-AE | 10 % | 9 %
| Raw data | 28 % | 30 %
50-60 | Vanilla AE | 27 % | 30 %
| Dis-AE | 30 % | 30 %
| Raw data | 19 % | 21 %
60-70 | Vanilla AE | 18 % | 21 %
| Dis-AE | 19 % | 20 %
| Raw data | 43 % | 42 %
70-80 | Vanilla AE | 43 % | 41 %
| Dis-AE | 44 % | 42 %
| Raw data | 27 % | 30 %
80-90 | Vanilla AE | 27 % | 30 %
| Dis-AE | 27 % | 29 %
| Raw data | 1 % | 1 %
90-100 | Vanilla AE | 1 % | 1 %
| Dis-AE | 1 % | 1 %
| Raw data | 0 % | 0 %
$\geq$ 100 | Vanilla AE | 0 % | 0 %
| Dis-AE | 0 % | 0 %
Table 12: Performance on HL-FBC dataset (part 2/2).
Tasks: sex, age bracket, care setting
Domains: haem. analyser, delay between venepuncture and analysis, time of year


Send correspondence to:
∗Rolf Bühler: E-mail<EMAIL_ADDRESS>
†Merlin Barschke: E-mail<EMAIL_ADDRESS>
# Design of the ULTRASAT UV Camera

Arooj Asif  Deutsches Elektronen-Synchrotron, Platanenallee 6, D-15735
Zeuthen, Germany  Merlin Barschke  Deutsches Elektronen-Synchrotron,
Platanenallee 6, D-15735 Zeuthen, Germany  Benjamin Bastian-Querner  Deutsches
Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany  David Berge
Deutsches Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany
Institut für Physik, Humboldt-Universität zu Berlin, Newtonstrasse 15, D-12489
Berlin, Germany  Rolf Bühler  Deutsches Elektronen-Synchrotron, Platanenallee
6, D-15735 Zeuthen, Germany  Nicola De Simone  Deutsches Elektronen-
Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany  Gianluca Giavitto
Deutsches Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany
Juan M. Haces Crespo  Deutsches Elektronen-Synchrotron, Platanenallee 6,
D-15735 Zeuthen, Germany  Nirmal Kaipachery  Deutsches Elektronen-Synchrotron,
Platanenallee 6, D-15735 Zeuthen, Germany  Marek Kowalski  Deutsches
Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany  Institut
für Physik, Humboldt-Universität zu Berlin, Newtonstrasse 15, D-12489 Berlin,
Germany  Shrinivasrao R. Kulkarni  Deutsches Elektronen-Synchrotron,
Platanenallee 6, D-15735 Zeuthen, Germany  Daniel Küsters  Department of
Physics, University of California at Berkeley, 366 LeConte Hall MC 7300,
Berkeley, CA, 94720-7300  Sebastian Philipp  Deutsches Elektronen-Synchrotron,
Platanenallee 6, D-15735 Zeuthen, Germany  Heike Prokoph  Deutsches
Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany  Julian
Schliwinski  Deutsches Elektronen-Synchrotron, Platanenallee 6, D-15735
Zeuthen, Germany  Institut für Physik, Humboldt-Universität zu Berlin,
Newtonstrasse 15, D-12489 Berlin, Germany  Mikhail Vasilev  Deutsches
Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen, Germany  Jason J.
Watson  Deutsches Elektronen-Synchrotron, Platanenallee 6, D-15735 Zeuthen,
Germany  Steven Worm  Deutsches Elektronen-Synchrotron, Platanenallee 6,
D-15735 Zeuthen, Germany  Francesco Zappon  Deutsches Elektronen-Synchrotron,
Platanenallee 6, D-15735 Zeuthen, Germany  Shay Alfassi  Tower Semiconductor,
20 Shaul Amor Avenue, Migdal Haemek, 2310502, Israel  Sagi Ben-Ami  Department
of Particle Physics and Astrophysics, Weizmann Institute of Science, Herzl St
234, Rehovot, Israel  Adi Birman  Tower Semiconductor, 20 Shaul Amor Avenue,
Migdal Haemek, 2310502, Israel  Kasey Boggs  Semiconductor Technology
Associates, Inc., 1241 Puerta Del Sol, San Clemente, CA 92673-6310, USA  Greg
Bredthauer  Semiconductor Technology Associates, Inc., 1241 Puerta Del Sol,
San Clemente, CA 92673-6310, USA  Amos Fenigstein  Tower Semiconductor, 20
Shaul Amor Avenue, Migdal Haemek, 2310502, Israel  Avishay Gel-Yam  Department
of Particle Physics and Astrophysics, Weizmann Institute of Science, Herzl St
234, Rehovot, Israel  Dmitri Ivanov  Tower Semiconductor, 20 Shaul Amor
Avenue, Migdal Haemek, 2310502, Israel  Omer Katz  Tower Semiconductor, 20
Shaul Amor Avenue, Migdal Haemek, 2310502, Israel  Ofer Lapid  Department of
Particle Physics and Astrophysics, Weizmann Institute of Science, Herzl St
234, Rehovot, Israel  Tuvia Liran  Department of Particle Physics and
Astrophysics, Weizmann Institute of Science, Herzl St 234, Rehovot, Israel
Ehud Netzer  Department of Particle Physics and Astrophysics, Weizmann
Institute of Science, Herzl St 234, Rehovot, Israel  Eran O. Ofek  Department
of Particle Physics and Astrophysics, Weizmann Institute of Science, Herzl St
234, Rehovot, Israel  Shirly Regev  Etesian Semiconductor Ltd, P.O.B 3227,
Ramat Yishai, 3004205, Israel  Yossi Shvartzvald  Department of Particle
Physics and Astrophysics, Weizmann Institute of Science, Herzl St 234,
Rehovot, Israel  Joseph Tufts  Semiconductor Technology Associates, Inc., 1241
Puerta Del Sol, San Clemente, CA 92673-6310, USA  Dmitry Veinger  Tower
Semiconductor, 20 Shaul Amor Avenue, Migdal Haemek, 2310502, Israel  Eli
Waxman  Department of Particle Physics and Astrophysics, Weizmann Institute of
Science, Herzl St 234, Rehovot, Israel

###### Abstract

The Ultraviolet Transient Astronomical Satellite (ULTRASAT) is a scientific UV
space telescope that will operate in geostationary orbit. The mission,
targeted to launch in 2024, is led by the Weizmann Institute of Science (WIS)
in Israel and the Israel Space Agency (ISA). Deutsches Elektronen Synchrotron
(DESY) in Germany is tasked with the development of the UV-sensitive camera at
the heart of the telescope. The camera’s total sensitive area of $\approx$
$90\text{\times}90\text{\,}\mathrm{mm}$ is built up by four back-side
illuminated CMOS sensors, which image a field of view of $\approx$
$200\text{\,}\mathrm{d}\mathrm{e}\mathrm{g}\mathrm{{}^{2}}$. Each sensor has
$22.4$ megapixels. The Schmidt design of the telescope locates the detector
inside the optical path, limiting the overall size of the assembly. As a
result, the readout electronics is located in a remote unit outside the
telescope. The short focal length of the telescope requires an accurate
positioning of the sensors within $\pm 50\text{\,}\mathrm{\SIUnitSymbolMicro
m}$ along the optical axis, with a flatness of $\pm
10\text{\,}\mathrm{\SIUnitSymbolMicro m}$. While the telescope will be at
around $295\text{\,}\mathrm{K}$ during operations, the sensors are required to
be cooled to $200\text{\,}\mathrm{K}$ for dark current reduction. At the same
time, the ability to heat the sensors to $343\text{\,}\mathrm{K}$ is required
for decontamination. In this paper, we present the preliminary design of the
UV sensitive ULTRASAT camera.

###### keywords:

Ultraviolet, space telescope, wide-field camera, CMOS, mosaic assembly,
satellite, survey, super novae, gravitational waves.

##  1 INTRODUCTION

ULTRASAT is an astronomical satellite mission whose wide-angle telescope
($\approx$200 deg2) will image the sky in the Near Ultraviolet (NUV) between
220 nm and 280 nm. The mission is designed to survey large fractions of the
sky at high cadence (minutes to months) and sensitivity (AB limiting magnitude
22.3 AB at 5$\sigma$ in 3$\times$$300\text{\,}\sec$ integration). The volume
of the Universe that will be surveyed per unit time by ULTRASAT is more than
300 times larger than the one accessible to the most sensitive UV satellite
flown to date, the Galaxy Evolution Explorer (GALEX) [1]. For hot sources with
temperatures exceeding $20\,000\text{\,}\mathrm{K}$ the volumetric survey
speed will be comparable to upcoming surveys as the Vera C. Rubin Observatory
[2]. The main science objectives of ULTRASAT are the detection of counterparts
to gravitational wave sources and of supernovae [3, 4]. Other science topics
are variable and flaring stars, active galactic nuclei, tidal disruption
events, compact objects, and galaxies. The satellite is expected to be in
orbit by the end of 2024 and will take data for at least three years. ULTRASAT
is jointly funded and managed by the ISA and the WIS, under the scientific
leadership of the WIS. DESY in Germany joined the mission in 2019 and will
provide the camera (i.e. the Focal Plane Array and the readout electronics).

The ULTRASAT camera design addresses several technical challenges at the same
time. First, a high photon sensitivity needs to be achieved in the NUV over a
wide sensitive area. A mosaic of four Complementary metal-oxide-semiconductor
(CMOS) sensors with 22.4 megapixels and a sensitive area of $\approx 4.5\times
4.5$ cm2 each was designed for this purpose. Second, the sensor needs to be
operated at $200\text{\,}\mathrm{K}$ to achieve the low noise level required
for deep observations. At the same time heating the sensor to
$343\text{\,}\mathrm{K}$ needs to be possible for decontamination. Third, a
flatness of $\pm 10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ over the entire
focal plane is required for the fast optics of the telescope (f/$\approx
1.1$). Finally, the camera needs to be as compact as possible to limit
obscuration, as it is located in the light path inside the telescope.

This paper describes the camera design at Preliminary Design Review (PDR) in
December 2020. A outlook of changes made since then will be given at the end
of this publication. The article is structured as follows: in section 2, we
give an overview of the camera design. In section 3, we will describe the main
sensor parameters and the mosaic assembly. We proceed to describe the
mechanical and thermal design of the camera in section 4. Afterwards, the
readout electronics is described in section 5. Finally, we conclude
introducing some design updates that were done after PDR in section 6.

##  2 Camera design overview

The camera is composed of two main elements: the Detector Assembly (DA) and
the Remote Electronics (RE), shown in Figure 1. The Remote Electronics Boards
(REBs) within the RE control and read out the sensors and communicate with the
spacecraft. The Sensor Bias Boards (SBBs) within the DA perform power
conditioning to supply the sensors. The sensor is cooled by means of thermal
straps in combination with heat pipes. The fine control of the sensors’
temperature as well as the heating of the sensors for decontamination is
performed by the spacecraft by means of a control loop using temperature
sensors and heaters installed in the DA.

Figure 1:  Digital renderings of the Detector Assembly (left) and the Remote
Electronics (right) of the ULTRASAT camera.

The power and data interfaces between spacecraft and camera are located at the
RE unit outside the telescope. The data interface can be divided between a
command and telemetry interface, as well as a high speed interface for
downloading the image data to the spacecraft. Mechanically, the DA is mounted
to the telescope, whereas the RE is mounted to the spacecraft’s structure. The
outer dimensions of the DA assembly excluding the heat pipes, the cabling and
externally attached elements are $\approx$
$135\text{\times}135\text{\times}120\text{\,}\mathrm{mm}$. Its total mass is
expected to be $\approx$ $5.6\text{\,}\mathrm{kg}$. The RE has dimensions of
$\approx$ $264\text{\times}153\text{\times}49\text{\,}\mathrm{mm}$. Its total
mass is expected to be $\approx$ $2.5\text{\,}\mathrm{kg}$.

The overall electrical layout of ULTRASAT camera is shown in Figure 2. The
four identical sensor tiles are assembled on a mosaic plate. Each two tiles
are connected to one SBB which carries Point of Loads required to bias the
sensor. Each sensor tile carries temperature sensors and heaters that allow
for fine-controlling its temperature. These heaters and temperature sensors
are directly connected to the spacecraft. A total of four cables connect the
DA to the RE. The two REBs inside the RE hold the Field Programmable Gate
Arrays (FPGAs) to read out the sensors and the main power converters supplied
by the spacecraft’s unregulated power lines. The camera design follows a
graceful degradation approach. This means, that a failure of a component may
lead to degraded camera performance, but not to a global system failure. For
instance, if one of the four sensors fail, the others still remain
operational.

Figure 2:  Schematic drawing of the data and power flow in the ULTRASAT
camera.

##  3 Sensor and mosaic assembly

The CMOS sensors were designed and produced for the ULTRASAT mission by Tower
Semiconductor Ltd. (TJ) and Analog Value Ltd. (AV) in Israel. The sensor’s
main performance parameters are shown in Table 1. A key performance goal was
to achieve a high Quantum Efficiency (QE) in the NUV. For this purpose, the
sensors are back-illuminated and coated with an Anti-Reflective Coating (ARC).
The different ARCs were optimized for the NUV by TJ. Their performance was
tested by DESY with test sensors provided by TJ. The chosen coating has a high
average QE of $\approx$ $60\text{\,}\mathrm{\char 37\relax}$ in the range of
$220280\text{\,}\mathrm{nm}$. Note, that this value is corrected for quantum
yield which is significant at these frequencies. The measurement setup and the
results are discussed in more detail in an accompanying article [5, 6]. The
detailed sensor design and the ongoing sensor performance validation will be
published in forthcoming publications.

Table 1:  Main design specifications for one CMOS sensor of the ULTRASAT camera mosaic. Characteristic | Design specification
---|---
Pixel size | 9.5 $\mu$m $\times$ 9.5 $\mu$m
Photo sensitive area | 45.011 mm $\times$ 45.011 mm (4738 $\times$ 4738 pixels)
Die size | 47.135 mm $\times$ 50.080 mm
Mean QE between 220-280nm |  $>$ 60$\%$
Low-gain full well capacity |  $>$ 140ke-
Dark current at 200 K |  $<$ 0.026 e-$/$s
Readout noise |  $<$ 3.5 e-
Readout mode | Rolling shutter
Readout time |  $<$ 20 sec

The mosaic assembly was designed by the company Semiconductor Technology
Associates (STA) in California. The assembly consists of a sensor package, a
mosaic plate and a sensor flex Printed Circuit Board (PCB) for noise filtering
shown in Figure 3. Four CMOS sensor tiles are aligned in a windmill
configuration. This configuration has two main advantages: first, it allows to
minimize the insensitive area in between sensors to $\lessapprox$
$2\text{\,}\mathrm{mm}$, as the CMOS periphery electronic is always at the
edge of the mosaic. Second, all sensor tiles are interchangeable, making it
possible to select the best sensor tiles for the flight camera.

The sensors are glued to the package with Epotek 301-2 epoxy. The sensor
package will be fabricated from CE6, a silicon-aluminum composite from
Sandvik-Osprey, to match the expansion coefficient of the sensors. Heli-Coils
are installed in the package for mounting the flex circuit as well as the
mosaic plate. The flex circuit is wire bonded to the sensor using aluminum
wedge wire bonding. The wire bonds are the highest protrusion from the
assembly, $<$200 $\mu$m above the sensor. Z shims are adjusted on each of
three feet per package to make the four tiles in a mosaic co-planar. A high
flatness significantly below 20 $\mu$m will be achieved by adjusting the shim
thicknesses. There are three thermal isolators per package, made from PEEK
material. The isolators are placed such that the flexible dimension is
oriented radially to allow compliant shrinkage of the tile relative to the
warm temperature stable mosaic plate. Note, that the design described here has
evolved further since PDR, as will be discussed in section 6.

Figure 3:  CAD drawing of the sensor package and mosaic assembly. The package
and mosaic assembly was designed by STA and shows the design at the PDR of the
camera.

##  4 Mechanical and thermal design

The thermo-mechanical design of the DA is mainly determined by two
requirements: first, the sensors are required to be positioned with an
absolute accuracy of $<50\text{\,}\mathrm{\SIUnitSymbolMicro m}$ and a
flatness of $\pm 10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ along the optical
axis. Second, the temperature of the sensor needs to be between
$195\text{\,}\mathrm{K}$ and $205\text{\,}~{}$K during observations and at
$\approx$$343\text{\,}\mathrm{K}$ for in-orbit decontamination. At operation
the sensor’s temperature needs to be homogeneous and stable to
$1\text{\,}\mathrm{K}$ within the nominal observing time of 300 sec.

The DA structure concept is based on a milled hollow box. This ensures
mechanical integrity and thus low displacements when being loaded mechanically
or thermally. The hollow box will be produced of Invar 36 and provides the
mechanical interfaces towards the telescope. The telescope will be held in
place by four “spiders” attached to the sides of the DA box. Furthermore, the
box provides the mechanical interface to flat-field lenses which will be
placed 400 $\mu$m above the sensors. A motor will be attached at the sides of
the box to allow adjustment of the lens’ distance to the sensors in orbit. An
outside view of the DA box is shown in Figure 1. The hollow box also provides
interfaces to the interior of the DA, where the mosaic assembly will be
attached. An exploded view of the DA’s interior is shown in Figure 4.

Figure 4:  Exploded view of the DA revealing structural, thermal and
electronic components.

Cooling of the sensor is realised by a thermal link between the sensor tiles
and the thermal interface provided by the spacecraft outside of the telescope.
This thermal link comprises of four graphene thermal straps (one per tile) and
two ethane heat pipes. Each thermal strap is connected directly to one of the
sensor tiles to mechanically decouple the mosaic from the heat pipes that
transport the heat to the spacecraft’s thermal interface. The heat load
transported outside of the telescope by the thermal chain is $\approx 8$ W
during normal operation. The main heat loads are the radiation from the flat-
field lenses ($\approx 2.8$ W), the electronic temperature control ($\approx
1.3$ W) and the CMOS sensor periphery electronics ($\approx 1.2$ W).

To minimise heat load, each sensor is thermally decoupled by three means: (1)
the interface between sensor tiles (cold) and the mosaic plate (warm) is
designed to minimise the heat conduction towards the sensor. (2) The inner
surfaces of the DA box are coated to minimise the heat radiation from the DA’s
structure and the mosaic plate towards the sensor tiles and the elements of
the cooling chain. (3) The application of a radiation shield between the
mosaic plate and the tiles to minimize the heat radiation. As mentioned, the
temperature control will be performed by the spacecraft’s on-board computer.
To maintain the operational temperature, the use of heaters with closed loop
control is foreseen. Two heaters with a maximum power of 1.5 W are allocated
per sensor tile. To achieve the higher temperatures during decontamination,
two additional heaters of 16 W are placed at the evaporator side of the heat
pipes.

---
Figure 5:  Thermal simulations of the ULTRASAT camera during imaging
operation. The left panel shows the thermal link: the sensor tiles, heat
straps, heat pipe evaporator and heat pipes. The right panel the temperature
distribution on the four sensors.

Thermal and structure simulations of the DA were carried out using ANSYS
Workbench 2020 R1. Sample simulations results are given here. The thermal
simulation considered all radiative and conductive heat flows from and to the
telescope, as well as to the spacecraft via the spiders. The interface between
the heat pipes and the radiator is considered as a perfect heat flow sink. The
simulated temperature distribution of the thermal chain and the sensors during
imaging operations are shown in Figure 5. The simulated temperature
homogeneity of the sensors is well within the required $<$ 1 K.

The structural simulations included static and modal analysis. The static
analysis calculates the effects of steady loading conditions on the structure
ignoring the inertia and damping effects, caused by time-varying loads. The
load envelope required for the DA is 50 g in each axis. All displacements were
found to be within the required limits. For the camera the most critical
quasi-static loads are the longitudinal and lateral g-loads during launch and
the thermal strain. In particular, sensor displacements during launch has to
be lower than 100 $\mu$m along the optical axis. A simulation result for this
case is shown in the right panel of Figure 6. The modal analysis is performed
without damping and without further boundary conditions. The analysis covers
all relevant frequency bands affecting the camera during transportation and
launch, from 5 up to 2,000 Hz. The first natural frequency found in the
simulations is at 627.1 Hz, shown in the left panel of Figure 6. This is above
the lowest permissible frequency specified in the launch requirements of 400
Hz.

---
Figure 6:  Two sample structural simulations of the DA. The left panel shows
the displacements at the first natural frequency of 627.1 Hz. The right panel
shows the displacement distribution for 50 g acceleration in Z direction for
the sensors.

##  5 Readout Electronics

Each sensor is controlled and read out via two separated interfaces. The first
one is an Serial Peripheral Interface (SPI), used to load the program to the
micro-controller implemented in each sensor. The program contains several
parameters (such as the integration time, for example) which can be changed to
optimize the detector’s performance. The second one is an Low-Voltage
Differential Signaling (LVDS) interface which is used to readout the pixel
data; this interface implements a one-link two-lanes, LiteFast compatible
protocol. An external LVDS clock (45 MHz nominal) needs to be provided by the
FPGA. During readout each pixel will output two 14-bits values, one for the
low gain and one for the high gain. A simple threshold algorithm implemented
in the FPGAs will decide which one to keep and which one to discard.

The sensor requires seven voltages to be supplied for pixel operations plus
two additional voltages for the analog and digital circuitry. The pixel
supplies, in particular, have very low noise requirements ($<1$ mV RMS).
Additionally, all the supplies shall be tunable in-orbit to correct for any
degradation in performance caused by ageing effects. To provide all required
supplies, two SBBs are placed in close proximity ($\approx 15$ cm, see Figure
4) to the mosaic. Each SBB includes two fully independent powering circuitry
for two tiles plus monitoring for voltages and currents. The SBBs are
connected to the respective sensor tiles via a rigid-flex PCB which also hosts
decoupling capacitors required to meet the noise requirements.

Both, the sensors and the SBB circuitry are controlled by the FPGAs located in
the RE box. The latter has four main functions: (1) it provides filtering and
isolation of the unregulated power supply coming from the spacecraft, while
lowering the voltage level (2) it configures, controls and reads out the
sensor tiles (3) it controls the Focus Mechanism (FME) of the flat-field
lenses and (4) it receives the commands from the spacecraft to control all the
mentioned subsystems. To do so, the RE box is connected to the spacecraft via
three interfaces: (1) an unregulated DC power line ($2845\text{\,}\mathrm{V}$)
(2) a 112 kbps UART to receive commands and send status information and (3) an
link to send out the science data.

Physically, the RE circuitry consists of two identical REBs, each one of them
controlling and reading out half of the sensor mosaic (2 tiles) with its bias
circuitry. An overview of the main interfaces and components located on one
REB is shown in Figure 7.

Figure 7:  Schematic overview showing one of the two identical camera control
boards that together form the RE. The central element is the FPGA that acts as
interface element between the spacecraft and the sensor. Power is transformed
by one main converter and then splits to supply the FPGA, the associated
sensor tiles and the FME control circuitry. The schematic shows the control
board in operational switching state, where the sensor is operated and the FME
is switched off. Here, all elements that are not powered during nominal sensor
operation are shown in grey.

##  6 Conclusions and outlook

We have presented the preliminary design of the ULTRASAT camera. The design
fulfills all requirements of the mission and passed the PDR in December 2020.
Since then, the design has evolved further. Two important changes have been
introduced to improve the expected reliability of the camera:

  1. 1.

The decision was taken to read out each sensor with one dedicated REB. The
number of REBs will therefore be four. As the SBBs are divided in four
completely independent circuits this result in four fully independent camera
quarters. This improves the graceful degradation of the system, as any failure
in the camera electronics will only affect one sensor tile.

  2. 2.

The mosaic plate will be thermally coupled to the sensor tiles. Thermal
isolation is realized at the interface between the mosaic plate and the DA
box. This improves the thermo-elastic stiffness of the mosaic assembly,
resulting in an improved flatness of the mosaic assembly during operation.

The camera team is working towards the Critical Design Review, scheduled for
October 2021. First camera models are expected in 2022.

###### Acknowledgements.

We would like to acknowledge the help and support of the ULTRASAT camera
advisory board, composed of Andrei Cacovean, Maria Fürmetz, Norbert
Kappelmann, Olivier Limousin, Harald Michaelis, Achim Peters, Chris Tenzer,
Simone del Togno, Nick Waltham and Jörn Wilms. We would also like to express
our gratitude to the Institute of Planetary Research of the DLR for their
advise.

## References

  * [1] Morrissey, P., Conrow, T., Barlow, T. A., Small, T., Seibert, M., Wyder, T. K., Budavári, T., Arnouts, S., Friedman, P. G., Forster, K., Martin, D. C., Neff, S. G., Schiminovich, D., Bianchi, L., Donas, J., Heckman, T. M., Lee, Y.-W., Madore, B. F., Milliard, B., Rich, R. M., Szalay, A. S., Welsh, B. Y., and Yi, S. K., “The Calibration and Data Products of GALEX,” The Astrophysical Journal Supplement Series 173, 682–697 (Dec. 2007).
  * [2] Sagiv, I., Gal-Yam, A., Ofek, E. O., Waxman, E., Aharonson, O., Kulkarni, S. R., Nakar, E., Maoz, D., Trakhtenbrot, B., Phinney, E. S., Topaz, J., Beichman, C., Murthy, J., and Worden, S. P., “Science with a Wide-field UV Transient Explorer,” Astronomical Journal 147, 79 (Apr. 2014).
  * [3] Ganot, N., Gal-Yam, A., Ofek, E. O., Sagiv, I., Waxman, E., Lapid, O., Kulkarni, S. R., Ben-Ami, S., Kasliwal, M. M., ULTRASAT Science, Chelouche, D., Rafter, S., Behar, E., Laor, A., Poznanski, D., Nakar, E., Maoz, D., Trakhtenbrot, B., WTTH Consortium, Neill, J. D., Barlow, T. A., Martin, C. D., Gezari, S., GALEX Science Team, Arcavi, I., Bloom, J. S., Nugent, P. E., Sullivan, M., and Palomar Transient Factory, “The Detection Rate of Early UV Emission from Supernovae: A Dedicated Galex/PTF Survey and Calibrated Theoretical Estimates,” Astrophysical Journal 820, 57 (Mar. 2016).
  * [4] Arcavi, I., “The First Hours of the GW170817 Kilonova and the Importance of Early Optical and Ultraviolet Observations for Constraining Emission Models,” Astrophysical Journal Letters 855, L23 (Mar. 2018).
  * [5] Bastian-Querner, B., Küsters, D., Kaipachery, N., Schliwinski, J. et al., “Sensor characterization for the ULTRASAT space telescope,” in [Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series ], Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series Optics $+$ Photonics (Aug. 2021).
  * [6] Küsters, D., Bastian-Querner, B., Aldering, G., Blot, S., Boone, K., Copin, Y., Hebecker, D., Karg, T., Kowalski, M., Lombardo, S., Nordin, J., and Rubin, D., “SCALA upgrade: development of a light source for sub-percent calibration uncertainties,” in [Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series ], Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series 11447, 1144771 (Dec. 2020).