Giter VIP home page Giter VIP logo

s2cloudmask's Introduction

s2cloudmask

License Release

The s2cloudmask Python package provides machine learning classifiers for Cloud and Shadow Detection in Sentinel-2 observations. The aim of this package is to open-source and showcase some of the tools being developed as part of the Digital Earth Australia initiative, and further, to push the state-of-art in the area of cloud classification.

The package currently provides a number of classifiers:

  • spectral: A spectral pixel-based cloud classifier
  • fast: A spectral pixel-based cloud classifier (using a decision tree for speed and interpretability)
  • temporal: A spectral-temporal pixel-based cloud classifier
  • fast-shadow: A spectral-temporal pixel-based shadow classifier (using a decision tree for speed and interpretability)

The spectral classifiers are useful if you only have a couple of observations (i.e., satellite images) while the the spectral-temporal classifiers (aka. temporal classifiers) give better classifications of clouds (and shadows) provided that you can supply it with a geomedian pixel-composite mosaic [Roberts et al. 2017] of the area (or a stack of data so that one can be created by this package).

We note the existence of Python package s2cloudless developed by Sentinel Hub's research team that, as they argue in their blog post, "didn't observe significant improvement using derived features instead of raw band values" so their "final classifier uses the following 10 bands as input: B01, B02, B04, B05, B08, B8A, B09, B10, B11, B12". By releasing this package, we argue the contrary and demonstrate that you can obtain a better classification of clouds by (thinking hard and) developing new derived features for your machine learning algorithm.

In the image above: Baseline is s2cloudless, Spectral is our spectral classifier, Temporal is our temporal classifier.

Installation

$ pip install git+https://github.com/daleroberts/s2cloudmask

Easy interface

This package has an easy interface. Given a numpy array obs ordered as (y,x,band) we can obtain a cloud mask.

>>> import s2cloudmask as s2cm
>>> mask = s2cm.cloud_mask(obs, model='spectral')

Tests

Tests (and examples) are available in tests/test_.py and can be run with pytest from the project root.

$ pytest

Further References

You may be interested to read:

Roberts, D., Mueller, N., McIntyre, A. (2017). High-dimensional pixel composites from Earth observation time series. IEEE Transactions on Geoscience and Remote Sensing, PP, 99. pp. 1--11.

or maybe some of my other open-source projects.

Examples

Cloud detection

Cloud and Shadow detection

s2cloudmask's People

Contributors

daleroberts 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.