Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

DeepOSM

> 编程语言
Open source

Train a deep learning net with OpenStreetMap features and satellite imagery.

1.3K stars0 likes0 views
WebsiteGitHub

About

Train a deep learning net with OpenStreetMap features and satellite imagery.

DeepOSM

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.

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.

  • get your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from AWS

  • export them as environment variables (and maybe add to your bash or zprofile)

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:

sudo bash 
sudo reboot

Finally, verify that the NVIDIA drivers are installed correctly, and your GPU can be located using nvidia-smi:

nvidia-smi
…

Now that the NVIDIA drivers are installed, nvidia-docker can be downloaded and installed as follows (based on these instructions):

wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb

And you can confirm the installation, by attempting to run nvida-smi inside of a docker container:

nvidia-docker run --rm nvidia/cuda nvidia-smi
…

Once you have confirmed nvidia-smi works inside of nvidia-docker, you should be able to run DeepOSM using your GPU.

Run Scripts

Start Docker, then run:

make dev-gpu

Or if you don't have a capable GPU, run:

make dev

Download NAIP, PBF, and Analyze

Inside Docker, the following Python scripts will work. This will download all source data, tile it into training/test data and labels, train the neural net, and generate image and text output.

The default data is six NAIPs, which get tiled into 64x64x4 bands of data (RGB-IR bands). The training labels derive from PBF files that overlap the NAIPs.

python bin/create_training_data.py
python bin/train_neural_net.py

For output, DeepOSM will produce some console logs, and then JPEGs of the ways, labels, and predictions overlaid on the tiff.

Testing

There is a very limited test suite available at the moment, that can be accessed (from the host system) by running:

make test

Jupyter Notebook

Alternately, development/research can be done via jupyter notebooks:

make notebook

To access the notebook via a browser on your host machine, find the IP VirtualBox is giving your default docker container by running:

docker-machine ls

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.10.3

The notebook server is accessible via port 8888, so in this case you'd go to: http://192.168.99.100:8888

Readings

  • Learning to Detect Roads in High-Resolution Aerial Images (Hinton)

  • Machine Learning for Aerial Image Labeling- Minh's 2013 thesis, student of Hinton's best/recent paper on doing this, great success with these methods

  • Similar Efforts with OSM Data

    • OSM-Crosswalk-Detection - uses Keras to detect crosswalks, a class project (Fall 2015)
    • OSM-HOT-ConvNet - attempted use for disaster response, author thinks it's only 69% accurate at pixel level (fall 2016)
    • Terrapattern - (spring 2016) - detect similar images, such as pools, boat wakes, or other patterns journalists/researchers might be interested in - Carnegie Mellon researchers, open source
    • Skynet Data - (spring 2016) - data pipeline for machine learning with OpenStreetMap
    • Full implementation of Mnih's CNN with Massachusetts data
  • Parsing Natural Scenes and Natural Language with Recursive Neural Networks (RNNs)

  • Background on Neural Networks and Deep Learning

    • MNIST Data and Background
    • all the other links to Nielsen’s book and Colah’s blog
    • original Information Theory paper by Shannon

Also see a work journal here.

Papers - Relevant Maybe

  • Aerial image geolocalization from recognition and matching of roads and intersections - May 2016

  • Uses a large window to improve predictions, trying to capture broad network topology.

  • Automatically extract roads with no human labels. Not that accurate, could work for preprocessing to detect roads.

Papers - Not All that Relevant

  • Uses map data and shapes of overpasses to then detect pictures of the objects? Seems like a cool paper to read if it was free.

  • New technique for classification of sub-half-meter data into different zones.

  • Couldn't access text, focused on using lidar data.

  • Proposes a way to extract network topology, and maybe this can be used as a post processor?

Papers to Review

Recent Recommendations

  • FIND - have you seen a paper from a few years ago about estimating OSM completeness by comparing size of compressed satellite images vs number of osm nodes

  • READ - this presentation on using GPS traces to suggest OSM edits (Strava/Telenav): http://webcache.googleusercontent.com/search?q=cache:VoiCwRHOyLUJ:stateofthemap.us/map-tracing-for-millennials/+&cd=3&hl=en&ct=clnk&gl=us

Citing Mnih and Hinton

I am reviewing these papers from Google Scholar that both cite the key papers and seem relevant to the topic.

  • http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=6602035&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D6602035

  • http://www.cv-foundation.org/openaccess/content_cvpr_workshops_2015/W13/html/Paisitkriangkrai_Effective_Semantic_Pixel_2015_CVPR_paper.html

  • http://www.tandfonline.com/doi/abs/10.1080/15481603.2013.802870

  • https://www.computer.org/csdl/proceedings/icpr/2014/5209/00/5209d708-abs.html

  • http://opticalengineering.spiedigitallibrary.org/article.aspx?articleid=1679147

  • http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=1354584

  • http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.309.8565

  • https://www.itc.nl/library/papers_2012/msc/gem/shaoqing.pdf

  • http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7326745&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7326745

  • http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=2191094

  • http://arxiv.org/abs/1509.03602

  • http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7112625&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7112625

  • http://www.sciencedirect.com/science/article/pii/S0924271615001690

  • http://arxiv.org/abs/1405.6137

  • https://www.itc.nl/external/ISPRS_WGIII4/ISPRSIII_4_Test_results/papers/Onera_2D_label_Vaih.pdf

  • http://link.springer.com/chapter/10.1007/978-3-319-23528-8_33#page-1

  • http://arxiv.org/abs/1508.06163

  • http://www.mdpi.com/2072-4292/8/4/329

  • http://arxiv.org/abs/1510.00098

  • http://link.springer.com/article/10.1007/s10489-016-0762-6

  • http://www.tandfonline.com/doi/abs/10.1080/01431161.2015.1054049

  • http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7393563&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7393563

  • http://www.cv-foundation.org/openaccess/content_iccv_2015/html/Mattyus_E

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言