oist / Usiigaci

Usiigaci: stain-free cell tracking in phase contrast microscopy enabled by supervised machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image format of raw image

lipeiwang opened this issue · comments

Hi, thanks for your perfect work. It's really amazing program.
I noticed that the raw image format is tif, but the label image is jpg.
And I tried change the format of input image from tif to jpg, it will failed.
Did you try to train the mask rcnn model with jpg input?
Is possible to train mask rcnn model with jpg?
Thanks for your reply.

Sorry i missed this issue.
We made it using tif files because it's the file format directly exported from the microscope.
I think it's possible to train the maskrcnn model with jpg. but you will need to curate the data. i might need to check where it was. I remember I trained it with png files too, but I didn't really need to do any changes.

I just converted my raw.tif files into jpg, and the training seems to start without any trouble.

Can you try also with just replacing line:22 of train.py INPUT_CHANNEL to the filename.jpg of your images?

if you masks are also in jpegs, you'll have to make some changes in the preprocessing.py

Thanks for your help!!! I trained my own model with jpg input and it's success. Thank you so much.
I am very sorry that I have another problem. I trained the model with 12801024 image but now I have some 256256 image need to inference. It will failed. Can we inference image with different size? Or the model can only inference specific image size?
Thank you so much.

Hi
good to hear the training works out

It's a typical problem and we tried it but unsuccessfuly.
if i remember correctly, in our work we resize the input image to 512x512 and then feed to the network. we tried different sizes and often it fails if the pixel numbers is not taken care of in CNNs.
We have some data suggesting that the neural network is more resilient to changes of magnification and resolution of the camera, but the fact is that the accuracy goes down a lot if the inference image is significantly different compared to ones that it is trained on.

We are working on a new version maybe could solve that. but not yet verified.

in your case, if the inference image is only 256 by 256. you need to modify the size in the neural network (and most like reduce the layers, i.e. you cant have more convolutional operations if your original size is smaller)
it is possible to inference image with different size (provided you need to take care of the padding issue). I would still recommend feed to the neural network the exact size that they are trained on.

I ran a brief test.
An equilateral smaller image can still be inferred. But the neural network we have been using are trained with 1024x1022 images, when i run 512x512 ones. the accuracy is extremely low. Also there are much more artifacts if the 512x512 images are jpg. (probably something happening with formats)

I would still recommend to keep the dimension similar.

no new update. consider this closed