Giter Site home page Giter Site logo

zerojumpline / colab Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 2.0 2.23 MB

[TMI2023] Context Label Learning: Improving Background Class Representations in Semantic Segmentation.

License: MIT License

Python 72.83% Jupyter Notebook 27.17%
image-segmentation meta-learning

colab's Introduction

Introduction

In semantic segmentation, background samples provide key contextual information for segmenting regions of interest (ROIs). Empirically, we find human-defined context labels (e.g., liver, kidney, brain tissue) provide additional anatomical information to benefit representation learning. For example, in the case of liver tumor segmentation, it is beneficial to also have labels for the liver available in addition to the tumor class.

In this study, we further propose context label learning (CoLab), which automatically generates context labels to improve the learning of a context representation yielding better ROI segmentation accuracy based on a meta-learning scheme. CoLab can bring similar improvements when compared with training with human-defined context labels, without the need for expert knowledge.


Installation

For Conda users, you can create a new Conda environment using

conda create -n colab python=3.7

after activating the environment with

source activate colab

try to install all the dependencies with

pip install -r requirements.txt

also install the conda environment for the jupyter notebook kernel.

python -m ipykernel install --user --name=colab

Data and preprocessing

Data downloading

We conduct experiments with several medical image segmentation datasets. Please consider downloading the datasets using follow links:

  • The datasets of liver tumor, colon tumor and pancreas tumor from Medical Segmentation Decathlon.
  • Brain lesion dataset can be downloaded from ATLAS.
  • Brain tumor (Vestibular Schwannoma) dataset can be downloaded from TCIA.
  • Kidney tumor dataset can be downloaded from KiTS19.

We keep the downloaded data in ./datadownloaded.

Data preprocessing

We provide the pre-processing code for liver tumor segmentation, which is based on CT. Please refer to datapreprocessing.ipynb about intensity normalization, resampling etc.

The example datasets are saved like:

datadownload/
├── Task03_Liver/
  ├── ImagesTr/
  └── LablesTr/

After obtaining the preprocessed data saved in ./datapreprocessed, we generate the datafiles such as those in ./datafiles.

Training

Train the network without context labels.

python train.py --name CoLab_LiverTumor_Vanilla --tensorboard --split 0 --deepsupervision --taskcls 1 --liver0 0 --taskupdate 5 --vanilla --det --gpu 0

Training with human-defined labels. Note that it utilized additional liver masks.

python train.py --name CoLab_LiverTumor_ManualLabel --tensorboard --split 1 --deepsupervision --taskcls 2 --liver0 0  --manuallabel --det --gpu 0

Traing with CoLab. Please refer to the paper for more hyperparamter details.

python train.py --name CoLab_LiverTumor --tensorboard --split 0 --deepsupervision --taskcls 2 --liver0 0 --taskupdate 5 --distdetach --threshold_sub 30 --threshold_dev 20 --det --gpu 0

Test

Test the trained model. Please remember to replace SAVE_PATH with the ones you save the trained model. You might also use this to visualize the generated context labels by CoLab.

Note that if you want to test you models trained without context labels, you should set taskcls = 1.

python test.py --resume SAVE_PATH/checkpoint.pth.tar --name CoLab_LiverTumor_test --liver0 0 --saveresults --taskcls 2 --deepsupervision --gpu 0

Citation

@article{li2023context,
  title={Context Label Learning: Improving Background Class Representations in Semantic Segmentation},
  author={Li, Zeju and Kamnitsas, Konstantinos and Ouyang, Cheng and Chen, Chen and Glocker, Ben},
  journal={IEEE Transactions on Medical Imaging},
  year={2023},
  publisher={IEEE}
}

colab's People

Contributors

zerojumpline avatar

Stargazers

Muhammad Faizan avatar 杨志毅 avatar  avatar  avatar Kilian Köppl avatar yupei zhang avatar  avatar see小高 avatar Tabris avatar  avatar Li Xiang avatar ZHANG CHU avatar Avinash  avatar Cheng avatar YeboSun avatar Luyi avatar

Watchers

Kostas Georgiou avatar  avatar

colab's Issues

NameError: name 'testlitstumor' is not defined

Hi, I must say excellent work you have done. But I met some problems while running the code you provided.
First, there is no args.aux in train.py. And there is no testlitstumor in common.py. Maybe there are some mistakes while you updating the code, but I really interesting in your work. If you could solve the bug, I would be really appreciate it.

Data preprocessing

Hello, your work is fantastic, but I have a few questions. I hope you can provide me with some advice.

  1. How can I transform the dataset saved in the datapreprocessed folder into the dataset inside the datafiles folder?
  2. The README file only provides preprocessing code for the Liver Tumor data. Could you please advise on how to preprocess the other datasets used in the project?

Looking forward to your response. Thank you!

Dataset download issues

Hello, I find your work very interesting and rewarding. I am having problems reproducing your paper, I don't have a good way to download the three datasets from Google Cloud Drive to my server, so I can't follow up on it. Do you have any good suggestions? I'm looking forward to your reply. 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.