Building segmentation based on DeeplabV3+
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Looking Glass

Looking Glass is a tool to identify buildings within satellite imagery. Specifically, it uses a segmentation algorithm to label each individual pixel in an image as to whether it's part of a building or not.

Input: Satellite image tiles (256x256 pixels) currently @ zoom 18

Output: Binary or signed-distance transform mask. In SDT, values represent the predicted distance (in meters) within or outside a building boundary (for positive and negative values, respectively).

Components within this repo

You'll need an AWS account and access to Digital Globe imagery to make full use of all the code here.

0. Configuration params


1. Data preparation

  • - Loads raster imagery and labels
    • Preprocesses large RGB images (e.g., from the SpaceNet Challenge database)
    • Creates and saves binary mask from geojson vector mask
    • Creates and saves signed-distance transform mask
    • Splits directories of large images into 256x256 RGB images and masks; checks for too many black pixels
  • - Helper functions to accomplish preprocessing and cropping in

2. Training the model

  • - contains Keras code for constructing the DeepLab V3+ model
  • - runs training based on a set of hyperparameters, autosaves hyperparams and TensorBoard tracking; syncs model and params to S3
  • - can return xtrain, xtest, ytrain, ytest from one or more saved datasets
  • - loss metrics (like Jaccard, F1, etc.) for training. Includes multiple versions since these aren't always well-defined
  • - helpers to print out start/finish details, load models from disk, custom TensorBoard callbacks, and sync folders to S3

3. Inference and plotting

  • - run basic inference and plot results for some example tiles
  • - finds all tiles for a given geojson boundary and uses them to populate an AWS SQS queue
  • - fetches SQS messages, downloads the image tiles, runs inference, and stores building area in CSV

Technical model details

Looking Glass is built on top of the DeepLab V3+ model developed by Google. This model is described in a blog post here and the associated paper is here.