Challenge website | Leaderboard
This directory contains a simple baseline method using MONAI for training, validation, and inference for COVID-19 LUNG CT LESION SEGMENTATION CHALLENGE - 2020 (a MICCAI Endorsed Event). The implementation is a basic deep learning pipeline which could serve as a starting point for further algorithmic improvements.
The script is tested with:
Ubuntu 20.04
|Python 3.8
|CUDA 11.7
On a GPU with automatic mixed precision support:
- the default training pipeline requires about 5.5GB memory,
- the default inference pipeline requires about 2.3GB memory.
Please follow the Pytorch instructions for installation. To verify that you have a viable installation, please run:
python -c 'import torch; print(torch.rand(4, 2, device="cuda"))'
pip install "git+https://github.com/Project-MONAI/MONAI#egg=monai[nibabel,ignite,tqdm]"
For more information please check out the installation guide.
Download run_net.py
to a local folder. The following instructions assume that the challenge data are also downloaded and unzipped into the same folder.
python run_net.py train --data_folder "COVID-19-20_v2/Train" --model_folder "runs"
During training, the top three models will be selected based on the per-epoch validation and stored at --model_folders
.
The training uses convenient file loading modules and a few intensity and spatial random augmentations using MONAI:
LoadImaged
,Orientationd
,Spacingd
,ScaleIntensityRanged
Load the image data into the LPS orientation (Left to right, Posterior to anterior, Superior to inferior), with a resolution of 1.25mm x 1.25mm x 5.00mm, and intensity between [-1000.0, 500.0] scaled to [0.0, 1.0].
SpatialPadd
Pad the volumes to have at least 192x192 voxels in its first two spatial dimensions.
RandAffined
,RandGaussianNoised
,RandFlipd
Data augmentations randomized at every training iteration.
RandCropByPosNegLabeld
Randomly sample image/label pairs of shape (192, 192, 16)
with balanced samples from the foreground (lesion) and background (anywhere else in the volume).
- U-Net model
the UNet model is from monai.networks.nets.BasicUNet
.
- Sliding window inference
Segmentations are generated by monai.inferers.SlidingWindowInferer
with a window size of (192, 192, 16)
.
Note that the evaluation scores from this inference pipeline is not computed at the original data resolution, and is presented here for model selection purpose only.
python run_net.py infer --data_folder "COVID-19-20_v2/Validation" --model_folder "runs"
This command will load the best validation model, run inference, and store the predictions at ./output
.
This baseline method achieves 0.6904 ± 0.1801 Dice score on the challenge validation set.
- For MONAI technical documentation, please visit docs.monai.io.
- Please visit
Project-MONAI/tutorials
for more examples, including:
By default, the predictions generated at ./output/to_submit
are ready for submission. Please zip the folder and follow the upload instructions to submit it.
For any queries, please contact the challenge organizers.
The code is licensed under the Apache License 2.0.