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:

  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:
  • num_input_channels (int) – Number of channels in input. default=3.

  • num_output_channels (int) – Number of output channels. default=2.

  • out_activation (str) – Activation to use at the output. MapDe inherits MicroNet but uses ReLU activation.

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

forward

Logic for using layers defined in init.

infer_batch

Run inference on an input batch.

postproc

Post-processing script for MicroNet.

preproc

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:
Returns:

A list of main and auxiliary outputs. The expected format is [main_output, aux1, aux2, aux3].

Return type:

list

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 (torch.Tensor) – A batch of data generated by torch.utils.data.DataLoader.

  • on_gpu (bool) – Whether to run inference on a GPU.

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:

numpy.ndarray

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:

numpy.ndarray