- A deep ConvNet for surface water mapping based on Sentinel-2 image
-
We use Deeplabv3+ with MobileNetv2 backbone as the main model structure, additionly, some simple yet effective modifications are designed for improving the satellite image-based surface water mapping.
-
Surface water dataset for Deep learning could be downloaded from Zenodo [Link].
Labeling example 1: Labeling example 2:
-
Examples for surface water mapping
Urban region
Urban scene AWEI MNDWI WatNet Cloudy region
Cloudy scene AWEI OBIA WatNet Mountainous region
Mountain scene AWEI OBIA WatNet
-
Enter the following commands for downloading the code files, and then configure the python and deep learning environment. The deep learning software used in this repo is Tensorflow 2.5.
git clone https://github.com/xinluo2018/WatNet.git
- Download Sentinel-2 images, and select four visible-near infrared 10-m bands and two 20-m shortwave infrared bands, which corresponding to the band number of 2, 3, 4, 8, 11, and 12 of sentinel-2 image.
- Add the prepared sentinel-2 image (6 bands) to the data/test-demo directory, modify the data name in the notebooks/infer_demo.ipynb file, then running the code file: notebooks/infer_demo.ipynb and surface water map can be generated.
- Users also can specify surface water mapping by using the watnet_infer.py, specifically,
- --- funtional API:
from watnet_infer import watnet_infer water_map = watnet_infer(rsimg) # full example in notebooks/infer_demo.ipynb.
- --- command line API:
python watnet_infer.py data/test-demo/*.tif -o data/test-demo/result
- With the Dataset, the user can train the WatNet through running the code file train/trainer.ipynb. Since tfrecords format data is required in the model training, the user should convert the .tif format dataset to .tfrecords format dataset by running code file dataloader/tfrecord_writter.ipynb firstly.
- Xin Luo, Xiaohua Tong, Zhongwen Hu. An applicable and automatic method for earth surface water mapping based on multispectral images. International Journal of Applied Earth Observation and Geoinformation, 2021, 103, 102472. [Link]
@article{luo2021_watnet, title = {An applicable and automatic method for earth surface water mapping based on multispectral images}, author = {Xin Luo and Xiaohua Tong and Zhongwen Hu}, journal = {International Journal of Applied Earth Observation and Geoinformation}, volume = {103}, pages = {102472}, year = {2021} }
- We thanks the authors for providing some of the code in this repo:
deeplabv3_plus and deepwatmapv2