MicroNet¶
tiatoolbox.models.architecture.micronet.MicroNet
- class MicroNet(num_input_channels=3, num_class=2)[source]¶
Initialise MicroNet [1].
The following models have been included in tiatoolbox: 1. micronet-consep:
This is trained on CoNSeP dataset The model is retrained in torch as the original model with results on CoNSeP [2] was trained in TensorFlow.
The tiatoolbox model should produce the following results on the CoNSeP dataset:
MicroNet performance¶ Model name
Data set
DICE
AJI
DQ
SQ
PQ
micronet-consep
CoNSeP
0.80
0.49
0.62
0.75
0.47
- Parameters
References
[1] Raza, Shan E Ahmed, et al. “Micro-Net: A unified model for segmentation of various objects in microscopy images.” Medical image analysis 52 (2019): 160-173.
[2] Graham, Simon, et al. “Hover-net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images.” Medical Image Analysis 58 (2019): 101563.
Methods
Logic for using layers defined in init.
Run inference on an input batch.
Post-processing script for MicroNet.
Preprocessing function for MicroNet.
Attributes
- forward(input_tensor)[source]¶
Logic for using layers defined in init.
This method defines how layers are used in forward operation.
- Parameters
input_tensor (torch.Tensor) – Input images, the tensor is in the shape of NHCW.
- Returns
A list of main and auxiliary outputs. The expected format is [main_output, aux1, aux2, aux3].
- Return type
- static infer_batch(model, batch_data, on_gpu)[source]¶
Run inference on an input batch.
This contains logic for forward operation as well as batch I/O aggregation.
- Parameters
model (nn.Module) – PyTorch defined model.
batch_data (
numpy.ndarray) – A batch of data generated by torch.utils.data.DataLoader.on_gpu (bool) – Whether to run inference on a GPU.
- Returns
List of output from each head, each head is expected to contain N predictions for N input patches. There are two cases, one with 2 heads (Nuclei Pixels np and Hover hv) or with 2 heads (np, hv, and Nuclei Types tp).
- static postproc(image)[source]¶
Post-processing script for MicroNet.
- Parameters
image (ndarray) – Input image of type numpy array.
- Returns
Pixel-wise nuclear instance segmentation prediction.
- Return type
- static preproc(image)[source]¶
Preprocessing function for MicroNet.
Performs per image standardization.
- Parameters
image (
numpy.ndarray) – Input image of type numpy array.- Returns
Pre-processed numpy array.
- Return type