{"id":17125521,"url":"https://github.com/daleroberts/s2cloudmask","last_synced_at":"2025-04-13T06:21:38.417Z","repository":{"id":70130692,"uuid":"149388496","full_name":"daleroberts/s2cloudmask","owner":"daleroberts","description":"Sentinel-2 Cloud and Shadow Detection using Machine Learning","archived":false,"fork":false,"pushed_at":"2020-07-07T23:42:36.000Z","size":50140,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T22:51:18.651Z","etag":null,"topics":["machine-learning","python","python3","satellite-imagery","sentinel2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daleroberts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-19T03:41:50.000Z","updated_at":"2024-09-02T02:08:35.000Z","dependencies_parsed_at":"2023-02-25T22:45:51.569Z","dependency_job_id":null,"html_url":"https://github.com/daleroberts/s2cloudmask","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.06451612903225812,"last_synced_commit":"35e0bcb7a22ddcd5390979b96bde26679cf10669"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fs2cloudmask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fs2cloudmask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fs2cloudmask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fs2cloudmask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daleroberts","download_url":"https://codeload.github.com/daleroberts/s2cloudmask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248671628,"owners_count":21143136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","python","python3","satellite-imagery","sentinel2"],"created_at":"2024-10-14T18:45:07.306Z","updated_at":"2025-04-13T06:21:38.383Z","avatar_url":"https://github.com/daleroberts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# s2cloudmask\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Release](https://img.shields.io/badge/Release-Private-ff69b4.svg)\n\nThe [s2cloudmask](https://github.com/daleroberts/s2cloudmask) Python package provides machine learning classifiers for **Cloud and Shadow Detection** in [Sentinel-2](https://en.wikipedia.org/wiki/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](https://www.ga.gov.au/dea) initiative, and further, to push the state-of-art in the area of cloud classification.\n\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/s2cloudmask.png\" width=\"960\"\u003e\n\nThe package currently provides a number of classifiers:\n\n * `spectral`: A spectral pixel-based cloud classifier\n * `fast`: A spectral pixel-based cloud classifier (using a decision tree for speed and interpretability)\n * `temporal`: A spectral-temporal pixel-based cloud classifier\n * `fast-shadow`: A spectral-temporal pixel-based shadow classifier (using a decision tree for speed and interpretability)\n\nThe *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).\n\nWe note the existence of Python package [s2cloudless](https://github.com/sentinel-hub/sentinel2-cloud-detector) developed by [Sentinel Hub](https://www.sentinel-hub.com/)'s research team that, as they argue in their [blog post](https://medium.com/sentinel-hub/improving-cloud-detection-with-machine-learning-c09dc5d7cf13), \"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.\n\nIn the image above: Baseline is s2cloudless, Spectral is our spectral classifier, Temporal is our temporal classifier.\n\n### Installation\n\n```\n$ pip install git+https://github.com/daleroberts/s2cloudmask\n```\n\n### Easy interface\n\nThis package has an easy interface. Given a numpy array `obs` ordered as (y,x,band) we can obtain a cloud `mask`.\n```\n\u003e\u003e\u003e import s2cloudmask as s2cm\n\u003e\u003e\u003e mask = s2cm.cloud_mask(obs, model='spectral')\n```\n\n### Tests\n\nTests (and examples) are available in `tests/test_.py` and can be run with pytest from the project root.\n```\n$ pytest\n```\n\n### Further References\n\nYou may be interested to read:\n\nRoberts, D., Mueller, N., McIntyre, A. (2017). [High-dimensional pixel composites from Earth observation time series](https://ieeexplore.ieee.org/document/8004469). *IEEE Transactions on Geoscience and Remote Sensing*, PP, 99. pp. 1--11.\n\nor maybe some of [my other open-source projects](https://github.com/daleroberts).\n\n### Examples\n\n#### Cloud detection\n\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/s2cloudmask-ex2.png\" width=\"960\"\u003e\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/s2cloudmask-ex3.png\" width=\"960\"\u003e\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/s2cloudmask-ex4.png\" width=\"960\"\u003e\n\n\n#### Cloud and Shadow detection\n\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/cloud-shadow-1.png\" width=\"960\"\u003e\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/cloud-shadow-2.png\" width=\"960\"\u003e\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/cloud-shadow-3.png\" width=\"960\"\u003e\n\u003cimg src=\"https://github.com/daleroberts/s2cloudmask/raw/master/docs/cloud-shadow-4.png\" width=\"960\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fs2cloudmask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaleroberts%2Fs2cloudmask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fs2cloudmask/lists"}