Skip to content

Commit 91b9906

Browse files
Update detection tutorial readme (Project-MONAI#767)
* add detection example * detection example * reformat detection enample * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add evaluation * add detection example Signed-off-by: Can Zhao <[email protected]> * readme Signed-off-by: Can Zhao <[email protected]> * add comments Signed-off-by: Can Zhao <[email protected]> * add links Signed-off-by: Can Zhao <[email protected]> * add folders Signed-off-by: Can Zhao <[email protected]> * add folders Signed-off-by: Can Zhao <[email protected]> * add folders Signed-off-by: Can Zhao <[email protected]> * add folders Signed-off-by: Can Zhao <[email protected]> * jit save Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typo Signed-off-by: Can Zhao <[email protected]> * typo Signed-off-by: Can Zhao <[email protected]> * typo Signed-off-by: Can Zhao <[email protected]> * typo Signed-off-by: Can Zhao <[email protected]> * correct post transform Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typo Signed-off-by: Can Zhao <[email protected]> * add link Signed-off-by: Can Zhao <[email protected]> * shebang Signed-off-by: Can Zhao <[email protected]> * shebang Signed-off-by: Can Zhao <[email protected]> * remove useless files Signed-off-by: Can Zhao <[email protected]> * mv data split to google drive Signed-off-by: Can Zhao <[email protected]> * generte env files Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typos Signed-off-by: Can Zhao <[email protected]> * typos Signed-off-by: Can Zhao <[email protected]> * typos Signed-off-by: Can Zhao <[email protected]> * readme Signed-off-by: Can Zhao <[email protected]> * remove official evaluation script Signed-off-by: Can Zhao <[email protected]> * copyright Signed-off-by: Can Zhao <[email protected]> * copyright Signed-off-by: Can Zhao <[email protected]> * copyright Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * nndet Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * rm unused config Signed-off-by: Can Zhao <[email protected]> * add curve Signed-off-by: Can Zhao <[email protected]> * add curve Signed-off-by: Can Zhao <[email protected]> * update fig Signed-off-by: Can Zhao <[email protected]> * update fig Signed-off-by: Can Zhao <[email protected]> * update fig Signed-off-by: Can Zhao <[email protected]> * update fig Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * add comments in training Signed-off-by: Can Zhao <[email protected]> * shebang Signed-off-by: Can Zhao <[email protected]> * fix a bug in training Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change download link Signed-off-by: Can Zhao <[email protected]> * add result Signed-off-by: Can Zhao <[email protected]> * add result Signed-off-by: Can Zhao <[email protected]> * add result Signed-off-by: Can Zhao <[email protected]> * add result Signed-off-by: Can Zhao <[email protected]> * update train curve Signed-off-by: Can Zhao <[email protected]> * update result curve Signed-off-by: Can Zhao <[email protected]> * add result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update result table Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * add acknowledge Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update readme Signed-off-by: Can Zhao <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update readme Signed-off-by: Can Zhao <[email protected]> * update readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> * incorporate Michale's comment on readme Signed-off-by: Can Zhao <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2c52a98 commit 91b9906

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

detection/README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MONAI detection implementation is based on the following papers:
99

1010
**RetinaNet:** Lin, Tsung-Yi, et al. "Focal loss for dense object detection." ICCV 2017. https://arxiv.org/abs/1708.02002
1111

12-
**Implementation details:** Baumgartner, Michael, et al. "nnDetection: A self-configuring method for medical object detection." MICCAI 2021. https://arxiv.org/pdf/2106.00817.pdf
12+
**Implementation details:** Baumgartner and Jaeger et al. "nnDetection: A self-configuring method for medical object detection." MICCAI 2021. https://arxiv.org/pdf/2106.00817.pdf
1313

1414
**ATSS Matcher:** Zhang, Shifeng, et al. "Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection." CVPR 2020. https://openaccess.thecvf.com/content_CVPR_2020/papers/Zhang_Bridging_the_Gap_Between_Anchor-Based_and_Anchor-Free_Detection_via_Adaptive_CVPR_2020_paper.pdf
1515

@@ -31,7 +31,7 @@ In these files, the values of "box" are the ground truth boxes in world coordina
3131
- For bugs relating to the running of a tutorial, please create an issue in [this repository](https://github.com/Project-MONAI/Tutorials/issues).
3232

3333
### 3. Run the example
34-
#### [Prepare Your Data](./luna16_prepare_images.py)
34+
#### [3.1 Prepare Your Data](./luna16_prepare_images.py)
3535

3636
The raw CT images in LUNA16 have various of voxel sizes. The first step is to resample them to the same voxel size, which is defined in the value of "spacing" in [./config/config_train_luna16_16g.json](./config/config_train_luna16_16g.json).
3737

@@ -45,7 +45,7 @@ python3 luna16_prepare_images.py -c ./config/config_train_luna16_16g.json
4545

4646
The original images are with mhd/raw format, the resampled images will be with Nifti format.
4747

48-
#### [3D Detection Training](./luna16_training.py)
48+
#### [3.2 3D Detection Training](./luna16_training.py)
4949

5050
The LUNA16 dataset was splitted into 10-fold to run cross-fold training and inference.
5151

@@ -74,7 +74,7 @@ The training and validation curves for 300 epochs of 10 folds are shown as below
7474

7575
With a single DGX1V 16G GPU, it took around 55 hours to train 300 epochs for each data fold.
7676

77-
#### [3D Detection Inference](./luna16_testing.py)
77+
#### [3.3 3D Detection Inference](./luna16_testing.py)
7878

7979
If you have a different GPU memory size than 16G, please maximize "val_patch_size" in [./config/config_train_luna16_16g.json](./config/config_train_luna16_16g.json) to fit the GPU you use.
8080

@@ -85,7 +85,7 @@ python3 luna16_testing.py \
8585
-c ./config/config_train_luna16_16g.json
8686
```
8787

88-
#### [LUNA16 Detection Evaluation](./run_luna16_offical_eval.sh)
88+
#### [3.4 LUNA16 Detection Evaluation](./run_luna16_offical_eval.sh)
8989
Please download the official LUNA16 evaluation scripts from https://luna16.grand-challenge.org/Evaluation/,
9090
and save it as ./evaluation_luna16
9191

@@ -112,18 +112,22 @@ We got FROC result as shown in the table below. It is comparable with the result
112112

113113
**Table 1**. The FROC sensitivity values at the predefined false positive per scan thresholds of the LUNA16 challenge.
114114

115-
This MONAI example uses similar training and inference workflows and same hyper-parameters as [nnDetection](https://github.com/MIC-DKFZ/nnDetection) LUNA16.
116115

117-
The major differences are:
118-
1) we use a different learning rate scheduler,
119-
2) during training, we run validation with 5% of the training data and select the best model for inference, while nnDetection directly uses the model from the last epoch for inference,
120-
3) when input image is too large to fit in the GPU memory, inference is performed on patches. We do sliding window aggregation on the predicted class logits and box regression, while nnDetection uses a different aggregation stategy from [Jaeger et al.](http://proceedings.mlr.press/v116/jaeger20a/jaeger20a.pdf).
116+
#### 3.5 Comparison to nnDetection
117+
This MONAI example uses similar training and inference workflows as [nnDetection](https://github.com/MIC-DKFZ/nnDetection) LUNA16, with same hyper-parameters and data augmentation pipeline.
118+
119+
The major differences are as follows:
120+
1) We use a different learning rate scheduler than nnDetection.
121+
2) We train 300 epochs (around 150k iterations), while nnDetection trains 125k iterations.
122+
3) During training, we run validation with 5% of the training data and save the best model, while nnDetection directly saves the model from the last iteration for inference.
123+
4) When input image is too large to fit in the GPU memory, inference is performed on patches. We do sliding window aggregation on the predicted class logits and box regression, while nnDetection uses a different aggregation stategy from [Jaeger et al.](http://proceedings.mlr.press/v116/jaeger20a/jaeger20a.pdf).
121124

122125

123126
There are other differences that may have minor impact on the performance:
124-
1) we use RetinaNet, while nnDetection uses [RetinaUnet](http://proceedings.mlr.press/v116/jaeger20a/jaeger20a.pdf),
125-
2) we directly apply the trained model to the images/patches during inference, while nnDetection applies the model to the images/patches flipped in three axes and average the flipped-back results.
127+
1) We use different network architecture. We use [RetinaNet](https://arxiv.org/abs/1708.02002) with ResNet as backbone, while nnDetection uses [RetinaUnet](http://proceedings.mlr.press/v116/jaeger20a/jaeger20a.pdf) with U-net as backbone.
128+
2) We directly apply the trained model to the images/patches during inference, while nnDetection uses mirror aggregation by applying the trained model to the images/patches flipped in three axes and averaging the flipped-back results.
129+
3) We read in boxes from data loader and do data augmentation on boxes. nnDetection, on the other hand, reads in image masks with ellipsoid as foreground and do data augmentation on masks, then convert the masks to boxes to train the network.
126130

127131

128132
### Acknowledgement
129-
We greatly appreciate Michael Baumgartner, one of the main contributor of [nnDetection](https://github.com/MIC-DKFZ/nnDetection) project, for his vital cooperation and help in ensuring the successful completion of this MONAI detection module.
133+
We greatly appreciate Michael Baumgartner, one of the main contributors of [nnDetection](https://github.com/MIC-DKFZ/nnDetection) project, for his vital cooperation and help in ensuring the successful completion of this MONAI detection module.

0 commit comments

Comments
 (0)