DeepOSM Build Status

Classify roads and features in satellite imagery, by training neural networks with OpenStreetMap (OSM) data.

DeepOSM can:

  • Download a chunk of satellite imagery
  • Download OSM data that shows roads/features for that area
  • Generate training and evaluation data
  • Display predictions of mis-registered roads in OSM data, or display raw predictions of ON/OFF

Running the code is as easy as install Docker, make dev, and run a script.

Contributions are welcome. Open an issue if you want to discuss something to do, or email me.

Default Data/Accuracy

By default, DeepOSM will analyze about 200 sq. km of area in Delaware. DeepOSM will

  • predict if the center 9px of a 64px tile contains road.
  • use the infrared (IR) band and RGB bands.
  • be 75-80% accurate overall, training only for a minute or so.
  • use a single fully-connected relu layer in TensorFlow.
  • render, as JPEGs, “false positive” predictions in the OSM data – i.e. where OSM lists a road, but DeepOSM thinks there isn’t one.

NAIP with Ways and Predictions

Background on Data – NAIPs and OSM PBF

For training data, DeepOSM cuts tiles out of NAIP images, which provide 1-meter-per-pixel resolution, with RGB+infrared data bands.

For training labels, DeepOSM uses PBF extracts of OSM data, which contain features/ways in binary format that can be munged with Python.

The NAIPs come from a requester pays bucket on S3 set up by Mapbox, and the OSM extracts come from geofabrik.

Install Requirements

DeepOSM has been run successfully on both Mac (10.x) and Linux (14.04 and 16.04). You need at least 4GB of memory.

AWS Credentials

You need AWS credentials to download NAIPs from an S3 requester-pays bucket. This only costs a few cents for a bunch of images, but you need a credit card on file.

export AWS_ACCESS_KEY_ID='FOO'
export AWS_SECRET_ACCESS_KEY='BAR'

Install Docker

First, install a Docker Binary.

I also needed to set my VirtualBox default memory to 4GB, when running on a Mac. This is easy:

  • start Docker, per the install instructions
  • stop Docker
  • open VirtualBox, and increase the memory of the VM Docker made

(GPU Only) Install nvidia-docker

In order to use your GPU to accelerate DeepOSM, you will need to download and install the latest NVIDIA drivers for your GPU, and (after first installing docker itself), install nvidia-docker.

First, find the latest NVIDIA drivers for your GPU on NVIDIA’s website. Make sure you check the version number of the driver, as the most recent release isn’t always the latest version.

Once you have downloaded the appropriate NVIDIA-*.run file, install it as follows (based on these instructions):

Ensure your system is up-to-date and reboot to ensure the latest installed kernel is loaded:

# ensure your packages are up-to-date
sudo apt-get update
sudo apt-get dist-upgrade
# and reboot
sudo reboot

Once your system has rebooted, install build-essential and the linux-headers package for your current kernel version (or equivalents for your linux distribution):

sudo apt-get install build-essential linux-headers-$(uname -r) 

Then run the NVIDIA driver install you downloaded earlier, and reboot your machine afterwards:

<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sudo bash
sudo reboot
“>

sudo bash <location of ./NVIDIA-Linux-*.run file>
sudo reboot