Geospatial Deep Learning resources & study group

Thanks! It may also work well for land cover mapping but I never tried it. Sentinel 2/Landsat images are quite a challenge due to the huge volume of data. I’m working on a desktop computer with a GTX 1080 so moving to high-res is not very feasible for now.

The Data Fusion competition looks interesting, thanks for sharing :slight_smile:

2 Likes

This is pretty awesome https://arxiv.org/abs/2001.01306
With competition https://www.agriculture-vision.com/
(Via the excellent https://jack-clark.net/)

2 Likes

Found cesium to be very useful. Posting here , if useful for anybody else. thanks

3 Likes

Hi Dave and thank you for a great tutorial,

At this time 1/15/2020, I’m having an issue following your colab notebook, that:

!add-apt-repository ppa:ubuntugis/ppa
!apt-get update
!apt-get install python-numpy gdal-bin libgdal-dev
!apt install python3-rtree

!pip install rasterio
!pip install geopandas
!pip install descartes
!pip install solaris
!pip install rio-tiler

will give this error installing solaris’ dependencies:

Building wheels for collected packages: gdal, pyyaml, albumentations, rio-cogeo, rtree, imgaug, supermercado
  Building wheel for gdal (setup.py) ... error
  ERROR: Failed building wheel for gdal
  Running setup.py clean for gdal
  Building wheel for pyyaml (setup.py) ... done
  Created wheel for pyyaml: filename=PyYAML-5.2-cp36-cp36m-linux_x86_64.whl size=44209 sha256=0a254364d86135d369e2688fe7161e44229c9a776254b4de37c62ef0191a1694
  Stored in directory: /root/.cache/pip/wheels/54/b7/c7/2ada654ee54483c9329871665aaf4a6056c3ce36f29cf66e67
  Building wheel for albumentations (setup.py) ... done
  Created wheel for albumentations: filename=albumentations-0.4.3-cp36-none-any.whl size=60764 sha256=edd15b9c26f06bf09b3c4c7458a007bc23a119f5038c65af56d776e3ce9f6447
  Stored in directory: /root/.cache/pip/wheels/20/16/8e/d3bec34bf30adff30929226f0b83cc8c005b5af131f51db9d0
  Building wheel for rio-cogeo (setup.py) ... done
  Created wheel for rio-cogeo: filename=rio_cogeo-1.1.8-cp36-none-any.whl size=17085 sha256=423bb51a6765f9faf0341dc67c6cf3f6f8d8106a2cfb385e1ffd681e510f006d
  Stored in directory: /root/.cache/pip/wheels/65/61/bb/57962da75239cb8f3bfef62b6f3e4f4a7dfeec2de3bc89995e
  Building wheel for rtree (setup.py) ... done
  Created wheel for rtree: filename=Rtree-0.9.3-cp36-none-any.whl size=21264 sha256=17ed3a8fcdd85f978155ec00cc16511a0381c20eab20be16936083161eff8a7d
  Stored in directory: /root/.cache/pip/wheels/0b/f6/58/2d819b2abdc280c3f70db0b0ce86a712839267957db7abad85
  Building wheel for imgaug (setup.py) ... done
  Created wheel for imgaug: filename=imgaug-0.2.6-cp36-none-any.whl size=654020 sha256=57ce9ae943c6600810474c25ffe411eb676a4bcce1a9ffddef7a89d42773faa8
  Stored in directory: /root/.cache/pip/wheels/97/ec/48/0d25896c417b715af6236dbcef8f0bed136a1a5e52972fc6d0
  Building wheel for supermercado (setup.py) ... done
  Created wheel for supermercado: filename=supermercado-0.0.5-cp36-none-any.whl size=7088 sha256=4fb7e76c6879b78d301a1979ed8c30acfcfb14f330b60cf51c1fdf579504c1b9
  Stored in directory: /root/.cache/pip/wheels/9b/2f/8e/011d7ab17b423894b4b358204c0bb854a8bb8de199e9f98f30
Successfully built pyyaml albumentations rio-cogeo rtree imgaug supermercado
Failed to build gdal
ERROR: kaggle 1.5.6 has requirement urllib3<1.25,>=1.21.1, but you'll have urllib3 1.25.7 which is incompatible.
ERROR: google-colab 1.0.0 has requirement requests~=2.21.0, but you'll have requests 2.22.0 which is incompatible.
ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.
Installing collected packages: tqdm, gdal, urllib3, requests, pyyaml, imgaug, albumentations, mercantile, supermercado, rio-cogeo, tensorboard, mock, tensorflow-estimator, tensorflow, rtree, solaris
  Found existing installation: tqdm 4.28.1
    Uninstalling tqdm-4.28.1:
      Successfully uninstalled tqdm-4.28.1
  Found existing installation: GDAL 2.4.2
ERROR: Cannot uninstall 'GDAL'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

There might be some change in the dependencies that make it doesn’t work any more. Can you have a check please?

Thank you.

We should create fastai2.geospatial, what do you think?

In the last months that I’ve been working on the burned areas mapping and dating, developing the datasets was the most time-consuming task. There are data from a lot of satellites and sources, different resolutions, timescales and projections. There are data also in shapefile format. All these need to be joined in order to have a dataset to train a model. When I published the code for my article that I shared above I included code to do this kind of processing aiming to make it as easy as possible. I’m now working to further refine my code using nbdev but I realized that maybe it could instead be a good idea to make it a starting point for a fastai2.geospatial module.

The idea would be to have something like:

  • fastai2.geospatial.download -> utility functions to download datasets from several public sources.
  • fastai2.geospatial.data -> scripts to preprocess the data, including coordinate transformation, resampling, handling geotiffs and shapefiles (this part requires libraries like shapely, geopandas, rasterio).
  • fastai2.geospatial.models -> some model architectures specific for geospatial data.

This would then connect to fastai2.vision.

@jeremy, @sgugger do you think this could be a good addition to the library?

10 Likes

Will answer to myself in order that someone else is solving similar challenge :slight_smile: Just found how to use COG https://towardsdatascience.com/access-satellite-imagery-with-aws-and-google-colab-4660178444f5 and in combination with POSTGIS- POSTGRE DB a table with data specific to each training sample (satellite image name, GPS.mask, band,…) could do the job.

3 Likes

@MichaelScofield thanks for the headsup - I’ve updated the notebook to install gdal 3 which is the change in dependency for solaris 0.2.1. The tutorial’s in need of a larger revamp but that should work for a quickfix at the moment. To make the change in your own notebook copy, you can update that cell by changing the apt repo to ubuntugis-unstable and installing gdal 3 with:

!add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y
!apt-get update
!apt-get install python-numpy gdal-bin libgdal-dev python3-rtree

!pip install rasterio
!pip install geopandas
!pip install descartes
!pip install solaris
!pip install rio-tiler

I’ve updated the top wikipost with the latest ongoing and upcoming competitions that have been shared here. Thanks everyone for sharing! Please feel free to make direct edits there as well.

@mnpinto - a geospatial module sounds great. Happy to help, although time is scarce at the moment and I need to get familiar with fastai2 first :). Maybe this is how! My initial take is that the biggest uniquely geospatial hurdle such a module could help fastai users overcome is in the .geospatial.data part you mentioned: wrangling various geodata formats into what we recognize as training images & labels. Maybe we can take some exemplar datasets that differ from each other and are diverse enough cover most use cases and try to get them into fastai2 as cleanly as possible?

6 Likes

I also need to get familiar with fastai2, I guess the 10 walk-thru videos are a good starting point, there are a lot of interesting stuff to dive in. I agree that .geospatial.data can be particularly useful, and I also like the idea of selecting a few datasets to include as benchmarks in fastai2 to make easy to test different models.

2 Likes

You can look at https://github.com/muellerzr/Practical-Deep-Learning-for-Coders-2.0 for a good introduction to fastai2

2 Likes

I just saw the recent Remote Sensing Special Issue called “Image Super-Resolution in Remote Sensing” … there are a few good papers in there that made me curious…

Before diving depper into the topic: Has anybody here applied super resolution to remote sensing images? And has some hints where to start or what works best?

Cheers,
Harry

2 Likes

I haven’t personally worked on superres but found this 4-part writeup from a little while back pretty informative (link goes to part 4, there are links at the beginning to the first 3):

4 Likes

This saves me a lot of testing, thank you very much!

2 Likes

New Crop Detection competition has just been posted.

4 Likes

We have written a paper on Setinel-2 superresolution (x2) [link] and we are finishing another about Sentinel-2 superresolution (x4) [here is an snapshot]

4 Likes

New remote sensing competition launched in Kaggle.

Posting link here: https://www.kaggle.com/c/ds4g-environmental-insights-explorer/overview

5 Likes

I created this dataset (https://www.kaggle.com/mnpinto/australia-bushfires-viirs-750m-daily) with VIIRS derived Red, NIR and MIR reflectances + Active fires for Eastern Australia to cover the regions affected by the extreme fires over the last months (September 2019 to 17 February 2020).

And here (https://www.kaggle.com/mnpinto/ba-net-australia-fires) is a notebook using the data to generate daily burned area maps, resulting in the following image. Notice that the resolution of the data is 0.01º x 0.01º so the extent of the region is about 1300 x 800 km, the dimension of the fires is insane :frowning:

I also made a GIF showing the animation of the daily evolution but I think it can’t play here so below is the link to it on twitter. The left image combines the input data channels and active fires (overlayed in red) and the right image shows the “accumulated” burned areas. It’s not easy to map burned areas over these regions due to the clouds.

8 Likes

I’ve started to update my fastai1 codes for multi- and hyperspectral data to fastai2, and because it seems that others are also working with this I’d like to be involved.

Gist for fastai2 stuff is here, and as described the work is still in progress. Mostly this is just quickly adapted from vision.data and vision.core, because really the main difference between multichannel images and geotiffs and default computer vision approaches is that we can’t use PIL.

The features I’d like the data classes to have are:

  • Option to visualize either only one channel or three-channel composite (done)
  • Option to select the bands used and to specify whether the image is 2D or 3D
  • Option to visualize spectral indices (NDVI and such)
  • Item transform to add spectral indices such as NDVI to images while reading them
  • Possibility to do random, stratified split based on TileID or coordinates
  • Own classes most commonly used satellite images, such as Sentinel1 and Sentinel2. These would have default channels for visualizing and calculating indices.
  • All that are in the todo-list but not mentioned here.

I’m certain that there are other needed features also, especially if we’d also like to have preprocessing and tiling in fastai.geospatial instead of doing those with for example SNAP.

7 Likes

For the Driven data Semantic Segmentation challenge, code using Keras segmentation-models library of - GitHub (https://github.com/qubvel/segmentation_models)

Starter code: https://github.com/anindabitm/Open-Cities-AI-Challenge-Segmenting-Buildings-for-Disaster-Resilience/blob/master/Open_cities_challenge_Keras.ipynb

Credits - johnowhitaker for fantastic starter code help

2 Likes

I have been working with geoespatial imaginery for a long time and I reckon that IAAPerspective doesn’t come in handy in this task. However, I would recommend you to use Dihedral transformation and standar color transformations in order to simulate different sun angles and seasons.

1 Like

Hi everyone,

I’m doing a project and want to use Microsoft CanadianBuildingFootprints dataset, which is available as geojson files, but I haven’t found a way to transform those files to corresponding images/masks yet.

There are a few candidates:

Which way should I use based on my purpose, that is to download images/labels. Thank you.