RainDisaggGAN - Temporal Disaggregation of Spatial 1 Rainfall Fields with Generative Adversarial Networks

Abstract


Introduction
Precipitation timeseries in sub-daily temporal resolution are required for numerous applications in environmental modeling.Especially in hydrology, with small to medium catchments whose rainfall-runoff response strongly depends on the temporal rainfall distribution, sub-daily precipitation data is necessary to simulate flood peaks accurately.
However, in many settings, precipitation sums only over timescales longer than the needed ones exist.Past sub-daily precipitation records are often only available at short recordlengths (e.g.Breinl and Di Baldassarre (2019); Lewis et al. (2019); Di Baldassarre et al. (2006)) and many future climate projections (GCM-RCM outputs) provide 6-hourly or daily precipitation sums (Müller-Thomy and Sikorska-Senoner (2019); Verfaillie et al. (2017)).To deal with this wide absence of sub-daily precipitation data, several procedures to disaggregate precipitation were proposed in recent years.These include multiplicative cascade models (e.g.Förster et al. (2016); Raut et al. (2018); Müller and Haberlandt (2018)), the method of fragments (e.g.Westra et al. (2012); Sharma and Srikanthan (2006)) and complex stochastic methods based on e.g. the randomized Bartlett-Lewis model (e.g.Koutsoyiannis and Onof (2001)).Burian et al. (2001Burian et al. ( , 2000) ) and Kumar et al. (2012) used artificial neural networks (ANNs) to perform rainfall disaggregation.Pui et al. (2012) provide a comparison of different univariate precipitation disaggregation approaches and an overview of the historical development of precipitation disaggregation frameworks can be found in Koutsoyiannis et al. (2003).Many of these methods are carried out on a station-by-station basis (Müller-Thomy and Sikorska-Senoner (2019)), while others also deal with the more challenging problem of temporal disaggregation of whole spatial fields (e.g.Raut et al. (2018)).
-2-manuscript submitted to Geophysical Research Letters In this study, we consider the latter, and we deal with the problem as a purely statistical one.For a given 2D (nlat×nlon) field c, representing the daily sum of precipitation, we want to generate a corresponding 3D field of sub-daily precipitation (tres× nlat×nlon) y abs .Since this is a highly under-determined problem, it is our goal to model the probability distribution The sum of y abs over the tres dimension must equal to c, therefore we can introduce the 3D-vector of fractions of the daily sum y f rac , defined via with t, i, j the indices of the tres/lat/lon dimension, and reformulate the problem as with the constraint that Thus we want to model the probability distribution of fractions of the daily precipitation sum, given the daily precipitation sum.The data-dimensionality of this problem increases drastically with increasing size of nlat and nlon, as the condition c has a dimensionality of nlat×nlon, and the target y f rac the even higher dimensionality nlat× nlon × tres.Here we use nlat = nlon = 16 and tres = 24 (corresponding to hourly resolution), thus dimensionalities of 256 and 6144, respectively.This makes statistically inferring the probability distribution P in principle very challenging, even given large amounts of training data.One approach to circumvent this would be building statistical models with information about the underlying problems, and then fitting the parameter of these models to the available observations.However, recent advances in machinelearning have made it possible to directly infer high dimensional probability distributions.
The most widely used are Generative Adversarial Networks (GANs) (Goodfellow et al., 2014).GANs are a special class of artificial neural networks that have originally been developed for estimating the probability distribution of images, with the goal of sampling (or "generating") images from this distributions (widely known as "deep fakes").
Especially in their conditional formulation (Mirza & Osindero, 2014)  observations of lower resolution satellite observations.GANs have also been used in the modeling of complex chaotic systems (e.g.Wu et al. (2020); King et al. (2018)) and have been proposed for stochastic parameterization in geophysical models (Gagne II et al., 2019).In this study we use measurements of precipitation from weather radars.We train the network on the daily sum of the measurements and the corresponding 1-hourly patterns of precipitation.To our best knowledge, GANs have not yet been used in the context of precipitation disaggregation.With this study we want to show that GANs are a useful tool in temporal precipitation disaggregation.Additionally, we want to provide the RainDisaggGAN as a ready-to-use tool to researchers and practitioners who are interested in creating sub-daily data from spatially distributed daily time series.All the software used for this study, as well as the trained GAN are openly available in the accompanying repository.
Note on terminology: In this study, we use the word "distribution" solely for probability distributions.In the hydrological literature, "distribution" is often also used for spatial and temporal patterns of rainfall.To avoid confusion, here we refer to these strictly as "patterns".

Data
We use openly available precipitation radar data from the Swedish meteorological (5) We then compute the daily sums and use them as condition, and the 24 corresponding 1-hourly fractions as target.The spatial resolution is ˜2 × 2 km.We use all available 16 × 16 (˜32 × 32 km) pixel samples (shifted by 16 pixels, so not including overlapping boxes) from the data that have no missing data in any of the pixels at any time of the day, and that satisfy the following condition: at least 20 pixels must exceed 5 mm/day.This is done to exclude days with very little precipitation from the training.The exact thresholds were chosen without specific physical reasons.For the training period 2009-2016 this results in 177909 samples, and for the test period 2017-2018 in 59122 samples.
We do not differentiate between different precipitation types (e.g.snow, hail) and for readability use rainfall and precipitation as synonyms.

GAN
We use the GAN type called Wasserstein-GAN (WGAN) (Arjovsky et al., 2017).A WGAN consists -such as all GANs -of two neural network.The generator, which generates "fake" samples, and a discriminator (called "critic" in WGANs) that judges whether a sample is real or not.In our conditional GAN, the generator takes as input a 16×16 field of daily sums as condition and a vector of random numbers, and generates a 24× 16 × 16 field of precipitation fractions.The critic takes as input the 16 × 16 condition and a 24×16×16 sample of fractions, and judges whether it is a fake example or not.The generator and the critic are trained alternately.The critic is trained with a combination of real and fake examples, and "taught" to differentiate between them.The generator is then trained to "fool" the critic.The trained generator can then be used to generate fraction scenarios ŷfrac from daily sum fields.These can then be converted to precipitation scenarios ŷabs via ŷabs,tij = ŷfrac,tij The method is sketched in fig. 1 (b).
We use a WGAN with gradient penalty (Gulrajani et al., 2017) and pixel normalization (Karras et al., 2018).For details of the training process and to GANs in general we refer to the original papers.Our architecture is based on deep convolutional GANs (DCGAN, Radford et al. (2016)).The input of the generator is a vector of length 100 for the random numbers, and a vector of of the flattened 16×16 condition.This is followed by a fully connected layer of size 256 × 2 × 2 × 3, three 3D upsampling and 3D convolution layers with increasing dimension and decreasing filter size, each followed by a pixel normalization, and finally a 3D convolution output layer.All layers except the output layer have rectified linear unit (ReLu) activation functions.The output layer uses a softmax layer that does a logistic regression over the nres dimension.Whit this, the generator automatically satisfies eq. ( 4).The critic has a corresponding mirrored architecture, with 4 strided 3D convolution layers, following the philosophy of using striding instead of downsampling from Gulrajani et al. (2017).Both networks are optimized with the Adam optimizer (Kingma & Ba, 2017) over 50 epochs.After 20 epochs the quality of the generator started to decrease (by visual inspection of samples generated from the train set), therefore we used the saved generator after 20 epochs.Training 20 epochs took 8 hours on a single NVIDIA Tesla V100 GPU.The architecture resulted after some experimentation with different architectures and training methods.The networks were developed with the Keras (Chollet et al., 2015) and Tensorflow (Martín Abadi et al., 2015) framework.For the details of the architectures, we refer to the appendix and the code published together with this paper.-6-manuscript submitted to Geophysical Research Letters to be indistinguishable by eye.In applications were the boundary problem would be an issue, one could use a larger domain and then remove the boundary.

Results
Figure 3 shows area means of precipitation per hour.Each panel shows the real pattern for one condition (in black), and 100 patterns generated from the same condition (in green).While it is important that individual samples look reasonable, it is also crucial that the generated sample follow the same distributions as the real patterns.Albeit it is impossible to check whether the GAN recreates the full inter-dependent probability distribution (as we use the GAN to solve this problem in lack of a better method), we can at least check whether the typical sub-daily distribution is captured by the GAN.
In the real data, the fractions are not equally distributed over the day, meaning that some times of the day have often have higher fractions of the daily sum than others.For this, we randomly select 10000 samples from the test data, and generate a single generator follows the distribution of the observations well.However, they generate to many hourly events with precipitation amounts around 1 mm/h, and on gridpoint level, the GAN extents to higher maximum precipitation amounts.At very low precipitation amounts (fig.S2 b) the distributions seem to be very different.Here, however, one has to consider that such extremely small precipitation amounts are usually of no importance.Additionally, due to the way the data is stored, the radar data cannot go down to zero, but has a minimum slightly above 10 −4 mm/hour.
Next, we check whether the GAN actually learns to use the condition input.It could be that the GAN only learns the general distribution of precipitation patterns, without connecting it to the daily sum at all.This could in principle partly be answered by the green lines in fig.3, however this is difficult to do by eye, and it it would also be hard to differentiate between the influence of the condition, and the influence of the randomness of the noise used as input for the generator.Therefore, we also generated 10 examples for each real one, using the same noise for all 4 panels.Thus generated sample 1 uses the same noise for all conditions, and sample 2 uses the same (different from sample 1) noise for all conditions and so on.The result is shown in the 10 colored lines fig. 3. The patterns generated for different conditions are similar, but not identical.For example, the blue line has a distinct peak between 15 and 20 h only in panel (a), and the peak of the yellow line between 1-5 h is slightly different in all panels.This means that dependent on the condition, different daily fractions are produced.
Finally, as additional test on the influence of the condition, we randomly select two conditions, sample 1000 patterns from each condition (using the same 1000 noise vectors for each condition), and then compute the distribution for each hour of the day, similarly to fig. 4. The result for two distinctly different conditions is shown in fig. 4 (b) (fig.S2 (b) with outliers).As can be seen, the distributions are not the same for both conditions.At 10 of the 24 hours of the day, the distributions are significantly different (p¡0.05 with 2-sample Kolmogorov-Smirnov test).For conditions that are very similar, there is no significant difference at any hour of the day (not shown).This confirms the result from above that the GAN has at least to some extent learned to use the condi- tion.Verifying the conditional relationships is difficult to impossible: the high dimension of the condition would make any type of binning or grouping either in very low sample size for each group, or in groups whose conditions are different only in some of the dimensions, and therefore a verification is not attempted here.

Discussion and conclusion
In this study we used a Generative Adversarial Network (GAN) to generate possible scenarios of hourly precipitation fields, conditioned on a field of daily precipitation sums.The network was trained on several years of hourly observations of Swedish precipitation radar data and the corresponding fields of daily precipitation sum.The trained network can generate reasonable looking hourly scenarios, and thus is able to approximate the probability distribution of the spatiotemporal rainfall patterns.By eye, the generated are nearly indistinguishable from the real patterns.We showed that the network does not simply learn a general distribution of precipitation patterns, but it also is able to use the conditional daily sum field to some extent.It thus learns a dependency of the probability distribution of rainfall patterns on the daily sum.We were, however, not able to find a reasonable way to verify this inferred dependency, and its quality hence remains unverified for now.Close inspection of the statistics of many generated samples showed partial agreement but also some deviation from the real statistics, pointing to potential limitations of the method, at least in its current implementation.
This study was mainly intended as a proof of concept, in order to assess whether it is principally possible to use GANs for temporarily disaggregating spatial rainfall patterns.Whether the method also proofs useful in rainfall-runoff modeling will be assessed in a follow-up study.This runoff modeling could include future climate scenarios.In such a setting it has to be noted that our method -as most other methods -makes a stationarity assumption, meaning that it assumes that the probability distribution of rainfall patterns is always the same (except for the dependency on the daily rainfall sum).In a future (warmer) climate, however, the typical patterns might be different.S2.
-9-manuscript submitted to Geophysical Research Letters There are many possible extensions to the algorithm used here that could open interesting lines of new research.For example, here we use samples from the whole available radar domain, without utilizing information about their geographic position.Additionally, we did not include any information on the time of year.Precipitation patterns are however not independent of geographic location and season.Therefore, it would be interesting to include time of the year and geographic location as additional conditions to the GAN.Other additional conditions that might potentially improve the GAN are meteorological variables such as temperature, windspeed or air pressure.These might contain information on the current weather pattern, which itself can have an impact on the possible sub-daily precipitation patterns.This might also be a way to -at least partly -deal with the problem of non-stationarity in future climate scenarios mentioned above.
It would also be of interest to modify the loss-function used for the training of the networks and include constraints on the statistics of the data (for example the reproduction of the daily cycle), following the ideas of Wu et al. (2020).This might eliminate the problems of deviation from the real statistics mentioned earlier.Another option would be to step back from the purely data-driven approach, and try to include physical constraints directly in the GAN.
Variational autoencoders (Kingma & Welling, 2014), which are another type of neural network that can be used to infer high-dimensional (potentially conditional) probability distributions, might also be an attractive alternative to the GAN presented here.
Finally, from a scientific point of view it would be a very appealing attempt using techniques from the emerging field of explainable AI (Samek et al., 2017;Adadi & Berrada, 2018) for the challenging task of using the trained GAN for inferring knowledge about the underlying physical processes.
they are potentially very useful for physics-related problems, such as the one considered in this study.GANs are a very active research field in the machine-learning community and their architectures and training methods are constantly improved (e.g.Arjovsky et al. (2017); Gulrajani et al. (2017); Karras et al. (2018)).Given the probabilistic nature of many physical problems, and the high-dimensionality of problems especially in Earth-science related fields, they provide an interesting pathway for new applications.For example, Leinonen et al. (2019) have used a GAN to infer the 2-D vertical structure of clouds, given 1-D service (SMHI).The data is available from 2009 to present.Here we use measurements from 2009 to 2018.The data covers Sweden and parts of the surrounding area (fig. 1 a), and has a temporal resolution of 5 minutes.The radar reflectivities Z (units dBZ) are converted to rainfall tp in mm/h via tp = 10 Z/10 200 1/1.5

Figure 1 .
Figure 1.a: Domain of the used SMHI radar data covering most parts of Sweden.b: sketch of the method.

Figure 2
Figure 2 shows examples of generated rainfall distributions for two randomly chosen daily sum conditions from a randomly chosen location.For each case, 15 hourly patterns are generated with the same daily sum condition from the test dataset.The figure shows the real daily pattern in the first row, and the generated ones thereafter.Shown are both the daily fractions y f rac (panels a,c) and the corresponding precipitation y abs (panels b,d).More examples are shown in the SI and the accompanying data and code repository.Except from boundary problems at the outermost pixels, the patterns seem

Figure 2 .
Figure 2. Real and generated examples of the fraction of hourly precipitation patterns, and the hourly precipitation itself.Shown are 2 examples (a-b first example, b-c second example).The leftmost column shows the daily sum precipitation field used as condition.The remaining 24 columns show the values for each hour.The first row shows the observed distribution over the day.The remaining rows show examples generated bye the GAN.
example for each.Then we analyze the daily cycle of the 10000 real patterns and the 10000 generated ones.The result is shown in fig. 4 (a) (fig.S2 (a) including outliers).When looking at the generated fractions, the generated distribution seems in general to reasonably follow the real distribution.There are, however, some deviations, mainly an underestimation of the daily cycle.When it comes to the daily cycle of precipitation corresponding to these fractions, the generator does a worse job.Here the daily cycle is even more under-estimated, thus the generator has too little dependency of precipitation on the hour of day.As additional validation, panel (b) fig. 4 shows cumulative distribution functions of the observed and generated hourly precipitation patterns, for the same data as the daily-cycle analysis.Shown are both the distribution of the area means, and of point-observations.The plots are capped to exclude very low precipitation amounts.The full plots are shown in fig.S2 (b).In general the distribution of the generated patterns

Figure 3 .
Figure 3. Examples of area averaged precipitation scenarios over a single day.The black line shows the observed precipitation, the green lines show 100 generated ones.The colored lines show 10 generated ones, were each color uses exactly the same noise in all 4 plots.

Figure 4 .
Figure 4. (a) Daily cycle of 10000 randomly selected real observations, and scenarios generated by conditioning on exactly the same 10000 daily sums.(b) cumulative distribution functions of generated and observed hourly area mean precipitation (upper panel) and hourly point-level precipitation (lower panel), same data as in (a).(c) Example of daily area mean distributions generated from 2 different daily sum conditions.For each conditions, 1000 scenarios were generated.In all barplots outliers are not shown.The same plots with outliers are shown in fig.