An open API service indexing awesome lists of open source software.

https://github.com/ahestevenz/flood-detection-segmentation

Flood detector using effientnet as semantic segmentation model
https://github.com/ahestevenz/flood-detection-segmentation

computer-vision effientnet flood-detection floods machine-learning segmentation-models

Last synced: 3 months ago
JSON representation

Flood detector using effientnet as semantic segmentation model

Awesome Lists containing this project

README

          

# Flood Detector
A flood detector using effientnet as semantic segmentation model.

## Dataset
[Sen1Floods11](https://github.com/cloudtostreet/Sen1Floods11): a georeferenced dataset to train and test deep learning flood algorithms for Sentinel-1 (Example). This data was generated by Cloud to Street, a Public Benefit Corporation: https://www.cloudtostreet.info/. For questions about this dataset or code please email support@cloudtostreet.info.

Paper:
Bonafilia, D., Tellman, B., Anderson, T., Issenberg, E. 2020. [Sen1Floods11: a georeferenced dataset to train and test deep learning flood algorithms for Sentinel-1](https://openaccess.thecvf.com/content_CVPRW_2020/html/w11/Bonafilia_Sen1Floods11_A_Georeferenced_Dataset_to_Train_and_Test_Deep_Learning_CVPRW_2020_paper.html). The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, 2020, pp. 210-211.

## Training and Testing
### Requirements

#### Python environment

It is highly recomomended to run the training scrips inside of python environment, in case the system does not have any use the following procedure (check [Virtualenvwrapper Installation](https://virtualenvwrapper.readthedocs.io/en/latest/install.html) for more details).

```setup
$ pip install --user virtualenvwrapper virtualenv
```

Add three lines to your shell startup file (.bashrc, .profile, etc.) to set the location where the virtual environments should live:

```
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
```

After editing it, reload the startup file (e.g., run `source ~/.bashrc`) and create a python environment:

```
$ mkvirtualenv venv_py
$ workon venv_py
```

#### Installing the package

Once the python environment was configured, run the following procedure to install all the required packages
```setup
(venv_py)$ git clone https://github.com/ahestevenz/flood-detection-segmentation
(venv_py)$ cd flood-detection-segmentation
(venv_py)$ pip install .
```

### Training

The following script will be used to train the model.
```train
(venv_py)$ bn-run-train --help
usage: bn-run-train [-h] [-j JSON_FILE] [-v] [-p output.prof]

Welcome to the Bushfires Detector training script

optional arguments:
-h, --help show this help message and exit
-j JSON_FILE, --json_file JSON_FILE
JSON configuration (default: "/Users/ahestevenz/Desktop/tech-projects/1_code/flood-detection-segmentation/config.json")
-v, --verbose Increase logging output (default: INFO)(can be specified several times)
-p output.prof, --profile output.prof
Run with profiling and store output in given file

```
Run the above command to start the training (check the `data` and `artefacts` paths in `config.json` first)
```train
(venv_py)$ bn-run-train --json_file config.json
```

### Testing

To evaluate the model indicated in `config.json` file, run this command:

```test
(venv_py)$ bn-run-test --json_file config.json
```

## Results

Qualitative results using the validation dataset

![](https://github.com/ahestevenz/flood-detection-segmentation/blob/main/assets/valid_results.gif)

In the plot below, you can observe quantitative results using a similarity metric between ground truth and prediction masks.

![](https://github.com/ahestevenz/flood-detection-segmentation/blob/main/assets/perf_result.png)

## TODO List
- [x] Add Docker container option to run/train models
- [x] Add release revision for [NASA_IIAC_IEEE_GRSS_ESITC_Flood_Data](https://nasa-impact.github.io/etci2021/) dataset from the NASA Interagency Implementation and Advanced Concepts Team
- [x] Notebook example