Giter Site home page Giter Site logo

spaceml-org / starcop Goto Github PK

View Code? Open in Web Editor NEW
28.0 6.0 5.0 9.28 MB

Official code for STARCOP: Semantic Segmentation of Methane Plumes with Hyperspectral Machine Learning models :rainbow::artificial_satellite:

License: GNU General Public License v3.0

Shell 0.06% Jupyter Notebook 94.38% Python 5.57%
aviris aviris-ng emit hyperspectral hyperspectral-datasets machine-learning methane methane-detection

starcop's Introduction

STARCOP

STARCOP banner
The STARCOP system
We introduce the STARCOP system, a lightweight model for methane plume detection in hyperspectral (AVIRIS-NG and EMIT) and multispectral (WorldView-3) data. We show that the proposed methods outperforms baseline approaches (ratio products for multispectral and matched filter approaches for hyperspectral data). Finally we release the full annotated training and evaluation dataset of methane plume events events. Project conducted as part of the ESA Cognitive Cloud Computing in Space (3CS) initiative with Trillium Technologies.

Nature Scientific Reports Paper 2023Oxford Department of Computer Science news

slides & video from ECMWF–ESA workshop 2022 • Quick Demo with AVIRIS Trained models🤗


Semantic Segmentation of Methane Plumes with Hyperspectral ML Models

Abstract Methane is the second most important greenhouse gas contributor to climate change; at the same time its reduction has been denoted as one of the fastest pathways to preventing temperature growth due to its short atmospheric lifetime. In particular, the mitigation of active point-sources associated with the fossil fuel industry has a strong and cost-effective mitigation potential. Detection of methane plumes in remote sensing data is possible, but the existing approaches exhibit high false positive rates and need manual intervention. Machine learning research in this area is limited due to the lack of large real-world annotated datasets. In this work, we are publicly releasing a machine learning ready dataset with manually refined annotation of methane plumes. We present labelled hyperspectral data from the AVIRIS-NG sensor and provide simulated multispectral WorldView-3 views of the same data to allow for model benchmarking across hyperspectral and multispectral sensors. We propose sensor agnostic machine learning architectures, using classical methane enhancement products as input features. Our HyperSTARCOP model outperforms strong matched filter baseline by over 25% in F1 score, while reducing its false positive rate per classified tile by over 41.83%. Additionally, we demonstrate zero-shot generalisation of our trained model on data from the EMIT hyperspectral instrument, despite the differences in the spectral and spatial resolution between the two sensors: in an annotated subset of EMIT images HyperSTARCOP achieves a 40% gain in F1 score over the baseline.

Dataset

The full annotated dataset used for training and evaluation is hosted on Zenodo. For easier access to the data for the demos, a smaller subsets are also hosted on Google Drive: evaluation dataset and subset of the training dataset, including only strong plumes. We provide selected AVIRIS hyperspectral bands, computed methane enhancement products and simulated multispectral views of the data from WorldView-3. For more details see the paper.

For dataset inspection use the prepared Colab Dataset Exploration demo .

Code examples

Install

conda create -c conda-forge -n starcop_env python=3.10 mamba
conda activate starcop_env

pip install git+https://github.com/spaceml-org/STARCOP.git

Inference

To start using our model for inference, you can check the demo with AVIRIS data in Colab Inference on AVIRIS , or with EMIT data in Colab Inference on EMIT . These download our annotated datasets and demonstrate the performance of our pre-trained models.

Detections in EMIT
Selected predictions of our model detecting methane leaks using the data from the EMIT sensor deployed on board of the International Space Station. Showing detections from around the world with data from 2022-2023. Image credit: Open source EMIT data (NASA) processed by Vít Růžička.
Detections in AVIRIS
Selected predictions of our model detecting methane leaks using the data from the AVIRIS aerial mission flown above the Four Corners area in the USA in 2019. Plume emission rates are used from the source annotations. Image credit: Open source AVIRIS data (NASA) processed by Vít Růžička.

Our trained models are stored in Hugging Face🤗 at isp-uv-es/starcop.

Training

To reproduce the same training process as reported in the paper, you will need to download the whole STARCOP dataset from Zenodo first, and prepare the coding environment.

# Check possible parameters with:
!python3 -m scripts.train --help

# Or run the prepared training script used for the paper models (remember to download and adjust the paths to the training datasets)
./bash/bash_train_example.sh

Minimal training example

If you install the environment using the commands above, this should work as a minimal training example (which includes first getting the data):

gdown https://drive.google.com/uc?id=1Qw96Drmk2jzBYSED0YPEUyuc2DnBechl -O STARCOP_mini.zip
unzip -q STARCOP_mini.zip
# The train script will expect the test dataset in the "test.csv" - so here in this small demo we just place the small subset there instead:
cp STARCOP_mini/test_mini10.csv STARCOP_mini/test.csv

python -m scripts.train dataset.input_products=["mag1c","TOA_AVIRIS_640nm","TOA_AVIRIS_550nm","TOA_AVIRIS_460nm"] model.model_type='unet_semseg' model.pos_weight=1 experiment_name="HyperSTARCOP_magic_rgb_DEMO" dataloader.num_workers=4 dataset.use_weight_loss=True training.val_check_interval=0.5 training.max_epochs=5 products_plot=["rgb_aviris","mag1c","label","pred","differences"] dataset.weight_sampling=True dataset.train_csv="train_mini10.csv" dataset.root_folder=PATH_TO/STARCOP_mini wandb.wandb_entity="YOUR_ENTITY" wandb.wandb_project="starcop_project"

Citation

If you find the STARCOP models or dataset useful in your research, please consider citing our work.

@article{ruzicka_starcop_2023,
	title = {Semantic segmentation of methane plumes with hyperspectral machine learning models},
	volume = {13},
	issn = {2045-2322},
	url = {https://www.nature.com/articles/s41598-023-44918-6},
	doi = {10.1038/s41598-023-44918-6},
	number = {1},
	journal = {Scientific Reports},
        author={Růžička, Vít and Mateo-Garcia, Gonzalo and G{\'o}mez-Chova, Luis and Vaughan, Anna and Guanter, Luis and Markham, Andrew},
	month = nov,
	year = {2023},
	pages = {19999}
}

starcop's People

Contributors

gonzmg88 avatar previtus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

starcop's Issues

dataset

Does your dataset which you had publish contain the methane leakage?

Channels of AVIRIS-NG original data

Hello dear author, very good work. I found that in the paper "MethaneMapper: Spectral Absorption aware Hyperspectral Transformer for Methane Detection", the original data of AVIRIS-NG is 432 channels, but in your article it is 425 channels, as shown in Figure 5. So I wonder how many channels the AVIRIS-NG really has?

multispectral (WorldView-3) data

Hello, thank you for your work. I did not find the "ratio_wv3_B7_B5_varon21_sum_c_out", "ratio_wv3_B8_B5_varon21_sum_c_out" and "ratio_wv3_B7_B7MLR_SanchezGarcia22_sum_c_out" files in the dataset. I would like to ask if multispectral (WorldView-3) data is disclosed in the data set. Or maybe I didn't find it?

git install fails

When running command pip install git+https://github.com/spaceml-org/STARCOP.git, I get the following message:

Collecting git+https://github.com/spaceml-org/STARCOP.git
Cloning https://github.com/spaceml-org/STARCOP.git to c:\users\tanni\appdata\local\temp\pip-req-build-g2jstq2n
Running command git clone --filter=blob:none --quiet https://github.com/spaceml-org/STARCOP.git 'C:\Users\tanni\AppData\Local\Temp\pip-req-build-g2jstq2n'
Resolved https://github.com/spaceml-org/STARCOP.git to commit b404aa9
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\tanni\AppData\Local\Temp\pip-req-build-g2jstq2n\setup.py", line 6, in
long_description = fh.read()
File "C:\Users\tanni\anaconda3\envs\starcop_env\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 5599: character maps to
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

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.