Announcing Solaris: an open source Python library for analyzing overhead imagery with machine learning

Nick Weir
Nick Weir
Jul 23, 2019 · 5 min read
Image for post
Image for post

Performing machine learning (ML) and analyzing geospatial data are both hard problems requiring a lot of domain expertise. These limitations have historically meant that one needs to be an expert in both to perform even the most basic analyses, making advances in AI for overhead imagery difficult to achieve. We at CosmiQ Works have asked ourselves: is there anything we can do to reduce this barrier to entry, making it easier to apply machine learning methods to overhead imagery data?

Enter Solaris, a new Python library for ML analysis of geospatial data from CosmiQ Works. Solaris builds upon SpaceNet’s previous tool suite, SpaceNetUtilities, along with several other CosmiQ projects like BASISS to provide an end-to-end pipeline for geospatial AI. Solaris provides well-documented Python APIs and simple command line tools to complete every step of a geospatial ML pipeline with ease:

  1. Tile raw imagery and vector labels into pieces compatible with ML
  2. Convert vector labels to ML-compatible pixel masks
  3. Train state-of-the-art deep learning models with three lines of Python code
  4. Segment objects of interest with machine learning models (including the SpaceNet winners’ models, with pre-trained weights and configs provided!)
  5. Georegister predictions and convert them to standardized geospatial data formats
  6. Score model performance against hand-labeled ground truth using the SpaceNet datasets

…and more!

Would you prefer a basic command line interface so you can run a pre-trained model without learning Python? Solaris has that, with tutorials to help you get started: Create pixel masks from vector labels, train a deep learning algorithm, or predict where buildings are using a pre-trained SpaceNet Challenge-winning model, all without writing a single line of Python code.

Are you a Python developer who doesn’t want to write the tedious pre- and post-processing functions to feed your geospatial data into a deep learning model? The thoroughly documented Solaris Python API as well as Python API usage tutorials are ready to help. Furthermore, the codebase is entirely open source and we welcome any feature requests, bug reports, and tutorial suggestions from users.

Here’s a peek at just a few of the exciting features of Solaris:

Pre-trained SpaceNet Challenge-winning models

  • A ResNet34-UNet, used by selim_sef;
  • A Densenet121-UNet, used by selim_sef;
  • A Densenet161-UNet, used by selim_sef;
  • A VGG16-UNet, used by XD_XD.

This allows you to quickly compare building footprints generated by different models, as we do in the example below:

Image for post
Image for post
Comparison between predictions generated using four different models on the same image from the SpaceNet MVOI Atlanta dataset. Original image courtesy of Maxar Technologies. Manually created labels are blue with red outlines, and model predictions are green with red outlines.

It’s worth noting that each of those prediction sets were generated with only five lines of Python code:

import solaris as solconfig = sol.utils.config.parse('/path/to/config/file.yml')
inferer = sol.nets.infer.Inferer(config)
inference_data = sol.nets.infer.get_infer_df(config)
inferer(inference_data)

See the documentation on the pretrained models to get the relevant configuration files.

You can also develop your own model architectures or provide your own pre-trained models to your deep learning pipeline using Solaris. Solaris can handle models written in either PyTorch or TensorFlow.

Create training masks from geo-registered labels

Image for post
Image for post
A pixel mask for model training created by Solaris. Red denotes building footprints, green is building outlines, and blue are areas between two nearby footprints.

Check out our Python API tutorial or mask creation CLI tutorial for more.

State-of-the-art loss functions, combination losses, optimizers, and more

Evaluate models using SpaceNet data and metrics

…and more!

Image for post
Image for post
Cars identified in the COWC dataset. Red boxes marking individual cars are extracted from segmentation masks. Keep an eye out for the upcoming post for code and a detailed explainer!

Follow us at this blog and on Twitter for tutorials, step-by-step guides, and to learn more about our other projects!

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab…

Thanks to Adam Van Etten and Jake Shermeyer

Nick Weir

Written by

Nick Weir

Data Scientist at CosmiQ Works and SpaceNet 4 Challenge Director at the SpaceNet LLC. Advancing computer vision and ML analysis of geospatial imagery.

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab dedicated to exploring the rapid advances delivered by artificial intelligence and geospatial startups, industry, academia, and the open source community

Nick Weir

Written by

Nick Weir

Data Scientist at CosmiQ Works and SpaceNet 4 Challenge Director at the SpaceNet LLC. Advancing computer vision and ML analysis of geospatial imagery.

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab dedicated to exploring the rapid advances delivered by artificial intelligence and geospatial startups, industry, academia, and the open source community

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store