Giter VIP home page Giter VIP logo

wsmis's Introduction

Weakly Supervised Medical Images Segmentation

This is an implementation of the Weakly-Supervised Segmentation for DiseaseLocalization in Chest X-Ray Images by Ostap Viniavskiy, Maria Dobko, and Oles Dobosevych.

Overview

We proposed a three-step approach to weakly-supervised semantic segmentation, which uses only image-level labels as supervision. The method can be applied to various medical problems as well as on datasets of different nature. We demonstrated the efficiency of this approach for semantic segmentation of Pneumothorax on chest X-ray images (SIIM-ACR Pneumothorax). We also evaluated the performance on PASCAL VOC 2012 dataset.

outline

License

WSMIS is released under the GNU General Public License version 3 license.

General Pipeline

  • Step 1. Cam extraction.
    • A fully-supervised classification model (ResNet50 or VGG16) is trained on image-level labels. Grad-CAM++ is used to generate activation maps.
  • Step 2. Boundaries improvements via IRNet.
    • IRNet takes the generated CAM from Step 1. and trains ResNet50 with two output branches that predict a displacement vector field and a class boundary map, correspondingly.
  • Step 3. Segmentation.
    • Outputs from Step 2 are used as pseudo-labels for training a fully-supervised segmentation model (DeepLabv3+ or U-Net).

Some postprocessing techniques are applied in between the steps, please refer to the paper for details.

Data

Download PASCAL VOC 2012 devkit

Download SIIM-ACR Pneumothorax

Usage

Dependencies and Computing resources

All necessary modules are in the requirements.txt

pip install -r requirements.txt

This code should be compatible with Python versions >= 3.5.

All the experiments were performed on four Nvidia Tesla K80 GPUs.

Training

  1. Set parameters for the experiment config.yaml (for detailed explanation of the config file see config section below)
  2. Run the following command:
python train.py

Configurations

The description of possible configurations for training is provided in model_training/CONFIGURATIONS.md

Testing

Will be added soon

Citation

@incollection{Viniavskyi2020,
  doi = {10.1007/978-3-030-59137-3_23},
  url = {https://doi.org/10.1007/978-3-030-59137-3_23},
  year = {2020},
  publisher = {Springer International Publishing},
  pages = {249--259},
  author = {Ostap Viniavskyi and Mariia Dobko and Oles Dobosevych},
  title = {Weakly-Supervised Segmentation for Disease Localization in Chest X-Ray Images},
  booktitle = {Artificial Intelligence in Medicine}
}

References

  • Learning Deep Features for Discriminative Localization: paper
  • Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations: paper
  • U-Net: Convolutional Networks for Biomedical Image Segmentation: paper
  • Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation: paper

wsmis's People

Contributors

marichka-dobko avatar viniavskyi-ostap 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wsmis's Issues

no train.py file

Greetings,

I am trying to run your baseline on a custom dataset. However, there is no train.py in your directory. Is there any way you can share it? Thank you.

Question about IRN implementation

While loading the dataset for training IRNet (PneumothoraxAffinityDataset) in /irn/voc2/dataloader.py, you load the mask on line 324. Is this the same segmentation mask saved on line 80 of cam.py in /inference/cam_generation/cam.py? If so, the original IRNet code had a step for converting cams to ir labels (irn/step/cam_to_ir_label.py). Do you make use of that step for the pneumothorax dataset or do you directly use the segmentation mask for training IRNet?

CAM generations

Hello again,

I try to follow directories to generate CAM. In your paper, you mentioned you used both GradCAM and GradCAM++, then decided to use GradCAM++. In your inference/cam_generation folder, there is generate_pascal.py file which I believe this file I should run to extract CAM. However, I see that you don't call either GradCAM and GradCAM++ in this file. Did you do some changes on GradCAM and used your own? Or should I go to another file?

Also, I am running the classification model (model_training/cam_generation/train_pascal.py) on a custom dataset by adjusting dataloaders. During training, I guess it is overfitting. My training loss is low whereas validation loss increases up to 33. My dataset is ~15.000 images. Did you also face that issue? Do you have any suggestions?

Lastly, am I referring correct directories? Thank you very much!

Questions about datasets

I'm sorry to bother you. I just started to contact the segmentation of medical images. I can't download the data set provided on kaggle at present. It shows that kaggle no longer provides downloading at present. Then I downloaded it from another shared website. As a result, the number of data sets does not correspond, and there are only more than 6000 mask tags. The number is incomplete. I can't carry out the following test at present.

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.