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), 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.
The released version of PyMIC (v0.4.0) is required for these examples, and it can be installed by:
pip install PYMIC==0.4.0
To use the latest development version, you can download the source code here, and install it by:
python setup.py install
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.
Currently we provide the following examples in this repository:
Catetory | Example | Remarks |
---|---|---|
Classification | AntBee | Finetuning a resnet18 for Ant and Bee classification |
Classification | CHNCXR | Finetuning restnet18 and vgg16 for normal/tuberculosis X-ray image classification |
Fully supervised segmentation | JSRT | Using a 2D UNet for lung segmentation from chest X-ray images |
Fully supervised segmentation | JSRT2 | Using a customized network and loss function for the JSRT dataset |
Fully supervised segmentation | Fetal_HC | Using a 2D UNet for fetal head segmentation from 2D ultrasound images |
Fully supervised segmentation | Prostate | Using a 3D UNet for prostate segmentation from 3D MRI |
Semi-supervised segmentation | seg_ssl/ACDC | Semi-supervised methods for heart structure segmentation using 2D CNNs |
Semi-supervised segmentation | seg_ssl/AtriaSeg | Semi-supervised methods for left atrial segmentation using 3D CNNs |
Weakly-supervised segmentation | seg_wsl/ACDC | Segmentation of heart structure with scrible annotations |
Noisy label learning | seg_nll/JSRT | Comparing different NLL methods for learning from noisy labels |
- PyMIC on Github: https://github.com/HiLab-git/PyMIC
- Usage of PyMIC: https://pymic.readthedocs.io/en/latest/usage.html