MapDe

class MapDe(num_input_channels=3, min_distance=4, threshold_abs=250, num_classes=1)[source]

Initialize MapDe [1].

The following models have been included in tiatoolbox:

  1. mapde-crchisto:

    This model is trained on CRCHisto dataset

  2. mapde-conic:

    This model is trained on CoNIC dataset Centroids of ground truth masks were used to train this model. The results are reported on the whole test data set including preliminary and final set.

The tiatoolbox model should produce the following results on the following datasets using 8 pixels as radius for true detection:

MapDe performance

Model name

Data set

Precision

Recall

F1Score

mapde-crchisto

CRCHisto

0.81

0.82

0.81

mapde-conic

CoNIC

0.85

0.85

0.85

Parameters:
  • num_input_channels (int) – Number of channels in input. default=3.

  • num_classes (int) – Number of cell classes to identify. default=1.

  • min_distance (int) – The minimal allowed distance separating peaks. To find the maximum number of peaks, use min_distance=1, default=6.

  • threshold_abs (float) – Minimum intensity of peaks, default=0.20.

References

[1] Raza, Shan E. Ahmed, et al. “Deconvolving convolutional neural network for cell detection.” 2019 IEEE 16th International Symposium on Biomedical Imaging (ISBI 2019). IEEE, 2019.

Initialize MapDe.

Methods

forward

Logic for using layers defined in init.

infer_batch

Run inference on an input batch.

postproc

Post-processing script 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 (MapDe)

Returns:

Output map for cell detection. Peak detection should be applied to this output for cell detection.

Return type:

torch.Tensor

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:

Probability map as numpy array.

Return type:

list(np.ndarray)

postproc(prediction_map)[source]

Post-processing script for MicroNet.

Performs peak detection and extracts coordinates in x, y format.

Parameters:
  • prediction_map (ndarray) – Input image of type numpy array.

  • self (MapDe)

Returns:

Pixel-wise nuclear instance segmentation prediction.

Return type:

numpy.ndarray