Home

Awesome

<h1 align="center"> <b>DAM-Net: Global Flood Detection from SAR Imagery Using Differential Attention Metric-Based Vision Transformers</b><br> </h1> <h2 align="left">Authors <br></h2>

Author Author Author Author Author

Updates

:zap:March, 2023: DAM-Net has been submitted for publication at ISPRS Journal of Photogrammetry and Remote Sensing.

Preamble

The following animation shows SAR images before and after the event and a sample of flooded area findings for a rural area in Iran that was hit by a flood in March 2019. The right figure provides an enlarged visual of a 1 km x 1 km area within the larger area as in the yellow box, showing the size of the affected buildings from the flood by our model.

<div align="left"> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/test-map.gif" width="480" height="340" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/zoom-test-map.gif" width="340" height="340" /> </div>

Description

Flooding can cause extensive damage to people, ecosystems, and economies, making it a severe natural disaster. Operating ground-based equipment in flood zones is hazardous, and limited physical access to flooded areas can make it challenging to acquire information about flood extent on the ground. Accurately detecting floods and flood extent via remote sensing greatly aids in mitigating and responding to these events. Remote sensing technology, such as satellites and airborne sensors, can provide valuable information about the extent of flooding, crucial for developing appropriate response strategies and minimizing damages. In this work, we present a new open-source global-scale flood detection dataset, S1GFloods, has been compiled to aid in flood detection. The dataset includes global pairs of high-resolution Sentinel-1 SAR images covering 42 flood events between 2016 and 2022, along with ground truth maps for each pixel. It showcases flooded areas such as rivers, lakes, vegetation, urban and rural areas, and common causes of flooding. This dataset provides critical information for developing strategies to mitigate and respond to future flooding events.

<div align="center"> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Bangladesh-Img.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Iran-Img.gif" width="266" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Nigeria-Img.gif" width="266" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Nanchang-Img.gif" width="133" height="200" /> </div> <div align="center"> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Bangladesh-GT.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Iran-GT.gif" width="266" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Nigeria-GT.gif" width="266" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Nanchang-GT.gif" width="133" height="200" /> </div> <div align="center"> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Wuhan-Img.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Redrivernorth-Img.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Sudan-Img.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Florence-Img.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Zambia-Img.gif" width="266" height="200" /> </div> <div align="center"> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Wuhan-GT.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Redrivernorth-GT.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Sudan-GT.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Florence-GT.gif" width="133" height="200" /> <img src="https://github.com/Tamer-Saleh/GFlood-Detection/blob/Flood-Mapping/images/Zambia-GT.gif" width="266" height="200" /> </div>
Image Ref.SiteS1 Pre DateS1 Post DateGT Date
Img (1)Bangladesh14-03-201712-07-201712-07-2017
Img (2)Iran12-07-201929-03-201929-03-2019
Img (3)Nigeria26-08-202213-10-202213-10-2022
Img (4)Nanchang21-04-202014-07-202014-07-2020
Img (5)Wuhan02-05-202013-07-202013-07-2020
Img (6)Redrivernorth09-02-201928-05-201928-05-2019
Img (7)Sudan13-07-202023-09-202023-09-2020
Img (8)Florence21-07-201819-09-201819-09-2018
Img (9)Zambia25-03-201706-04-201706-04-2017

Requirements

Python 3.7+ Pytorch 1.7.1 torchvision 0.8.2 Opencv 4.5.5 CUDA Toolkit 10.1 Python-SNAPPY 8.0 Wandb 0.13.10

Our model

An overview of the proposed DAM-Net. The feature maps of the pre-and post-event image pairs are extracted through a Siamese structure and pre-trained remote sensing. Overall

Quantitative Results

image-QuantitativeResult

Qualitative Results

A visual comparison of flood detection results in the Iran dataset. The first three images, (a), (b), and (c), represent the pre-flood image, post-flood image, and binary ground truth, respectively. The subsequent images show a comparison of flood detection using various methods, including (d) Unet, (e) FC-Siam-Conc, (f) FC-Siam-Diff, (g) SNUNet-ECAM, (h) Siam-Nested-Unet, (i) ResNet50-IMP, (j) ResNet50-RSP, (k) Swin-T-IMP, (l) ViTAEv2-IMP, (m) Swin-T-RSP, and (n) our proposed DAM-Net method. image-QualitativeResult

πŸ”­ Baselines <a name="baselines"></a>

:speech_balloon: <span id="jump">Dataset Preparation</span>

:point_right: Data Structure

For S1GFloods dataset, clip the images to 256 Γ— 256 patches. Please, respect the following structure: 
β”œβ€”β€”β€”β€”train/
|      β”œβ€”β€”β€”Pre/                                  Images of Time 1 before the flood event
            β”œβ€”β€”β€”<region><year><XY>.png
            ...
            β”œβ€”β€”β€”<region><year><XY>.png
|      β”œβ€”β€”β€”Post/                                 Images of Time 2 after the flood event
            β”œβ€”β€”β€”<region><year><XY>.png
            ...
            β”œβ€”β€”β€”<region><year><XY>.png            
|      β”œβ€”β€”β€”GT/                                   Ground truth labels
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|
β”œβ€”β€”β€”β€”val/
|      β”œβ€”β€”β€”Pre/  
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|      β”œβ€”β€”β€”Post/
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|      β”œβ€”β€”β€”GT/
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|
β”œβ€”β€”β€”β€”test/
|      β”œβ€”β€”β€”Pre/  
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|      β”œβ€”β€”β€”Post/
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 
|      β”œβ€”β€”β€”GT/
            β”œβ€”β€”β€”<region><year><XY>.png 
            ...
            β”œβ€”β€”β€”<region><year><XY>.png 

:truck: Datasets <a name="dataset"></a>

The full train and test code will be released soon. You can download our novel public S1GFloods dataset through the following link:

:page_with_curl: Citing <a name="citing"></a>

@ARTICLE{tamersalehdam2023,
  Author = {T. Saleh, G-S Xia, S. Holail, X. Weng, and C. Hao},
  Title = {DAM-Net: Global Flood Detection from SAR Imagery Using Differential Attention Metric-Based Vision Transformers},
  Journal = {ISPRS Journal of Photogrammetry and Remote Sensing},
  Year = {2023},
  volume={},
  number={},
  pages={1-21}
  }

Contact Information

If you have any questions or would like to collaborate, please reach out to me at tamersaleh@whu.edu.cn or feel free to make issues.

License

The code and datasets are released for non-commercial and research purposes only. For commercial purposes, please contact the authors.

Acknowledgment

Appreciate the work from the following repositories:

Related resources