Skip to content

Repository for the PRAT Project about Rain Nowcasting

Notifications You must be signed in to change notification settings

lberetti/PRAT_Rain_Nowcasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Precipitation Nowcasting

Precipitation nowcasting is the high-resolution forecasting of precipitation up to two hours. Traditional numerical weather prediction models, are not always accurate enough to provide reliable forecasts for periods of less than two hours or are too complex to operate at high resolution with real-time constraints. Various methods are currently available to address this problem, including image block matching, precipitation cell matching and methods based on optical flow. The emergence of machine learning technologies has led researchers to investigate the application of Deep Learning methods to this field.

This research project is part of the Master 2 IMA program at Sorbonne University. The aim was to establish a state of the art of current deep learning methods for the Precipitation Nowcasting problem, to implement methods on data from the Meteo-Net dataset and to compare its results with those obtained following work undertaken in the LIP6 laboratory with a U-Net model [1].

  1. Models
  2. Results
    1. Quantitative results
    2. Examples of predictions
  3. Code
    1. Train a model
    2. Evaluate a model

1. Models

We have studied whether the use of a recurrent model brings added value compared to the U-Net model. The ConvGRU and TrajGRU models were implemented.

ConvGRU

A ConvGRU model is a neural network architecture that combines the concepts of Convolutional Neural Networks (CNNs) and Gated Recurrent Units (GRUs). The ConvGRU model blends the strengths of both architectures to handle spatiotemporal data efficiently.

The architecture of the model is as follows :

RNN blocks correspond to the GRU cell, while Conv2D and Conv2DTranspose operations act as upsampler and downsampler with stride. This helps analysing at different resolution levels and capture a global representation for the deepest layers, which can help guide the update of shallower layers.

TrajGRU

The architecture of this neural network is the same as the previous Conv-GRU neural network shown in the figure above. Only the type of recurrent cell used changes. The TrajGRU recurrent cell is an extension of the ConvGRU cell, in which recurrent connections between hidden states are learned automatically.

In traditional RNN, recurrent connections are fixed over time.
In TrajGRU, recurrent connections are dynamically determined.

Figures are from [2].

Connections are calculated dynamically in two steps. Firstly, a small neural network within the TrajGRU cell is used to estimate the $U$ and $V$ components of the optic flow at $t$. Then, the hidden state $H$ at $t$ is updated with the positions pointed out by $U$ and $V$ from $H$ at $t-1$.

2. Results

a. Quantitative results

The neural networks take as input the accumulation of one hour's rainfall data by the concatenation of 12 successive images (radar data acquired every 5 minutes). We have also studied the joint use of rainfall data with wind data in two components, U and V, as was done in [1].

Time Model F1-Score TS-Score Bias-Score
Class 1 Class 2 Class 3 Class 1 Class 2 Class 3 Class 1 Class 2 Class 3
30 min Persistence 0.602 0.438 0.264 0.43 0.28 0.152 0.993 0.999 1.006
ConvGRU 0.689 0.592 0.425 0.525 0.42 0.27 1.104 1.088 0.755
TrajGRU 0.685 0.604 0.461 0.521 0.433 0.3 1.129 1.196 0.904
ConvGRU_Wind 0.674 0.595 0.476 0.508 0.424 0.313 1.224 1.342 1.211
TrajGRU_Wind 0.667 0.598 0.48 0.501 0.426 0.316 1.297 1.245 1.021
UNet_Wind 0.724 0.581 0.43 0.567 0.41 0.274 0.907 0.817 0.699
60 min Persistence 0.523 0.338 0.166 0.354 0.203 0.09 0.998 0.997 0.997
ConvGRU 0.596 0.456 0.171 0.425 0.296 0.093 1.017 0.818 0.293
TrajGRU 0.598 0.493 0.274 0.426 0.327 0.159 1.215 1.099 0.547
ConvGRU_Wind 0.581 0.485 0.311 0.41 0.32 0.184 1.468 1.592 1.281
TrajGRU_Wind 0.578 0.502 0.319 0.407 0.335 0.19 1.53 1.303 0.819
UNet_Wind 0.569 0.391 0.204 0.397 0.243 0.113 0.848 0.78 0.627

Metrics are defined at the end of this README.md.

For a pixel $p_{i,j}$ in the image, the classes are the following:

  • CLass 1 if $0.1$ mm/h $\le p_{i, j} < 1$ mm/h
  • Class 2 if $1$ mm/h $\le p_{i, j} < 2.5$ mm/h
  • Class 3 if $2.5$ mm/h $\le p_{i, j}$

Recurrent neural networks perform better than U-Net for high precipitation rates, which tends to generate blurry predictions but scores well at low precipitation rates. Without wind data, TrajGRU improves on ConvGRU, especially for classes 2 and 3. Estimating the optical flow seems to help understand the context and improve prediction. With wind data, these two neural networks have similar results, and the optical flow estimation module is no longer necessary, since the input wind data already provides this information.

b. Examples of predictions

Example 1
Example 2

On the left, the prediction made by the TrajGRU model, on the right, the ground truth.

A few points for improvement :

  • Predicted cell boundaries are usually smoothed.
  • Fails to localize small but heavy rain events.
  • We are limited by windows size.

These are some of the arguments in favor of using a GAN as presented in [3].

3. Code

a. Train a model

To train a model you can use the file main.py. The command python3 main.py --help helps you look at the different parameters to specify.

Example :

python3 main.py --epochs 50 --batch_size 4 --input_length 12 --output_length 12 --network TrajGRU

Be careful, you need to change the folder path of the data in main.py.

The mean and variance parameters for the wind that appeared in dataset.py have been computed from the file compute_wind_statistics.py.

b. Evaluate a model.

To evaluate the model you will use the file eval_model.py. You can use the command python3 main.py --help to look at the different parameters to specify.

You need to provide the location to the .pth file that contains the network. You may also need to change the folder path of the data.

4. References

  1. Vincent Bouget et al. “Fusion of Rain Radar Images and Wind Forecasts in a Deep Learning Model Applied to Rain Nowcasting”, In : Remote Sensing 13.2, p. 246.

  2. Xingjian Shi et al. Deep Learning for Precipitation Nowcasting: A Benchmark and A New Model, 2017.

  3. Suman V. Ravuri et al. “Skilful precipitation nowcasting using deep generative models of radar”, In : Nature 597 (2021), p. 672-677.

5. Metrics

F1-Score

$$ F_1=\frac{2 T P}{2 T P+F P+F N} $$

Threat Score or critical success index

$$ TS=\frac{T P}{T P + F N + F P} $$

Bias

$$ BIAS = \frac{T P + F P}{T P + F N} $$

About

Repository for the PRAT Project about Rain Nowcasting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages