Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Mateo Garcia committed Dec 4, 2023
1 parent ee45276 commit 9606c75
Show file tree
Hide file tree
Showing 38 changed files with 8,879 additions and 1,616 deletions.
8 changes: 2 additions & 6 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_Run_Inference_multioutput_binary.html">Inference with clouds aware floods segmentation model</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_postprocess_inference.html">Postprocess inference</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_inference_on_image_time_series.html">Run inference on time series of Sentinel-2 images</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">The *WorldFloods* dataset</span></p>
<ul class="nav bd-sidenav">
Expand All @@ -189,19 +190,14 @@
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_performance_metrics_workflow.html">Model Metrics</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_Run_Inference_on_new_data.html">Run inference</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">End-to-end Pipeline</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_inference_on_image_time_series.html">Run inference on time series of Sentinel-2 images</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_inference_SAFE_file.html">Inference on Sentinel-2 <code class="docutils literal notranslate"><span class="pre">SAFE</span></code> files</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Experimental</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="content/prep/demo_pytorch_transforms.html">Pre-processing Demonstration</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/ml4ops/HOWTO_Calculate_uncertainty_maps.html">Probabilistic neural networks</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Project rationale</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="content/intro/introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/intro/introduction.html">Project rationale</a></li>
</ul>

</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/ts_albania.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 34 additions & 19 deletions _sources/content/config.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
# Introduction

---
ML4Floods is python package to do *end-to-end* flood extent estimation from optical images using deep learning models.

## Install
```{figure} ./ml4ops/ts_albania.gif
---
name: ts_albania
width: 100%
align: center
---
```

ML4Floods is python package to do *end-to-end* flood extent estimation from optical images using deep learning models.
## Democratising AI-Enhanced Flooding Tools

Machine learning (ML) algorithms have the potential to offer significantly faster and more accurate flood mapping than traditional methods. Their adaptability means they can easily grow to accommodate more data over time, and expand to ingest a wide range of data types. Such ‘data fusion’ capabilities are potentially game-changing for a broad spectrum of users, from emergency workers to urban planners.

Training robust and reliable ML models is almost an art-form, requiring specialist knowledge of statistics, computing and data platforms. ML workflows have become much more accessible because of dedicated open-source libraries like PyTorch and TensorFlow. However, there are a myriad of subtle pitfalls associated with training and deploying ML models - these can produce deeply skewed results that still appear reasonable to the untrained eye. Democratising end-to-end integrated AI workflows avoids these pitfalls by creating a series of linked tools that non-ML expert users can trust to deploy machine learning. These tools incorporate data acquisition, preparation, calibration, enhancement and deployment steps, wrapped in an accessible interface. The full workflow is embedded in a visualisation tool that enables users to query, understand and use the insights and information generated. This unified suite of tools can get users 80% of the way and then allows straightforward customisation to a specific problem sub-domain.

## Install

To install the package run:

```
pip install ml4floods
```

The package is available in [GitHub](https://github.com/spaceml-org/ml4floods). ML4Floods is published under a [GNU Lesser GPL v3 licence](https://www.gnu.org/licenses/lgpl-3.0.en.html) <img src="https://www.gnu.org/graphics/lgplv3-88x31.png" alt="licence" width="80">


## Tutorials

ML4Floods is a self-contained tool for training and deploying flood extent segmentation models for Sentinel-2 and Landsat. These tools include: image downloading, flood map acquisition, neural network training, testing and the visualization of the results in an interactive map.
See the [project rationale](./intro/introduction.md) for a more detailed explanation.
See the [project rationale](./intro/introduction.md) for a more detailed explanation of the goals of the tool.

These tutorials may help you explore the datasets and models:
* [Run the clouds-aware flood segmentation model in Sentinel-2 and Landsat and vectorise the flood maps](https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_postprocess_inference.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/ml4ops/HOWTO_postprocess_inference.ipynb)
* [Run the model on time series of Sentinel-2 images](https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_inference_on_image_time_series.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/ml4ops/HOWTO_inference_on_image_time_series.ipynb)
* [Ingest data from Copernicus EMS](https://spaceml-org.github.io/ml4floods/content/prep/full_data_ingest.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/prep/full_data_ingest.ipynb)
* [ML-models step by step](https://spaceml-org.github.io/ml4floods/content/ml_overview.html)
* [Training](https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_Train_models.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/ml4ops/HOWTO_Train_models.ipynb)
* [Inference on new data](https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_Run_Inference_on_new_data.html) (a Sentinel-2 image) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/ml4ops/HOWTO_Run_Inference_on_new_data.ipynb)
* [Perf metrics](https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_performance_metrics_workflow.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/ml4ops/HOWTO_performance_metrics_workflow.ipynb)
* [Ingest data from Copernicus EMS](https://spaceml-org.github.io/ml4floods/content/prep/full_data_ingest.html) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/spaceml-org/ml4floods/blob/main/jupyterbook/content/prep/full_data_ingest.ipynb)


## About

This work is an extension of the [FDL Europe 2019](https://fdleurope.org/) *"Disaster Prevention, Progress and Response"* team which results are published in:

> G. Mateo-Garcia, J. Veitch-Michaelis, L. Smith, S. Oprea, G. Schumann, Y. Gal, Baydin G.A., Backes D. [Towards global flood mapping onboard low cost satellites with machine learning](https://www.nature.com/articles/s41598-021-86650-z). _Scientific Reports 11, 7249_ (2021). DOI: 10.1038/s41598-021-86650-z
This work has been further extended in:

> E. Portalés-Julià, G. Mateo-García, C. Purcell, and L. Gómez-Chova [Global flood extent segmentation in optical satellite images](https://www.nature.com/articles/s41598-023-47595-7). _Scientific Reports 13, 20316_ (2023). DOI: 10.1038/s41598-023-47595-7.

ML4Floods has been funded by the United Kingdom Space Agency (UKSA) and led by [Trillium Technologies](http://trillium.tech/). It has also been partially supported by the Spanish Ministry of Science and Innovation project PID2019-109026RB-I00 (MINECO-ERDF MCIN/AEI/10.13039/501100011033).

## Citation

If you find this work useful please cite:
Expand Down Expand Up @@ -64,19 +86,12 @@ These tutorials may help you explore the datasets and models:
}
```

## About

This work is an extension of the [FDL Europe 2019](https://fdleurope.org/) *"Disaster Prevention, Progress and Response"* team which results are published in:

> G. Mateo-Garcia, J. Veitch-Michaelis, L. Smith, S. Oprea, G. Schumann, Y. Gal, Baydin G.A., Backes D. [Towards global flood mapping onboard low cost satellites with machine learning](https://www.nature.com/articles/s41598-021-86650-z). _Scientific Reports 11, 7249_ (2021). DOI: 10.1038/s41598-021-86650-z
This work has been further extended in:
## Licence
The package is available in [GitHub](https://github.com/spaceml-org/ml4floods). ML4Floods is published under a [GNU Lesser GPL v3 licence](https://www.gnu.org/licenses/lgpl-3.0.en.html) <img src="https://www.gnu.org/graphics/lgplv3-88x31.png" alt="licence" width="80">.

> E. Portalés-Julià, G. Mateo-García, C. Purcell, and L. Gómez-Chova [Global flood extent segmentation in optical satellite images](https://www.nature.com/articles/s41598-023-47595-7). _Scientific Reports 13, 20316_ (2023). DOI: 10.1038/s41598-023-47595-7.

ML4Floods has been funded by the United Kingdom Space Agency (UKSA) and led by [Trillium Technologies](http://trillium.tech/). It has also been partially supported by the Spanish Ministry of Science and Innovation project PID2019-109026RB-I00 (MINECO-ERDF MCIN/AEI/10.13039/501100011033).
The *WorldFloods* database and all pre-trained models are released under a [Creative Commons non-commercial licence](https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt)
<img src="https://mirrors.creativecommons.org/presskit/buttons/88x31/png/by-nc.png" alt="licence" width="60"/>

## Contributors

[*Gonzalo Mateo-García*](https://www.uv.es/gonmagar/), *Enrique Portalés-Julià*, *Tarun Narayanan*, *J. Emmanuel Jonhson*, *Nadia Ahmed, Sam Budd, Satyarth Praveen, Lucas Kruitwagen, Margaret Maynard-Reid, Nicholas Roth, Cormac Purcell, Richard Strange, Leo Silverberg, Guy Schumann, Edoardo Nemni, Luis Gómez-Chova, Freddie Kalaitzis, Sara Jennings, Jodie Hughes and James Parr.*
*Gonzalo Mateo-García*, *Enrique Portalés-Julià*, *Tarun Narayanan*, *J. Emmanuel Jonhson*, *Nadia Ahmed, Sam Budd, Satyarth Praveen, Lucas Kruitwagen, Margaret Maynard-Reid, Nicholas Roth, Cormac Purcell, Richard Strange, Leo Silverberg, Guy Schumann, Edoardo Nemni, Luis Gómez-Chova, Freddie Kalaitzis, Sara Jennings, Jodie Hughes* and *James Parr*.
4 changes: 3 additions & 1 deletion _sources/content/intro/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

<p style="text-align: center; font-style: italic;">ML4Floods: an ecosystem of data, models and code pipelines to tackle flooding with ML</p>

# Introduction
# Project rationale

## Introduction

Satellites image the whole globe, revisiting locations every few days or even hours to record the changing landscape. Their cameras see deep into the infrared and radar sensors see through clouds and at night. They capture information on many different observable parameters including dynamic and rapid processes and events like floods. Newer instruments can now provide contextual details at more and more precise scale, locating for instance individual buildings that are flooded, or even search and rescue people using airborne platforms. At the same time, ground-based sensors like rain gauges or river level stations record surface conditions unavailable from space. All of this data is stored - sometimes by commercial companies, but often by government agencies under open- or restricted-access policies. However, there remain significant barriers for non-specialists to access and use this information or to respond quickly in emergency situations.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c80c8e5867ad4aaf8c294edaec4c8e17",
"model_id": "5a2735cf3d4f450eb182c7eadff15d44",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -108,7 +108,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f6c30a0d269b4c47a83da89e9dfbea66",
"model_id": "2b0aaead05ab48f0bde7b573f291a4a3",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -198,7 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "80f980d1-2ef2-419c-b5ee-d4894d7e2ae0",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -229,7 +229,7 @@
" "
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -1000,7 +1000,26 @@
"metadata": {},
"source": [
"## Licence\n",
"The *WorldFloods* database and all pre-trained models are released under a [Creative Commons non-commercial licence](https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt). For using the models in comercial pipelines written consent by the authors must be provided."
"The ML4Floods package is published under a [GNU Lesser GPL v3 licence](https://www.gnu.org/licenses/lgpl-3.0.en.html)\n",
"\n",
"The *WorldFloods* database and all pre-trained models are released under a [Creative Commons non-commercial licence](https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt). For using the models in comercial pipelines written consent by the authors must be provided.\n",
"\n",
" If you find this work useful please cite:\n",
"```\n",
"@article{portales-julia_global_2023,\n",
"\ttitle = {Global flood extent segmentation in optical satellite images},\n",
"\tvolume = {13},\n",
"\tissn = {2045-2322},\n",
"\tdoi = {10.1038/s41598-023-47595-7},\n",
"\tnumber = {1},\n",
"\turldate = {2023-11-30},\n",
"\tjournal = {Scientific Reports},\n",
"\tauthor = {Portalés-Julià, Enrique and Mateo-García, Gonzalo and Purcell, Cormac and Gómez-Chova, Luis},\n",
"\tmonth = nov,\n",
"\tyear = {2023},\n",
"\tpages = {20316},\n",
"}\n",
"```"
]
}
],
Expand Down
26 changes: 22 additions & 4 deletions _sources/content/ml4ops/HOWTO_Run_Inference_on_new_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "fd6d5c34",
"metadata": {},
"source": [
"# Run inference\n",
Expand All @@ -10,6 +11,8 @@
"* **Authors**: Sam Budd, Gonzalo Mateo-García\n",
"---\n",
"\n",
"<div class=\"alert alert-block alert-danger\"> This tutorial is deprecated. In order to run inference with the latest flood detection model go to <a href=\"https://spaceml-org.github.io/ml4floods/content/ml4ops/HOWTO_Run_Inference_multioutput_binary.html\">this notebook</a></div>\n",
"\n",
"> Run inference on Sentinel-2 images using a trained model\n",
"\n",
"This notebook shows how to load a trained model from a experiment config file. With that model we will then make predictions on new Sentinel-2 images.\n",
Expand All @@ -20,6 +23,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "2a5fa1ce",
"metadata": {
"tags": [
"remove-cell"
Expand All @@ -28,12 +32,13 @@
"outputs": [],
"source": [
"# Install the ml4floods package\n",
"!pip install git+https://github.com/spaceml-org/ml4floods#egg=ml4floods"
"!pip install ml4floods"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "6ab07774",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,6 +47,7 @@
},
{
"cell_type": "markdown",
"id": "280b290c",
"metadata": {},
"source": [
"## Step 0: Download the necessary data\n",
Expand All @@ -59,6 +65,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "05cbfa05",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -87,6 +94,7 @@
},
{
"cell_type": "markdown",
"id": "ea2e0260",
"metadata": {
"tags": []
},
Expand All @@ -99,6 +107,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "3821e18f",
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -163,6 +172,7 @@
},
{
"cell_type": "markdown",
"id": "971a4b33",
"metadata": {},
"source": [
"## Step 1: Get config"
Expand All @@ -171,6 +181,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "b6212955",
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -243,6 +254,7 @@
},
{
"cell_type": "markdown",
"id": "bd86882b",
"metadata": {},
"source": [
"## Step 2: Load pre-trained model"
Expand All @@ -251,6 +263,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "b58cbb65",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -336,6 +349,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "a6bb5cb6",
"metadata": {},
"outputs": [
{
Expand All @@ -354,6 +368,7 @@
},
{
"cell_type": "markdown",
"id": "312135c9",
"metadata": {},
"source": [
"## Step 3: Run Inference\n",
Expand All @@ -367,6 +382,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "4de620ab",
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -433,6 +449,7 @@
},
{
"cell_type": "markdown",
"id": "3de563b0",
"metadata": {},
"source": [
"## Step 4: Vectorise the water masks and plot them\n",
Expand All @@ -443,6 +460,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "96d222d8",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -490,9 +508,9 @@
"metadata": {
"celltoolbar": "Edit Metadata",
"kernelspec": {
"display_name": "Python [conda env:ml4floods]",
"display_name": "ml4floods",
"language": "python",
"name": "conda-env-ml4floods-py"
"name": "ml4floods"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -504,7 +522,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.9"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 9606c75

Please sign in to comment.