TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
340 stars 71 forks source link

nucleus segmentation with classification using "hovernet_original-kumar" #749

Closed Taylor-Kelce closed 7 months ago

Taylor-Kelce commented 7 months ago

Description

Is there a way to do nucleus segmentation with hovernet_original-kumar while generating class probabilities as shown in the example notebook 08? In particular, I'm interested in identifying fibroblast within WIS.

What I Did

inst_segmentor = NucleusInstanceSegmentor(
    pretrained_model="hovernet_original-kumar", 
    num_loader_workers=4,
    num_postproc_workers=4,
    batch_size=10,
    auto_generate_mask=False,
    verbose=False,
)

However, when I checked the output files *.dat, the prob and type fields are always None.

from collections import Counter
data = joblib.load('0.dat') 
[preds['type'] for key, preds in data.items()]
adamshephard commented 7 months ago

Hi @Taylor-Kelce,

Thanks for the comment. Unfortunately the HoVer-Net model trained on Kumar is for nuclear segmentation alone, and does not perform classification. So it is not currently possible to generate class probabilities/labels. If you are trying to segment fibroblasts, you may be better using the HoVer-Net CoNSeP weights, where fibroblasts and endothelial nuclei are grouped together as "spindle-shaped nuclei". Hope this clears things up.

Best wishes, Adam