Home

Awesome

PyMIC_examples

PyMIC is a PyTorch-based toolkit for medical image computing with annotation-efficient deep learning. Here we provide a set of examples to show how it can be used for image classification and segmentation tasks. For annotation efficient learning, we show examples of Semi-Supervised Learning (SSL), Self-Supervised Learning (Self-SL), Weakly Supervised Learning (WSL) and Noisy Label Learning (NLL), respectively. For beginners, you can follow the examples by just editting the configuration files for model training, testing and evaluation. For advanced users, you can easily develop your own modules, such as customized networks and loss functions.

News

2024.01 Examples of Self-Supervised Learning have been added.

2024.01 More 2D segmentation networks including SwinUNet and TransUNet have been added.

2023.12 Semi-Supervised Method MCNet has been added to seg_semi_sup/ACDC.

Install PyMIC

The released version of PyMIC (v0.5.0) is required for these examples, and it can be installed by:

pip install PYMIC==0.5.0

To use the latest development version, you can download the source code here, and install it by:

python setup.py install

Data

The datasets for the examples can be downloaded from Google Drive or Baidu Disk (extraction code: xlwg). Extract the files to PyMIC_data after downloading.

List of Examples

Currently we provide the following examples in this repository:

CatetoryExampleRemarks
ClassificationAntBeeFinetuning a resnet18 for Ant and Bee classification
CHNCXRFinetuning restnet18 and vgg16 for normal/tuberculosis X-ray image classification
Fully supervised segmentationJSRTUsing five 2D Networks for lung segmentation from chest X-ray images
JSRT2Using a customized network and loss function for the JSRT dataset
Fetal_HCUsing a 2D UNet for fetal head segmentation from 2D ultrasound images
ProstateUsing a 3D UNet for prostate segmentation from 3D MRI
Semi-supervised segmentationseg_semi_sup/ACDCSemi-supervised methods for heart structure segmentation using 2D CNNs
seg_semi_sup/AtriaSegSemi-supervised methods for left atrial segmentation using 3D CNNs
Weakly-supervised segmentationseg_weak_sup/ACDCSegmentation of heart structure with scrible annotations
Noisy label learningseg_noisy_label/JSRTComparing different NLL methods for learning from noisy labels
Self-Supervised learningseg_self_sup/lungSelf-Supervised learning methods for pretraining a segmentation model

Useful links

Citation

BibTeX entry:

@article{Wang2022pymic,
author = {Guotai Wang and Xiangde Luo and Ran Gu and Shuojue Yang and Yijie Qu and Shuwei Zhai and Qianfei Zhao and Kang Li and Shaoting Zhang},
title = {{PyMIC: A deep learning toolkit for annotation-efficient medical image segmentation}},
year = {2023},
url = {https://doi.org/10.1016/j.cmpb.2023.107398},
journal = {Computer Methods and Programs in Biomedicine},
volume = {231},
pages = {107398},
}