Skip to content

Update HoVerNet pipeline #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
04e79ed
Merge remote-tracking branch 'origin/main' into main
KumoLiu Jul 21, 2022
4c2b7b3
Merge remote-tracking branch 'origin/main' into main
KumoLiu Jul 22, 2022
078a770
Merge remote-tracking branch 'origin/main' into main
KumoLiu Jul 22, 2022
38de0d2
Merge remote-tracking branch 'origin/main' into main
KumoLiu Jul 25, 2022
4726117
Merge remote-tracking branch 'origin/main' into main
KumoLiu Jul 26, 2022
79dd41f
Merge remote-tracking branch 'origin/main' into main
KumoLiu Aug 6, 2022
5ac6c2d
Merge remote-tracking branch 'origin/main' into main
KumoLiu Aug 18, 2022
9138bcd
Merge remote-tracking branch 'origin/main' into main
KumoLiu Aug 22, 2022
fd6a6b1
easy-integrate-bundle-v1
KumoLiu Aug 22, 2022
58ce3ca
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 22, 2022
7b69b3a
add multigpu implementation
KumoLiu Aug 23, 2022
567da73
Merge remote-tracking branch 'yliu/easy-integrate-bundle' into main
KumoLiu Aug 23, 2022
a152924
Merge remote-tracking branch 'yliu/easy-integrate-bundle' into easy-i…
KumoLiu Aug 23, 2022
e4fd544
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2022
e40cf40
Merge remote-tracking branch 'yliu/easy-integrate-bundle' into main
KumoLiu Aug 23, 2022
a4f29d1
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Sep 9, 2022
4494091
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Sep 9, 2022
1c88106
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Sep 9, 2022
82590de
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Sep 21, 2022
396edfd
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Sep 21, 2022
fbd9059
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Nov 8, 2022
2c713f6
Merge branch 'main' of https://github.com/Project-MONAI/tutorials int…
KumoLiu Dec 12, 2022
f8906f1
update README
KumoLiu Dec 12, 2022
68a31ed
minor fix
KumoLiu Dec 12, 2022
86c0a3a
update colab link
KumoLiu Dec 12, 2022
646f963
Merge remote-tracking branch 'origin/main' into update-hovernet-readme
KumoLiu Dec 12, 2022
57382e9
address comments
KumoLiu Dec 13, 2022
9a97874
update default mode
KumoLiu Dec 13, 2022
a60d100
minor fix
KumoLiu Dec 13, 2022
ffa4dcd
update performance curve
KumoLiu Dec 13, 2022
e416983
Merge branch 'main' into update-hovernet-readme
bhashemian Dec 14, 2022
1362054
update default value in post-processing
KumoLiu Dec 15, 2022
94e1eae
Merge branch 'update-hovernet-readme' of https://github.com/KumoLiu/t…
KumoLiu Dec 15, 2022
2c459b4
update default value in post-processing
KumoLiu Dec 15, 2022
4fec4d6
Merge branch 'main' into update-hovernet-readme
wyli Dec 15, 2022
876cb02
update citation
KumoLiu Dec 15, 2022
355f416
Merge branch 'update-hovernet-readme' of https://github.com/KumoLiu/t…
KumoLiu Dec 15, 2022
7dc1370
add reference section
KumoLiu Dec 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pathology/hovernet/README.MD
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# HoVerNet Examples

This folder contains ignite version examples to run train and validate a HoVerNet model.
This folder contains ignite version examples to run train and validate a HoVerNet [1] model.
It also has torch version notebooks to run training and evaluation.
<p align="center">
<img src="https://ars.els-cdn.com/content/image/1-s2.0-S1361841519301045-fx1_lrg.jpg" alt="HoVerNet scheme")
</p>
implementation based on:

Simon Graham et al., HoVer-Net: Simultaneous Segmentation and Classification of Nuclei in Multi-Tissue Histology Images.' Medical Image Analysis, (2019). <https://arxiv.org/abs/1812.06499>

### 1. Data

Expand Down Expand Up @@ -47,6 +44,8 @@ python ./prepare_patches.py \
This example uses MONAI workflow to train a HoVerNet model on prepared CoNSeP dataset.
Since HoVerNet is training via a two-stage approach. First initialized the model with pre-trained weights on the [ImageNet dataset](https://ieeexplore.ieee.org/document/5206848), trained only the decoders for the first 50 epochs, and then fine-tuned all layers for another 50 epochs. We need to specify `--stage` during training.

There are two training modes in total. If "original" mode is specified, it uses [270, 270] and [80, 80] for `patch_size` and `out_size` respectively. If "fast" mode is specified, it uses [256, 256] and [164, 164] for `patch_size` and `out_size` respectively. The results we show below are based on the "fast" model.

Each user is responsible for checking the content of models/datasets and the applicable licenses and determining if suitable for the intended use.
The license for the pre-trained model used in examples is different than MONAI license. Please check the source where these weights are obtained from:
<https://github.com/vqdang/hover_net#data-format>
Expand Down Expand Up @@ -78,7 +77,7 @@ torchrun --nnodes=1 --nproc_per_node=2 training.py --stage 1
#### [HoVerNet Validation](./evaluation.py)

This example uses MONAI workflow to evaluate the trained HoVerNet model on prepared test data from CoNSeP dataset.
With their metrics on original mode. We reproduce the results with Dice: 0.82762; PQ: 0.48976; F1d: 0.73592.
Using this training pipeline in the "fast" mode, we have achieved the following metrics: Dice: 0.8329, PQ: 0.4977 and F1d: 0.7421.

```bash
# Run to get all possible arguments
Expand Down Expand Up @@ -117,3 +116,7 @@ torchrun --nnodes=1 --nproc_per_node=2 ./inference.py
## Disclaimer

This is an example, not to be used for diagnostic purposes.

## Reference
[1] Simon Graham, Quoc Dang Vu, Shan E Ahmed Raza, Ayesha Azam, Yee Wah Tsang, Jin Tae Kwak, Nasir Rajpoot, Hover-Net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images, Medical Image Analysis, 2019
https://doi.org/10.1016/j.media.2019.101563
2 changes: 1 addition & 1 deletion pathology/hovernet/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def main():
parser.add_argument("--bs", type=int, default=16, dest="batch_size", help="batch size")
parser.add_argument("--no-amp", action="store_false", dest="amp", help="deactivate amp")
parser.add_argument("--classes", type=int, default=5, dest="out_classes", help="output classes")
parser.add_argument("--mode", type=str, default="original", help="choose either `original` or `fast`")
parser.add_argument("--mode", type=str, default="fast", help="choose either `original` or `fast`")

parser.add_argument("--cpu", type=int, default=8, dest="num_workers", help="number of workers")
parser.add_argument("--use_gpu", type=bool, default=True, dest="use_gpu", help="whether to use gpu")
Expand Down
Loading