GithubHelp home page GithubHelp logo

jokame / deeposm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trailbehind/deeposm

0.0 2.0 0.0 488 KB

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

License: MIT License

Makefile 2.42% Python 94.10% Shell 3.48%

deeposm's Introduction

DeepOSM

Detect roads and features in satellite imagery, by training neural networks with OpenStreetMap (OSM) data. This code lets you:

  • Download a chunk of satellite imagery
  • Download OSM data that shows roads/features for that area
  • Generate training and evaluation data

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 download the minimum necessary training data, and use the simplest possible network.

  • It will predict if the center 9px of a 64px tile contains road.
  • It will only use the infrared (IR) band, not the RGB bands.
  • It will be about 65% accurate, based on how the training/test data is constructed.
  • It will use a single fully connected relu layer in TensorFlow.

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, which 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 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

Run Scripts

Start Docker, then 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 eight NAIPs, which gets tiled into NxNx4 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, it will produce some console logs, and then JPEGs of the ways, labels, and predictions overlaid on the tiff.

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

Also see a work journal here.

Papers - Relevant Maybe

Papers - Not All that Relevant

Papers to Review

Recent Recommendations

Citing Mnih and Hinton

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

Original Idea

This was the general idea to start, and working with TMS tiles sort of worked (see first 50 or so commits), so DeepOSM got switched to better data:

Deep OSM Project

deeposm's People

Contributors

andrewljohnson avatar migurski avatar nvkelso avatar silberman avatar zain avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.