{'fraction_non_alphanumeric': 0.03579952267303103, 'fraction_numerical': 0.010992984740001446, 'mean_word_length': 4.406647116324535, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
RadialGAN: Leveraging multiple datasets to improve target-specific predictive models using Generative Adversarial Networks

Training complex machine learning models for prediction often requires a large amount of data that is not always readily available. Leveraging these external datasets from related but different sources is therefore an important task if good predictive models are to be built for deployment in settings where data can be rare. In this paper we propose a novel approach to the problem in which we use multiple GAN architectures to learn to translate from one dataset to another, thereby allowing us to effectively enlarge the target dataset, and therefore learn better predictive models than if we simply used the target dataset. We show the utility of such an approach, demonstrating that our method improves the prediction performance on the target domain over using just the target dataset and also show that our framework outperforms several other benchmarks on a collection of real-world medical datasets.


Introduction
Modern machine learning methods often require large amounts of data in order to learn the large number of parameters that define them efficiently, this may be because the model itself is complex (such as a multi-layer perceptron) and/or because the dimensions of the input data are large (as is often the case in the medical setting (Alaa et al., 2018;Yoon et al., 2018b)). On the other hand, large datasets for a specific task such as counterfactual estimation and survival analysis may not be readily available (Yoon et al., 2018a;Lee et al., 2018). Equally, it might be the case that it is desirable to learn a model that performs well on a specific, potentially small, sub-population. For example, in the medical setting it is important that models to be deployed for use in hospitals perform well on each hospital's patient population (rather than simply performing well across the entire population) (Wiens et al., 2014;Lee et al., 2012;Yoon et al., 2017). Learning an accurate model using the limited data from a single hospital can be difficult due to the lack of data and it is therefore important to leverage data from other hospitals, while avoiding biasing the learned model.
There are two main challenges presented when attempting to utilize data from multiple sources: feature mismatch and distribution mismatch. Feature mismatch refers to the fact that even among datasets drawn from the same field (such as medicine), the features that are actually recorded for each dataset may vary. It can often be the case, for example, that the practices in different hospitals lead to different features being measured (Yoon et al., 2017). The challenge this poses is two-fold -we need to deal with the fact that the "auxiliary" hospitals' datasets do not contain all the features that have been measured by the target hospital and moreover we leverage the information contained in the features that are measured by the auxiliary hospitals but not the target hospital.
Distribution mismatch refers to the fact that the patient population across two hospitals may vary. For instance, it may be the case that hospitals located in wealthier areas serve wealthier patients and that because of a patient's wealth, they are likely to have received a different standard of care in the past, therefore one might expect that patients in this hospital are more likely to exhibit "healthier" characteristics, whereas a hospital in a poorer area is more likely to have an average patient exhibit "sicker" characteristics. In order to utilize the datasets from several hospitals to construct a hospital-specific predictive model, we need to deal with the distribution mismatch between the source and target datasets. Otherwise, the learned predictive model will be biased and could perform poorly in the targeted setting. There is a wealth of literature that focuses solely on this problem, working under the assumption that all domains contain the same features. This paper provides a natural solution to both and is therefore solving a more general problem than frameworks tackling only distribution mismatch.
In this paper, we propose a novel approach for utilizing datasets from multiple sources to effectively enlarge a target arXiv:1802.06403v2 [cs.LG] 7 Jun 2018 dataset. This has strong implications for learning targetspecific predictive models, since an enlarged dataset allows us to train more complex models, thus improving the prediction performance of such a model. We generalize a variant of the well known generative adversarial networks (GAN) (Goodfellow et al., 2014), namely CycleGAN (Zhu et al., 2017). The proposed model, which we call RadialGAN, provides a natural solution to the two challenges outlined above and moreover is able to jointly perform the task for each dataset (i.e. it simultaneously solves the problem for each dataset as if it were the target). We use multiple GAN architectures to translate the patient information from one hospital to another, leveraging the adversarial framework to ensure that the learned translation respects the distribution of the target hospital. To learn multiple translations efficiently and simultaneously, we introduce a latent space through which each translation occurs. This has the added benefit of naturally addressing the problem of feature mismatch -all samples are mapped into the same latent space.
We evaluate the proposed model against various state-of-theart benchmarks including domain translation frameworks such as CycleGAN (Zhu et al., 2017) and StarGAN (Choi et al., 2017) using a set of real-world datasets. We use the prediction performance of two different predictive models (logistic regression and multi-layer perceptrons) to measure the performance of the various translation frameworks.

Related Works
Utilizing datasets from multiple sources: Several previous studies have addressed the problem of utilizing multiple datasets to aid model-building on a specific target dataset. (Lee et al., 2012;Heskes, 2000;Evgeniou & Pontil, 2004;Liao et al., 2005) address this problem in the setting where all datasets have identical features and provide no solution to the feature mismatch problem described in the introduction. On the other hand, (Wiens et al., 2014) addresses only the problem of feature mismatch (specifically in the medical setting) and does not address the distributional differences that exist across the datasets. In spirit, our paper is most similar to (Wiens et al., 2014) as both are attempting to provide methods for utilizing multiple medical datasets that each contain a different set of features.
Conditional GAN: The conditional GAN framework presented in (Mirza & Osindero, 2014) provides an algorithm for learning to generate samples conditional on a discrete label. We draw motivation from this approach when we define our solution to the problem when the label of interest lies in a discrete space. However, we note (and demonstrate in Fig. 5) that a conditional GAN has limited applications in improving prediction performance -we cannot hope to generate samples that contain further information about the data than already contained in the dataset used to train the data generating process if the input is simply random noise.
Pairwise dataset utilization: Adversarially Learned Inference (ALI) (Dumoulin et al., 2016;Donahue et al., 2016) proposes a framework for learning mappings between two distributions. It matches the joint distribution of sample and mapped sample of one distribution to sample and mapped sample of the other. However, due to the lack of restrictions on the conditional distributions, the learned functions do not satisfy cycle-consistency, that is, when mapping from one distribution to the other and then back again, the output is not the same as the original input. In other words, the characteristics of the original sample are "lost in translation".
Adversarially Learned Inference with Conditional Entropy (ALICE) (Li et al., 2017) is an extension of ALI that learns mappings which satisfy both reversibility (i.e. that the distribution of mapped samples match those of the other distribution in both directions) and cycle-consistency. More specifically, ALICE introduces the conditional entropy loss in addition to the adversarial loss to restrict the conditionals. This conditional entropy loss forces cycle-consistency.
CycleGAN (Zhu et al., 2017) and DiscoGAN  propose further frameworks for estimating cycleconsistent and reversible mappings between two domains. Using explicit reconstruction error in place of the conditional entropy, CycleGAN and DiscoGAN ensure cycleconsistency. However, ALICE, CycleGAN and DiscoGAN are not scalable to multiple domains because the number of mappings to be learned is M (M − 1) when we have M datasets. Furthermore, each pair of mappings only utilizes the two corresponding datasets when learning their parameters, on the other hand our framework is able to leverage all datasets when learning to map between a pair of datasets.
Multi-domain translation: StarGAN (Choi et al., 2017) proposes a framework for multi-domain translation that is scalable to multiple domains by using a single generator (mapping) that takes as an additional input the target domain that the sample is to be mapped to. This framework utilizes all datasets to optimize the single generator. However, it only applies when there is no feature mismatch between domains. Moreover, the restrictive nature of modeling all mapping functions as a single network may create problems when the mapping functions between different pairs of domains are significantly different.

Motivation
To understand our solution to this problem we consider a simple toy example. Suppose that X 1 ∼ N (0, I 2 ), X 2 ∼ N (µ, I 2 ) and that Z ∼ U([−1, 1] 2 ), so that X 1 , X 2 , Z ∈ R 2 . Then there is a "simple" function f 1 such that f 1 (X 1 ) d.
= X 2 , namely, f 1 (x) = x + µ. On the RadialGAN: Leveraging multiple datasets to improve target-specific predictive models using GANs other hand, an f 2 such that f 2 (Z) d.
= X 2 is not as "simple". If for example we attempt to learn f i using linear regression, then our approximation of f 1 will be far better than our approximation of f 2 , primarily because the function f 1 lies in the space of linear models, and f 2 does not. Similarly, if we model f as a neural net, then a larger capacity of neural net will be required in order to learn a suitable f 2 than to learn a suitable f 1 . In particular, in order to learn more complex functions, we require a network with a larger capacity, however, in order to train such a network, we require more training samples. Note that learning f i is precisely what the GAN framework attempts to do, with f 1 being learned in the case that the GAN is given Gaussian noise, and f 2 being learned in the case that it is given uniform noise. In particular, the GAN framework can be very sensitive to the type of input noise it is given. Fig. 1 demonstrates this toy example for µ = (2, 2). As can be seen in the top row of the figure, when the initial and target distributions have similar shapes, the GAN framework is capable of learning the function even when the models are restricted to being low-capacity. On the other hand, the bottom row demonstrates that, even given the moderate capacity of a two-layer perceptron, the shape of the initial distribution can make learning to map to the target distribution difficult.
Note that the preceding discussion implies that (at least intuitively) if two random variables have similarly "shaped" distributions, then a mapping between them will be "simpler". In particular, if we have access to a random variable we believe to be very similar to our target, we can expect that generating samples of our target using this auxiliary variable will be easier than generating samples of our target using random noise. This motivates our approach to the transfer learning problem. We use the auxiliary datasets as the noise for a GAN framework, relying on the fact that the complex shape of a hospital's patient distribution will be better matched by another hospital's patient distribution, than by random (Gaussian) noise.

RadialGAN
Suppose that we have M spaces X (1) , ..., X (M ) , and that for each i, X (i) is a random variable taking values in X (i) . Suppose further that Y is a random variable taking values in some label space Y. Suppose that we have M datasets realizations of the pair (X (i) , Y ) and n i is the total number of realizations (observations) in dataset i.
For example, each X (i) may correspond to the space of features (such as age, weight, respiratory rate etc.) that the ith hospital (of M ) records, X (i) to a patient from the ith hospital and Y might be 1-year mortality of the patient. The dataset D i therefore contains observations of several patients from hospital i.

Our goal is to learn
Motivated by the preceding discussion, we do this by using the datasets {D j : j = i} as input to a GAN generator, noting that the datasets collected within the same field (e.g. medical datasets) are likely to be observing random variables with similar shapes. We provide two slightly different instances of our framework depending on whether the label, Y , is discrete or continuous. An overall picture of both architectures is captured in Fig. 2. For what follows, we introduce a space Z, that we refer to as the latent space, and let α ij = nj k =i n k . Where an expectation is taken, it is with respect to the randomness in each of the pairs (X (i) , Y ).

Continuous case
In the continuous setting we attempt to generate joint samples of the pair (X (i) , Y ).
Let F i : X (i) × Y → Z and G i : Z → X (i) × Y for i = 1, ..., M . We will refer to the maps {F i : i = 1, ..., M } as encoders and the maps {G i : i = 1, ..., M } as decoders. Then for each j, W j = F j (X (j) , Y ) is a random variable taking values in the latent space Z and we define the random variable Z i to be a mixture of the random variables {W j : j = i} with P(Z i = W j ) = α ij . Sampling from Z i therefore corresponds to sampling uniformly from j =i D j and then applying the corresponding F j .
For i = 1, ..., M , we define the random variable We jointly train the maps G i , F i for all i simultaneously by introducing M discriminators D 1 , ..., D M , with D i : X (i) × Y → R, that (as in the standard GAN framework) attempt to distinguish real samples, (X (i) , Y ), from fake samples, (X (i) ,Ŷ ).
We define the ith adversarial loss in this case to be  Note that L i adv depends on D i , G i and {F j : j = i}. We also introduce a cycle-consistency loss that ensures that translating into the latent space and back again returns something close to the original input and that mapping from the latent space into one of the domains and back again also returns something close to the original input, i.e. G i (F i (x, y)) ≈ (x, y) and F i (G i (z)) ≈ z. This ensures that the encoding of each space into the latent space captures all the information present in the original space. Note that this also implies that translating into one of the other domains and translating back will also return the original input. We define the ith cycle-consistency loss as where ||·|| 2 is the standard 2 -norm. Note that L i cyc depends on G i and {F j : j = 1, ..., M }.

Discrete case
In the discrete setting, rather than attempting to generate the label, Y , we instead create additional samples by conditioning on Y and generating according to the distributions X (i) |Y = y for each i = 1, ..., M, y ∈ Y. Motivated by the conditional GAN framework (Mirza & Osindero, 2014), (Odena et al., 2016), we do this by passing Y as an input to our generator.
Let F i : X (i) × Y → Z and G i : Z × Y → X (i) for i = 1, ..., M . Note that now G i takes Y as an input, i.e. it conditions on Y . As before, for each j, we define the random variable W j by W j = F j (X (j) , Y ) ∈ Z and we similarly define Z i as above.
In contrast to the continuous case, we now defineX (i) = G i (Z i , Y ) and the discriminators, D i , are now trying to distinguish real samples of X (i) |Y = y from fake sampleŝ X (i) |Y = y.
The adversarial and cycle-consistency losses are defined in a similar manner to the continuous case.

Training
For the remainder of this section, we will focus on the continuous case, but equivalent expressions can be written for and similar discussions apply to the discrete case. For all i, we implement each of F i , G i and D i as multi-layer perceptrons and denote their parameters by θ i F , θ i G and θ i D respectively.
Using the losses L i adv and L i rec we define the objective of RadialGAN as the following minimax problem where G = (G 1 , ..., G M ), F = (F 1 , ..., F M ) and D = (D 1 , ..., D M ) and λ > 0 is a hyper-parameter.
As in the standard GAN framework, we solve this minimax problem iteratively by first training D with a fixed G and F using a mini-batch of size k D and then training G and F with a fixed D using a mini-batch of size k G . Pseudo-code for our algorithm can be found in Algorithm 1. Fig. 3 depicts the interactions that occur between the F i , G i , F j , G j and D j for i = j when Z j = W i .

Prediction
After we have trained the translation functions G 1 , ..., G M and F 1 , ..., F M , we create M augmented datasets . The predictors f 1 , ..., f M are then learned on these augmented datasets. In Section 4 we model each f i as a logistic regression, but we stress that our method can be used for any choice of predictive model and we show further results in the Supplementary Materials where we model each f i as a multi-layer perceptron to demonstrate this point.

Algorithm 1 Pseudo-code of RadialGAN
k , y k )))|| 2 end while 3.5. Improved learning using WGAN The model proposed above is cast in the original GAN setting outlined by (Goodfellow et al., 2014). To improve the robustness of the GAN training, we can instead cast the model in the WGAN setting (Gulrajani et al., 2017) by replacing L i adv with the loss proposed given by RadialGAN: Leveraging multiple datasets to improve target-specific predictive models using GANs  whereX is given by sampling uniformly along straight lines between pairs of samples of X (i) andX (i) and β is a hyper-parameter.

Verifying intuition
Using a synthetic example, we provide further experimental results to back up the intuition outlined in Section 2 and in Fig. 1. In this experiment we show that if the initial and target distributions are similarly shaped, the GAN framework requires fewer samples in order to learn a mapping between them. Fig. 4 depicts the results of this experiment in which the target distribution is a Gaussian mixture with 5 modes, showing a comparison between the quality of the mapping function when the initial distribution is a simple Gaussian distribution (top row of figure) compared to a Gaussian mixture with 4 modes (bottom row of figure). As can be seen in Fig. 4, learning a good mapping from the 4 mode Gaussian mixture to the target distribution requires fewer samples than learning a good mapping from the simple Gaussian distribution to the target.

Experiment Setup
Data Description: The remainder of the experiments in this section are all performed using real-world datasets. MAG-GIC (Pocock et al., 2012) is a collection of 30 different datasets from 30 different medical studies containing patients that experienced heart failure. Among the 30 datasets, we use the 14 studies that each contain more than 500 pa-tients to allow us to create a large test set for each dataset.
We set the label of each patient as 1-year all-cause mortality, excluding all patients who are censored before 1 year. Across the 14 selected studies the total number of features is 216, with the average number of features in a single study being 66. There are 35 features (53.8%) shared between any two of the selected studies on average. The average number of patients in each selected study is 3008 with all of the selected studies containing between 528 and 13279 patients. 1 For each dataset, we randomly sample 300 patients to be used as training samples and the remaining samples are used for testing.
Benchmarks: We demonstrate the performance of Radi-alGAN against 6 benchmarks. In the Target-only benchmark, we use just the target dataset to construct a predictive model. In the Simple-combine benchmark, we combine all the datasets by defining the feature space to be the union of all feature spaces, treating unmeasured values as missing and setting them to zero. We also concatenate the mask vector to capture the missingness of each feature and then learn a predictive model on top of this dataset. The conditional-GAN (Co-GAN) and StarGAN (StarGAN) benchmarks also use this combined dataset. The Cycle-GAN benchmark learns pairwise translation functions between pairs of datasets (rather than mapping through a central latent space). For a given target dataset (Wiens et al., 2014) creates an augmented dataset by taking the additional dataset, discarding features not present in the target dataset, and augmenting with 0s to account for features present in the target but not the source. The predictive model is then learned on this aug- Metrics: As the end goal is prediction, not domain translation, we use the prediction performance of a logistic regression and a 2-layer perceptron to measure the quality of the domain translation algorithms. We report two types of prediction accuracy: Area Under ROC Curve (AUC) and Average Precision Recall (APR) 23 . Furthermore, we set the performance of the Target-only predictive model as the baseline and report the performance gain of other benchmarks (including RadialGAN) over the Target-only predictive model. We run each experiment 10 times with 5-fold cross validation each time and report the average performance over the 10 experiments.

Comparison with Target-only GAN
Before extensively comparing RadialGAN with the previously mentioned benchmarks, we first demonstrate the advantage of using auxiliary datasets to generate additional samples over using just the target dataset to train a generative model. We compare the performance of a predictive model trained on 3 different datasets: the original target dataset (Target-only), one enlarged by translating other datasets to the target domain using RadialGAN, and one enlarged using a standard GAN trained to simulate the target dataset (and using no other datasets, i.e. only use the target dataset).
As can be seen in Fig. 5, as the number of additional samples we provide increases, RadialGAN achieves higher prediction gains over the target-only predictive model. On the other hand, the target-only GAN shows a tendency to worsen the predictive model, particularly when a larger number of samples are generated. This is because the samples generated by a target-only GAN cannot possibly include information that is not already contained in the dataset used to train the GAN (i.e. the target dataset). Moreover, due to the limited size of the target dataset, the samples produced 2 Unless otherwise stated, we calculate these individually for each dataset and then report the average across all datasets. 3 The results presented in this section are for logistic regression, with the 2-layer perceptron results reported in the Supplementary Materials. by the GAN will be noisy, and so when a large number of them are generated, the resulting dataset can be significantly noisier than the original. On the other hand, RadialGAN is able to leverage the information contained across multiple datasets to generate higher quality (and therefore less noisy) additional samples.

Utilizing Multiple Datasets
In this subsection, we compare RadialGAN to the other benchmarks when we vary the total number of datasets. In the first experiment we select 3, 5 or 7 datasets randomly from among the 14 already chosen. Table 1 shows the average improvements of prediction performance over the Target-only benchmark.
As can be seen in Table 1, RadialGAN consistently leads to more accurate target-specific predictive models than the target-only predictive model and other benchmarks. Moreover, as the number of domains (datasets) increases (from M = 3 to M = 7), the performance gain increases due to the larger number of samples that RadialGAN can utilize. The performance of (Wiens et al., 2014) is usually worse than the Target-only model due to the fact that it does not address the problem of distribution mismatch across the domains. Simple-combine, Co-GAN, and StarGAN each treat the problem in a way that requires learning from a large sparse matrix (equivalent to their being a large amount of missing data); thus, even though the number of available  Figure 6. Performance improvements on each of the 14 studies.
samples increases, the improvement of prediction performance is marginal due to the high dimensional data.
Utilizing all datasets: In this experiment, we set M = 14 and so use all 14 datasets. We report the improvement of AUC and APR for each study over the Target-only baseline for each study individually in Fig. 6. We compare Radial-GAN with three competitive benchmarks (Simple-combine, StarGAN and (Wiens et al., 2014)). As can be seen in Fig. 6, RadialGAN outperforms the Target-only predictive model and other benchmarks in almost every study. Furthermore, significant improvements can be seen in some cases (such as Study 8 and 9). On the other hand, the performance improvements by other benchmarks are marginal in all cases and often the performance is decreased due to the introduction of noisy additional samples.

Two extreme cases
In this paper, we address two challenges of transfer learning: (1) feature mismatch, (2) distribution mismatch. To understand the source of gain, we conduct two further experiments. First, we evaluate the performance of RadialGAN in a setting where there is no feature mismatch (i.e. the datasets all contain the same features), which we call Setting A. We use the same MAGGIC dataset (used in Table 1) with M = 5 but only use the features that are shared across all 5 datasets. Second, we evaluate the performance of Radi-alGAN in a setting where there is no distribution mismatch, which we call Setting B. For this, we use the study in the original MAGGIC dataset with the most samples (13,279 patients) and randomly divide it into 5 subsets. Then, we randomly remove 33% of the features in each subset; thus, introducing a different feature set for each subset.
As can be seen in Table 2, the performance of RadialGAN is competitive with the other benchmarks in both Settings. The performance gain is smaller than can be seen in Table 1 due to the fact that RadialGAN is the only algorithm designed to efficiently deal with both challenges, though RadialGAN is still competitive in both settings individually. Note that (Wiens et al., 2014) works well in Setting B because it is designed for the setting where there is no distribution mismatch. On the other hand, the performance gain of StarGAN decreases in Setting B because it does not naturally address the challenge of feature mismatch.

Conclusion
In this paper we proposed a novel approach for utilizing multiple datasets to improve the performance of target-specific predictive models. Future work will investigate methods for determining which datasets should or should not be included in a specific analysis. By doing so, we hope to build on the current algorithm such that it can automatically learn to include suitable datasets which result in an improvement.