MouseLand/cellpose

[BUG] normalisation problem?

Opened this issue · 0 comments

I couldn't get the cellpose 'nuclei' model to work well on images with only a few nuclei (which were otherwise clear and looked 'easy' to segment). I noticed this happened when nuclei took up around less than 1% of the image. That lead me to find the problem is solved by changing the normalisation...

The default normalisation in cellpose seems to be without clipping. I.e. you subtract the 1st percentile and divide by (99th - 1st percentile). In images with few nuclei this results in an image with amplified noise and minimum pixel value <<0 and a maximum pixel value >>1. This seems to result in a bad segmentation, whereas if I did exactly the same but clipped the image at 0 and 1 the segmentation was good. This didn't effect segmentations of several images with many nuclei that I tried.

So I'm wondering if the normalisation should include clipping? It seems an odd choice to normalise without clipping but maybe I'm missing something?