Giter Club home page Giter Club logo

mlclouddetection's Introduction

MLCloudDetection

This project was for the ESA 2019 Summer of Code

Cloud detection with machine learning using the RGBN bands

This algorithm started off as just applying band thresholding and other filters and then progressed into using algorithms, such as K-Means Clustering and Quickshift to cluster the image, to try and detect and mask clouds. A big issue that I’ve come across is trying to detect haze in an image. V1 also contains cloud shadow masking that is based upon the generated cloud mask. A problem with this is if there’s a cloud shadow in the image but there’s no cloud, it won’t get detected. Otherwise, it's pretty decent at detecting cloud shadows.

V1 does contain a bit of machine learning, as it is just an initial attempt at solving this issue and so that I can learn the basics, but more advanced machine learning (CNN’s) is definitely going to be explored in V2. The included model and training data is pretty limited (only 80 or so samples) so the SVM's performance at classifying clusters is not the greatest. However, with more training data and more inputs, such as the GLCM outputs, I believe it would be able to perform better.

Another area to look into would be going back to using the K-Means Clustering instead of the Gaussian Mixture Model. I chose to use the GMM because it generally clustered pixels more accurately, however it is much, much slower than the K-Means algorithm in scikit-learn because (among other things like covariance_type and num_clusters) it doesn't have a n_jobs argument, which parallelizes the algorithm.

The main constraint with all of this is only being able to use the RGB and N bands as the images only contain those.

Getting Started

DISCLAIMER: These instructions are for Windows 10

  1. Make sure you install or have a Python version supported by Snappy
  2. Install all the libraries in the requirements.txt file
  3. Install ESA SNAP and Snappy
  4. Follow all the instructions for installing Snappy in the links below
  5. Proceed to Running the sample

Installing Snappy

https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface

https://github.com/senbox-org/snap-engine/tree/master/snap-python/src/main/resources

Running the sample

  1. Run all the cells in cloudv1.ipynb

Usage

  1. Rename sample_consts.py to consts.py
  2. Fill in the fields
  3. Uncomment line 182 in cloudv1.ipynb if you want to get your data from an S3 bucket
  4. Run all the cells in cloudv1.ipynb

mlclouddetection's People

Contributors

aaronpinto avatar dependabot[bot] 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.