Coder Social home page Coder Social logo

sidgan / etci-2021-competition-on-flood-detection Goto Github PK

View Code? Open in Web Editor NEW
153.0 5.0 27.0 4.55 MB

Experiments on Flood Segmentation on Sentinel-1 SAR Imagery with Cyclical Pseudo Labeling and Noisy Student Training

Home Page: https://arxiv.org/abs/2107.08369

License: Apache License 2.0

Jupyter Notebook 60.38% Python 39.62%
deep-learning noisy-student pseudo-labeling floods segmentation semi-supervised-learning pytorch python arxiv-papers

etci-2021-competition-on-flood-detection's Introduction

Flood Detection Challenge

This repository contains code for our submission to the ETCI 2021 Competition on Flood Detection (Leaderboard, Homepage) (Winning Solution #2).

Accompanying paper: Flood Segmentation on Sentinel-1 SAR Imagery with Semi-Supervised Learning.

by Sayak Paul*, Siddha Ganju*.

(*) equal contribution.


Update (May 17, 2022): Orange Business Services, France optimized our public code and made it 2.5 times faster for inference, now inference takes 1.22 seconds over a 63,000 square kilometers tile! Together with Balcony Labs, Oakland, California, an integrated solution was developed which can deliver notifications to mobile devices for early warning and disaster management and has been operationally deployed in Afghanistan, Bangladesh, Mexico, Haiti, and Ukraine. Read here

Update (May 1, 2022): NVIDIA Deep Learning Institute leveraged this code and produced a new, free, educational course called Disaster Risk Monitoring Using Satellite Imagery, where one can learn to build and deploy a deep learning model to automate the detection of floods using satellite imagery. Check it out here

Update (April 23, 2022): We got a shoutout from PyTorch.

Update (December 11, 2021): We are releasing a presentation deck, a presentation video, and a poster of our work.

Update (October 26, 2021): Our work made it to the following NeurIPS 2021 workshops: AI for Science: Mind the Gaps, Tackling Climate Change with Machine Learning, Women in ML, and Machine Learning and the Physical Sciences.

Team

Executing the code

We executed the scripts and notebooks on a Vertex AI Notebook instance. The instance has four Tesla V100 GPUs and its base configuration is n1-standard-16.

We use Python 3.8 and PyTorch 1.9. Apart from the requirements specified in requirements.txt you'd need to install the following as well to run the scripts and notebooks:

$ pip install git+https://github.com/qubvel/segmentation_models.pytorch
$ pip install git+https://github.com/lucasb-eyer/pydensecrf.git

Our scripts and notebooks make use of mixed-precision training (via torch.cuda.amp) and distributed training (via torch.nn.parallelDistributedDataParallel). With this combination we are able to achieve significant boosts in the overall model training time.

Execution instructions for the scripts (src) and notebooks (notebooks) are provided in their respective directories. Download the data from the website after agreeing to their license agreements.

Pre-trained weights

For complete reproducibility, we provide the pre-trained weights here. With these weights and the workflow depicted in the notebooks and scripts one should be able to get an IoU of ~0.76 (as per the competition leaderboard) on the test set provided at the competition.

Results

You can verify the reported results here. Just switch to "Test (Phase 2)" after clicking the link.

FAQ

Acknowledgements

  • We are grateful to the ML-GDE program for providing GCP credits to support our experiments.
  • Thanks to Charmi Chokshi, and domain experts Shubhankar Gahlot, May Casterline, Ron Hagensieker, Lucas Kruitwagen, Aranildo Rodrigues, Bertrand Le Saux, Sam Budd, Nick Leach, and, Veda Sunkara for insightful discussions.

Citation

@inproceedings{paul2021flood,
    title   = {Flood Segmentation on Sentinel-1 SAR Imagery with Semi-Supervised Learning},
    author  = {Sayak Paul and Siddha Ganju},
    year    = {2021},
    URL = {https://arxiv.org/abs/2107.08369},
    booktitle = {NeurIPS Tackling Climate Change with Machine Learning Workshop}
}

etci-2021-competition-on-flood-detection's People

Contributors

sayakpaul avatar sidgan 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

etci-2021-competition-on-flood-detection's Issues

Unable to visualize images in Data_Viz notebook

I was going through your repository to understand visualization of data in ETCI20201 competition.And I have few queries
1.On executing the cells related to downloading the data,when i execute the below code the number of image paths comes out to be 66812.But in your text cell,the number of images is 33406.Any reason why this is happening?

all_image_paths = list(paths.list_images("train"))
print(f"Total images: {int(len(all_image_paths)/2)}")

Secondly,on executing the below code in the data_viz notebook

def show_all_four_images(filenames, titles):
    plt.figure(figsize=(20, 10))
    images = []
    for filename in filenames:
        images.append(mpimg.imread(filename))
        
    plt.suptitle(get_image_id(filenames[0]), size=16)
    columns = 4
    
    for i, image in enumerate(images):
        ax = plt.subplot(len(images)/ columns + 1, columns, i + 1)
        ax.set_title(titles[i])
        plt.imshow(image)

    plt.show()
`
import random

titles = ["V V","V H" , "Land or water before flood/Water body image" ,"After Flood/flood image"]

random_index =  random.sample(range(0, len(vv_image_paths)), 10) 
for i in random_index:
    # The assertions make sure we are operating on the right pairs
    assert  get_intensity(vv_image_paths[i]) == get_intensity(flood_image_paths[i])
    assert  get_intensity(vh_image_paths[i]) == get_intensity(water_body_label_paths[i])
    show_all_four_images([vv_image_paths[i], vh_image_paths[i],  
                          water_body_label_paths[i], flood_image_paths[i] ] , titles  throws exception error 

Using random indices when you call show_all_four_images,the following error is encountered

Number of rows must be positive integer not 2.0 
the exception is raised in show_alL_four_images when you run ax.subplot(len(images)/columns+1,columns,i+1)

The issue can be resolved when I convert it to int,but then the visualization is not good.
As such,I feel that there is some issues in the all_image_path section,because the number of images must be 33406 according to torch-rs but when I execute your code it comes out to be 4 times that amount.
thanks

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.