Code Monkey home page Code Monkey logo

jlcsilva / efficientunetplusplus Goto Github PK

View Code? Open in Web Editor NEW
63.0 1.0 10.0 28.94 MB

Decoder architecture based on the UNet++. Combining residual bottlenecks with depthwise convolutions and attention mechanisms, it outperforms the UNet++ in a coronary artery segmentation task, while being significantly more computationally efficient.

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

License: MIT License

Python 100.00%
pytorch deep-learning segmentation unet efficientnet unetplusplus efficientunetplusplus medical-image-segmentation

efficientunetplusplus's Introduction

EfficientUNet++

Paper Generic badge

1. About the EfficientUNet++ decoder architecture

The EfficientUNet++ is a decoder architecture inspired by the UNet++. Although it was designed and fine-tuned for a coronary artery segmentation task, we expect it to perform well across a wide variety of medical image segmentation tasks. We plan to test it on other tasks soon, and will upload test set performance when we do.

In our coronary artery segmentation task, using EfficientNet models as backbone, the EfficientUNet++ achieves higher performance that the UNet++, U-Net, ResUNet++ and other high-performing medical image segmentation architectures. Such improvement is achieved by two simple modifications, inspired by the EfficientNet building blocks:

  • To reduce computation, the 3x3 convolutional blocks of the UNet++ are replaced with residual bottleneck blocks with depthwise convolutions
  • To enhance performance, the feature maps outputted by 3x3 depthwise convolution are processed by an scSE, that applies both channel and spatial attention. The SE channel attention used in the EfficientNet was tested, but yielded worse results. For more details, refer to the paper.

Comparison of the EfficientUNet++ and UNet++ building blocks:

Performance of different decoder architectures as a function of the number of FLOPS and the number of parameters, when using the EfficientNet B0 to B7 models as encoders:

To help practicioners choose the most adequate model for their clinical needs and available hardware, the Pareto Frontier of the tested models was drawn, with the number of FLOPS as a function of model performance.

2. Installing the repository

When installing the repository, do not forget to update the submodule, by running the git submodule update --init --recursive command.

3. Using the EfficientUNet++ independently

The EfficientUNet++ was implemented as an extension of the Segmentation Models Pytorch repository, by Pavel Yakubovskiy. Currently, it is a pending pull request. For detailed information on library installation and model usage, visit the Read The Docs Project Page or the repository's README.

4. Training the EfficientUNet++

It was not possible to obtain the necessary clearances to release the full coronary artery segmentation dataset. Therefore, to enable other researchers and programmers to test our architecture, we provide a toy dataset with 6 coronary angiography images, and built a loader for the the retinal vessel segmentation DRIVE dataset. We still haven't had the time to test the EfficientUNet++ in the retinal vessel segmentation task, but we expect it to perform well when coupled with the right encoder.

To train the an EfficientUNet++ model on the coronary artery segmentation toy dataset using the EfficientNetB0 encoder, run:

  python train.py -d Coronary -enc timm-efficientnet-b0

To train the same model on the DRIVE dataset:

  python train.py -d DRIVE -enc timm-efficientnet-b0

For more details on program arguments, run:

  python train.py -h

To consult the available encoder architectures, visit the Read The Docs Project Page.

5. Inference

To perform inference, run the following command:

  python predict.py -d <dataset> -enc <encoder> -i <list of files> -m <path to model>

where the dataset can be either Coronary or DRIVE.

6. Citing 📝

If you find our work useful and use it or draw inspiration from it in your research, please consider citing it.

@misc{silva2021encoderdecoder,
      title={Encoder-Decoder Architectures for Clinically Relevant Coronary Artery Segmentation}, 
      author={João Lourenço Silva and Miguel Nobre Menezes and Tiago Rodrigues and Beatriz Silva and Fausto J. Pinto and Arlindo L. Oliveira},
      year={2021},
      eprint={2106.11447},
      archivePrefix={arXiv},
      primaryClass={eess.IV}
}

6. License 🛡️

Distributed under MIT License

efficientunetplusplus's People

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

Watchers

 avatar

efficientunetplusplus's Issues

Predicted error reporting

Hello ! Sir !
There are always a lot of fractures in the predicted results. Is there any post-treatment process? Look forward to your guidance!

Drive evaluation result

Hi @jlcsilva thanks for your repository and paper. It was really interesting to read it but I cannot find any evaluation of your approach on public datasets. You mentioned DRIVE in repository but what is actual performance on this dataset?

Report errors when training

Hello!

Thanks for your work!
But I encountered some difficulties when I run python train.py -d DRIVE -enc timm-efficientnet-b0

Could you tell me what the problem is and how can I solve this problem? Thank you!
Best Wishes!

(EfficientUNetPP) ch@Z390-UD:~/workspace//EfficientUNetPlusPlus$ python train.py -d DRIVE -enc timm-efficientnet-b0
INFO: Using device cpu
Traceback (most recent call last):
  File "train.py", line 168, in <module>
    net = smp.EfficientUnetPlusPlus(encoder_name=args.encoder, encoder_weights="imagenet", in_channels=3, classes=n_classes)
  File "/home/cheng/workspace/EfficientUNetPlusPlus/segmentation_models_pytorch/segmentation_models_pytorch/efficientunetplusplus/model.py", line 66, in __init__
    weights=encoder_weights,
  File "/home/cheng/workspace/EfficientUNetPlusPlus/segmentation_models_pytorch/segmentation_models_pytorch/encoders/__init__.py", line 48, in get_encoder
    encoder = Encoder(**params)
  File "/home/cheng/workspace/EfficientUNetPlusPlus/segmentation_models_pytorch/segmentation_models_pytorch/encoders/timm_efficientnet.py", line 134, in __init__
    super().__init__(stage_idxs, out_channels, depth, **kwargs)
  File "/home/cheng/workspace/EfficientUNetPlusPlus/segmentation_models_pytorch/segmentation_models_pytorch/encoders/timm_efficientnet.py", line 95, in __init__
    super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'channel_multiplier'

Training Issues!

Segmentation Models: using keras framework.
INFO: Using device cuda
Traceback (most recent call last):
File "train.py", line 169, in
net = smp.EfficientUnetPlusPlus(encoder_name=args.encoder, encoder_weights="imagenet", in_channels=3, classes=n_classes)
AttributeError: module 'segmentation_models' has no attribute 'EfficientUnetPlusPlus'

erros when training

Hello,Sir!

Thanks for your sharing!
But I encountered some difficulties when I trained the model using my own data.

Could you give me some advice? Thanks!
Best Wishes!
'''
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\EfficientUNetPlusPlus\train.py", line 198, in
training_set = CoronaryArterySegmentationDataset(args.train_img_dir if args.train_img_dir is not None else 'Coronary/train/imgs/',
TypeError: init() got an unexpected keyword argument 'crop_size'
'''

Error with predict.py

Dear authors,
Great thanks for sharing the code. I wanted to use your model to predict on my own data. I used you proposed code: python predict.py -d Coronary -i .
However, there is an error - TypeError: init() got unexpected keyword argument "channel_multiplier"
Please, could you help me with this issue? Great thanks in advance

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.