This repository is a part of our team's submission for the ML4Earth Physics-aware 2023 hackathon. Presentation slide: https://www.canva.com/design/DAFuwH_Hdyk/7-zK9G9zyozcZtwr0F4ONA/view?utm_content=DAFuwH_Hdyk&utm_campaign=designshare&utm_medium=link&utm_source=publishsharelink
In this hackathon, our goal was to develop a robust flood modeling framework capable of performing at large scales using input and ground truth data from the Pakistan flood in 2022. We focused on applying supervised machine learning methods, specifically utilizing the Linear Regression for Neural Networks model, to solve the 2-D shallow water equations. Our ultimate objective was to create a flood forecast model that can provide valuable insights and predictions in the event of future floods in Pakistan.
Meet our team members:
- Parinda Pannoon (GitHub:https://github.com/parindapannoon)
- Yanika Dontong (GitHub: https://github.com/YanikaD)
- Lisah Ligono (GitHub: https://github.com/lisahligono)
DEM
Load data from tiff file then selected the values that less than -2,000 and clean missing data. Precipitation Load data from tiff file in ordering by name. After that, down sampling the image by 16 to get the image of size 881x440 and unsqueeze to 1x1x881x440
Manning
Load data from numpy file then selected the down sampling the image by 16 and unsqueeze the data to be the size of 1x1x881x440
Trainning and Validation data
Load data from of tiff files from training and validation path and make the first layer as a ground height. After that, generate grid x, y and t and put them together in tensor list in the order of x, y, t and initial height
Data for input layer
Concatenate the tensor of t, dem,manning,rain and height together in the shape of 1x16x881x440x5
Model
The model consist of 3 Linear layers, 4 SpectralConv3d, Modulelist of [5 Conv1d] in the following order
(fc0): Linear(in_features=8, out_features=16, bias=True)
(sp_convs): ModuleList( (0-3): 4 x SpectralConv3d() )
(ws): ModuleList(
(0): Conv1d(16, 24, kernel_size=(1,), stride=(1,))
(1-2): 2 x Conv1d(24, 24, kernel_size=(1,), stride=(1,))
(3): Conv1d(24, 32, kernel_size=(1,), stride=(1,))
(4): Conv1d(32, 32, kernel_size=(1,), stride=(1,)) )
(fc1): Linear(in_features=32, out_features=128, bias=True)
(fc2): Linear(in_features=128, out_features=1, bias=True)
Which these layers have the following description:
1.Linear Layer
this layer is to transform data to a linear form:
2.SpectralConv3d Layer
this layer is applied 3D fourier transform to find Fourier coefficients:
3.Conv1d Layer
this layer is applied to 1D convolution over an input signal composed of several input planes:
Predicted values from our model in the range from 0.15 - 0.14 are close to ground truth values. When we visualized the predicted values as images, we found that there are high values of flood height in the west side of the area which is corressponding to the given ground truth values.
For Mean Absolute Error (MAE) and Mean Absolute Percentage(MAPE), the MAE is 0.198 and MAPE is 41% from 10 training epochs.
-We tried to connect with GPU resources from the EO-Lab but it did not work for us.
-The dataset was too large and therefore required more space to load and train our model.
-The GPU provided by the hackathon was barely enough and it required us to purchase extra GPU from Google Colab.
-When running our models, they kept crashing repeatedly thus needed to run them over and over
-We had no previous knowledge of the 2D SWE thus required a steep learning curve and we spent a lot of time developing a model that suited the problem.
-According to the time limitations, we needed to plan and understand all the processes but we took time to understand the provided dataset, also the model codes. But at first, it was difficult to understand and familiarize with it.
https://www.rnz.co.nz/news/world/473682/pakistan-floods-appeals-for-aid-as-119-more-die-in-a-dayhttps://earthobservatory.nasa.gov/images/150279/devastating-floods-in-pakistan
https://math.stackexchange.com/questions/307019/3d-fourier-transform
https://cryoemprinciples.yale.edu/sites/default/files/files/4%20Fourier2D-3D.pdf




