Giter VIP home page Giter VIP logo

divergent-nets's Introduction

Endocv2021-winner

[Paper]

This is the winning solution of the Endocv-2021 grand challange.

Dependencies

pytorch # tested with 1.7 and 1.8
torchvision 
tqdm
pandas
numpy
albumentations # for augmentations
torchsummary
segmentation_models_pytorch # for basic segmentaion models
pyra_pytorch # pyra_pytorch.PYRADatasetFromDF is used. But this can be replaced with normal pytorch dataset.

Tri-Unet

Block diagram of Tri-Unet

TriUnet

How to train Tri-Unet and other basic models to DivergentNet?

# To train Tri-unet

python tri_unet.py train \
    --num_epochs 2 \
    --device_id 0  \
    --train_CSVs sample_CSV_files/C1.csv sample_CSV_files/C1.csv \
    --val_CSVs sample_CSV_files/C2.csv sample_CSV_files/C3.csv \
    --test_CSVs sample_CSV_files/C3.csv \
    --out_dir ../temp_data \
    --tensorboard_dir ../temp_data  

# To train other models, you have to replace tri_unet.py with one of the follwings:
unet_plusplus.py
deeplabv3.py
deeplabv3_plusplus.py

Pretrained checkpoint paths


DivergentNet

DivergentNet

Merging and predicting from divergent networks

Set following parameters in inference_from_divergentNets.sh

--input_dir <directory to input images>
--output_dir <directory to save predicted mask>
--chk_paths <path to pretrained checkpoints. You can provide single checkpoint path or multiple checkpoint paths. Use a space to seperate multiple checkpoint paths or '\' as the given example paths.>

Then run it:

bash inference_from_divergentNets.sh

For Windows users we provide an inference script that supports windows. You can run it without the bash. For example:

python inference_from_divergentNets.py --input_dir C:\Users\xxx\GitHub\divergent-nets\input --output_dir C:\Users\xxx\GitHub\divergent-nets\output --chk_paths C:\Users\xxx\OneDrive\Dokumente\GitHub\divergent-nets\checkpoints\best_checkpoint_Deeplabv3.pth

Sample predictions from different models used in DivergentNets and it's own output.

predictions

Citation

@inproceedings{divergentNets,
  title={DivergentNets: Medical Image Segmentation by Network Ensemble},
  author={Thambawita, Vajira and Hicks, Steven A. and Halvorsen, P{\aa}l and Riegler, Michael A.},
  booktitle={Proceedings of the 3rd International Workshop and Challenge on Computer Vision in Endoscopy (EndoCV 2021)
co-located with with the 17th IEEE International Symposium on Biomedical Imaging (ISBI 2021)},
  year={2021}
}

Contact us:

[email protected], [email protected], [email protected]

divergent-nets's People

Contributors

kelkalot avatar vlbthambawita avatar

Watchers

 avatar

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.