ukis-csmask

UKIS Cloud Shadow MASK

https://github.com/dlr-eoc/ukis-csmask

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 14 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 6 committers (50.0%) from academic institutions
  • Institutional organization owner
    Organization dlr-eoc has institutional domain (www.dlr.de)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary

Keywords

cloud-shadow cloud-shadow-mask earth-observation gis satellite-data ukis
Last synced: 6 months ago · JSON representation

Repository

UKIS Cloud Shadow MASK

Basic Info
  • Host: GitHub
  • Owner: dlr-eoc
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 408 MB
Statistics
  • Stars: 51
  • Watchers: 1
  • Forks: 6
  • Open Issues: 0
  • Releases: 15
Topics
cloud-shadow cloud-shadow-mask earth-observation gis satellite-data ukis
Created about 5 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

UKIS ukis-csmask

ukis-csmask codecov Upload Python Package PyPI version GitHub license Code Style DOI

UKIS Cloud Shadow MASK (ukis-csmask) package masks clouds and cloud shadows in Sentinel-2, Landsat-9, Landsat-8, Landsat-7 and Landsat-5 images. Masking is performed with a pre-trained convolution neural network. It is fast and works with both Level-1C (no atmospheric correction) and Level-2A (atmospherically corrected) data. Images just need to be in reflectance and include at least the "blue", "green", "red" and "nir" spectral bands. Best performance (in terms of accuracy and speed) is achieved when images also include "swir16" and "swir22" spectral bands and are resampled to approximately 30 m spatial resolution.

This publication provides further insight into the underlying algorithm and compares it to the widely used Fmask algorithm across a heterogeneous test dataset.

Wieland, M.; Li, Y.; Martinis, S. Multi-sensor cloud and cloud shadow segmentation with a convolutional neural network. Remote Sensing of Environment, 2019, 230, 1-12. https://doi.org/10.1016/j.rse.2019.05.022

This publication introduces the Python package, performs additional evaluation on recent cloud and cloud shadow benchmark datasets and tests the applicability of ukis-csmask on Landsat-9 imagery.

Wieland, M.; Fichtner, F.; Martinis, S. UKIS-CSMASK: A Python package for multi-sensor cloud and cloud shadow segmentation. Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci., 2022, XLIII-B3-2022, 217222. https://doi.org/10.5194/isprs-archives-XLIII-B3-2022-217-2022

If you use ukis-csmask in your work, please consider citing one of the above publications.

Examples

Example

Here's an example on how to compute a cloud and cloud shadow mask from an image. Please note that here we use ukis-pysat for convencience image handling, but you can also work directly with numpy arrays. Further examples can be found here.

````python from ukiscsmask.mask import CSmask from ukispysat.raster import Image, Platform

read Level-1C image from file, convert digital numbers to TOA reflectance

and make sure resolution is 30 m to get best performance

NOTE: band_order must match the order of bands in the input image. it does not have to be in this explicit order.

bandorder = ["blue", "green", "red", "nir", "swir16", "swir22"] img = Image(data="sentinel2.tif", dimorder="last") img.dn2toa(platform=Platform.Sentinel2, wavelength=bandorder) img.warp(resamplingmethod=0,resolution=30,dstcrs=img.dataset.crs)

compute cloud and cloud shadow mask

csmask = CSmask(img=img.arr, productlevel="l1c", bandorder=bandorder, nodatavalue=0)

access cloud and cloud shadow mask

csmask_csm = csmask.csm

access valid mask

csmask_valid = csmask.valid

convert results to UKIS-pysat Image

csmaskcsm = Image(csmask.csm, transform=img.dataset.transform, crs=img.dataset.crs, dimorder="last") csmaskvalid = Image(csmask.valid, transform=img.dataset.transform, crs=img.dataset.crs, dimorder="last")

write results back to file

csmaskcsm.writetofile("sentinel2csm.tif", dtype="uint8", compress="PACKBITS") csmaskvalid.writetofile("sentinel2valid.tif", dtype="uint8", compress="PACKBITS", kwargs={"nbits":2}) ````

Accuracy assessment

The original ukis-csmask models, which are available in ukis-csmask<=v0.2.2 and are described in this publication, have been trained and tested on a custom reference dataset specifically for Level-1C data.

From ukis-csmask>=v1.0.0 on, we provide new models for Level-1C (L1C) and Level-2A (L2A) data, which have been trained on a much larger reference dataset (consisting of SPARCS, CloudSEN12+ and some additional custom samples). Both datasets natively only provide L1C images. Therefore, we have compiled corresponding L2A images for each sample.

Accuracy

Above barplot compares the new ukis-csmask>=v1.0.0 models against the previous ukis-csmask<=v0.2.2 models on CloudSEN12+ and SPARCS test splits for both L1C and L2A images. The results indicate the superior performance of the new ukis-csmask>=v1.0.0 models against the previous ukis-csmask<=v0.2.2 models across all tested datasets and product levels. Providing separate models for each product level provides further improvements and enables greater flexibiliy.

Installation

The easiest way to install ukis-csmask is through pip. To install ukis-csmask with default CPU provider run the following.

shell pip install ukis-csmask[cpu]

To install ukis-csmask with OpenVino support for enhanced CPU inference run the following instead.

shell pip install ukis-csmask[openvino]

To install ukis-csmask with GPU support run the following instead. This requires that you have a GPU with CUDA runtime libraries installed on the system.

shell pip install ukis-csmask[gpu]

ukis-csmask depends on onnxruntime. For a list of additional dependencies check the requirements.

Contributors

The UKIS team creates and adapts libraries which simplify the usage of satellite data. Our team includes (in alphabetical order): * Boehnke, Christian * Fichtner, Florian * Mandery, Nico * Martinis, Sandro * Riedlinger, Torsten * Wieland, Marc

German Aerospace Center (DLR)

Licenses

This software is licensed under the Apache 2.0 License.

Copyright (c) 2020 German Aerospace Center (DLR) * German Remote Sensing Data Center * Department: Geo-Risks and Civil Security

Changelog

See changelog.

Contributing

The UKIS team welcomes contributions from the community. For more detailed information, see our guide on contributing if you're interested in getting involved.

What is UKIS?

The DLR project Environmental and Crisis Information System (the German abbreviation is UKIS, standing for Umwelt- und Kriseninformationssysteme aims at harmonizing the development of information systems at the German Remote Sensing Data Center (DFD) and setting up a framework of modularized and generalized software components.

UKIS is intended to ease and standardize the process of setting up specific information systems and thus bridging the gap from EO product generation and information fusion to the delivery of products and information to end users.

Furthermore the intention is to save and broaden know-how that was and is invested and earned in the development of information systems and components in several ongoing and future DFD projects.

Owner

  • Name: German Aerospace Center, Earth Observation Center
  • Login: dlr-eoc
  • Kind: organization
  • Location: Oberpfaffenhofen, Germany

GitHub Events

Total
  • Create event: 10
  • Issues event: 5
  • Release event: 6
  • Watch event: 2
  • Delete event: 11
  • Issue comment event: 9
  • Push event: 20
  • Pull request event: 10
  • Pull request review event: 2
Last Year
  • Create event: 10
  • Issues event: 5
  • Release event: 6
  • Watch event: 2
  • Delete event: 11
  • Issue comment event: 9
  • Push event: 20
  • Pull request event: 10
  • Pull request review event: 2

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 63
  • Total Committers: 6
  • Avg Commits per committer: 10.5
  • Development Distribution Score (DDS): 0.508
Past Year
  • Commits: 15
  • Committers: 4
  • Avg Commits per committer: 3.75
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
wiel_mc m****d@d****e 31
Fichtner, Florian Willy f****r@d****e 17
Fichtner, Florian Willy 1****r 7
Sandro Groth S****h@d****e 4
MWieland m****d@g****e 3
Stefan 1****a 1
Committer Domains (Top 20 + Academic)
dlr.de: 3 gmx.de: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 23
  • Average time to close issues: 3 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 1.64
  • Average comments per pull request: 0.57
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 12
  • Average time to close issues: 5 months
  • Average time to close pull requests: 16 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 6.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • MWieland (7)
  • roserustowicz (2)
  • SandroGroth (1)
  • fwfichtner (1)
Pull Request Authors
  • MWieland (18)
  • fwfichtner (4)
  • s-kowa (1)
  • SandroGroth (1)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels
documentation (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 959 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 29
  • Total maintainers: 1
proxy.golang.org: github.com/dlr-eoc/ukis-csmask
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.4%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 7 months ago
pypi.org: ukis-csmask

masks clouds and cloud shadows in Sentinel-2, Landsat-8, Landsat-7 and Landsat-5 images

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 959 Last month
Rankings
Downloads: 6.6%
Stargazers count: 9.9%
Dependent packages count: 10.1%
Average: 12.5%
Forks count: 14.2%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 7 months ago

Dependencies

requirements.txt pypi
  • numpy *
  • onnxruntime *
  • scipy *
.github/workflows/black.yml actions
  • actions/checkout v3 composite
  • psf/black stable composite
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pythonapp.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
setup.py pypi