In this repository, I investigate ways to semantically segment buildings and roads in top down. The motivation is that humanitarian and natural disasters can impact roads and buildings, and having a tool that can quickly survey them is useful. I make use of tensorflow to create a UNet and perform the prediction.
Below we display an example of an input image and the corresponding ground truth and predicted road network and building footprints.
The training and test data is taken from two SpaceNet competitions 2 and 3, where the road and building data are cross matched. The foler data_cleaning_EDA
holds the notebooks that cover the EDA and data cleaning process.
There are a number of models implemented for testing in this repository, all of which are variations of UNet:
- Original UNet (U-Net: Convolutional Networks for Biomedical Image Segmentation, Ronneberger et al. (2015))
- Residual UNet (A deep Residual U-Net convolutional neural network for automated lung segmentation in computed tomography images, Khanna et al. (2021))
- Attention UNet (Attention U-Net: Learning Where to Look for the Pancreas, Oktay et al. (2018))
- Residual Attention UNet (Residual Attention U-Net for Semantic Segmentation of Cataract Surgical Instruments, Zhen-Liang et al.(2019))
- EfficientNet UNet (Eff-UNet: A Novel Architecture for Semantic Segmentation in Unstructured Environment, Baheti et al. (2020))
For a good list of requirements, you can check the testing build in .github/workflows/python-app.yml
.
It should work with Python 3.8 or greater.
Note: raterio and gdal can have issues on windows. The order of import in python of geopandas and rasterio can be important.
For the EDA:
- geopandas
- pandas
- matplotlib
- rasterio
- numpy
- gdal
For the Training/Inference:
- PIL/Pillow
- Tensorflow 2.8