Convolutional Neural Networks (CNN) possess many positive qualities when it comes to spatial raster data. Translation invariance enables CNNs to detect features regardless of their position in the scene. But in some domains, like geospatial, not all locations are exactly equal. In this work we propose localized convolutional neural networks that enable convolutional architectures to learn local features in addition to the global ones. We investigate their instantiations in the form of learnable inputs, local weights, and a more general form. They can be added to any convolutional layers, easily end-to-end trained, introduce minimal additional complexity, and let CNNs retain most of their benefits to the extent that they are needed.
This repository contains the code used in this work. See [1] for details.
Data of this task can be downloaded [here], it contains two files: bouncing_balls_training_data.dat
, which includes training and first test set data, and bouncing_balls_testing_data.dat
, a second test set.
Easiest way to run the code is through Google Colab . Otherwise, Localized_CNNs_on_synthetic_data.ipynb can be executed locally by updating the path of the data files. See requirements.txt
for compatible packages.
Three datasets were used to benchmark proposed methods and their compatibility with leading CNN architectures:
- Wind Integration National Dataset (WIND), 10x10 relatively high-resolution data ordered in a grid. The data can be acquired [here] by using wind resource download tool on the wind toolkit data and selecting 2012 for year, wind speed for attributes, and including leap year and 5 minute interval for download options. This will download a csv for each site, that should be stored in one folder. Also, files that do not fall into the rotated rectangle will be discared. Final processed file can be acquired by running [form_WINDS_data.py]:
python preprocessing/form_WINDS_data.py --dataset_folder_path path_to_data_folder --out_file WINDS_processed_data.pkl
- Meteorological Terminal Aviation Routine Dataset, non-orderly data, that we embed into a 8x8 grid: directly and by an optimized embedding. The data file is located [here] (it can be examined visually in [2]). No further processing is required. Permutation file of the optimized embedding is located [here].
- Copernicus Dataset, 10x10 low-resolution data ordered in a grid, part of which overlaps with the Atlantic Ocean. The data can be downloaded [here], by selecting wind speed variable, 6 hour time aggregation, 10m vertical level and no bias correction boxes. The acquired NetCDF file needs to be further processed by executing [form_copernicus_data.py]:
python preprocessing/form_copernicus_data.py --dataset_path path_to_NetCDF_file --out_file copernicus_processed_data.pkl
The code can be run in Google Colab or locally [in a notebook], just update the locations of the data files.
[1] Uselis, Arnas, Mantas Lukoševičius, and Lukas Stasytis. "Localized Convolutional Neural Networks for Geospatial Wind Forecasting". 2020. [arxiv]
[2] Ghaderi, Amir, Borhan M. Sanandaji, and Faezeh Ghaderi. "Deep forecast: deep learning-based spatio-temporal forecasting". 2017. [arxiv]