cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

[BUG] weird scaling numbers when training nuclei model

Open pawlowska opened this issue 2 years ago • 3 comments

Describe the bug Different diameters displayed when training from nuclei model; when using the model I also need to use an artificial diameter.

My nuclei have diameter of 50-60 and this number works when segmenting in GUI with nuclei model. I then corrected the masks manually and wanted to use them for further training. The manual says that for training the nuclei model, cells need to have diameter 17, so I downscaled my images and masks. I then did the training. However, when I load the model, the default diameter displayed in GUI is 3.164 and not 17. When I put in 50 or 60, I do not get meaningful results either. For the trained model to work, I need to put in diameter of around 12.

Then, during training I see displayed as below. How to understand that? Are the images rescaled by cellpose, or do I need to rescale them?

And mostly, what is the meaning of >>>> model diam_labels = 3.164 (mean diameter of training ROIs) and is this connected to having to put in 12 in GUI instead of 50?

To conclude, either I'm missing something or there is a bug in scaling when training from nuclei.

Screenshots cellpose training scaling

pawlowska avatar Sep 22 '23 10:09 pawlowska

The line you referenced means that the mean diameter of the training masks (the input masks during training) was 3.164 pixels. Can you double check that your input masks are actually 17 pixels in diameter and not closer to 3? You can also attach an example image if you put it into a zip archive.

Also, please provide the entire command used for training and the output.

mrariden avatar Oct 03 '23 20:10 mrariden

closing due to inactivity, reopen if necessary

mrariden avatar Nov 03 '23 13:11 mrariden

Hi @mrariden I apologize for missing your reply. I'm attaching one image&mask pair of the 46 used. seq_rescaled_05_example.zip command: python -m cellpose --train --dir ./seq_rescaled_05/ --verbose --use_gpu --pretrained_model nuclei

pawlowska avatar Nov 16 '23 14:11 pawlowska