MicroNet¶
tiatoolbox
.models
.architecture
.micronet
.MicroNet
- class MicroNet(num_input_channels=3, num_output_channels=2, out_activation='softmax')[source]¶
Initialize MicroNet [1].
The following models have been included in tiatoolbox:
- 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.
Initialize
MicroNet
.Methods
Logic for using layers defined in init.
Run inference on an input batch.
Post-processing script for MicroNet.
Preprocessing function for MicroNet.
Attributes
training
- 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 NCHW.
self (MicroNet)
- 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, *, device)[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 (
torch.Tensor
) – A batch of data generated by torch.utils.data.DataLoader.device (str) – Transfers model to the specified device. Default is “cpu”.
- Returns:
Probability map as a numpy array.
- Return type:
list(np.ndarray)
- 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: