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

Nick Weir
Nick Weir
Jul 23, 2019 · 5 min read

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:

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

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!

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 archived blog of CosmiQ Works, an IQT Lab

The DownLinQ

As of March 2021, CosmiQ Works has been folded into IQT Labs. An archive will remain here to showcase historical work from CosmiQ Works that took place July 2016 — March 2021.

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

As of March 2021, CosmiQ Works has been folded into IQT Labs. An archive will remain here to showcase historical work from CosmiQ Works that took place July 2016 — March 2021.