From 706d0e0e706c093d915b5eb23756e0752accd9bc Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Fri, 26 Nov 2021 11:07:40 +0800 Subject: [PATCH 1/3] [DLMED] enhance doc Signed-off-by: Nic Ma --- monai/networks/nets/milmodel.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monai/networks/nets/milmodel.py b/monai/networks/nets/milmodel.py index c7fb7f3937..71e40a09a6 100644 --- a/monai/networks/nets/milmodel.py +++ b/monai/networks/nets/milmodel.py @@ -11,6 +11,8 @@ class MILModel(nn.Module): """ Multiple Instance Learning (MIL) model, with a backbone classification model. + Currently, it only works for 2D images and expected shape is `[B, N, C, H, W]`, + where `B` is batch_size from PyTorch Dataloader and `N` is number of patches. Args: num_classes: number of output classes. From c9f96a04b3ab751085c39a2d0675df30986f97d3 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Fri, 26 Nov 2021 17:45:36 +0800 Subject: [PATCH 2/3] [DLMED] update based on Yiheng's comments Signed-off-by: Nic Ma --- monai/networks/nets/milmodel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monai/networks/nets/milmodel.py b/monai/networks/nets/milmodel.py index 71e40a09a6..4c116a5cbe 100644 --- a/monai/networks/nets/milmodel.py +++ b/monai/networks/nets/milmodel.py @@ -11,8 +11,10 @@ class MILModel(nn.Module): """ Multiple Instance Learning (MIL) model, with a backbone classification model. - Currently, it only works for 2D images and expected shape is `[B, N, C, H, W]`, - where `B` is batch_size from PyTorch Dataloader and `N` is number of patches. + Currently, it only works for 2D images, typical use case is for classification of the + digital pathology whole slide images. The expected shape of input data is `[B, N, C, H, W]`, + where `B` is the batch_size of PyTorch Dataloader and `N` is the number of the instances + extracted from every original image in the batch. Args: num_classes: number of output classes. From b44e4e78d2b0be5bec3bbca0492d832f6107afd0 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Fri, 26 Nov 2021 22:34:48 +0800 Subject: [PATCH 3/3] [DLMED] add tutorial link Signed-off-by: Nic Ma --- monai/networks/nets/milmodel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monai/networks/nets/milmodel.py b/monai/networks/nets/milmodel.py index 4c116a5cbe..75cd9cf53e 100644 --- a/monai/networks/nets/milmodel.py +++ b/monai/networks/nets/milmodel.py @@ -14,7 +14,8 @@ class MILModel(nn.Module): Currently, it only works for 2D images, typical use case is for classification of the digital pathology whole slide images. The expected shape of input data is `[B, N, C, H, W]`, where `B` is the batch_size of PyTorch Dataloader and `N` is the number of the instances - extracted from every original image in the batch. + extracted from every original image in the batch. A tutorial example is available at: + https://github.com/Project-MONAI/tutorials/tree/master/pathology/multiple_instance_learning. Args: num_classes: number of output classes.